From cc2e2c9cbc889e5d7519842daf67f9b30653ed7e Mon Sep 17 00:00:00 2001 From: Diogo Sousa Date: Mon, 24 Jul 2023 15:55:06 +0100 Subject: [PATCH 01/28] remove ProviderName --- .../benzinga/openbb_benzinga/provider.py | 4 +- .../providers/fmp/openbb_fmp/provider.py | 4 +- .../providers/fred/openbb_fred/provider.py | 4 +- .../polygon/openbb_polygon/provider.py | 4 +- .../openbb_provider/abstract/provider.py | 62 +++---------------- .../sdk/provider/openbb_provider/registry.py | 15 ++--- 6 files changed, 23 insertions(+), 70 deletions(-) diff --git a/openbb_sdk/providers/benzinga/openbb_benzinga/provider.py b/openbb_sdk/providers/benzinga/openbb_benzinga/provider.py index b5f50fc3276..2eea97cc4a2 100644 --- a/openbb_sdk/providers/benzinga/openbb_benzinga/provider.py +++ b/openbb_sdk/providers/benzinga/openbb_benzinga/provider.py @@ -5,7 +5,7 @@ # IMPORT THIRD-PARTY # IMPORT INTERNAL -from openbb_provider.abstract.provider import Provider, ProviderNameType +from openbb_provider.abstract.provider import Provider from openbb_benzinga.global_news import BenzingaGlobalNewsFetcher from openbb_benzinga.stock_news import BenzingaStockNewsFetcher @@ -14,7 +14,7 @@ from openbb_benzinga.stock_news import BenzingaStockNewsFetcher benzinga_provider = Provider( - name=ProviderNameType("benzinga"), + name="benzinga", description="Provider for Benzinga.", required_credentials=["api_key"], fetcher_list=[BenzingaGlobalNewsFetcher, BenzingaStockNewsFetcher], diff --git a/openbb_sdk/providers/fmp/openbb_fmp/provider.py b/openbb_sdk/providers/fmp/openbb_fmp/provider.py index adb620fb9bd..135318f7c2c 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/provider.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/provider.py @@ -5,7 +5,7 @@ # IMPORT THIRD-PARTY # IMPORT INTERNAL -from openbb_provider.abstract.provider import Provider, ProviderNameType +from openbb_provider.abstract.provider import Provider from .analyst_estimates import FMPAnalystEstimatesFetcher from .available_indices import FMPAvailableIndicesFetcher @@ -55,7 +55,7 @@ from .treasury_rates import FMPTreasuryRatesFetcher # mypy: disable-error-code="list-item" fmp_provider = Provider( - name=ProviderNameType("fmp"), + name="fmp", description="Provider for FMP.", required_credentials=["api_key"], fetcher_list=[ diff --git a/openbb_sdk/providers/fred/openbb_fred/provider.py b/openbb_sdk/providers/fred/openbb_fred/provider.py index fc02d3fe9b7..2c8e60bb69a 100644 --- a/openbb_sdk/providers/fred/openbb_fred/provider.py +++ b/openbb_sdk/providers/fred/openbb_fred/provider.py @@ -3,14 +3,14 @@ # IMPORT STANDARD # IMPORT THIRD-PARTY # IMPORT INTERNAL -from openbb_provider.abstract.provider import Provider, ProviderNameType +from openbb_provider.abstract.provider import Provider from openbb_fred.cpi import FREDCPIFetcher # mypy: disable-error-code="list-item" fred_provider = Provider( - name=ProviderNameType("fred"), + name="fred", description="Provider for FRED.", required_credentials=["api_key"], fetcher_list=[FREDCPIFetcher], diff --git a/openbb_sdk/providers/polygon/openbb_polygon/provider.py b/openbb_sdk/providers/polygon/openbb_polygon/provider.py index 04245a0b9f2..32c29b8e9ea 100644 --- a/openbb_sdk/providers/polygon/openbb_polygon/provider.py +++ b/openbb_sdk/providers/polygon/openbb_polygon/provider.py @@ -3,7 +3,7 @@ # IMPORT STANDARD # IMPORT INTERNAL -from openbb_provider.abstract.provider import Provider, ProviderNameType +from openbb_provider.abstract.provider import Provider from openbb_polygon.balance_sheet import PolygonBalanceSheetFetcher from openbb_polygon.cash_flow import PolygonCashFlowStatementFetcher @@ -22,7 +22,7 @@ from openbb_polygon.stock_price import PolygonStockPriceFetcher # mypy: disable-error-code="list-item" polygon_provider = Provider( - name=ProviderNameType("polygon"), + name="polygon", description="Provider for Polygon.", required_credentials=["api_key"], fetcher_list=[ diff --git a/openbb_sdk/sdk/provider/openbb_provider/abstract/provider.py b/openbb_sdk/sdk/provider/openbb_provider/abstract/provider.py index 1628aff946f..9a9b4a3cb97 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/abstract/provider.py +++ b/openbb_sdk/sdk/provider/openbb_provider/abstract/provider.py @@ -1,56 +1,8 @@ """Abstract class for providers.""" +from typing import Any, Dict, List, Optional -from typing import Any, Dict, List, Literal, Optional - -import pkg_resources - - -def build_provider_name(): - """Build the provider name Literal from the entry points.""" - extension_names = [] - - for entry_point in pkg_resources.iter_entry_points("openbb_provider_extension"): - extension_names.append(entry_point.name) - - literal_values = () - for extension_name in extension_names: - literal_values += (extension_name,) - - provider_name = Literal[literal_values] # type: ignore - - return provider_name - - -ProviderName = build_provider_name() - - -class ProviderNameType(type): - """Metaclass for ProviderName.""" - - __args__ = ProviderName.__args__ - __str__ = ProviderName.__str__ - - def __new__(mcs, value): - """Override __new__ to check if value is a valid provider name.""" - return value - - def __init__(cls, value): - if value not in ProviderName.__args__: - raise ValueError(f"{value} is not a valid provider name.") - cls.value = value - - def __getstate__(cls): - """Override __getstate__ to return the value of the provider name.""" - return cls.value - - def __setstate__(cls, state): - """Override __setstate__ to set the value of the provider name.""" - cls.value = state - - def __repr__(cls): - """Override __repr__ to return the value of the provider name.""" - return f"ProviderName({cls.value})" +from openbb_provider.abstract.fetcher import Fetcher class Provider: @@ -60,20 +12,20 @@ class Provider: def __init__( self, - name: ProviderNameType, + name: str, description: str, - fetcher_list: List[Any], + fetcher_list: List[Fetcher], required_credentials: Optional[List[str]], ) -> None: """Initialize the provider. Parameters ---------- - name : ProviderNameType - The name of the provider that will define the typing and usage of the provider. + name : str + The name of the provider. description : str The description of the provider. - fetcher_list : List[Any] + fetcher_list : List[Fetcher] The list of fetchers that the provider supports. required_credentials : Optional[List[str]] The list of required credentials for the provider. diff --git a/openbb_sdk/sdk/provider/openbb_provider/registry.py b/openbb_sdk/sdk/provider/openbb_provider/registry.py index 703aba2b35b..81201996dbd 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/registry.py +++ b/openbb_sdk/sdk/provider/openbb_provider/registry.py @@ -7,7 +7,7 @@ import pkg_resources from openbb_provider.abstract.data import QueryParams from openbb_provider.abstract.fetcher import Fetcher -from openbb_provider.abstract.provider import Provider, ProviderNameType +from openbb_provider.abstract.provider import Provider class ProviderError(Exception): @@ -18,10 +18,10 @@ class ProviderRegistry: """A Provider Registry is the central executor for dynamically retrieving data.""" def __init__(self) -> None: - self.providers: Dict[ProviderNameType, Provider] = {} - self.credentials: Dict[ProviderNameType, Dict[str, None]] = {} + self.providers: Dict[str, Provider] = {} + self.credentials: Dict[str, Dict[str, None]] = {} - def get_provider(self, provider_name: ProviderNameType) -> Provider: + def get_provider(self, provider_name: str) -> Provider: """Get a provider from the registry.""" if not self.providers: raise ValueError("No providers found, please confirm they are loaded.") @@ -38,7 +38,7 @@ class ProviderRegistry: def filter_credentials( self, - provider_name: ProviderNameType, + provider_name: str, credentials: Optional[Dict[str, str]] = None, ) -> Dict[str, str]: required_credentials = self.credentials.get(provider_name) @@ -68,13 +68,13 @@ class ProviderRegistry: if fetcher is None: raise ProviderError( f"This query is not supported by the '{provider.name}' provider. " - f"Please try another provider: '{ProviderNameType.__args__}'" + f"Please try another provider: '{list(self.providers.keys())}'" ) return fetcher def fetch( self, - provider_name: ProviderNameType, + provider_name: str, query_params: QueryParams, extra_params: Optional[Dict] = None, credentials: Optional[Dict[str, str]] = None, @@ -94,6 +94,7 @@ def load_extensions(entry_point_group: str = "openbb_provider_extension") -> Any """Load extensions from entry points and their API keys from settings.""" # TODO: Figure actual type for dict values Union[Provider, Dict[str, Dict[str, None]]] + # Can we try to load the extensions directly into the ProviderRegistry? Let's try it. extensions_dict: Dict[str, Dict[str, Any]] = {} extensions_dict["providers"] = {} From c55fe0ab33a134256a601345a13a778415301291 Mon Sep 17 00:00:00 2001 From: James Maslek Date: Fri, 21 Jul 2023 10:34:43 -0400 Subject: [PATCH 02/28] make the summary file --- .github/workflows/windows10_build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows10_build.yml b/.github/workflows/windows10_build.yml index 005ada68fe0..d4e1f99dafe 100644 --- a/.github/workflows/windows10_build.yml +++ b/.github/workflows/windows10_build.yml @@ -104,6 +104,7 @@ jobs: - name: Run Integration Tests run: | + if (!(Test-Path summary.txt)) { New-Item -ItemType File -Path summary.txt } dist\OpenBBTerminal\OpenBBTerminal.exe -t -s forecast cryptocurrency reports alternative economy futures econometrics dashboards portfolio stocks/test_stocks_options_screen.openbb stocks/test_stocks_options.openbb forex etf stocks/test_stocks_fa.openbb | tee result.txt Select-String "================================ Integration Test Summary ================================" result.txt -Context 0,100 | Select-Object -Last 2000 | Out-File summary.txt Write-output `n >> summary.txt From 2b01955965ada583bf0113cc4bca58de80f6c164 Mon Sep 17 00:00:00 2001 From: James Maslek Date: Fri, 21 Jul 2023 11:47:39 -0400 Subject: [PATCH 03/28] another --- .github/workflows/windows10_build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows10_build.yml b/.github/workflows/windows10_build.yml index d4e1f99dafe..b3648ee3b1c 100644 --- a/.github/workflows/windows10_build.yml +++ b/.github/workflows/windows10_build.yml @@ -105,6 +105,7 @@ jobs: - name: Run Integration Tests run: | if (!(Test-Path summary.txt)) { New-Item -ItemType File -Path summary.txt } + if (!(Test-Path results.txt)) { New-Item -ItemType File -Path results.txt } dist\OpenBBTerminal\OpenBBTerminal.exe -t -s forecast cryptocurrency reports alternative economy futures econometrics dashboards portfolio stocks/test_stocks_options_screen.openbb stocks/test_stocks_options.openbb forex etf stocks/test_stocks_fa.openbb | tee result.txt Select-String "================================ Integration Test Summary ================================" result.txt -Context 0,100 | Select-Object -Last 2000 | Out-File summary.txt Write-output `n >> summary.txt From 8a5146baa62f4640a724f298f935f7168f6554f1 Mon Sep 17 00:00:00 2001 From: James Maslek Date: Fri, 21 Jul 2023 12:57:21 -0400 Subject: [PATCH 04/28] Change 3.1 to 3.2 --- build/docker/compose.env | 2 +- build/nsis/setup.nsi | 8 ++++---- build/pyinstaller/version.rc | 4 ++-- openbb_terminal/core/models/system_model.py | 2 +- pyproject.toml | 2 +- website/content/terminal/changelog/version2_0_0.mdx | 2 +- website/content/terminal/changelog/version2_1_0.mdx | 2 +- website/content/terminal/changelog/version2_2_0.mdx | 2 +- website/content/terminal/changelog/version2_3_0.mdx | 2 +- website/content/terminal/changelog/version2_3_1.mdx | 2 +- website/content/terminal/changelog/version2_4_0.mdx | 2 +- website/content/terminal/changelog/version2_4_1.mdx | 2 +- website/content/terminal/changelog/version2_5_0.mdx | 2 +- website/content/terminal/changelog/version2_5_1.mdx | 2 +- website/content/terminal/changelog/version3_0_0.mdx | 2 +- website/content/terminal/changelog/version3_0_1.mdx | 2 +- website/content/terminal/changelog/version3_1_0.mdx | 2 +- website/content/terminal/changelog/version3_2_0.mdx | 7 +++++++ website/content/terminal/installation/macos.md | 2 +- website/content/terminal/installation/windows.md | 2 +- 20 files changed, 30 insertions(+), 23 deletions(-) create mode 100644 website/content/terminal/changelog/version3_2_0.mdx diff --git a/build/docker/compose.env b/build/docker/compose.env index 64c55b56956..d1c6141e53c 100644 --- a/build/docker/compose.env +++ b/build/docker/compose.env @@ -1,2 +1,2 @@ OPENBBTERMINAL_DOCKER_REGISTRY="ghcr.io" -OPENBBTERMINAL_DOCKER_RELEASE_VERSION="3.1.0" +OPENBBTERMINAL_DOCKER_RELEASE_VERSION="3.2.0" diff --git a/build/nsis/setup.nsi b/build/nsis/setup.nsi index aa402f0e201..d80b4ffaf05 100644 --- a/build/nsis/setup.nsi +++ b/build/nsis/setup.nsi @@ -10,18 +10,18 @@ !define NAME "OpenBB Terminal" !define COMPANY "OpenBB" !define APPFILE "OpenBBTerminal.exe" - !define VERSION "3.1.0" + !define VERSION "3.2.0" !define SLUG "${NAME} v${VERSION}" ;-------------------------------- ; Info for Installer.exe - VIProductVersion 3.1.0.0 + VIProductVersion 3.2.0.0 VIAddVersionKey ProductName "OpenBB Terminal" VIAddVersionKey Comments "An installer for OpenBB Terminal. For additional details, visit OpenBB.co" VIAddVersionKey CompanyName OpenBB.co VIAddVersionKey FileDescription "OpenBB Terminal Program" - VIAddVersionKey FileVersion 3.1.0.0 - VIAddVersionKey ProductVersion 3.1.0.0 + VIAddVersionKey FileVersion 3.2.0.0 + VIAddVersionKey ProductVersion 3.2.0.0 VIAddVersionKey InternalName "OpenBB Terminal" ;-------------------------------- diff --git a/build/pyinstaller/version.rc b/build/pyinstaller/version.rc index 44d1c42f6ba..444f270896b 100644 --- a/build/pyinstaller/version.rc +++ b/build/pyinstaller/version.rc @@ -32,10 +32,10 @@ VSVersionInfo( [StringStruct('Comments', 'The OpenBB Terminal. For additional details, visit OpenBB.co'), StringStruct('CompanyName', 'OpenBB'), StringStruct('FileDescription', 'OpenBB Terminal Program'), - StringStruct('FileVersion', '3.1.0.0'), + StringStruct('FileVersion', '3.2.0.0'), StringStruct('InternalName', 'OpenBB Terminal'), StringStruct('ProductName', 'OpenBB Terminal'), - StringStruct('ProductVersion', '3.1.0.0')]) + StringStruct('ProductVersion', '3.2.0.0')]) ]), VarFileInfo([VarStruct('Translation', [1033, 1200])]) ] diff --git a/openbb_terminal/core/models/system_model.py b/openbb_terminal/core/models/system_model.py index 91c1bcfc9a6..85d61e7b1bf 100644 --- a/openbb_terminal/core/models/system_model.py +++ b/openbb_terminal/core/models/system_model.py @@ -28,7 +28,7 @@ class SystemModel(BaseModel): PLATFORM: str = str(platform.platform()) # OpenBB section - VERSION: str = "3.1.0" + VERSION: str = "3.2.0" # Logging section LOGGING_APP_ID: str = "REPLACE_ME" diff --git a/pyproject.toml b/pyproject.toml index c18b5f9b164..d393e231130 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "openbb" -version = "3.1.0" +version = "3.2.0" description = "Investment Research for Everyone, Anywhere." license = "MIT" authors = ["Didier Rodrigues Lopes"] diff --git a/website/content/terminal/changelog/version2_0_0.mdx b/website/content/terminal/changelog/version2_0_0.mdx index 7bf588bfefd..c401bd29c86 100644 --- a/website/content/terminal/changelog/version2_0_0.mdx +++ b/website/content/terminal/changelog/version2_0_0.mdx @@ -3,7 +3,7 @@ title: v2.0.0 version: "2.0.0" date: 2022-11-29 description: v2.0.0 -sidebar_position: 103 +sidebar_position: 104 --- ## Major Release Notes diff --git a/website/content/terminal/changelog/version2_1_0.mdx b/website/content/terminal/changelog/version2_1_0.mdx index 730e140eea0..e1cdd8e5f44 100644 --- a/website/content/terminal/changelog/version2_1_0.mdx +++ b/website/content/terminal/changelog/version2_1_0.mdx @@ -3,7 +3,7 @@ title: v2.1.0 version: "2.1.0" date: 2022-12-21 description: v2.1.0 -sidebar_position: 102 +sidebar_position: 103 --- ## What's new diff --git a/website/content/terminal/changelog/version2_2_0.mdx b/website/content/terminal/changelog/version2_2_0.mdx index 0cabe8e00c2..5bedd316e98 100644 --- a/website/content/terminal/changelog/version2_2_0.mdx +++ b/website/content/terminal/changelog/version2_2_0.mdx @@ -3,7 +3,7 @@ title: v2.2.0 version: "2.2.0" date: 2022-01-19 description: v2.2.0 -sidebar_position: 101 +sidebar_position: 102 --- ## What's new diff --git a/website/content/terminal/changelog/version2_3_0.mdx b/website/content/terminal/changelog/version2_3_0.mdx index 92dffb8f6d8..11a082997df 100644 --- a/website/content/terminal/changelog/version2_3_0.mdx +++ b/website/content/terminal/changelog/version2_3_0.mdx @@ -3,7 +3,7 @@ title: v2.3.0 version: "2.3.0" date: 2023-01-31 description: v2.3.0 -sidebar_position: 100 +sidebar_position: 101 --- diff --git a/website/content/terminal/changelog/version2_3_1.mdx b/website/content/terminal/changelog/version2_3_1.mdx index 991af4aa0b7..1b553ad84ad 100644 --- a/website/content/terminal/changelog/version2_3_1.mdx +++ b/website/content/terminal/changelog/version2_3_1.mdx @@ -3,7 +3,7 @@ title: v2.3.1 version: "2.3.1" date: 2023-02-01 description: v2.3.1 -sidebar_position: 99 +sidebar_position: 100 --- ## Fixed diff --git a/website/content/terminal/changelog/version2_4_0.mdx b/website/content/terminal/changelog/version2_4_0.mdx index 96f9424be88..bea3f19a099 100644 --- a/website/content/terminal/changelog/version2_4_0.mdx +++ b/website/content/terminal/changelog/version2_4_0.mdx @@ -3,7 +3,7 @@ title: v2.4.0 version: "2.4.0" date: 2023-02-14 description: v2.4.0 -sidebar_position: 98 +sidebar_position: 99 --- ## What's new diff --git a/website/content/terminal/changelog/version2_4_1.mdx b/website/content/terminal/changelog/version2_4_1.mdx index 0f9d28ff4a1..1cba750d632 100644 --- a/website/content/terminal/changelog/version2_4_1.mdx +++ b/website/content/terminal/changelog/version2_4_1.mdx @@ -3,7 +3,7 @@ title: v2.4.1 version: "2.4.1" date: 2023-02-17 description: v2.4.1 -sidebar_position: 97 +sidebar_position: 98 --- ## What's new diff --git a/website/content/terminal/changelog/version2_5_0.mdx b/website/content/terminal/changelog/version2_5_0.mdx index 60d7c0e5ea7..35aaf918ba5 100644 --- a/website/content/terminal/changelog/version2_5_0.mdx +++ b/website/content/terminal/changelog/version2_5_0.mdx @@ -3,7 +3,7 @@ title: v2.5.0 version: "2.5.0" date: 2023-03-01 description: v2.5.0 -sidebar_position: 96 +sidebar_position: 97 --- diff --git a/website/content/terminal/changelog/version2_5_1.mdx b/website/content/terminal/changelog/version2_5_1.mdx index ec42dfeac79..ef55df63440 100644 --- a/website/content/terminal/changelog/version2_5_1.mdx +++ b/website/content/terminal/changelog/version2_5_1.mdx @@ -3,7 +3,7 @@ title: 2.5.1 version: "2.5.1" date: 2023-03-01 description: Current - v2.5.1 -sidebar_position: 95 +sidebar_position: 96 --- ## Fixed diff --git a/website/content/terminal/changelog/version3_0_0.mdx b/website/content/terminal/changelog/version3_0_0.mdx index f3f2838fd20..8c44fefb86c 100644 --- a/website/content/terminal/changelog/version3_0_0.mdx +++ b/website/content/terminal/changelog/version3_0_0.mdx @@ -3,7 +3,7 @@ title: v3.0.0 version: "3.0.0" date: 2023-04-25 description: v3.0.0 -sidebar_position: 94 +sidebar_position: 95 --- ## What's new diff --git a/website/content/terminal/changelog/version3_0_1.mdx b/website/content/terminal/changelog/version3_0_1.mdx index 1750ff4a9f2..a63a568308c 100644 --- a/website/content/terminal/changelog/version3_0_1.mdx +++ b/website/content/terminal/changelog/version3_0_1.mdx @@ -3,7 +3,7 @@ title: v3.0.1 version: "3.0.1" date: 2023-05-15 description: v3.0.1 -sidebar_position: 93 +sidebar_position: 94 --- ## Thank you and welcome to our new contributors 🔥 diff --git a/website/content/terminal/changelog/version3_1_0.mdx b/website/content/terminal/changelog/version3_1_0.mdx index 198266d051e..cd56c8eac09 100644 --- a/website/content/terminal/changelog/version3_1_0.mdx +++ b/website/content/terminal/changelog/version3_1_0.mdx @@ -3,7 +3,7 @@ title: Current - v3.1.0 version: "3.1.0" date: 2023-06-21 description: Current - v3.1.0 -sidebar_position: 92 +sidebar_position: 93 --- ## Thank you and welcome to our new contributors 🔥 diff --git a/website/content/terminal/changelog/version3_2_0.mdx b/website/content/terminal/changelog/version3_2_0.mdx new file mode 100644 index 00000000000..07c30becd63 --- /dev/null +++ b/website/content/terminal/changelog/version3_2_0.mdx @@ -0,0 +1,7 @@ +--- +title: Current - v3.2.0 +version: "3.2.0" +date: 2023-07-21 +description: Current - v3.2.0 +sidebar_position: 92 +--- diff --git a/website/content/terminal/installation/macos.md b/website/content/terminal/installation/macos.md index 68e3a5f6ab3..5cb04f61679 100644 --- a/website/content/terminal/installation/macos.md +++ b/website/content/terminal/installation/macos.md @@ -37,7 +37,7 @@ Install the OpenBB Terminal on MacOS (Big Sur or later). There are two versions
- +
Minimum Requirements diff --git a/website/content/terminal/installation/windows.md b/website/content/terminal/installation/windows.md index 67d45d531fe..2eaa9e62242 100644 --- a/website/content/terminal/installation/windows.md +++ b/website/content/terminal/installation/windows.md @@ -30,7 +30,7 @@ import InstallerButton from "@site/src/components/General/InstallerButton"; This section provides you with the installation file as well as the guide to install the OpenBB Terminal via Windows (10 or greater). - +
Minimum Requirements From 8cc7dd5bc713ef417bb576f0d26f8ba3936eaf1b Mon Sep 17 00:00:00 2001 From: James Maslek Date: Fri, 21 Jul 2023 14:15:49 -0400 Subject: [PATCH 05/28] Update the release notes and revert build --- .github/workflows/unit-test.yml | 2 - .github/workflows/windows10_build.yml | 2 - .../terminal/changelog/version3_1_0.mdx | 4 +- .../terminal/changelog/version3_2_0.mdx | 50 +++++++++++++++++++ 4 files changed, 52 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 9ec66266dc3..d9b43ad11f8 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -254,8 +254,6 @@ jobs: include: - os: ubuntu python: 3.9 - - os: windows - python: 3.9 env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python }} diff --git a/.github/workflows/windows10_build.yml b/.github/workflows/windows10_build.yml index b3648ee3b1c..005ada68fe0 100644 --- a/.github/workflows/windows10_build.yml +++ b/.github/workflows/windows10_build.yml @@ -104,8 +104,6 @@ jobs: - name: Run Integration Tests run: | - if (!(Test-Path summary.txt)) { New-Item -ItemType File -Path summary.txt } - if (!(Test-Path results.txt)) { New-Item -ItemType File -Path results.txt } dist\OpenBBTerminal\OpenBBTerminal.exe -t -s forecast cryptocurrency reports alternative economy futures econometrics dashboards portfolio stocks/test_stocks_options_screen.openbb stocks/test_stocks_options.openbb forex etf stocks/test_stocks_fa.openbb | tee result.txt Select-String "================================ Integration Test Summary ================================" result.txt -Context 0,100 | Select-Object -Last 2000 | Out-File summary.txt Write-output `n >> summary.txt diff --git a/website/content/terminal/changelog/version3_1_0.mdx b/website/content/terminal/changelog/version3_1_0.mdx index cd56c8eac09..64a7333629d 100644 --- a/website/content/terminal/changelog/version3_1_0.mdx +++ b/website/content/terminal/changelog/version3_1_0.mdx @@ -1,8 +1,8 @@ --- -title: Current - v3.1.0 +title: v3.1.0 version: "3.1.0" date: 2023-06-21 -description: Current - v3.1.0 +description: v3.1.0 sidebar_position: 93 --- diff --git a/website/content/terminal/changelog/version3_2_0.mdx b/website/content/terminal/changelog/version3_2_0.mdx index 07c30becd63..f6394b67ed6 100644 --- a/website/content/terminal/changelog/version3_2_0.mdx +++ b/website/content/terminal/changelog/version3_2_0.mdx @@ -5,3 +5,53 @@ date: 2023-07-21 description: Current - v3.2.0 sidebar_position: 92 --- + +## Thank you and welcome to our new contributors 🔥 +@harshvardhansharma + +## What's new 🎉 +* New hold functionality for overlaying charts +* Added the USD Liquidity Index to the economy menu +* Edited economy/treasury data source +* Deprecated stocks/ta/rsp +* Deprecated economy/rtps +* Updated some older pinned dependencies +* General bug fixes and enhancements + + +## What's changed 🚀 +* add public routines flag (#5236) @montezdesousa +* Release Cleanup (#5233) @jmaslek +* Hotfix/ improve tables/charts (#5228) @tehcoderer +* Adds a matlab like `hold on` to plot on same axis (#5173) @jmaslek +* Update routine tags (#5221) @DidierRLopes +* Manually triggered unit test (#5229) @jmaslek +* adds note indicating V3.1.0 is required for loops and keywords (#5219) @deeleeramone +* Update treasury command to get directly from fed (#5215) @jmaslek +* hotfix / improve autoscaling/dynamic loading, fix forex candle charts, equity reports (#5183) @tehcoderer +* Close 2 stocks fa issues with polygon (#5217) @jmaslek +* Fix prompt typo (#5192) @montezdesousa +* hotfix / Moving Averages Export (#5214) @tehcoderer +* Get oanda back to forex sources to fix the menu (#5204) @piiq +* Make some improvements to askobb (#5205) @jmaslek +* Remove `economy/rtps` and `stocks/ta/rsp` (#5181) @jmaslek +* [Update] bump langchain and llama (#5202) @martinb-bb +* Hotfix / Switch `download_plotly_js` to run in thread (#5203) @tehcoderer +* feature/usd-liquidity-index: Adds USD Liquidity Index to Economy menu (#5174) @deeleeramone +* hotfix/fix-stocks-screener: Fixes the random column header artifacts (#5199) @deeleeramone +* feature/examples-optionsChains: Add Notebook example: optionsChains (#5165) @deeleeramone +* hotfix/fix-intrinio-load: (#5188) @deeleeramone +* hotfix/economy-index-list: Adds Six Indices to the `economy/index` List (#5185) @deeleeramone +* hotfix/docs-sdk-forex: Fixes #5194 (#5196) @deeleeramone +* hotfix / Save session on oauth login (#5195) @tehcoderer +* Adds Topledger on-chain data (#5029) @harshvardhansharma +* hotfix / TA ma's empty if not enough data for window (#5180) @tehcoderer +* hotfix/fix-options-skew: Fixes columns not subtracting (#5170) @deeleeramone +* Release/3.1.0 (#5168) @jmaslek + +We are proud of our community contributors and staunch supporters of open-source ecosystems. +Help us promote our community by tagging `@openbb_finance` on Twitter with a link to your pull request, +and join our Discord server to chat about your contribution! We want to hear about your experience! + +### Links 🦋 +[Website](https://openbb.co/), [Twitter](https://twitter.com/openbb_finance), [Linkedin](https://www.linkedin.com/company/openbb-finance), [Instagram](https://www.instagram.com/openbb.finance/), [Reddit](https://www.reddit.com/r/openbb/), [Discord](https://discord.com/invite/xPHTuHCmuV) From 96f3709e0c42294b91ddf1ad001c790d2db5e47a Mon Sep 17 00:00:00 2001 From: tehcoderer Date: Fri, 21 Jul 2023 15:39:42 -0400 Subject: [PATCH 06/28] fix windows missing `matplotlib.libs` dir --- build/pyinstaller/terminal.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/pyinstaller/terminal.spec b/build/pyinstaller/terminal.spec index f1e20644961..7c01351ff9e 100644 --- a/build/pyinstaller/terminal.spec +++ b/build/pyinstaller/terminal.spec @@ -3,6 +3,7 @@ import os import subprocess import sys from pathlib import Path +import matplotlib import scipy from dotenv import set_key @@ -74,7 +75,7 @@ added_files = [ (str(pathex / "langchain"), "langchain"), (str(pathex / "llama_index/VERSION"), "llama_index"), (str(pathex / "tiktoken"), "tiktoken"), - (str(pathex / "tiktoken_ext"), "tiktoken_ext") + (str(pathex / "tiktoken_ext"), "tiktoken_ext"), ] if is_win: @@ -82,6 +83,10 @@ if is_win: [ (os.path.join(f"{os.path.dirname(scipy.__file__)}.libs"), "scipy.libs/"), (str(pathex / "frozendict/version.py"), "frozendict"), + ( + os.path.join(f"{os.path.dirname(matplotlib.__file__)}.libs"), + "matplotlib.libs/", + ), ] ) From 4c5f9c77b1fa994fbaa3a11d638b775ef3dd733e Mon Sep 17 00:00:00 2001 From: James Maslek Date: Fri, 21 Jul 2023 15:51:57 -0400 Subject: [PATCH 07/28] Fix reqs --- poetry.lock | 116 ++++++++++-------------------------------- pyproject.toml | 2 +- requirements-full.txt | 3 +- 3 files changed, 29 insertions(+), 92 deletions(-) diff --git a/poetry.lock b/poetry.lock index af90ff23394..22d20175c76 100644 --- a/poetry.lock +++ b/poetry.lock @@ -7827,66 +7827,6 @@ files = [ {file = "ruff-0.0.256.tar.gz", hash = "sha256:f9a96b34a4870ee8cf2f3779cd7854620d1788a83b52374771266cf800541bb7"}, ] -[[package]] -name = "safetensors" -version = "0.3.1" -description = "Fast and Safe Tensor serialization" -optional = true -python-versions = "*" -files = [ - {file = "safetensors-0.3.1-cp310-cp310-macosx_10_11_x86_64.whl", hash = "sha256:2ae9b7dd268b4bae6624729dac86deb82104820e9786429b0583e5168db2f770"}, - {file = "safetensors-0.3.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:08c85c1934682f1e2cd904d38433b53cd2a98245a7cc31f5689f9322a2320bbf"}, - {file = "safetensors-0.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba625c7af9e1c5d0d91cb83d2fba97d29ea69d4db2015d9714d24c7f6d488e15"}, - {file = "safetensors-0.3.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b57d5890c619ec10d9f1b6426b8690d0c9c2868a90dc52f13fae6f6407ac141f"}, - {file = "safetensors-0.3.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5c9f562ea696d50b95cadbeb1716dc476714a87792ffe374280c0835312cbfe2"}, - {file = "safetensors-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c115951b3a865ece8d98ee43882f2fd0a999c0200d6e6fec24134715ebe3b57"}, - {file = "safetensors-0.3.1-cp310-cp310-win32.whl", hash = "sha256:118f8f7503ea312fc7af27e934088a1b589fb1eff5a7dea2cd1de6c71ee33391"}, - {file = "safetensors-0.3.1-cp310-cp310-win_amd64.whl", hash = "sha256:54846eaae25fded28a7bebbb66be563cad221b4c80daee39e2f55df5e5e0266f"}, - {file = "safetensors-0.3.1-cp311-cp311-macosx_10_11_universal2.whl", hash = "sha256:5af82e10946c4822506db0f29269f43147e889054704dde994d4e22f0c37377b"}, - {file = "safetensors-0.3.1-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:626c86dd1d930963c8ea7f953a3787ae85322551e3a5203ac731d6e6f3e18f44"}, - {file = "safetensors-0.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:12e30677e6af1f4cc4f2832546e91dbb3b0aa7d575bfa473d2899d524e1ace08"}, - {file = "safetensors-0.3.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d534b80bc8d39945bb902f34b0454773971fe9e5e1f2142af451759d7e52b356"}, - {file = "safetensors-0.3.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ddd0ddd502cf219666e7d30f23f196cb87e829439b52b39f3e7da7918c3416df"}, - {file = "safetensors-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:997a2cc14023713f423e6d16536d55cb16a3d72850f142e05f82f0d4c76d383b"}, - {file = "safetensors-0.3.1-cp311-cp311-win32.whl", hash = "sha256:6ae9ca63d9e22f71ec40550207bd284a60a6b4916ae6ca12c85a8d86bf49e0c3"}, - {file = "safetensors-0.3.1-cp311-cp311-win_amd64.whl", hash = "sha256:62aa7421ca455418423e35029524489480adda53e3f702453580180ecfebe476"}, - {file = "safetensors-0.3.1-cp37-cp37m-macosx_10_11_x86_64.whl", hash = "sha256:6d54b3ed367b6898baab75dfd057c24f36ec64d3938ffff2af981d56bfba2f42"}, - {file = "safetensors-0.3.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:262423aeda91117010f8c607889066028f680fbb667f50cfe6eae96f22f9d150"}, - {file = "safetensors-0.3.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:10efe2513a8327fd628cea13167089588acc23093ba132aecfc536eb9a4560fe"}, - {file = "safetensors-0.3.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:689b3d6a7ebce70ee9438267ee55ea89b575c19923876645e927d08757b552fe"}, - {file = "safetensors-0.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14cd9a87bc73ce06903e9f8ee8b05b056af6f3c9f37a6bd74997a16ed36ff5f4"}, - {file = "safetensors-0.3.1-cp37-cp37m-win32.whl", hash = "sha256:a77cb39624480d5f143c1cc272184f65a296f573d61629eff5d495d2e0541d3e"}, - {file = "safetensors-0.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:9eff3190bfbbb52eef729911345c643f875ca4dbb374aa6c559675cfd0ab73db"}, - {file = "safetensors-0.3.1-cp38-cp38-macosx_10_11_x86_64.whl", hash = "sha256:05cbfef76e4daa14796db1bbb52072d4b72a44050c368b2b1f6fd3e610669a89"}, - {file = "safetensors-0.3.1-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:c49061461f4a81e5ec3415070a3f135530834c89cbd6a7db7cd49e3cb9d9864b"}, - {file = "safetensors-0.3.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22cf7e73ca42974f098ce0cf4dd8918983700b6b07a4c6827d50c8daefca776e"}, - {file = "safetensors-0.3.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04f909442d6223ff0016cd2e1b2a95ef8039b92a558014627363a2e267213f62"}, - {file = "safetensors-0.3.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2c573c5a0d5d45791ae8c179e26d74aff86e719056591aa7edb3ca7be55bc961"}, - {file = "safetensors-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6994043b12e717cf2a6ba69077ac41f0d3675b2819734f07f61819e854c622c7"}, - {file = "safetensors-0.3.1-cp38-cp38-win32.whl", hash = "sha256:158ede81694180a0dbba59422bc304a78c054b305df993c0c6e39c6330fa9348"}, - {file = "safetensors-0.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:afdc725beff7121ea8d39a7339f5a6abcb01daa189ea56290b67fe262d56e20f"}, - {file = "safetensors-0.3.1-cp39-cp39-macosx_10_11_x86_64.whl", hash = "sha256:cba910fcc9e5e64d32d62b837388721165e9c7e45d23bc3a38ad57694b77f40d"}, - {file = "safetensors-0.3.1-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:a4f7dbfe7285573cdaddd85ef6fa84ebbed995d3703ab72d71257944e384612f"}, - {file = "safetensors-0.3.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54aed0802f9eaa83ca7b1cbb986bfb90b8e2c67b6a4bcfe245627e17dad565d4"}, - {file = "safetensors-0.3.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:34b75a766f3cfc99fd4c33e329b76deae63f5f388e455d863a5d6e99472fca8e"}, - {file = "safetensors-0.3.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1a0f31904f35dc14919a145b2d7a2d8842a43a18a629affe678233c4ea90b4af"}, - {file = "safetensors-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcf527ecc5f58907fd9031510378105487f318cc91ecdc5aee3c7cc8f46030a8"}, - {file = "safetensors-0.3.1-cp39-cp39-win32.whl", hash = "sha256:e2f083112cf97aa9611e2a05cc170a2795eccec5f6ff837f4565f950670a9d83"}, - {file = "safetensors-0.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:5f4f614b8e8161cd8a9ca19c765d176a82b122fa3d3387b77862145bfe9b4e93"}, - {file = "safetensors-0.3.1.tar.gz", hash = "sha256:571da56ff8d0bec8ae54923b621cda98d36dcef10feb36fd492c4d0c2cd0e869"}, -] - -[package.extras] -all = ["black (==22.3)", "click (==8.0.4)", "flake8 (>=3.8.3)", "flax (>=0.6.3)", "h5py (>=3.7.0)", "huggingface-hub (>=0.12.1)", "isort (>=5.5.4)", "jax (>=0.3.25)", "jaxlib (>=0.3.25)", "numpy (>=1.21.6)", "paddlepaddle (>=2.4.1)", "pytest (>=7.2.0)", "pytest-benchmark (>=4.0.0)", "setuptools-rust (>=1.5.2)", "tensorflow (>=2.11.0)", "torch (>=1.10)"] -dev = ["black (==22.3)", "click (==8.0.4)", "flake8 (>=3.8.3)", "flax (>=0.6.3)", "h5py (>=3.7.0)", "huggingface-hub (>=0.12.1)", "isort (>=5.5.4)", "jax (>=0.3.25)", "jaxlib (>=0.3.25)", "numpy (>=1.21.6)", "paddlepaddle (>=2.4.1)", "pytest (>=7.2.0)", "pytest-benchmark (>=4.0.0)", "setuptools-rust (>=1.5.2)", "tensorflow (>=2.11.0)", "torch (>=1.10)"] -jax = ["flax (>=0.6.3)", "jax (>=0.3.25)", "jaxlib (>=0.3.25)"] -numpy = ["numpy (>=1.21.6)"] -paddlepaddle = ["paddlepaddle (>=2.4.1)"] -quality = ["black (==22.3)", "click (==8.0.4)", "flake8 (>=3.8.3)", "isort (>=5.5.4)"] -tensorflow = ["tensorflow (>=2.11.0)"] -testing = ["h5py (>=3.7.0)", "huggingface-hub (>=0.12.1)", "numpy (>=1.21.6)", "pytest (>=7.2.0)", "pytest-benchmark (>=4.0.0)", "setuptools-rust (>=1.5.2)"] -torch = ["torch (>=1.10)"] - [[package]] name = "scikit-learn" version = "1.3.0" @@ -9359,72 +9299,70 @@ test = ["argcomplete (>=2.0)", "pre-commit", "pytest", "pytest-mock"] [[package]] name = "transformers" -version = "4.31.0" +version = "4.27.1" description = "State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow" optional = true -python-versions = ">=3.8.0" +python-versions = ">=3.7.0" files = [ - {file = "transformers-4.31.0-py3-none-any.whl", hash = "sha256:8487aab0195ce1c2a5ae189305118b9720daddbc7b688edb09ccd79e3b149f6b"}, - {file = "transformers-4.31.0.tar.gz", hash = "sha256:4302fba920a1c24d3a429a29efff6a63eac03f3f3cf55b55927fc795d01cb273"}, + {file = "transformers-4.27.1-py3-none-any.whl", hash = "sha256:b8cf844cbeaefd24b07f7ab1550af11b5d9cf0a7d09e5f4fedede9b15a3da2c0"}, + {file = "transformers-4.27.1.tar.gz", hash = "sha256:05120d91e407c0d3db364f5d0710cdacccd15f67114b075f161a71535c133695"}, ] [package.dependencies] filelock = "*" -huggingface-hub = ">=0.14.1,<1.0" +huggingface-hub = ">=0.11.0,<1.0" numpy = ">=1.17" packaging = ">=20.0" pyyaml = ">=5.1" regex = "!=2019.12.17" requests = "*" -safetensors = ">=0.3.1" tokenizers = ">=0.11.1,<0.11.3 || >0.11.3,<0.14" tqdm = ">=4.27" [package.extras] -accelerate = ["accelerate (>=0.20.3)"] -agents = ["Pillow (<10.0.0)", "accelerate (>=0.20.3)", "datasets (!=2.5.0)", "diffusers", "opencv-python", "sentencepiece (>=0.1.91,!=0.1.92)", "torch (>=1.9,!=1.12.0)"] -all = ["Pillow (<10.0.0)", "accelerate (>=0.20.3)", "av (==9.2.0)", "codecarbon (==1.2.0)", "decord (==0.6.0)", "flax (>=0.4.1,<=0.7.0)", "jax (>=0.2.8,!=0.3.2,<=0.4.13)", "jaxlib (>=0.1.65,<=0.4.13)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "onnxconverter-common", "optax (>=0.0.8,<=0.1.4)", "optuna", "phonemizer", "protobuf", "pyctcdecode (>=0.4.0)", "ray[tune]", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "tensorflow (>=2.6,<2.14)", "tensorflow-text (<2.14)", "tf2onnx", "timm", "tokenizers (>=0.11.1,!=0.11.3,<0.14)", "torch (>=1.9,!=1.12.0)", "torchaudio", "torchvision"] +accelerate = ["accelerate (>=0.10.0)"] +all = ["Pillow", "accelerate (>=0.10.0)", "av (==9.2.0)", "codecarbon (==1.2.0)", "decord (==0.6.0)", "flax (>=0.4.1)", "jax (>=0.2.8,!=0.3.2,<=0.3.6)", "jaxlib (>=0.1.65,<=0.3.6)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "onnxconverter-common", "optax (>=0.0.8)", "optuna", "phonemizer", "protobuf (<=3.20.2)", "pyctcdecode (>=0.4.0)", "ray[tune]", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "tensorflow (>=2.4,<2.12)", "tensorflow-text", "tf2onnx", "timm", "tokenizers (>=0.11.1,!=0.11.3,<0.14)", "torch (>=1.7,!=1.12.0)", "torchaudio", "torchvision"] audio = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)"] codecarbon = ["codecarbon (==1.2.0)"] -deepspeed = ["accelerate (>=0.20.3)", "deepspeed (>=0.9.3)"] -deepspeed-testing = ["GitPython (<3.1.19)", "accelerate (>=0.20.3)", "beautifulsoup4", "black (>=23.1,<24.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "deepspeed (>=0.9.3)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "hf-doc-builder (>=0.3.0)", "nltk", "optuna", "parameterized", "protobuf", "psutil", "pytest (>=7.2.0)", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "sentencepiece (>=0.1.91,!=0.1.92)", "timeout-decorator"] -dev = ["GitPython (<3.1.19)", "Pillow (<10.0.0)", "accelerate (>=0.20.3)", "av (==9.2.0)", "beautifulsoup4", "black (>=23.1,<24.0)", "codecarbon (==1.2.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "decord (==0.6.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "flax (>=0.4.1,<=0.7.0)", "fugashi (>=1.0)", "hf-doc-builder", "hf-doc-builder (>=0.3.0)", "ipadic (>=1.0.0,<2.0)", "isort (>=5.5.4)", "jax (>=0.2.8,!=0.3.2,<=0.4.13)", "jaxlib (>=0.1.65,<=0.4.13)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "nltk", "onnxconverter-common", "optax (>=0.0.8,<=0.1.4)", "optuna", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pytest (>=7.2.0)", "pytest-timeout", "pytest-xdist", "ray[tune]", "rhoknp (>=1.1.0,<1.3.1)", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (>=0.0.241,<=0.0.259)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "tensorflow (>=2.6,<2.14)", "tensorflow-text (<2.14)", "tf2onnx", "timeout-decorator", "timm", "tokenizers (>=0.11.1,!=0.11.3,<0.14)", "torch (>=1.9,!=1.12.0)", "torchaudio", "torchvision", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)", "urllib3 (<2.0.0)"] -dev-tensorflow = ["GitPython (<3.1.19)", "Pillow (<10.0.0)", "beautifulsoup4", "black (>=23.1,<24.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "hf-doc-builder", "hf-doc-builder (>=0.3.0)", "isort (>=5.5.4)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "nltk", "onnxconverter-common", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pytest (>=7.2.0)", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (>=0.0.241,<=0.0.259)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "tensorflow (>=2.6,<2.14)", "tensorflow-text (<2.14)", "tf2onnx", "timeout-decorator", "tokenizers (>=0.11.1,!=0.11.3,<0.14)", "urllib3 (<2.0.0)"] -dev-torch = ["GitPython (<3.1.19)", "Pillow (<10.0.0)", "accelerate (>=0.20.3)", "beautifulsoup4", "black (>=23.1,<24.0)", "codecarbon (==1.2.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "fugashi (>=1.0)", "hf-doc-builder", "hf-doc-builder (>=0.3.0)", "ipadic (>=1.0.0,<2.0)", "isort (>=5.5.4)", "kenlm", "librosa", "nltk", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "optuna", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pytest (>=7.2.0)", "pytest-timeout", "pytest-xdist", "ray[tune]", "rhoknp (>=1.1.0,<1.3.1)", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (>=0.0.241,<=0.0.259)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "timeout-decorator", "timm", "tokenizers (>=0.11.1,!=0.11.3,<0.14)", "torch (>=1.9,!=1.12.0)", "torchaudio", "torchvision", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)", "urllib3 (<2.0.0)"] -docs = ["Pillow (<10.0.0)", "accelerate (>=0.20.3)", "av (==9.2.0)", "codecarbon (==1.2.0)", "decord (==0.6.0)", "flax (>=0.4.1,<=0.7.0)", "hf-doc-builder", "jax (>=0.2.8,!=0.3.2,<=0.4.13)", "jaxlib (>=0.1.65,<=0.4.13)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "onnxconverter-common", "optax (>=0.0.8,<=0.1.4)", "optuna", "phonemizer", "protobuf", "pyctcdecode (>=0.4.0)", "ray[tune]", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "tensorflow (>=2.6,<2.14)", "tensorflow-text (<2.14)", "tf2onnx", "timm", "tokenizers (>=0.11.1,!=0.11.3,<0.14)", "torch (>=1.9,!=1.12.0)", "torchaudio", "torchvision"] +deepspeed = ["accelerate (>=0.10.0)", "deepspeed (>=0.6.5)"] +deepspeed-testing = ["GitPython (<3.1.19)", "accelerate (>=0.10.0)", "beautifulsoup4", "black (>=23.1,<24.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "deepspeed (>=0.6.5)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "hf-doc-builder (>=0.3.0)", "nltk", "optuna", "parameterized", "protobuf (<=3.20.2)", "psutil", "pytest", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "safetensors (>=0.2.1)", "sentencepiece (>=0.1.91,!=0.1.92)", "timeout-decorator"] +dev = ["GitPython (<3.1.19)", "Pillow", "accelerate (>=0.10.0)", "av (==9.2.0)", "beautifulsoup4", "black (>=23.1,<24.0)", "codecarbon (==1.2.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "decord (==0.6.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "flax (>=0.4.1)", "fugashi (>=1.0)", "hf-doc-builder", "hf-doc-builder (>=0.3.0)", "ipadic (>=1.0.0,<2.0)", "isort (>=5.5.4)", "jax (>=0.2.8,!=0.3.2,<=0.3.6)", "jaxlib (>=0.1.65,<=0.3.6)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "nltk", "onnxconverter-common", "optax (>=0.0.8)", "optuna", "parameterized", "phonemizer", "protobuf (<=3.20.2)", "psutil", "pyctcdecode (>=0.4.0)", "pytest", "pytest-timeout", "pytest-xdist", "ray[tune]", "rhoknp (>=1.1.0)", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (>=0.0.241)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "safetensors (>=0.2.1)", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "tensorflow (>=2.4,<2.12)", "tensorflow-text", "tf2onnx", "timeout-decorator", "timm", "tokenizers (>=0.11.1,!=0.11.3,<0.14)", "torch (>=1.7,!=1.12.0)", "torchaudio", "torchvision", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)"] +dev-tensorflow = ["GitPython (<3.1.19)", "Pillow", "beautifulsoup4", "black (>=23.1,<24.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "hf-doc-builder", "hf-doc-builder (>=0.3.0)", "isort (>=5.5.4)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "nltk", "onnxconverter-common", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "parameterized", "phonemizer", "protobuf (<=3.20.2)", "psutil", "pyctcdecode (>=0.4.0)", "pytest", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (>=0.0.241)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "safetensors (>=0.2.1)", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "tensorflow (>=2.4,<2.12)", "tensorflow-text", "tf2onnx", "timeout-decorator", "tokenizers (>=0.11.1,!=0.11.3,<0.14)"] +dev-torch = ["GitPython (<3.1.19)", "Pillow", "beautifulsoup4", "black (>=23.1,<24.0)", "codecarbon (==1.2.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "fugashi (>=1.0)", "hf-doc-builder", "hf-doc-builder (>=0.3.0)", "ipadic (>=1.0.0,<2.0)", "isort (>=5.5.4)", "kenlm", "librosa", "nltk", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "optuna", "parameterized", "phonemizer", "protobuf (<=3.20.2)", "psutil", "pyctcdecode (>=0.4.0)", "pytest", "pytest-timeout", "pytest-xdist", "ray[tune]", "rhoknp (>=1.1.0)", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (>=0.0.241)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "safetensors (>=0.2.1)", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "timeout-decorator", "timm", "tokenizers (>=0.11.1,!=0.11.3,<0.14)", "torch (>=1.7,!=1.12.0)", "torchaudio", "torchvision", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)"] +docs = ["Pillow", "accelerate (>=0.10.0)", "av (==9.2.0)", "codecarbon (==1.2.0)", "decord (==0.6.0)", "flax (>=0.4.1)", "hf-doc-builder", "jax (>=0.2.8,!=0.3.2,<=0.3.6)", "jaxlib (>=0.1.65,<=0.3.6)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "onnxconverter-common", "optax (>=0.0.8)", "optuna", "phonemizer", "protobuf (<=3.20.2)", "pyctcdecode (>=0.4.0)", "ray[tune]", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "tensorflow (>=2.4,<2.12)", "tensorflow-text", "tf2onnx", "timm", "tokenizers (>=0.11.1,!=0.11.3,<0.14)", "torch (>=1.7,!=1.12.0)", "torchaudio", "torchvision"] docs-specific = ["hf-doc-builder"] fairscale = ["fairscale (>0.3)"] -flax = ["flax (>=0.4.1,<=0.7.0)", "jax (>=0.2.8,!=0.3.2,<=0.4.13)", "jaxlib (>=0.1.65,<=0.4.13)", "optax (>=0.0.8,<=0.1.4)"] +flax = ["flax (>=0.4.1)", "jax (>=0.2.8,!=0.3.2,<=0.3.6)", "jaxlib (>=0.1.65,<=0.3.6)", "optax (>=0.0.8)"] flax-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)"] ftfy = ["ftfy"] integrations = ["optuna", "ray[tune]", "sigopt"] -ja = ["fugashi (>=1.0)", "ipadic (>=1.0.0,<2.0)", "rhoknp (>=1.1.0,<1.3.1)", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)"] +ja = ["fugashi (>=1.0)", "ipadic (>=1.0.0,<2.0)", "rhoknp (>=1.1.0)", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)"] modelcreation = ["cookiecutter (==1.7.3)"] -natten = ["natten (>=0.14.6)"] +natten = ["natten (>=0.14.4)"] onnx = ["onnxconverter-common", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "tf2onnx"] onnxruntime = ["onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)"] optuna = ["optuna"] -quality = ["GitPython (<3.1.19)", "black (>=23.1,<24.0)", "datasets (!=2.5.0)", "hf-doc-builder (>=0.3.0)", "isort (>=5.5.4)", "ruff (>=0.0.241,<=0.0.259)", "urllib3 (<2.0.0)"] +quality = ["GitPython (<3.1.19)", "black (>=23.1,<24.0)", "datasets (!=2.5.0)", "hf-doc-builder (>=0.3.0)", "isort (>=5.5.4)", "ruff (>=0.0.241)"] ray = ["ray[tune]"] retrieval = ["datasets (!=2.5.0)", "faiss-cpu"] sagemaker = ["sagemaker (>=2.31.0)"] -sentencepiece = ["protobuf", "sentencepiece (>=0.1.91,!=0.1.92)"] -serving = ["fastapi", "pydantic (<2)", "starlette", "uvicorn"] +sentencepiece = ["protobuf (<=3.20.2)", "sentencepiece (>=0.1.91,!=0.1.92)"] +serving = ["fastapi", "pydantic", "starlette", "uvicorn"] sigopt = ["sigopt"] sklearn = ["scikit-learn"] speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)", "torchaudio"] -testing = ["GitPython (<3.1.19)", "beautifulsoup4", "black (>=23.1,<24.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "hf-doc-builder (>=0.3.0)", "nltk", "parameterized", "protobuf", "psutil", "pytest (>=7.2.0)", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "timeout-decorator"] -tf = ["keras-nlp (>=0.3.1)", "onnxconverter-common", "tensorflow (>=2.6,<2.14)", "tensorflow-text (<2.14)", "tf2onnx"] -tf-cpu = ["keras-nlp (>=0.3.1)", "onnxconverter-common", "tensorflow-cpu (>=2.6,<2.14)", "tensorflow-text (<2.14)", "tf2onnx"] +testing = ["GitPython (<3.1.19)", "beautifulsoup4", "black (>=23.1,<24.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "hf-doc-builder (>=0.3.0)", "nltk", "parameterized", "protobuf (<=3.20.2)", "psutil", "pytest", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "safetensors (>=0.2.1)", "timeout-decorator"] +tf = ["keras-nlp (>=0.3.1)", "onnxconverter-common", "tensorflow (>=2.4,<2.12)", "tensorflow-text", "tf2onnx"] +tf-cpu = ["keras-nlp (>=0.3.1)", "onnxconverter-common", "tensorflow-cpu (>=2.4,<2.12)", "tensorflow-text", "tf2onnx"] tf-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)"] timm = ["timm"] tokenizers = ["tokenizers (>=0.11.1,!=0.11.3,<0.14)"] -torch = ["accelerate (>=0.20.3)", "torch (>=1.9,!=1.12.0)"] +torch = ["torch (>=1.7,!=1.12.0)"] torch-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)", "torchaudio"] -torch-vision = ["Pillow (<10.0.0)", "torchvision"] -torchhub = ["filelock", "huggingface-hub (>=0.14.1,<1.0)", "importlib-metadata", "numpy (>=1.17)", "packaging (>=20.0)", "protobuf", "regex (!=2019.12.17)", "requests", "sentencepiece (>=0.1.91,!=0.1.92)", "tokenizers (>=0.11.1,!=0.11.3,<0.14)", "torch (>=1.9,!=1.12.0)", "tqdm (>=4.27)"] +torch-vision = ["Pillow", "torchvision"] +torchhub = ["filelock", "huggingface-hub (>=0.11.0,<1.0)", "importlib-metadata", "numpy (>=1.17)", "packaging (>=20.0)", "protobuf (<=3.20.2)", "regex (!=2019.12.17)", "requests", "sentencepiece (>=0.1.91,!=0.1.92)", "tokenizers (>=0.11.1,!=0.11.3,<0.14)", "torch (>=1.7,!=1.12.0)", "tqdm (>=4.27)"] video = ["av (==9.2.0)", "decord (==0.6.0)"] -vision = ["Pillow (<10.0.0)"] +vision = ["Pillow"] [[package]] name = "triad" @@ -10546,4 +10484,4 @@ optimization = ["Riskfolio-Lib"] [metadata] lock-version = "2.0" python-versions = "^3.8.1,<3.11, !=3.9.7" -content-hash = "8cb493928cc7116e1ef3dc2fc3d7ce90fdc1790f6cc44bfdce5bcb98eea0c6aa" +content-hash = "38dff4b9cdf474ad09c493b85b4168826350c6f8cb4da920ee4a823e5a807525" diff --git a/pyproject.toml b/pyproject.toml index d393e231130..919bfe76844 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,7 +110,7 @@ intrinio-sdk = "^6.22.2" yahooquery = "^2.3.0" openai-whisper = {version = "^20230124", optional = true} setuptools-rust = {version = "^1.5.2", optional = true} -transformers = {version = "^4.26.1", optional = true} +transformers = {version = "4.27.1", optional = true} yt-dlp = {version = "^2023.2.17", optional = true} pydantic = "<2" posthog = "^3.0.1" diff --git a/requirements-full.txt b/requirements-full.txt index 2bb479ba838..d0015c945d5 100644 --- a/requirements-full.txt +++ b/requirements-full.txt @@ -334,7 +334,6 @@ rsa==4.9 ; python_full_version >= "3.8.1" and python_version < "3.11" and python ruamel-yaml-clib==0.2.7 ; platform_python_implementation == "CPython" and python_version < "3.11" and python_full_version >= "3.8.1" and python_full_version != "3.9.7" ruamel-yaml==0.17.32 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" ruff==0.0.256 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" -safetensors==0.3.1 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" scikit-learn==1.3.0 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" scipy==1.10.1 ; python_full_version >= "3.8.1" and python_version < "3.11" and python_full_version != "3.9.7" screeninfo==0.6.7 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" @@ -397,7 +396,7 @@ tqdm==4.65.0 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" trace-updater==0.0.9.1 ; python_full_version >= "3.8.1" and python_version < "3.11" and python_full_version != "3.9.7" tradingview-ta==3.3.0 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" traitlets==5.9.0 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" -transformers==4.31.0 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" +transformers==4.27.1 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" triad==0.9.1 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" types-python-dateutil==2.8.19.14 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" types-pytz==2021.3.8 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" From ee6d12b511026b78f46695fc6a42417a2df63656 Mon Sep 17 00:00:00 2001 From: tehcoderer Date: Fri, 21 Jul 2023 16:32:01 -0400 Subject: [PATCH 08/28] fix tables --- frontend-components/tables/src/components/Table/index.tsx | 6 +++--- openbb_terminal/core/plots/table.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend-components/tables/src/components/Table/index.tsx b/frontend-components/tables/src/components/Table/index.tsx index 40b8bacdd7d..e948185ece6 100644 --- a/frontend-components/tables/src/components/Table/index.tsx +++ b/frontend-components/tables/src/components/Table/index.tsx @@ -159,8 +159,8 @@ export default function Table({ //@ts-ignore const getColumnWidth = (rows, accessor, headerText) => { - const maxWidth = 180; - const magicSpacing = 5; + const maxWidth = 200; + const magicSpacing = 12; const cellLength = Math.max( //@ts-ignore ...rows.map((row) => getCellWidth(row, accessor)), @@ -473,7 +473,7 @@ export default function Table({ {table.getHeaderGroups().map((headerGroup, idx) => ( diff --git a/openbb_terminal/core/plots/table.html b/openbb_terminal/core/plots/table.html index 78aad801e92..98161f92834 100644 --- a/openbb_terminal/core/plots/table.html +++ b/openbb_terminal/core/plots/table.html @@ -291,7 +291,7 @@ Add a component higher in the tree to provide a loading `),s.bookType=="fods"?l.push(""):l.push(""),l.join("")}}();function qw(e,t){if(t.bookType=="fods")return Yg(e,t);var r=kd(),n="",i=[],o=[];return n="mimetype",De(r,n,"application/vnd.oasis.opendocument.spreadsheet"),n="content.xml",De(r,n,Yg(e,t)),i.push([n,"text/xml"]),o.push([n,"ContentFile"]),n="styles.xml",De(r,n,C6(e,t)),i.push([n,"text/xml"]),o.push([n,"StylesFile"]),n="meta.xml",De(r,n,at+cw()),i.push([n,"text/xml"]),o.push([n,"MetadataFile"]),n="manifest.rdf",De(r,n,M3(o)),i.push([n,"application/rdf+xml"]),n="META-INF/manifest.xml",De(r,n,$3(i)),r}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function Xl(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function A6(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):yr(jr(e))}function R6(e,t){e:for(var r=0;r<=e.length-t.length;++r){for(var n=0;n>7,e[t+14]|=(n&127)<<1;for(var o=0;i>=1;++o,i/=256)e[t+o]=i&255;e[t+15]|=r>=0?0:128}function Wa(e,t){var r=t?t[0]:0,n=e[r]&127;e:if(e[r++]>=128&&(n|=(e[r]&127)<<7,e[r++]<128||(n|=(e[r]&127)<<14,e[r++]<128)||(n|=(e[r]&127)<<21,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,28),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,35),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,42),++r,e[r++]<128)))break e;return t&&(t[0]=r),n}function Le(e){var t=new Uint8Array(7);t[0]=e&127;var r=1;e:if(e>127){if(t[r-1]|=128,t[r]=e>>7&127,++r,e<=16383||(t[r-1]|=128,t[r]=e>>14&127,++r,e<=2097151)||(t[r-1]|=128,t[r]=e>>21&127,++r,e<=268435455)||(t[r-1]|=128,t[r]=e/256>>>21&127,++r,e<=34359738367)||(t[r-1]|=128,t[r]=e/65536>>>21&127,++r,e<=4398046511103))break e;t[r-1]|=128,t[r]=e/16777216>>>21&127,++r}return t.slice(0,r)}function so(e){var t=0,r=e[t]&127;e:if(e[t++]>=128){if(r|=(e[t]&127)<<7,e[t++]<128||(r|=(e[t]&127)<<14,e[t++]<128)||(r|=(e[t]&127)<<21,e[t++]<128))break e;r|=(e[t]&127)<<28}return r}function st(e){for(var t=[],r=[0];r[0]=128;);s=e.slice(l,r[0])}break;case 5:a=4,s=e.slice(r[0],r[0]+a),r[0]+=a;break;case 1:a=8,s=e.slice(r[0],r[0]+a),r[0]+=a;break;case 2:a=Wa(e,r),s=e.slice(r[0],r[0]+a),r[0]+=a;break;case 3:case 4:default:throw new Error("PB Type ".concat(o," for Field ").concat(i," at offset ").concat(n))}var u={data:s,type:o};t[i]==null?t[i]=[u]:t[i].push(u)}return t}function pt(e){var t=[];return e.forEach(function(r,n){r.forEach(function(i){i.data&&(t.push(Le(n*8+i.type)),i.type==2&&t.push(Le(i.data.length)),t.push(i.data))})}),Mn(t)}function mr(e){for(var t,r=[],n=[0];n[0]>>0>0),r.push(a)}return r}function bi(e){var t=[];return e.forEach(function(r){var n=[];n[1]=[{data:Le(r.id),type:0}],n[2]=[],r.merge!=null&&(n[3]=[{data:Le(+!!r.merge),type:0}]);var i=[];r.messages.forEach(function(a){i.push(a.data),a.meta[3]=[{type:0,data:Le(a.data.length)}],n[2].push({data:pt(a.meta),type:2})});var o=pt(n);t.push(Le(o.length)),t.push(o),i.forEach(function(a){return t.push(a)})}),Mn(t)}function F6(e,t){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],n=Wa(t,r),i=[];r[0]>2;if(a<60)++a;else{var s=a-59;a=t[r[0]],s>1&&(a|=t[r[0]+1]<<8),s>2&&(a|=t[r[0]+2]<<16),s>3&&(a|=t[r[0]+3]<<24),a>>>=0,a++,r[0]+=s}i.push(t.slice(r[0],r[0]+a)),r[0]+=a;continue}else{var l=0,u=0;if(o==1?(u=(t[r[0]]>>2&7)+4,l=(t[r[0]++]&224)<<3,l|=t[r[0]++]):(u=(t[r[0]++]>>2)+1,o==2?(l=t[r[0]]|t[r[0]+1]<<8,r[0]+=2):(l=(t[r[0]]|t[r[0]+1]<<8|t[r[0]+2]<<16|t[r[0]+3]<<24)>>>0,r[0]+=4)),i=[Mn(i)],l==0)throw new Error("Invalid offset 0");if(l>i[0].length)throw new Error("Invalid offset beyond length");if(u>=l)for(i.push(i[0].slice(-l)),u-=l;u>=i[i.length-1].length;)i.push(i[i.length-1]),u-=i[i.length-1].length;i.push(i[0].slice(-l,-l+u))}}var c=Mn(i);if(c.length!=n)throw new Error("Unexpected length: ".concat(c.length," != ").concat(n));return c}function vr(e){for(var t=[],r=0;r>8&255]))):n<=16777216?(a+=4,t.push(new Uint8Array([248,n-1&255,n-1>>8&255,n-1>>16&255]))):n<=4294967296&&(a+=5,t.push(new Uint8Array([252,n-1&255,n-1>>8&255,n-1>>16&255,n-1>>>24&255]))),t.push(e.slice(r,r+n)),a+=n,i[0]=0,i[1]=a&255,i[2]=a>>8&255,i[3]=a>>16&255,r+=n}return Mn(t)}function Lc(e,t){var r=new Uint8Array(32),n=Xl(r),i=12,o=0;switch(r[0]=5,e.t){case"n":r[1]=2,O6(r,i,e.v),o|=1,i+=16;break;case"b":r[1]=6,n.setFloat64(i,e.v?1:0,!0),o|=2,i+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[1]=3,n.setUint32(i,t.indexOf(e.v),!0),o|=8,i+=4;break;default:throw"unsupported cell type "+e.t}return n.setUint32(8,o,!0),r.slice(0,i)}function Bc(e,t){var r=new Uint8Array(32),n=Xl(r),i=12,o=0;switch(r[0]=3,e.t){case"n":r[2]=2,n.setFloat64(i,e.v,!0),o|=32,i+=8;break;case"b":r[2]=6,n.setFloat64(i,e.v?1:0,!0),o|=32,i+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[2]=3,n.setUint32(i,t.indexOf(e.v),!0),o|=16,i+=4;break;default:throw"unsupported cell type "+e.t}return n.setUint32(4,o,!0),r.slice(0,i)}function un(e){var t=st(e);return Wa(t[1][0].data)}function D6(e,t,r){var n,i,o,a;if(!((n=e[6])!=null&&n[0])||!((i=e[7])!=null&&i[0]))throw"Mutation only works on post-BNC storages!";var s=((a=(o=e[8])==null?void 0:o[0])==null?void 0:a.data)&&so(e[8][0].data)>0||!1;if(s)throw"Math only works with normal offsets";for(var l=0,u=Xl(e[7][0].data),c=0,f=[],d=Xl(e[4][0].data),h=0,m=[],p=0;p1&&console.error("The Numbers writer currently writes only the first table");var n=er(r["!ref"]);n.s.r=n.s.c=0;var i=!1;n.e.c>9&&(i=!0,n.e.c=9),n.e.r>49&&(i=!0,n.e.r=49),i&&console.error("The Numbers writer is currently limited to ".concat(ot(n)));var o=Kl(r,{range:n,header:1}),a=["~Sh33tJ5~"];o.forEach(function(M){return M.forEach(function(N){typeof N=="string"&&a.push(N)})});var s={},l=[],u=Ve.read(t.numbers,{type:"base64"});u.FileIndex.map(function(M,N){return[M,u.FullPaths[N]]}).forEach(function(M){var N=M[0],F=M[1];if(N.type==2&&N.name.match(/\.iwa/)){var V=N.content,Y=vr(V),J=mr(Y);J.forEach(function(W){l.push(W.id),s[W.id]={deps:[],location:F,type:so(W.messages[0].meta[1][0].data)}})}}),l.sort(function(M,N){return M-N});var c=l.filter(function(M){return M>1}).map(function(M){return[M,Le(M)]});u.FileIndex.map(function(M,N){return[M,u.FullPaths[N]]}).forEach(function(M){var N=M[0];if(M[1],!!N.name.match(/\.iwa/)){var F=mr(vr(N.content));F.forEach(function(V){V.messages.forEach(function(Y){c.forEach(function(J){V.messages.some(function(W){return so(W.meta[1][0].data)!=11006&&R6(W.data,J[1])})&&s[J[0]].deps.push(V.id)})})})}});for(var f=Ve.find(u,s[1].location),d=mr(vr(f.content)),h,m=0;m-1,i=sw();qd(t=t||{});var o=kd(),a="",s=0;if(t.cellXfs=[],Vn(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),a="docProps/core.xml",De(o,a,fw(e.Props,t)),i.coreprops.push(a),Be(t.rels,2,a,ke.CORE_PROPS),a="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var l=[],u=0;u0&&(a="docProps/custom.xml",De(o,a,pw(e.Custprops)),i.custprops.push(a),Be(t.rels,4,a,ke.CUST_PROPS)),s=1;s<=e.SheetNames.length;++s){var c={"!id":{}},f=e.Sheets[e.SheetNames[s-1]],d=(f||{})["!type"]||"sheet";switch(d){case"chart":default:a="xl/worksheets/sheet"+s+"."+r,De(o,a,MD(s-1,a,t,e,c)),i.sheets.push(a),Be(t.wbrels,-1,"worksheets/sheet"+s+"."+r,ke.WS[0])}if(f){var h=f["!comments"],m=!1,p="";h&&h.length>0&&(p="xl/comments"+s+"."+r,De(o,p,UD(h,p)),i.comments.push(p),Be(c,-1,"../comments"+s+"."+r,ke.CMNT),m=!0),f["!legacy"]&&m&&De(o,"xl/drawings/vmlDrawing"+s+".vml",Dw(s,f["!comments"])),delete f["!comments"],delete f["!legacy"]}c["!id"].rId1&&De(o,uw(a),oo(c))}return t.Strings!=null&&t.Strings.length>0&&(a="xl/sharedStrings."+r,De(o,a,BD(t.Strings,a,t)),i.strs.push(a),Be(t.wbrels,-1,"sharedStrings."+r,ke.SST)),a="xl/workbook."+r,De(o,a,ND(e,a)),i.workbooks.push(a),Be(t.rels,1,a,ke.WB),a="xl/theme/theme1.xml",De(o,a,Ow(e.Themes,t)),i.themes.push(a),Be(t.wbrels,-1,"theme/theme1.xml",ke.THEME),a="xl/styles."+r,De(o,a,LD(e,a,t)),i.styles.push(a),Be(t.wbrels,-1,"styles."+r,ke.STY),e.vbaraw&&n&&(a="xl/vbaProject.bin",De(o,a,e.vbaraw),i.vba.push(a),Be(t.wbrels,-1,"vbaProject.bin",ke.VBA)),a="xl/metadata."+r,De(o,a,HD(a)),i.metadata.push(a),Be(t.wbrels,-1,"metadata."+r,ke.XLMETA),De(o,"[Content_Types].xml",lw(i,t)),De(o,"_rels/.rels",oo(t.rels)),De(o,"xl/_rels/workbook."+r+".rels",oo(t.wbrels)),delete t.revssf,delete t.ssf,o}function $6(e,t){Gi=1024,e&&!e.SSF&&(e.SSF=Xt(rt)),e&&e.SSF&&(Su(),Eu(e.SSF),t.revssf=_u(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,Ea?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r="xml",n=Iw.indexOf(t.bookType)>-1,i=sw();qd(t=t||{});var o=kd(),a="",s=0;if(t.cellXfs=[],Vn(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),a="docProps/core.xml",De(o,a,fw(e.Props,t)),i.coreprops.push(a),Be(t.rels,2,a,ke.CORE_PROPS),a="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var l=[],u=0;u0&&(a="docProps/custom.xml",De(o,a,pw(e.Custprops)),i.custprops.push(a),Be(t.rels,4,a,ke.CUST_PROPS));var c=["SheetJ5"];for(t.tcid=0,s=1;s<=e.SheetNames.length;++s){var f={"!id":{}},d=e.Sheets[e.SheetNames[s-1]],h=(d||{})["!type"]||"sheet";switch(h){case"chart":default:a="xl/worksheets/sheet"+s+"."+r,De(o,a,Hw(s-1,t,e,f)),i.sheets.push(a),Be(t.wbrels,-1,"worksheets/sheet"+s+"."+r,ke.WS[0])}if(d){var m=d["!comments"],p=!1,g="";if(m&&m.length>0){var v=!1;m.forEach(function(w){w[1].forEach(function(y){y.T==!0&&(v=!0)})}),v&&(g="xl/threadedComments/threadedComment"+s+"."+r,De(o,g,dR(m,c,t)),i.threadedcomments.push(g),Be(f,-1,"../threadedComments/threadedComment"+s+"."+r,ke.TCMNT)),g="xl/comments"+s+"."+r,De(o,g,Pw(m)),i.comments.push(g),Be(f,-1,"../comments"+s+"."+r,ke.CMNT),p=!0}d["!legacy"]&&p&&De(o,"xl/drawings/vmlDrawing"+s+".vml",Dw(s,d["!comments"])),delete d["!comments"],delete d["!legacy"]}f["!id"].rId1&&De(o,uw(a),oo(f))}return t.Strings!=null&&t.Strings.length>0&&(a="xl/sharedStrings."+r,De(o,a,Sw(t.Strings,t)),i.strs.push(a),Be(t.wbrels,-1,"sharedStrings."+r,ke.SST)),a="xl/workbook."+r,De(o,a,zw(e)),i.workbooks.push(a),Be(t.rels,1,a,ke.WB),a="xl/theme/theme1.xml",De(o,a,Ow(e.Themes,t)),i.themes.push(a),Be(t.wbrels,-1,"theme/theme1.xml",ke.THEME),a="xl/styles."+r,De(o,a,Aw(e,t)),i.styles.push(a),Be(t.wbrels,-1,"styles."+r,ke.STY),e.vbaraw&&n&&(a="xl/vbaProject.bin",De(o,a,e.vbaraw),i.vba.push(a),Be(t.wbrels,-1,"vbaProject.bin",ke.VBA)),a="xl/metadata."+r,De(o,a,Fw()),i.metadata.push(a),Be(t.wbrels,-1,"metadata."+r,ke.XLMETA),c.length>1&&(a="xl/persons/person.xml",De(o,a,hR(c)),i.people.push(a),Be(t.wbrels,-1,"persons/person.xml",ke.PEOPLE)),De(o,"[Content_Types].xml",lw(i,t)),De(o,"_rels/.rels",oo(t.rels)),De(o,"xl/_rels/workbook."+r+".rels",oo(t.wbrels)),delete t.revssf,delete t.ssf,o}function N6(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=rn(e.slice(0,12));break;case"binary":r=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function Qw(e,t){switch(t.type){case"base64":case"binary":break;case"buffer":case"array":t.type="";break;case"file":return ns(t.file,Ve.write(e,{type:Me?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");default:throw new Error("Unrecognized type "+t.type)}return Ve.write(e,t)}function M6(e,t){var r=Xt(t||{}),n=b6(e,r);return L6(n,r)}function L6(e,t){var r={},n=Me?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(t.compression&&(r.compression="DEFLATE"),t.password)r.type=n;else switch(t.type){case"base64":r.type="base64";break;case"binary":r.type="string";break;case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");case"buffer":case"file":r.type=n;break;default:throw new Error("Unrecognized type "+t.type)}var i=e.FullPaths?Ve.write(e,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[r.type]||r.type,compression:!!t.compression}):e.generate(r);if(typeof Deno<"u"&&typeof i=="string"){if(t.type=="binary"||t.type=="base64")return i;i=new Uint8Array(yu(i))}return t.password&&typeof encrypt_agile<"u"?Qw(encrypt_agile(i,t.password),t):t.type==="file"?ns(t.file,i):t.type=="string"?va(i):i}function B6(e,t){var r=t||{},n=t6(e,r);return Qw(n,r)}function Or(e,t,r){r||(r="");var n=r+e;switch(t.type){case"base64":return Ua(jr(n));case"binary":return jr(n);case"string":return e;case"file":return ns(t.file,n,"utf8");case"buffer":return Me?ln(n,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(n):Or(n,{type:"binary"}).split("").map(function(i){return i.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function U6(e,t){switch(t.type){case"base64":return Ua(e);case"binary":return e;case"string":return e;case"file":return ns(t.file,e,"binary");case"buffer":return Me?ln(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function Vs(e,t){switch(t.type){case"string":case"base64":case"binary":for(var r="",n=0;n0&&(i=0);var f=yt(l.s.r),d=[],h=[],m=0,p=0,g=Array.isArray(e),v=l.s.r,w=0,y={};g&&!e[v]&&(e[v]=[]);var E=u.skipHidden&&e["!cols"]||[],b=u.skipHidden&&e["!rows"]||[];for(w=l.s.c;w<=l.e.c;++w)if(!(E[w]||{}).hidden)switch(d[w]=Rt(w),r=g?e[v][w]:e[d[w]+f],n){case 1:o[w]=w-l.s.c;break;case 2:o[w]=d[w];break;case 3:o[w]=u.header[w-l.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),s=a=nn(r,null,u),p=y[a]||0,!p)y[a]=1;else{do s=a+"_"+p++;while(y[s]);y[a]=p,y[s]=1}o[w]=s}for(v=l.s.r+i;v<=l.e.r;++v)if(!(b[v]||{}).hidden){var k=W6(e,l,v,d,n,o,g,u);(k.isempty===!1||(n===1?u.blankrows!==!1:u.blankrows))&&(h[m++]=k.row)}return h.length=m,h}var qg=/"/g;function z6(e,t,r,n,i,o,a,s){for(var l=!0,u=[],c="",f=yt(r),d=t.s.c;d<=t.e.c;++d)if(n[d]){var h=s.dense?(e[r]||[])[d]:e[n[d]+f];if(h==null)c="";else if(h.v!=null){l=!1,c=""+(s.rawNumbers&&h.t=="n"?h.v:nn(h,null,s));for(var m=0,p=0;m!==c.length;++m)if((p=c.charCodeAt(m))===i||p===o||p===34||s.forceQuotes){c='"'+c.replace(qg,'""')+'"';break}c=="ID"&&(c='"ID"')}else h.f!=null&&!h.F?(l=!1,c="="+h.f,c.indexOf(",")>=0&&(c='"'+c.replace(qg,'""')+'"')):c="";u.push(c)}return s.blankrows===!1&&l?null:u.join(a)}function Qd(e,t){var r=[],n=t??{};if(e==null||e["!ref"]==null)return"";var i=Xe(e["!ref"]),o=n.FS!==void 0?n.FS:",",a=o.charCodeAt(0),s=n.RS!==void 0?n.RS:` `,l=s.charCodeAt(0),u=new RegExp((o=="|"?"\\|":o)+"+$"),c="",f=[];n.dense=Array.isArray(e);for(var d=n.skipHidden&&e["!cols"]||[],h=n.skipHidden&&e["!rows"]||[],m=i.s.c;m<=i.e.c;++m)(d[m]||{}).hidden||(f[m]=Rt(m));for(var p=0,g=i.s.r;g<=i.e.r;++g)(h[g]||{}).hidden||(c=z6(e,i,g,f,a,l,o,n),c!=null&&(n.strip&&(c=c.replace(u,"")),(c||n.blankrows!==!1)&&r.push((p++?s:"")+c)));return delete n.dense,r.join("")}function Jw(e,t){t||(t={}),t.FS=" ",t.RS=` `;var r=Qd(e,t);return r}function G6(e){var t="",r,n="";if(e==null||e["!ref"]==null)return[];var i=Xe(e["!ref"]),o="",a=[],s,l=[],u=Array.isArray(e);for(s=i.s.c;s<=i.e.c;++s)a[s]=Rt(s);for(var c=i.s.r;c<=i.e.r;++c)for(o=yt(c),s=i.s.c;s<=i.e.c;++s)if(t=a[s]+o,r=u?(e[c]||[])[s]:e[t],n="",r!==void 0){if(r.F!=null){if(t=r.F,!r.f)continue;n=r.f,t.indexOf(":")==-1&&(t=t+":"+t)}if(r.f!=null)n=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)n=""+r.v;else if(r.t=="b")n=r.v?"TRUE":"FALSE";else if(r.w!==void 0)n="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?n="'"+r.v:n=""+r.v}}l[l.length]=t+"="+n}return l}function e2(e,t,r){var n=r||{},i=+!n.skipHeader,o=e||{},a=0,s=0;if(o&&n.origin!=null)if(typeof n.origin=="number")a=n.origin;else{var l=typeof n.origin=="string"?ft(n.origin):n.origin;a=l.r,s=l.c}var u,c={s:{c:0,r:0},e:{c:s,r:a+t.length-1+i}};if(o["!ref"]){var f=Xe(o["!ref"]);c.e.c=Math.max(c.e.c,f.e.c),c.e.r=Math.max(c.e.r,f.e.r),a==-1&&(a=f.e.r+1,c.e.r=a+t.length-1+i)}else a==-1&&(a=0,c.e.r=t.length-1+i);var d=n.header||[],h=0;t.forEach(function(p,g){St(p).forEach(function(v){(h=d.indexOf(v))==-1&&(d[h=d.length]=v);var w=p[v],y="z",E="",b=He({c:s+h,r:a+g+i});u=za(o,b),w&&typeof w=="object"&&!(w instanceof Date)?o[b]=w:(typeof w=="number"?y="n":typeof w=="boolean"?y="b":typeof w=="string"?y="s":w instanceof Date?(y="d",n.cellDates||(y="n",w=jt(w)),E=n.dateNF||rt[14]):w===null&&n.nullError&&(y="e",w=0),u?(u.t=y,u.v=w,delete u.w,delete u.R,E&&(u.z=E)):o[b]=u={t:y,v:w},E&&(u.z=E))})}),c.e.c=Math.max(c.e.c,s+d.length-1);var m=yt(a);if(i)for(h=0;h=0&&e.SheetNames.length>t)return t;throw new Error("Cannot find sheet # "+t)}else if(typeof t=="string"){var r=e.SheetNames.indexOf(t);if(r>-1)return r;throw new Error("Cannot find sheet name |"+t+"|")}else throw new Error("Cannot find sheet |"+t+"|")}function K6(){return{SheetNames:[],Sheets:{}}}function Y6(e,t,r,n){var i=1;if(!r)for(;i<=65535&&e.SheetNames.indexOf(r="Sheet"+i)!=-1;++i,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(n&&e.SheetNames.indexOf(r)>=0){var o=r.match(/(^.*?)(\d+)$/);i=o&&+o[2]||0;var a=o&&o[1]||r;for(++i;i<=65535&&e.SheetNames.indexOf(r=a+i)!=-1;++i);}if(Ww(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return e.SheetNames.push(r),e.Sheets[r]=t,r}function q6(e,t,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var n=X6(e,t);switch(e.Workbook.Sheets[n]||(e.Workbook.Sheets[n]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}e.Workbook.Sheets[n].Hidden=r}function Q6(e,t){return e.z=t,e}function t2(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e}function Z6(e,t,r){return t2(e,"#"+t,r)}function J6(e,t,r){e.c||(e.c=[]),e.c.push({t,a:r||"SheetJS"})}function eP(e,t,r,n){for(var i=typeof t!="string"?t:Xe(t),o=typeof t=="string"?t:ot(t),a=i.s.r;a<=i.e.r;++a)for(var s=i.s.c;s<=i.e.c;++s){var l=za(e,a,s);l.t="n",l.F=o,delete l.v,a==i.s.r&&s==i.s.c&&(l.f=r,n&&(l.D=!0))}return e}var Uc={encode_col:Rt,encode_row:yt,encode_cell:He,encode_range:ot,decode_col:Ud,decode_row:Bd,split_cell:p3,decode_cell:ft,decode_range:er,format_cell:nn,sheet_add_aoa:tw,sheet_add_json:e2,sheet_add_dom:Kw,aoa_to_sheet:Ro,json_to_sheet:j6,table_to_sheet:Yw,table_to_book:_6,sheet_to_csv:Qd,sheet_to_txt:Jw,sheet_to_json:Kl,sheet_to_html:Xw,sheet_to_formulae:G6,sheet_to_row_object_array:Kl,sheet_get_cell:za,book_new:K6,book_append_sheet:Y6,book_set_sheet_visibility:q6,cell_set_number_format:Q6,cell_set_hyperlink:t2,cell_set_internal_link:Z6,cell_add_comment:J6,sheet_set_array_formula:eP,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};function t0(e){if(typeof e=="string"){const t=e.replace(/[^a-zA-Z]/g,"").trim(),r=["","K","M","B","T"].indexOf(t.replace(/\s/g,""));e=Number(e.replace(/[^0-9.]/g,"").trim())*Math.pow(10,r*3)}return e}function tP(e,t){var r;if(typeof e=="string"&&(e=Number(t0(e))),e%1!==0){const n=Math.max(2,((r=e.toString().split(".")[1])==null?void 0:r.length)||0),i=Math.min(4,n);if(e<5)return e.toFixed(i)||0;e=Number(e.toFixed(2))}if((e>1e5||e<-1e5)&&!n2(t||"")){const n=Math.min(4,Math.floor(Math.log10(Math.abs(e))/3)),i=["","K","M","B","T"][n];return`${(e/10**(n*3)).toFixed(3).replace(/\.?0+$/,"")} ${i}`}return e>1e3||e<-1e3?r2(e):e}function r2(e){if(e>1e3||e<-1e3){const t=e.toString().split("."),r=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),n=t[1]?`.${t[1]}`:"";return`${r}${n}`}return e}function Yl(e){return["date","day","time","timestamp","year"].some(t=>e==null?void 0:e.toLowerCase().includes(t))}function n2(e){return["price","open","close"].some(t=>e==null?void 0:e.toLowerCase().includes(t))}function ji(e,t){const r=window.document.getElementById("loading"),n=window.document.getElementById("loading_text");return new Promise(i=>{t?r.classList.remove("show"):(n.innerHTML=e,r.classList.add("show"));const o=setInterval(function(){(t?!r.classList.contains("show"):r.classList.contains("show"))&&(clearInterval(o),i(!0))},.01)})}function rP(e,t){if(e===t)return!0;if(e==null||t==null||(e==null?void 0:e.length)!==(t==null?void 0:t.length))return!1;for(let r=0;r<(e==null?void 0:e.length);++r)if(e[r]!==t[r])return!1;return!0}const nP=(e,t,r,n)=>{const i=n4(e.getValue(t),r);return n(i),i},iP=async({fileHandle:e,blob:t})=>{e&&await oP({fileHandle:e,blob:t})},oP=async({fileHandle:e,blob:t})=>{const r=await e.createWritable();await r.write(t),await r.close()},aP=[{description:"PNG Image",accept:{"image/png":[".png"]}},{description:"JPEG Image",accept:{"image/jpeg":[".jpeg"]}}],i2=({filename:e,is_image:t})=>{try{if("showSaveFilePicker"in window){const r={suggestedName:e,types:t?aP:[{description:"CSV File",accept:{"image/csv":[".csv"]}}],excludeAcceptAllOption:!0};return showSaveFilePicker(r)}}catch(r){console.error(r)}return new Promise(r=>{r(null)})},o2=(e,t,r)=>{try{if(r===null)throw new Error("Cannot access filesystem");iP({fileHandle:r,blob:e})}catch(n){console.error("oops, something went wrong!",n);const i=URL.createObjectURL(e),o=document.createElement("a");o.setAttribute("href",i),o.setAttribute("download",t),o.style.visibility="hidden",document.body.appendChild(o),o.click(),document.body.removeChild(o)}return new Promise(n=>{n(!0)})};async function Qg(e,t,r,n){const i=t,o=r.map(u=>i.map(c=>u[c])),a=[i,...o];if(e==="csv"){const u=a.map(d=>d.join(",")).join(` -`),c=new Blob([u],{type:"text/csv;charset=utf-8;"}),f=`${window.title}.csv`;try{const d=await i2({filename:f});let h="csv";d!==null&&(h=d.name.split(".").pop()),await ji(`Saving ${h.toUpperCase()}`),r0(async function(){o2(c,f,d).then(async function(){await new Promise(m=>setTimeout(m,1500)),await ji("",!0),d||n(!0)})},2)()}catch(d){console.error(d)}return}const s=Uc.book_new(),l=Uc.aoa_to_sheet(a);Uc.book_append_sheet(s,l,"Sheet1"),await ji("Saving XLSX"),r0(async function(){await new Promise(u=>setTimeout(u,1500)),V6(s,`${window.title}.xlsx`),await ji("",!0),n==null||n(!0)},2)()}async function sP(e,t){const r=document.getElementById(e),n=`${window.title}.png`;try{const i=await i2({filename:n,is_image:!0});let o="png";i!==null&&(o=i.name.split(".").pop()),await ji(`Saving ${o.toUpperCase()}`),r0(async function(){c4.toBlob(r).then(function(a){o2(a,n,i).then(async function(){await new Promise(s=>setTimeout(s,1500)),await ji("",!0),i||t(!0)})})},2)()}catch(i){console.error(i)}}const r0=(e,t)=>{let r;return function(){const n=this,i=arguments;clearTimeout(r),r=setTimeout(()=>e.apply(n,i),t)}},ql=({title:e,titleId:t,...r})=>X("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,...r,children:X("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});function Zg(e,[t,r]){return Math.min(r,Math.max(t,e))}function Ou(e){const t=e+"CollectionProvider",[r,n]=sn(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:m,children:p}=h,g=ir.useRef(null),v=ir.useRef(new Map).current;return ir.createElement(i,{scope:m,itemMap:v,collectionRef:g},p)},s=e+"CollectionSlot",l=ir.forwardRef((h,m)=>{const{scope:p,children:g}=h,v=o(s,p),w=We(m,v.collectionRef);return ir.createElement(oi,{ref:w},g)}),u=e+"CollectionItemSlot",c="data-radix-collection-item",f=ir.forwardRef((h,m)=>{const{scope:p,children:g,...v}=h,w=ir.useRef(null),y=We(m,w),E=o(u,p);return ir.useEffect(()=>(E.itemMap.set(w,{ref:w,...v}),()=>void E.itemMap.delete(w))),ir.createElement(oi,{[c]:"",ref:y},g)});function d(h){const m=o(e+"CollectionConsumer",h);return ir.useCallback(()=>{const g=m.collectionRef.current;if(!g)return[];const v=Array.from(g.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((E,b)=>v.indexOf(E.ref.current)-v.indexOf(b.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:f},d,n]}const lP=x.createContext(void 0);function Zd(e){const t=x.useContext(lP);return e||t||"ltr"}function Do(e){return e.split("-")[1]}function Jd(e){return e==="y"?"height":"width"}function Zr(e){return e.split("-")[0]}function _i(e){return["top","bottom"].includes(Zr(e))?"x":"y"}function Jg(e,t,r){let{reference:n,floating:i}=e;const o=n.x+n.width/2-i.width/2,a=n.y+n.height/2-i.height/2,s=_i(t),l=Jd(s),u=n[l]/2-i[l]/2,c=s==="x";let f;switch(Zr(t)){case"top":f={x:o,y:n.y-i.height};break;case"bottom":f={x:o,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:a};break;case"left":f={x:n.x-i.width,y:a};break;default:f={x:n.x,y:n.y}}switch(Do(t)){case"start":f[s]-=u*(r&&c?-1:1);break;case"end":f[s]+=u*(r&&c?-1:1)}return f}const uP=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=Jg(u,n,l),d=n,h={},m=0;for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:a,elements:s}=t,{element:l,padding:u=0}=on(e,t)||{};if(l==null)return{};const c=a2(u),f={x:r,y:n},d=_i(i),h=Jd(d),m=await a.getDimensions(l),p=d==="y",g=p?"top":"left",v=p?"bottom":"right",w=p?"clientHeight":"clientWidth",y=o.reference[h]+o.reference[d]-f[d]-o.floating[h],E=f[d]-o.reference[d],b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let k=b?b[w]:0;k&&await(a.isElement==null?void 0:a.isElement(b))||(k=s.floating[w]||o.floating[h]);const _=y/2-E/2,C=k/2-m[h]/2-1,A=ja(c[g],C),L=ja(c[v],C),B=A,U=k-m[h]-L,H=k/2-m[h]/2+_,G=n0(B,H,U),ee=Do(i)!=null&&H!=G&&o.reference[h]/2-(He.concat(t,t+"-start",t+"-end"),[]);const cP={left:"right",right:"left",bottom:"top",top:"bottom"};function Zl(e){return e.replace(/left|right|bottom|top/g,t=>cP[t])}function fP(e,t,r){r===void 0&&(r=!1);const n=Do(e),i=_i(e),o=Jd(i);let a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Zl(a)),{main:a,cross:Zl(a)}}const dP={start:"end",end:"start"};function Hc(e){return e.replace(/start|end/g,t=>dP[t])}const hP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r;const{placement:n,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...p}=on(e,t),g=Zr(n),v=Zr(a)===a,w=await(s.isRTL==null?void 0:s.isRTL(l.floating)),y=f||(v||!m?[Zl(a)]:function(B){const U=Zl(B);return[Hc(B),U,Hc(U)]}(a));f||h==="none"||y.push(...function(B,U,H,G){const ee=Do(B);let ae=function(he,Te,oe){const ye=["left","right"],te=["right","left"],O=["top","bottom"],M=["bottom","top"];switch(he){case"top":case"bottom":return oe?Te?te:ye:Te?ye:te;case"left":case"right":return Te?O:M;default:return[]}}(Zr(B),H==="start",G);return ee&&(ae=ae.map(he=>he+"-"+ee),U&&(ae=ae.concat(ae.map(Hc)))),ae}(a,m,h,w));const E=[a,...y],b=await Ga(t,p),k=[];let _=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(b[g]),c){const{main:B,cross:U}=fP(n,o,w);k.push(b[B],b[U])}if(_=[..._,{placement:n,overflows:k}],!k.every(B=>B<=0)){var C,A;const B=(((C=i.flip)==null?void 0:C.index)||0)+1,U=E[B];if(U)return{data:{index:B,overflows:_},reset:{placement:U}};let H=(A=_.filter(G=>G.overflows[0]<=0).sort((G,ee)=>G.overflows[1]-ee.overflows[1])[0])==null?void 0:A.placement;if(!H)switch(d){case"bestFit":{var L;const G=(L=_.map(ee=>[ee.placement,ee.overflows.filter(ae=>ae>0).reduce((ae,he)=>ae+he,0)]).sort((ee,ae)=>ee[1]-ae[1])[0])==null?void 0:L[0];G&&(H=G);break}case"initialPlacement":H=a}if(n!==H)return{reset:{placement:H}}}return{}}}};function t1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function r1(e){return s2.some(t=>e[t]>=0)}const pP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=on(e,t);switch(n){case"referenceHidden":{const o=t1(await Ga(t,{...i,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:r1(o)}}}case"escaped":{const o=t1(await Ga(t,{...i,altBoundary:!0}),r.floating);return{data:{escapedOffsets:o,escaped:r1(o)}}}default:return{}}}}},gP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,c=await(l.isRTL==null?void 0:l.isRTL(u.floating)),f=Zr(s),d=Do(s),h=_i(s)==="x",m=["left","top"].includes(f)?-1:1,p=c&&h?-1:1,g=on(a,o);let{mainAxis:v,crossAxis:w,alignmentAxis:y}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return d&&typeof y=="number"&&(w=d==="end"?-1*y:y),h?{x:w*p,y:v*m}:{x:v*m,y:w*p}}(t,e);return{x:r+i.x,y:n+i.y,data:i}}}};function l2(e){return e==="x"?"y":"x"}const mP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:v,y:w}=g;return{x:v,y:w}}},...l}=on(e,t),u={x:r,y:n},c=await Ga(t,l),f=_i(Zr(i)),d=l2(f);let h=u[f],m=u[d];if(o){const g=f==="y"?"bottom":"right";h=n0(h+c[f==="y"?"top":"left"],h,h-c[g])}if(a){const g=d==="y"?"bottom":"right";m=n0(m+c[d==="y"?"top":"left"],m,m-c[g])}const p=s.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-r,y:p.y-n}}}}},vP=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=on(e,t),c={x:r,y:n},f=_i(i),d=l2(f);let h=c[f],m=c[d];const p=on(s,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const y=f==="y"?"height":"width",E=o.reference[f]-o.floating[y]+g.mainAxis,b=o.reference[f]+o.reference[y]-g.mainAxis;hb&&(h=b)}if(u){var v,w;const y=f==="y"?"width":"height",E=["top","left"].includes(Zr(i)),b=o.reference[d]-o.floating[y]+(E&&((v=a.offset)==null?void 0:v[d])||0)+(E?0:g.crossAxis),k=o.reference[d]+o.reference[y]+(E?0:((w=a.offset)==null?void 0:w[d])||0)-(E?g.crossAxis:0);mk&&(m=k)}return{[f]:h,[d]:m}}}},xP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:i,elements:o}=t,{apply:a=()=>{},...s}=on(e,t),l=await Ga(t,s),u=Zr(r),c=Do(r),f=_i(r)==="x",{width:d,height:h}=n.floating;let m,p;u==="top"||u==="bottom"?(m=u,p=c===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(p=u,m=c==="end"?"top":"bottom");const g=h-l[m],v=d-l[p],w=!t.middlewareData.shift;let y=g,E=v;if(f){const k=d-l.left-l.right;E=c||w?ja(v,k):k}else{const k=h-l.top-l.bottom;y=c||w?ja(g,k):k}if(w&&!c){const k=jn(l.left,0),_=jn(l.right,0),C=jn(l.top,0),A=jn(l.bottom,0);f?E=d-2*(k!==0||_!==0?k+_:jn(l.left,l.right)):y=h-2*(C!==0||A!==0?C+A:jn(l.top,l.bottom))}await a({...t,availableWidth:E,availableHeight:y});const b=await i.getDimensions(o.floating);return d!==b.width||h!==b.height?{reset:{rects:!0}}:{}}}};function Zt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Nr(e){return Zt(e).getComputedStyle(e)}function u2(e){return e instanceof Zt(e).Node}function Ln(e){return u2(e)?(e.nodeName||"").toLowerCase():"#document"}function Cr(e){return e instanceof HTMLElement||e instanceof Zt(e).HTMLElement}function n1(e){return typeof ShadowRoot<"u"&&(e instanceof Zt(e).ShadowRoot||e instanceof ShadowRoot)}function Xa(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Nr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function wP(e){return["table","td","th"].includes(Ln(e))}function i0(e){const t=eh(),r=Nr(e);return r.transform!=="none"||r.perspective!=="none"||!!r.containerType&&r.containerType!=="normal"||!t&&!!r.backdropFilter&&r.backdropFilter!=="none"||!t&&!!r.filter&&r.filter!=="none"||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function eh(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Fu(e){return["html","body","#document"].includes(Ln(e))}const o0=Math.min,lo=Math.max,Jl=Math.round,Ws=Math.floor,Bn=e=>({x:e,y:e});function c2(e){const t=Nr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=Cr(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=Jl(r)!==o||Jl(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function Jr(e){return e instanceof Element||e instanceof Zt(e).Element}function th(e){return Jr(e)?e:e.contextElement}function uo(e){const t=th(e);if(!Cr(t))return Bn(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=c2(t);let a=(o?Jl(r.width):r.width)/n,s=(o?Jl(r.height):r.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const yP=Bn(0);function f2(e){const t=Zt(e);return eh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:yP}function ui(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=th(e);let a=Bn(1);t&&(n?Jr(n)&&(a=uo(n)):a=uo(e));const s=function(d,h,m){return h===void 0&&(h=!1),!(!m||h&&m!==Zt(d))&&h}(o,r,n)?f2(o):Bn(0);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o){const d=Zt(o),h=n&&Jr(n)?Zt(n):n;let m=d.frameElement;for(;m&&n&&h!==d;){const p=uo(m),g=m.getBoundingClientRect(),v=getComputedStyle(m),w=g.left+(m.clientLeft+parseFloat(v.paddingLeft))*p.x,y=g.top+(m.clientTop+parseFloat(v.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,f*=p.y,l+=w,u+=y,m=Zt(m).frameElement}}return Ql({width:c,height:f,x:l,y:u})}function Du(e){return Jr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function en(e){var t;return(t=(u2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function d2(e){return ui(en(e)).left+Du(e).scrollLeft}function vo(e){if(Ln(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n1(e)&&e.host||en(e);return n1(t)?t.host:t}function h2(e){const t=vo(e);return Fu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cr(t)&&Xa(t)?t:h2(t)}function eu(e,t){var r;t===void 0&&(t=[]);const n=h2(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),o=Zt(n);return i?t.concat(o,o.visualViewport||[],Xa(n)?n:[]):t.concat(n,eu(n))}function i1(e,t,r){let n;if(t==="viewport")n=function(i,o){const a=Zt(i),s=en(i),l=a.visualViewport;let u=s.clientWidth,c=s.clientHeight,f=0,d=0;if(l){u=l.width,c=l.height;const h=eh();(!h||h&&o==="fixed")&&(f=l.offsetLeft,d=l.offsetTop)}return{width:u,height:c,x:f,y:d}}(e,r);else if(t==="document")n=function(i){const o=en(i),a=Du(i),s=i.ownerDocument.body,l=lo(o.scrollWidth,o.clientWidth,s.scrollWidth,s.clientWidth),u=lo(o.scrollHeight,o.clientHeight,s.scrollHeight,s.clientHeight);let c=-a.scrollLeft+d2(i);const f=-a.scrollTop;return Nr(s).direction==="rtl"&&(c+=lo(o.clientWidth,s.clientWidth)-l),{width:l,height:u,x:c,y:f}}(en(e));else if(Jr(t))n=function(i,o){const a=ui(i,!0,o==="fixed"),s=a.top+i.clientTop,l=a.left+i.clientLeft,u=Cr(i)?uo(i):Bn(1);return{width:i.clientWidth*u.x,height:i.clientHeight*u.y,x:l*u.x,y:s*u.y}}(t,r);else{const i=f2(e);n={...t,x:t.x-i.x,y:t.y-i.y}}return Ql(n)}function p2(e,t){const r=vo(e);return!(r===t||!Jr(r)||Fu(r))&&(Nr(r).position==="fixed"||p2(r,t))}function EP(e,t,r){const n=Cr(t),i=en(t),o=r==="fixed",a=ui(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Bn(0);if(n||!n&&!o)if((Ln(t)!=="body"||Xa(i))&&(s=Du(t)),Cr(t)){const u=ui(t,!0,o,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else i&&(l.x=d2(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function o1(e,t){return Cr(e)&&Nr(e).position!=="fixed"?t?t(e):e.offsetParent:null}function a1(e,t){const r=Zt(e);if(!Cr(e))return r;let n=o1(e,t);for(;n&&wP(n)&&Nr(n).position==="static";)n=o1(n,t);return n&&(Ln(n)==="html"||Ln(n)==="body"&&Nr(n).position==="static"&&!i0(n))?r:n||function(i){let o=vo(i);for(;Cr(o)&&!Fu(o);){if(i0(o))return o;o=vo(o)}return null}(e)||r}const SP={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:r,strategy:n}=e;const i=Cr(r),o=en(r);if(r===o)return t;let a={scrollLeft:0,scrollTop:0},s=Bn(1);const l=Bn(0);if((i||!i&&n!=="fixed")&&((Ln(r)!=="body"||Xa(o))&&(a=Du(r)),Cr(r))){const u=ui(r);s=uo(r),l.x=u.x+r.clientLeft,l.y=u.y+r.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:en,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[...r==="clippingAncestors"?function(l,u){const c=u.get(l);if(c)return c;let f=eu(l).filter(p=>Jr(p)&&Ln(p)!=="body"),d=null;const h=Nr(l).position==="fixed";let m=h?vo(l):l;for(;Jr(m)&&!Fu(m);){const p=Nr(m),g=i0(m);g||p.position!=="fixed"||(d=null),(h?!g&&!d:!g&&p.position==="static"&&d&&["absolute","fixed"].includes(d.position)||Xa(m)&&!g&&p2(l,m))?f=f.filter(v=>v!==m):d=p,m=vo(m)}return u.set(l,f),f}(t,this._c):[].concat(r),n],a=o[0],s=o.reduce((l,u)=>{const c=i1(t,u,i);return l.top=lo(c.top,l.top),l.right=o0(c.right,l.right),l.bottom=o0(c.bottom,l.bottom),l.left=lo(c.left,l.left),l},i1(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:a1,getElementRects:async function(e){let{reference:t,floating:r,strategy:n}=e;const i=this.getOffsetParent||a1,o=this.getDimensions;return{reference:EP(t,await i(r),n),floating:{x:0,y:0,...await o(r)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return c2(e)},getScale:uo,isElement:Jr,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function _P(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=th(e),c=i||o?[...u?eu(u):[],...eu(t)]:[];c.forEach(g=>{i&&g.addEventListener("scroll",r,{passive:!0}),o&&g.addEventListener("resize",r)});const f=u&&s?function(g,v){let w,y=null;const E=en(g);function b(){clearTimeout(w),y&&y.disconnect(),y=null}return function k(_,C){_===void 0&&(_=!1),C===void 0&&(C=1),b();const{left:A,top:L,width:B,height:U}=g.getBoundingClientRect();if(_||v(),!B||!U)return;const H={rootMargin:-Ws(L)+"px "+-Ws(E.clientWidth-(A+B))+"px "+-Ws(E.clientHeight-(L+U))+"px "+-Ws(A)+"px",threshold:lo(0,o0(1,C))||1};let G=!0;function ee(ae){const he=ae[0].intersectionRatio;if(he!==C){if(!G)return k();he?k(!1,he):w=setTimeout(()=>{k(!1,1e-7)},100)}G=!1}try{y=new IntersectionObserver(ee,{...H,root:E.ownerDocument})}catch{y=new IntersectionObserver(ee,H)}y.observe(g)}(!0),b}(u,r):null;let d,h=-1,m=null;a&&(m=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{m&&m.observe(t)})),r()}),u&&!l&&m.observe(u),m.observe(t));let p=l?ui(e):null;return l&&function g(){const v=ui(e);!p||v.x===p.x&&v.y===p.y&&v.width===p.width&&v.height===p.height||r(),p=v,d=requestAnimationFrame(g)}(),r(),()=>{c.forEach(g=>{i&&g.removeEventListener("scroll",r),o&&g.removeEventListener("resize",r)}),f&&f(),m&&m.disconnect(),m=null,l&&cancelAnimationFrame(d)}}const TP=(e,t,r)=>{const n=new Map,i={platform:SP,...r},o={...i.platform,_c:n};return uP(e,t,{...i,platform:o})},CP=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?e1({element:n.current,padding:i}).fn(r):{}:n?e1({element:n,padding:i}).fn(r):{}}}};var ll=typeof document<"u"?x.useLayoutEffect:x.useEffect;function tu(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 r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!tu(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!tu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function g2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s1(e,t){const r=g2(e);return Math.round(t*r)/r}function l1(e){const t=x.useRef(e);return ll(()=>{t.current=e}),t}function AP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,f]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=x.useState(n);tu(d,n)||h(n);const[m,p]=x.useState(null),[g,v]=x.useState(null),w=x.useCallback(ae=>{ae!=k.current&&(k.current=ae,p(ae))},[p]),y=x.useCallback(ae=>{ae!==_.current&&(_.current=ae,v(ae))},[v]),E=o||m,b=a||g,k=x.useRef(null),_=x.useRef(null),C=x.useRef(c),A=l1(l),L=l1(i),B=x.useCallback(()=>{if(!k.current||!_.current)return;const ae={placement:t,strategy:r,middleware:d};L.current&&(ae.platform=L.current),TP(k.current,_.current,ae).then(he=>{const Te={...he,isPositioned:!0};U.current&&!tu(C.current,Te)&&(C.current=Te,gi.flushSync(()=>{f(Te)}))})},[d,t,r,L]);ll(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(ae=>({...ae,isPositioned:!1})))},[u]);const U=x.useRef(!1);ll(()=>(U.current=!0,()=>{U.current=!1}),[]),ll(()=>{if(E&&(k.current=E),b&&(_.current=b),E&&b){if(A.current)return A.current(E,b,B);B()}},[E,b,B,A]);const H=x.useMemo(()=>({reference:k,floating:_,setReference:w,setFloating:y}),[w,y]),G=x.useMemo(()=>({reference:E,floating:b}),[E,b]),ee=x.useMemo(()=>{const ae={position:r,left:0,top:0};if(!G.floating)return ae;const he=s1(G.floating,c.x),Te=s1(G.floating,c.y);return s?{...ae,transform:"translate("+he+"px, "+Te+"px)",...g2(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:he,top:Te}},[r,s,G.floating,c.x,c.y]);return x.useMemo(()=>({...c,update:B,refs:H,elements:G,floatingStyles:ee}),[c,B,H,G,ee])}function RP(e){const[t,r]=x.useState(void 0);return Mt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=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;r({width:a,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}const m2="Popper",[v2,Pu]=sn(m2),[OP,x2]=v2(m2),FP=e=>{const{__scopePopper:t,children:r}=e,[n,i]=x.useState(null);return x.createElement(OP,{scope:t,anchor:n,onAnchorChange:i},r)},DP="PopperAnchor",PP=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=x2(DP,r),a=x.useRef(null),s=We(t,a);return x.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:x.createElement(Ie.div,ge({},i,{ref:s}))}),w2="PopperContent",[IP,r$]=v2(w2),bP=x.forwardRef((e,t)=>{var r,n,i,o,a,s,l,u;const{__scopePopper:c,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:m=0,arrowPadding:p=0,collisionBoundary:g=[],collisionPadding:v=0,sticky:w="partial",hideWhenDetached:y=!1,avoidCollisions:E=!0,onPlaced:b,...k}=e,_=x2(w2,c),[C,A]=x.useState(null),L=We(t,ie=>A(ie)),[B,U]=x.useState(null),H=RP(B),G=(r=H==null?void 0:H.width)!==null&&r!==void 0?r:0,ee=(n=H==null?void 0:H.height)!==null&&n!==void 0?n:0,ae=f+(h!=="center"?"-"+h:""),he=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},Te=Array.isArray(g)?g:[g],oe=Te.length>0,ye={padding:he,boundary:Te.filter(kP),altBoundary:oe},{refs:te,floatingStyles:O,placement:M,isPositioned:N,middlewareData:F}=AP({strategy:"fixed",placement:ae,whileElementsMounted:_P,elements:{reference:_.anchor},middleware:[gP({mainAxis:d+ee,alignmentAxis:m}),E&&mP({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?vP():void 0,...ye}),E&&hP({...ye}),xP({...ye,apply:({elements:ie,rects:$e,availableWidth:Pe,availableHeight:ve})=>{const{width:Pt,height:Bt}=$e.reference,Ne=ie.floating.style;Ne.setProperty("--radix-popper-available-width",`${Pe}px`),Ne.setProperty("--radix-popper-available-height",`${ve}px`),Ne.setProperty("--radix-popper-anchor-width",`${Pt}px`),Ne.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),B&&CP({element:B,padding:p}),$P({arrowWidth:G,arrowHeight:ee}),y&&pP({strategy:"referenceHidden"})]}),[V,Y]=y2(M),J=Dt(b);Mt(()=>{N&&(J==null||J())},[N,J]);const W=(i=F.arrow)===null||i===void 0?void 0:i.x,Q=(o=F.arrow)===null||o===void 0?void 0:o.y,le=((a=F.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[me,_e]=x.useState();return Mt(()=>{C&&_e(window.getComputedStyle(C).zIndex)},[C]),x.createElement("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:N?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(s=F.transformOrigin)===null||s===void 0?void 0:s.x,(l=F.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},x.createElement(IP,{scope:c,placedSide:V,onArrowChange:U,arrowX:W,arrowY:Q,shouldHideArrow:le},x.createElement(Ie.div,ge({"data-side":V,"data-align":Y},k,{ref:L,style:{...k.style,animation:N?void 0:"none",opacity:(u=F.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function kP(e){return e!==null}const $P=e=>({name:"transformOrigin",options:e,fn(t){var r,n,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,f=((r=u.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:e.arrowWidth,h=f?0:e.arrowHeight,[m,p]=y2(s),g={start:"0%",center:"50%",end:"100%"}[p],v=((n=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,w=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+h/2;let y="",E="";return m==="bottom"?(y=f?g:`${v}px`,E=`${-h}px`):m==="top"?(y=f?g:`${v}px`,E=`${l.floating.height+h}px`):m==="right"?(y=`${-h}px`,E=f?g:`${w}px`):m==="left"&&(y=`${l.floating.width+h}px`,E=f?g:`${w}px`),{data:{x:y,y:E}}}});function y2(e){const[t,r="center"]=e.split("-");return[t,r]}const E2=FP,S2=PP,_2=bP;function NP(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const rh=x.forwardRef((e,t)=>x.createElement(Ie.span,ge({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),MP=[" ","Enter","ArrowUp","ArrowDown"],LP=[" ","Enter"],Iu="Select",[bu,ku,BP]=Ou(Iu),[Po,n$]=sn(Iu,[BP,Pu]),nh=Pu(),[UP,Ti]=Po(Iu),[HP,VP]=Po(Iu),WP=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:u,name:c,autoComplete:f,disabled:d,required:h}=e,m=nh(t),[p,g]=x.useState(null),[v,w]=x.useState(null),[y,E]=x.useState(!1),b=Zd(u),[k=!1,_]=go({prop:n,defaultProp:i,onChange:o}),[C,A]=go({prop:a,defaultProp:s,onChange:l}),L=x.useRef(null),B=p?!!p.closest("form"):!0,[U,H]=x.useState(new Set),G=Array.from(U).map(ee=>ee.props.value).join(";");return x.createElement(E2,m,x.createElement(UP,{required:h,scope:t,trigger:p,onTriggerChange:g,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:y,onValueNodeHasChildrenChange:E,contentId:Kr(),value:C,onValueChange:A,open:k,onOpenChange:_,dir:b,triggerPointerDownPosRef:L,disabled:d},x.createElement(bu.Provider,{scope:t},x.createElement(HP,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(ee=>{H(ae=>new Set(ae).add(ee))},[]),onNativeOptionRemove:x.useCallback(ee=>{H(ae=>{const he=new Set(ae);return he.delete(ee),he})},[])},r)),B?x.createElement(R2,{key:G,"aria-hidden":!0,required:h,tabIndex:-1,name:c,autoComplete:f,value:C,onChange:ee=>A(ee.target.value),disabled:d},C===void 0?x.createElement("option",{value:""}):null,Array.from(U)):null))},zP="SelectTrigger",GP=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,o=nh(r),a=Ti(zP,r),s=a.disabled||n,l=We(t,a.onTriggerChange),u=ku(r),[c,f,d]=O2(m=>{const p=u().filter(w=>!w.disabled),g=p.find(w=>w.value===a.value),v=F2(p,m,g);v!==void 0&&a.onValueChange(v.value)}),h=()=>{s||(a.onOpenChange(!0),d())};return x.createElement(S2,ge({asChild:!0},o),x.createElement(Ie.button,ge({type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":a.value===void 0?"":void 0},i,{ref:l,onClick:Se(i.onClick,m=>{m.currentTarget.focus()}),onPointerDown:Se(i.onPointerDown,m=>{const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&(h(),a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:Se(i.onKeyDown,m=>{const p=c.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(p&&m.key===" ")&&MP.includes(m.key)&&(h(),m.preventDefault())})})))}),jP="SelectValue",XP=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:o,placeholder:a,...s}=e,l=Ti(jP,r),{onValueNodeHasChildrenChange:u}=l,c=o!==void 0,f=We(t,l.onValueNodeChange);return Mt(()=>{u(c)},[u,c]),x.createElement(Ie.span,ge({},s,{ref:f,style:{pointerEvents:"none"}}),l.value===void 0&&a!==void 0?a:o)}),KP=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return x.createElement(Ie.span,ge({"aria-hidden":!0},i,{ref:t}),n||"▼")}),YP=e=>x.createElement(vu,ge({asChild:!0},e)),xo="SelectContent",qP=x.forwardRef((e,t)=>{const r=Ti(xo,e.__scopeSelect),[n,i]=x.useState();if(Mt(()=>{i(new DocumentFragment)},[]),!r.open){const o=n;return o?gi.createPortal(x.createElement(T2,{scope:e.__scopeSelect},x.createElement(bu.Slot,{scope:e.__scopeSelect},x.createElement("div",null,e.children))),o):null}return x.createElement(QP,ge({},e,{ref:t}))}),Hr=10,[T2,Ci]=Po(xo),QP=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:g,...v}=e,w=Ti(xo,r),[y,E]=x.useState(null),[b,k]=x.useState(null),_=We(t,Y=>E(Y)),[C,A]=x.useState(null),[L,B]=x.useState(null),U=ku(r),[H,G]=x.useState(!1),ee=x.useRef(!1);x.useEffect(()=>{if(y)return _d(y)},[y]),Ed();const ae=x.useCallback(Y=>{const[J,...W]=U().map(me=>me.ref.current),[Q]=W.slice(-1),le=document.activeElement;for(const me of Y)if(me===le||(me==null||me.scrollIntoView({block:"nearest"}),me===J&&b&&(b.scrollTop=0),me===Q&&b&&(b.scrollTop=b.scrollHeight),me==null||me.focus(),document.activeElement!==le))return},[U,b]),he=x.useCallback(()=>ae([C,y]),[ae,C,y]);x.useEffect(()=>{H&&he()},[H,he]);const{onOpenChange:Te,triggerPointerDownPosRef:oe}=w;x.useEffect(()=>{if(y){let Y={x:0,y:0};const J=Q=>{var le,me,_e,ie;Y={x:Math.abs(Math.round(Q.pageX)-((le=(me=oe.current)===null||me===void 0?void 0:me.x)!==null&&le!==void 0?le:0)),y:Math.abs(Math.round(Q.pageY)-((_e=(ie=oe.current)===null||ie===void 0?void 0:ie.y)!==null&&_e!==void 0?_e:0))}},W=Q=>{Y.x<=10&&Y.y<=10?Q.preventDefault():y.contains(Q.target)||Te(!1),document.removeEventListener("pointermove",J),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",W,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",W,{capture:!0})}}},[y,Te,oe]),x.useEffect(()=>{const Y=()=>Te(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[Te]);const[ye,te]=O2(Y=>{const J=U().filter(le=>!le.disabled),W=J.find(le=>le.ref.current===document.activeElement),Q=F2(J,Y,W);Q&&setTimeout(()=>Q.ref.current.focus())}),O=x.useCallback((Y,J,W)=>{const Q=!ee.current&&!W;(w.value!==void 0&&w.value===J||Q)&&(A(Y),Q&&(ee.current=!0))},[w.value]),M=x.useCallback(()=>y==null?void 0:y.focus(),[y]),N=x.useCallback((Y,J,W)=>{const Q=!ee.current&&!W;(w.value!==void 0&&w.value===J||Q)&&B(Y)},[w.value]),F=n==="popper"?u1:ZP,V=F===u1?{side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:g}:{};return x.createElement(T2,{scope:r,content:y,viewport:b,onViewportChange:k,itemRefCallback:O,selectedItem:C,onItemLeave:M,itemTextRefCallback:N,focusSelectedItem:he,selectedItemText:L,position:n,isPositioned:H,searchRef:ye},x.createElement(Sd,{as:oi,allowPinchZoom:!0},x.createElement(yd,{asChild:!0,trapped:w.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Se(i,Y=>{var J;(J=w.trigger)===null||J===void 0||J.focus({preventScroll:!0}),Y.preventDefault()})},x.createElement(mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>w.onOpenChange(!1)},x.createElement(F,ge({role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Y=>Y.preventDefault()},v,V,{onPlaced:()=>G(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Se(v.onKeyDown,Y=>{const J=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!J&&Y.key.length===1&&te(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let Q=U().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(Q=Q.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const le=Y.target,me=Q.indexOf(le);Q=Q.slice(me+1)}setTimeout(()=>ae(Q)),Y.preventDefault()}})}))))))}),ZP=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,o=Ti(xo,r),a=Ci(xo,r),[s,l]=x.useState(null),[u,c]=x.useState(null),f=We(t,_=>c(_)),d=ku(r),h=x.useRef(!1),m=x.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:v,focusSelectedItem:w}=a,y=x.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&p&&g&&v){const _=o.trigger.getBoundingClientRect(),C=u.getBoundingClientRect(),A=o.valueNode.getBoundingClientRect(),L=v.getBoundingClientRect();if(o.dir!=="rtl"){const le=L.left-C.left,me=A.left-le,_e=_.left-me,ie=_.width+_e,$e=Math.max(ie,C.width),Pe=window.innerWidth-Hr,ve=Zg(me,[Hr,Pe-$e]);s.style.minWidth=ie+"px",s.style.left=ve+"px"}else{const le=C.right-L.right,me=window.innerWidth-A.right-le,_e=window.innerWidth-_.right-me,ie=_.width+_e,$e=Math.max(ie,C.width),Pe=window.innerWidth-Hr,ve=Zg(me,[Hr,Pe-$e]);s.style.minWidth=ie+"px",s.style.right=ve+"px"}const B=d(),U=window.innerHeight-Hr*2,H=p.scrollHeight,G=window.getComputedStyle(u),ee=parseInt(G.borderTopWidth,10),ae=parseInt(G.paddingTop,10),he=parseInt(G.borderBottomWidth,10),Te=parseInt(G.paddingBottom,10),oe=ee+ae+H+Te+he,ye=Math.min(g.offsetHeight*5,oe),te=window.getComputedStyle(p),O=parseInt(te.paddingTop,10),M=parseInt(te.paddingBottom,10),N=_.top+_.height/2-Hr,F=U-N,V=g.offsetHeight/2,Y=g.offsetTop+V,J=ee+ae+Y,W=oe-J;if(J<=N){const le=g===B[B.length-1].ref.current;s.style.bottom="0px";const me=u.clientHeight-p.offsetTop-p.offsetHeight,_e=Math.max(F,V+(le?M:0)+me+he),ie=J+_e;s.style.height=ie+"px"}else{const le=g===B[0].ref.current;s.style.top="0px";const _e=Math.max(N,ee+p.offsetTop+(le?O:0)+V)+W;s.style.height=_e+"px",p.scrollTop=J-N+p.offsetTop}s.style.margin=`${Hr}px 0`,s.style.minHeight=ye+"px",s.style.maxHeight=U+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[d,o.trigger,o.valueNode,s,u,p,g,v,o.dir,n]);Mt(()=>y(),[y]);const[E,b]=x.useState();Mt(()=>{u&&b(window.getComputedStyle(u).zIndex)},[u]);const k=x.useCallback(_=>{_&&m.current===!0&&(y(),w==null||w(),m.current=!1)},[y,w]);return x.createElement(JP,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:k},x.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E}},x.createElement(Ie.div,ge({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),u1=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Hr,...o}=e,a=nh(r);return x.createElement(_2,ge({},a,o,{ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[JP,ih]=Po(xo,{}),c1="SelectViewport",eI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Ci(c1,r),o=ih(c1,r),a=We(t,i.onViewportChange),s=x.useRef(0);return x.createElement(x.Fragment,null,x.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),x.createElement(bu.Slot,{scope:r},x.createElement(Ie.div,ge({"data-radix-select-viewport":"",role:"presentation"},n,{ref:a,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:Se(n.onScroll,l=>{const u=l.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&c){const d=Math.abs(s.current-u.scrollTop);if(d>0){const h=window.innerHeight-Hr*2,m=parseFloat(c.style.minHeight),p=parseFloat(c.style.height),g=Math.max(m,p);if(g0?y:0,c.style.justifyContent="flex-end")}}}s.current=u.scrollTop})}))))}),tI="SelectGroup",[rI,nI]=Po(tI),iI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Kr();return x.createElement(rI,{scope:r,id:i},x.createElement(Ie.div,ge({role:"group","aria-labelledby":i},n,{ref:t})))}),oI="SelectLabel",aI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=nI(oI,r);return x.createElement(Ie.div,ge({id:i.id},n,{ref:t}))}),a0="SelectItem",[sI,C2]=Po(a0),lI=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:o,...a}=e,s=Ti(a0,r),l=Ci(a0,r),u=s.value===n,[c,f]=x.useState(o??""),[d,h]=x.useState(!1),m=We(t,v=>{var w;return(w=l.itemRefCallback)===null||w===void 0?void 0:w.call(l,v,n,i)}),p=Kr(),g=()=>{i||(s.onValueChange(n),s.onOpenChange(!1))};return x.createElement(sI,{scope:r,value:n,disabled:i,textId:p,isSelected:u,onItemTextChange:x.useCallback(v=>{f(w=>{var y;return w||((y=v==null?void 0:v.textContent)!==null&&y!==void 0?y:"").trim()})},[])},x.createElement(bu.ItemSlot,{scope:r,value:n,disabled:i,textValue:c},x.createElement(Ie.div,ge({role:"option","aria-labelledby":p,"data-highlighted":d?"":void 0,"aria-selected":u&&d,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},a,{ref:m,onFocus:Se(a.onFocus,()=>h(!0)),onBlur:Se(a.onBlur,()=>h(!1)),onPointerUp:Se(a.onPointerUp,g),onPointerMove:Se(a.onPointerMove,v=>{if(i){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}else v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(a.onPointerLeave,v=>{if(v.currentTarget===document.activeElement){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}}),onKeyDown:Se(a.onKeyDown,v=>{var w;((w=l.searchRef)===null||w===void 0?void 0:w.current)!==""&&v.key===" "||(LP.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})}))))}),zs="SelectItemText",uI=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...o}=e,a=Ti(zs,r),s=Ci(zs,r),l=C2(zs,r),u=VP(zs,r),[c,f]=x.useState(null),d=We(t,v=>f(v),l.onItemTextChange,v=>{var w;return(w=s.itemTextRefCallback)===null||w===void 0?void 0:w.call(s,v,l.value,l.disabled)}),h=c==null?void 0:c.textContent,m=x.useMemo(()=>x.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},h),[l.disabled,l.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return Mt(()=>(p(m),()=>g(m)),[p,g,m]),x.createElement(x.Fragment,null,x.createElement(Ie.span,ge({id:l.textId},o,{ref:d})),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?gi.createPortal(o.children,a.valueNode):null)}),cI="SelectItemIndicator",fI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return C2(cI,r).isSelected?x.createElement(Ie.span,ge({"aria-hidden":!0},n,{ref:t})):null}),f1="SelectScrollUpButton",dI=x.forwardRef((e,t)=>{const r=Ci(f1,e.__scopeSelect),n=ih(f1,e.__scopeSelect),[i,o]=x.useState(!1),a=We(t,n.onScrollButtonChange);return Mt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=l.scrollTop>0;o(c)};var s=u;const l=r.viewport;return u(),l.addEventListener("scroll",u),()=>l.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?x.createElement(A2,ge({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}})):null}),d1="SelectScrollDownButton",hI=x.forwardRef((e,t)=>{const r=Ci(d1,e.__scopeSelect),n=ih(d1,e.__scopeSelect),[i,o]=x.useState(!1),a=We(t,n.onScrollButtonChange);return Mt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?x.createElement(A2,ge({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}})):null}),A2=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,o=Ci("SelectScrollButton",r),a=x.useRef(null),s=ku(r),l=x.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return x.useEffect(()=>()=>l(),[l]),Mt(()=>{var u;const c=s().find(f=>f.ref.current===document.activeElement);c==null||(u=c.ref.current)===null||u===void 0||u.scrollIntoView({block:"nearest"})},[s]),x.createElement(Ie.div,ge({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Se(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:Se(i.onPointerMove,()=>{var u;(u=o.onItemLeave)===null||u===void 0||u.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:Se(i.onPointerLeave,()=>{l()})}))}),R2=x.forwardRef((e,t)=>{const{value:r,...n}=e,i=x.useRef(null),o=We(t,i),a=NP(r);return x.useEffect(()=>{const s=i.current,l=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==r&&c){const f=new Event("change",{bubbles:!0});c.call(s,r),s.dispatchEvent(f)}},[a,r]),x.createElement(rh,{asChild:!0},x.createElement("select",ge({},n,{ref:o,defaultValue:r})))});R2.displayName="BubbleSelect";function O2(e){const t=Dt(e),r=x.useRef(""),n=x.useRef(0),i=x.useCallback(a=>{const s=r.current+a;t(s),function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,o]}function F2(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=pI(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function pI(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const gI=WP,mI=GP,vI=XP,xI=KP,wI=YP,yI=qP,EI=eI,Vc=iI,h1=aI,SI=lI,_I=uI,TI=fI,CI=dI,AI=hI;function oh(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}var RI=["color"],OI=x.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,RI);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),FI=["color"],s0=x.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,FI);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),DI=["color"],PI=x.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,DI);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))});const Xi=({value:e,onChange:t,label:r="Select",placeholder:n="Select a fruit…",groups:i,labelType:o="col"})=>{const a=(i==null?void 0:i.length)===1;return Ce(gI,{value:e,onValueChange:t,children:[Ce(Vc,{className:kt("flex gap-1",{"flex-row items-center gap-2":o==="row","flex-col":o==="col"}),children:[X(h1,{className:"whitespace-nowrap",children:r}),Ce(mI,{className:"justify-between bg-white text-black dark:text-white dark:bg-grey-900 whitespace-nowrap h-[36px] border-[1.5px] border-grey-700 rounded p-3 inline-flex items-center leading-none gap-[5px] shadow-[0_2px_10px] shadow-black/10 focus:shadow-[0_0_0_2px] focus:shadow-black data-[placeholder]:text-white outline-none","aria-label":r,children:[X(vI,{placeholder:n}),X(xI,{children:X(s0,{})})]})]}),X(wI,{children:Ce(yI,{className:"z-50 bg-white/80 dark:bg-grey-900/80 backdrop-filter backdrop-blur overflow-hidden border-[1.5px] border-grey-700 rounded p-3 shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)]",children:[X(CI,{className:"flex items-center justify-center h-[25px] cursor-default dark:text-white text-black",children:X(PI,{})}),X(EI,{className:"p-[5px]",children:a?X(Vc,{children:i[0].items.map(s=>X(p1,{value:s.value,disabled:s.disabled,children:s.label}))}):i.map((s,l)=>Ce(Vc,{children:[X(h1,{className:"text-xs leading-[25px]",children:s.label}),s.items.map(u=>X(p1,{value:u.value,disabled:u.disabled,children:u.label},u.value))]},s.label))}),X(AI,{className:"flex items-center justify-center h-[25px] cursor-default dark:text-white text-black",children:X(s0,{})})]})})]})},p1=x.forwardRef(({children:e,className:t,...r},n)=>Ce(SI,{className:kt("text-[13px] leading-none rounded-[3px] flex items-center h-[25px] pr-[35px] pl-[25px] relative select-none data-[disabled]:text-grey-400 data-[disabled]:pointer-events-none data-[highlighted]:outline-none data-[highlighted]:bg-grey-600 data-[highlighted]:text-white text-black dark:text-white",t),...r,ref:n,children:[X(_I,{children:e}),X(TI,{className:"absolute left-0 w-[25px] inline-flex items-center justify-center",children:X(OI,{})})]})),D2="ToastProvider",[ah,II,bI]=Ou("Toast"),[P2,i$]=sn("Toast",[bI]),[kI,$u]=P2(D2),I2=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:a}=e,[s,l]=x.useState(null),[u,c]=x.useState(0),f=x.useRef(!1),d=x.useRef(!1);return x.createElement(ah.Provider,{scope:t},x.createElement(kI,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:o,toastCount:u,viewport:s,onViewportChange:l,onToastAdd:x.useCallback(()=>c(h=>h+1),[]),onToastRemove:x.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:d},a))};I2.propTypes={label(e){if(e.label&&typeof e.label=="string"&&!e.label.trim()){const t=`Invalid prop \`label\` supplied to \`${D2}\`. Expected non-empty \`string\`.`;return new Error(t)}return null}};const $I="ToastViewport",NI=["F8"],l0="toast.viewportPause",u0="toast.viewportResume",MI=x.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=NI,label:i="Notifications ({hotkey})",...o}=e,a=$u($I,r),s=II(r),l=x.useRef(null),u=x.useRef(null),c=x.useRef(null),f=x.useRef(null),d=We(t,f,a.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=a.toastCount>0;x.useEffect(()=>{const g=v=>{var w;n.every(E=>v[E]||v.code===E)&&((w=f.current)===null||w===void 0||w.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),x.useEffect(()=>{const g=l.current,v=f.current;if(m&&g&&v){const w=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent(l0);v.dispatchEvent(k),a.isClosePausedRef.current=!0}},y=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(u0);v.dispatchEvent(k),a.isClosePausedRef.current=!1}},E=k=>{!g.contains(k.relatedTarget)&&y()},b=()=>{g.contains(document.activeElement)||y()};return g.addEventListener("focusin",w),g.addEventListener("focusout",E),g.addEventListener("pointermove",w),g.addEventListener("pointerleave",b),window.addEventListener("blur",w),window.addEventListener("focus",y),()=>{g.removeEventListener("focusin",w),g.removeEventListener("focusout",E),g.removeEventListener("pointermove",w),g.removeEventListener("pointerleave",b),window.removeEventListener("blur",w),window.removeEventListener("focus",y)}}},[m,a.isClosePausedRef]);const p=x.useCallback(({tabbingDirection:g})=>{const w=s().map(y=>{const E=y.ref.current,b=[E,...e5(E)];return g==="forwards"?b:b.reverse()});return(g==="forwards"?w.reverse():w).flat()},[s]);return x.useEffect(()=>{const g=f.current;if(g){const v=w=>{const y=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!y){const C=document.activeElement,A=w.shiftKey;if(w.target===g&&A){var b;(b=u.current)===null||b===void 0||b.focus();return}const U=p({tabbingDirection:A?"backwards":"forwards"}),H=U.findIndex(G=>G===C);if(Wc(U.slice(H+1)))w.preventDefault();else{var k,_;A?(k=u.current)===null||k===void 0||k.focus():(_=c.current)===null||_===void 0||_.focus()}}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[s,p]),x.createElement(s_,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:m?void 0:"none"}},m&&x.createElement(g1,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});Wc(g)}}),x.createElement(ah.Slot,{scope:r},x.createElement(Ie.ol,ge({tabIndex:-1},o,{ref:d}))),m&&x.createElement(g1,{ref:c,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});Wc(g)}}))}),LI="ToastFocusProxy",g1=x.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,o=$u(LI,r);return x.createElement(rh,ge({"aria-hidden":!0,tabIndex:0},i,{ref:t,style:{position:"fixed"},onFocus:a=>{var s;const l=a.relatedTarget;!((s=o.viewport)!==null&&s!==void 0&&s.contains(l))&&n()}}))}),Nu="Toast",BI="toast.swipeStart",UI="toast.swipeMove",HI="toast.swipeCancel",VI="toast.swipeEnd",WI=x.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:o,...a}=e,[s=!0,l]=go({prop:n,defaultProp:i,onChange:o});return x.createElement(mi,{present:r||s},x.createElement(b2,ge({open:s},a,{ref:t,onClose:()=>l(!1),onPause:Dt(e.onPause),onResume:Dt(e.onResume),onSwipeStart:Se(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Se(e.onSwipeMove,u=>{const{x:c,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Se(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Se(e.onSwipeEnd,u=>{const{x:c,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})))}),[zI,GI]=P2(Nu,{onClose(){}}),b2=x.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...m}=e,p=$u(Nu,r),[g,v]=x.useState(null),w=We(t,G=>v(G)),y=x.useRef(null),E=x.useRef(null),b=i||p.duration,k=x.useRef(0),_=x.useRef(b),C=x.useRef(0),{onToastAdd:A,onToastRemove:L}=p,B=Dt(()=>{var G;(g==null?void 0:g.contains(document.activeElement))&&((G=p.viewport)===null||G===void 0||G.focus()),a()}),U=x.useCallback(G=>{!G||G===1/0||(window.clearTimeout(C.current),k.current=new Date().getTime(),C.current=window.setTimeout(B,G))},[B]);x.useEffect(()=>{const G=p.viewport;if(G){const ee=()=>{U(_.current),u==null||u()},ae=()=>{const he=new Date().getTime()-k.current;_.current=_.current-he,window.clearTimeout(C.current),l==null||l()};return G.addEventListener(l0,ae),G.addEventListener(u0,ee),()=>{G.removeEventListener(l0,ae),G.removeEventListener(u0,ee)}}},[p.viewport,b,l,u,U]),x.useEffect(()=>{o&&!p.isClosePausedRef.current&&U(b)},[o,b,p.isClosePausedRef,U]),x.useEffect(()=>(A(),()=>L()),[A,L]);const H=x.useMemo(()=>g?N2(g):null,[g]);return p.viewport?x.createElement(x.Fragment,null,H&&x.createElement(jI,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},H),x.createElement(zI,{scope:r,onClose:B},gi.createPortal(x.createElement(ah.ItemSlot,{scope:r},x.createElement(a_,{asChild:!0,onEscapeKeyDown:Se(s,()=>{p.isFocusedToastEscapeKeyDownRef.current||B(),p.isFocusedToastEscapeKeyDownRef.current=!1})},x.createElement(Ie.li,ge({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection},m,{ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Se(e.onKeyDown,G=>{G.key==="Escape"&&(s==null||s(G.nativeEvent),G.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:Se(e.onPointerDown,G=>{G.button===0&&(y.current={x:G.clientX,y:G.clientY})}),onPointerMove:Se(e.onPointerMove,G=>{if(!y.current)return;const ee=G.clientX-y.current.x,ae=G.clientY-y.current.y,he=!!E.current,Te=["left","right"].includes(p.swipeDirection),oe=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,ye=Te?oe(0,ee):0,te=Te?0:oe(0,ae),O=G.pointerType==="touch"?10:2,M={x:ye,y:te},N={originalEvent:G,delta:M};he?(E.current=M,Gs(UI,f,N,{discrete:!1})):m1(M,p.swipeDirection,O)?(E.current=M,Gs(BI,c,N,{discrete:!1}),G.target.setPointerCapture(G.pointerId)):(Math.abs(ee)>O||Math.abs(ae)>O)&&(y.current=null)}),onPointerUp:Se(e.onPointerUp,G=>{const ee=E.current,ae=G.target;if(ae.hasPointerCapture(G.pointerId)&&ae.releasePointerCapture(G.pointerId),E.current=null,y.current=null,ee){const he=G.currentTarget,Te={originalEvent:G,delta:ee};m1(ee,p.swipeDirection,p.swipeThreshold)?Gs(VI,h,Te,{discrete:!0}):Gs(HI,d,Te,{discrete:!0}),he.addEventListener("click",oe=>oe.preventDefault(),{once:!0})}})})))),p.viewport))):null});b2.propTypes={type(e){if(e.type&&!["foreground","background"].includes(e.type)){const t=`Invalid prop \`type\` supplied to \`${Nu}\`. Expected \`foreground | background\`.`;return new Error(t)}return null}};const jI=e=>{const{__scopeToast:t,children:r,...n}=e,i=$u(Nu,t),[o,a]=x.useState(!1),[s,l]=x.useState(!1);return ZI(()=>a(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),s?null:x.createElement(vu,{asChild:!0},x.createElement(rh,n,o&&x.createElement(x.Fragment,null,i.label," ",r)))},XI=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return x.createElement(Ie.div,ge({},n,{ref:t}))}),KI=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return x.createElement(Ie.div,ge({},n,{ref:t}))}),YI="ToastAction",qI=x.forwardRef((e,t)=>{const{altText:r,...n}=e;return r?x.createElement($2,{altText:r,asChild:!0},x.createElement(k2,ge({},n,{ref:t}))):null});qI.propTypes={altText(e){return e.altText?null:new Error(`Missing prop \`altText\` expected on \`${YI}\``)}};const QI="ToastClose",k2=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=GI(QI,r);return x.createElement($2,{asChild:!0},x.createElement(Ie.button,ge({type:"button"},n,{ref:t,onClick:Se(e.onClick,i.onClose)})))}),$2=x.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...i}=e;return x.createElement(Ie.div,ge({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:t}))});function N2(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),JI(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...N2(n))}}),t}function Gs(e,t,r,{discrete:n}){const i=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?wd(i,o):i.dispatchEvent(o)}const m1=(e,t,r=0)=>{const n=Math.abs(e.x),i=Math.abs(e.y),o=n>i;return t==="left"||t==="right"?o&&n>r:!o&&i>r};function ZI(e=()=>{}){const t=Dt(e);Mt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function JI(e){return e.nodeType===e.ELEMENT_NODE}function e5(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Wc(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}const t5=I2,r5=MI,n5=WI,i5=XI,o5=KI,a5=k2,s5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 18 18",width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M9 16.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15ZM11.25 6.75l-4.5 4.5M6.75 6.75l4.5 4.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),l5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM12 16v-4M12 8h.01",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),u5=({title:e,titleId:t,...r})=>Ce("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M16.5 8.31V9a7.5 7.5 0 1 1-4.447-6.855",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),X("path",{d:"M16.5 3 9 10.508l-2.25-2.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),c5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 18 18",width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M7.718 2.895 1.366 13.5a1.5 1.5 0 0 0 1.282 2.25h12.705a1.5 1.5 0 0 0 1.283-2.25L10.283 2.895a1.5 1.5 0 0 0-2.565 0v0ZM9 6.75v3M9 12.75h.008",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),f5=({toast:e,open:t,setOpen:r})=>Ce(t5,{children:[Ce(n5,{open:t,onOpenChange:n=>{e.preventClose||r(n)},className:kt("z-50 fixed bottom-4 md:left-1/2 md:-translate-x-[50%] inset-x-4 w-auto shadow-lg md:max-w-[658px] duration-300","radix-state-open:animate-fade-in","radix-state-closed:animate-toast-hide","radix-swipe-end:animate-toast-swipe-out","translate-x-radix-toast-swipe-move-x","radix-swipe-cancel:translate-x-0 radix-swipe-cancel:duration-200 radix-swipe-cancel:ease-[ease]","px-[40px] md:px-[58px] py-6 flex flex-col border rounded-[4px]",{"bg-green-100 text-green-600 border-green-600":e.status==="success","bg-red-200 text-red-600 border-red-600":e.status==="error","bg-blue-100 text-blue-700 border-blue-600":e.status==="info","bg-orange-200 text-orange-600 border-orange-600":e.status==="warning"},{"h-[72px]":!e.description}),children:[e.status==="success"?X(u5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):e.status==="warning"?X(c5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):e.status==="error"?X(s5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):X(l5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}),X(i5,{className:"text-grey-900 font-bold text-sm",children:e.title}),e.description&&X(o5,{className:"mt-2 text-[10px] md:text-xs text-grey-800",children:e.description}),X(a5,{className:"absolute top-7 right-5 md:right-7",children:X(ql,{className:"w-4 h-4 text-grey-900"})})]}),X(r5,{})]}),zc="rovingFocusGroup.onEntryFocus",d5={bubbles:!1,cancelable:!0},sh="RovingFocusGroup",[c0,M2,h5]=Ou(sh),[p5,L2]=sn(sh,[h5]),[g5,m5]=p5(sh),v5=x.forwardRef((e,t)=>x.createElement(c0.Provider,{scope:e.__scopeRovingFocusGroup},x.createElement(c0.Slot,{scope:e.__scopeRovingFocusGroup},x.createElement(x5,ge({},e,{ref:t}))))),x5=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...c}=e,f=x.useRef(null),d=We(t,f),h=Zd(o),[m=null,p]=go({prop:a,defaultProp:s,onChange:l}),[g,v]=x.useState(!1),w=Dt(u),y=M2(r),E=x.useRef(!1),[b,k]=x.useState(0);return x.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(zc,w),()=>_.removeEventListener(zc,w)},[w]),x.createElement(g5,{scope:r,orientation:n,dir:h,loop:i,currentTabStopId:m,onItemFocus:x.useCallback(_=>p(_),[p]),onItemShiftTab:x.useCallback(()=>v(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(_=>_+1),[]),onFocusableItemRemove:x.useCallback(()=>k(_=>_-1),[])},x.createElement(Ie.div,ge({tabIndex:g||b===0?-1:0,"data-orientation":n},c,{ref:d,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{E.current=!0}),onFocus:Se(e.onFocus,_=>{const C=!E.current;if(_.target===_.currentTarget&&C&&!g){const A=new CustomEvent(zc,d5);if(_.currentTarget.dispatchEvent(A),!A.defaultPrevented){const L=y().filter(ee=>ee.focusable),B=L.find(ee=>ee.active),U=L.find(ee=>ee.id===m),G=[B,U,...L].filter(Boolean).map(ee=>ee.ref.current);B2(G)}}E.current=!1}),onBlur:Se(e.onBlur,()=>v(!1))})))}),w5="RovingFocusGroupItem",y5=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,...a}=e,s=Kr(),l=o||s,u=m5(w5,r),c=u.currentTabStopId===l,f=M2(r),{onFocusableItemAdd:d,onFocusableItemRemove:h}=u;return x.useEffect(()=>{if(n)return d(),()=>h()},[n,d,h]),x.createElement(c0.ItemSlot,{scope:r,id:l,focusable:n,active:i},x.createElement(Ie.span,ge({tabIndex:c?0:-1,"data-orientation":u.orientation},a,{ref:t,onMouseDown:Se(e.onMouseDown,m=>{n?u.onItemFocus(l):m.preventDefault()}),onFocus:Se(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Se(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const p=_5(m,u.orientation,u.dir);if(p!==void 0){m.preventDefault();let v=f().filter(w=>w.focusable).map(w=>w.ref.current);if(p==="last")v.reverse();else if(p==="prev"||p==="next"){p==="prev"&&v.reverse();const w=v.indexOf(m.currentTarget);v=u.loop?T5(v,w+1):v.slice(w+1)}setTimeout(()=>B2(v))}})})))}),E5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function S5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _5(e,t,r){const n=S5(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return E5[n]}function B2(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function T5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const C5=v5,A5=y5,R5=["Enter"," "],O5=["ArrowDown","PageUp","Home"],U2=["ArrowUp","PageDown","End"],F5=[...O5,...U2],Mu="Menu",[f0,D5,P5]=Ou(Mu),[Ai,Lu]=sn(Mu,[P5,Pu,L2]),lh=Pu(),H2=L2(),[I5,ls]=Ai(Mu),[b5,uh]=Ai(Mu),k5=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:o,modal:a=!0}=e,s=lh(t),[l,u]=x.useState(null),c=x.useRef(!1),f=Dt(o),d=Zd(i);return x.useEffect(()=>{const h=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),x.createElement(E2,s,x.createElement(I5,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:u},x.createElement(b5,{scope:t,onClose:x.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:d,modal:a},n)))},$5=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=lh(r);return x.createElement(S2,ge({},i,n,{ref:t}))}),V2="MenuPortal",[N5,M5]=Ai(V2,{forceMount:void 0}),L5=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,o=ls(V2,t);return x.createElement(N5,{scope:t,forceMount:r},x.createElement(mi,{present:r||o.open},x.createElement(vu,{asChild:!0,container:i},n)))},On="MenuContent",[B5,W2]=Ai(On),U5=x.forwardRef((e,t)=>{const r=M5(On,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=ls(On,e.__scopeMenu),a=uh(On,e.__scopeMenu);return x.createElement(f0.Provider,{scope:e.__scopeMenu},x.createElement(mi,{present:n||o.open},x.createElement(f0.Slot,{scope:e.__scopeMenu},a.modal?x.createElement(H5,ge({},i,{ref:t})):x.createElement(V5,ge({},i,{ref:t})))))}),H5=x.forwardRef((e,t)=>{const r=ls(On,e.__scopeMenu),n=x.useRef(null),i=We(t,n);return x.useEffect(()=>{const o=n.current;if(o)return _d(o)},[]),x.createElement(z2,ge({},e,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)}))}),V5=x.forwardRef((e,t)=>{const r=ls(On,e.__scopeMenu);return x.createElement(z2,ge({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)}))}),z2=x.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:d,onDismiss:h,disableOutsideScroll:m,...p}=e,g=ls(On,r),v=uh(On,r),w=lh(r),y=H2(r),E=D5(r),[b,k]=x.useState(null),_=x.useRef(null),C=We(t,_,g.onContentChange),A=x.useRef(0),L=x.useRef(""),B=x.useRef(0),U=x.useRef(null),H=x.useRef("right"),G=x.useRef(0),ee=m?Sd:x.Fragment,ae=m?{as:oi,allowPinchZoom:!0}:void 0,he=oe=>{var ye,te;const O=L.current+oe,M=E().filter(W=>!W.disabled),N=document.activeElement,F=(ye=M.find(W=>W.ref.current===N))===null||ye===void 0?void 0:ye.textValue,V=M.map(W=>W.textValue),Y=J5(V,O,F),J=(te=M.find(W=>W.textValue===Y))===null||te===void 0?void 0:te.ref.current;(function W(Q){L.current=Q,window.clearTimeout(A.current),Q!==""&&(A.current=window.setTimeout(()=>W(""),1e3))})(O),J&&setTimeout(()=>J.focus())};x.useEffect(()=>()=>window.clearTimeout(A.current),[]),Ed();const Te=x.useCallback(oe=>{var ye,te;return H.current===((ye=U.current)===null||ye===void 0?void 0:ye.side)&&tb(oe,(te=U.current)===null||te===void 0?void 0:te.area)},[]);return x.createElement(B5,{scope:r,searchRef:L,onItemEnter:x.useCallback(oe=>{Te(oe)&&oe.preventDefault()},[Te]),onItemLeave:x.useCallback(oe=>{var ye;Te(oe)||((ye=_.current)===null||ye===void 0||ye.focus(),k(null))},[Te]),onTriggerLeave:x.useCallback(oe=>{Te(oe)&&oe.preventDefault()},[Te]),pointerGraceTimerRef:B,onPointerGraceIntentChange:x.useCallback(oe=>{U.current=oe},[])},x.createElement(ee,ae,x.createElement(yd,{asChild:!0,trapped:i,onMountAutoFocus:Se(o,oe=>{var ye;oe.preventDefault(),(ye=_.current)===null||ye===void 0||ye.focus()}),onUnmountAutoFocus:a},x.createElement(mu,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:d,onDismiss:h},x.createElement(C5,ge({asChild:!0},y,{dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:b,onCurrentTabStopIdChange:k,onEntryFocus:Se(l,oe=>{v.isUsingKeyboardRef.current||oe.preventDefault()})}),x.createElement(_2,ge({role:"menu","aria-orientation":"vertical","data-state":q5(g.open),"data-radix-menu-content":"",dir:v.dir},w,p,{ref:C,style:{outline:"none",...p.style},onKeyDown:Se(p.onKeyDown,oe=>{const te=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,O=oe.ctrlKey||oe.altKey||oe.metaKey,M=oe.key.length===1;te&&(oe.key==="Tab"&&oe.preventDefault(),!O&&M&&he(oe.key));const N=_.current;if(oe.target!==N||!F5.includes(oe.key))return;oe.preventDefault();const V=E().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);U2.includes(oe.key)&&V.reverse(),Q5(V)}),onBlur:Se(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(A.current),L.current="")}),onPointerMove:Se(e.onPointerMove,h0(oe=>{const ye=oe.target,te=G.current!==oe.clientX;if(oe.currentTarget.contains(ye)&&te){const O=oe.clientX>G.current?"right":"left";H.current=O,G.current=oe.clientX}}))})))))))}),W5=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return x.createElement(Ie.div,ge({role:"group"},n,{ref:t}))}),z5=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return x.createElement(Ie.div,ge({},n,{ref:t}))}),d0="MenuItem",v1="menu.itemSelect",G5=x.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,o=x.useRef(null),a=uh(d0,e.__scopeMenu),s=W2(d0,e.__scopeMenu),l=We(t,o),u=x.useRef(!1),c=()=>{const f=o.current;if(!r&&f){const d=new CustomEvent(v1,{bubbles:!0,cancelable:!0});f.addEventListener(v1,h=>n==null?void 0:n(h),{once:!0}),wd(f,d),d.defaultPrevented?u.current=!1:a.onClose()}};return x.createElement(j5,ge({},i,{ref:l,disabled:r,onClick:Se(e.onClick,c),onPointerDown:f=>{var d;(d=e.onPointerDown)===null||d===void 0||d.call(e,f),u.current=!0},onPointerUp:Se(e.onPointerUp,f=>{var d;u.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:Se(e.onKeyDown,f=>{const d=s.searchRef.current!=="";r||d&&f.key===" "||R5.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),j5=x.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...o}=e,a=W2(d0,r),s=H2(r),l=x.useRef(null),u=We(t,l),[c,f]=x.useState(!1),[d,h]=x.useState("");return x.useEffect(()=>{const m=l.current;if(m){var p;h(((p=m.textContent)!==null&&p!==void 0?p:"").trim())}},[o.children]),x.createElement(f0.ItemSlot,{scope:r,disabled:n,textValue:i??d},x.createElement(A5,ge({asChild:!0},s,{focusable:!n}),x.createElement(Ie.div,ge({role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},o,{ref:u,onPointerMove:Se(e.onPointerMove,h0(m=>{n?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus())})),onPointerLeave:Se(e.onPointerLeave,h0(m=>a.onItemLeave(m))),onFocus:Se(e.onFocus,()=>f(!0)),onBlur:Se(e.onBlur,()=>f(!1))}))))}),X5="MenuRadioGroup";Ai(X5,{value:void 0,onValueChange:()=>{}});const K5="MenuItemIndicator";Ai(K5,{checked:!1});const Y5="MenuSub";Ai(Y5);function q5(e){return e?"open":"closed"}function Q5(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Z5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function J5(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=Z5(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function eb(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,a=t.length-1;on!=c>n&&r<(u-s)*(n-l)/(c-l)+s&&(i=!i)}return i}function tb(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return eb(r,t)}function h0(e){return t=>t.pointerType==="mouse"?e(t):void 0}const G2=k5,j2=$5,X2=L5,K2=U5,rb=W5,nb=z5,ib=G5,Y2="ContextMenu",[ob,o$]=sn(Y2,[Lu]),Bu=Lu(),[ab,q2]=ob(Y2),sb=e=>{const{__scopeContextMenu:t,children:r,onOpenChange:n,dir:i,modal:o=!0}=e,[a,s]=x.useState(!1),l=Bu(t),u=Dt(n),c=x.useCallback(f=>{s(f),u(f)},[u]);return x.createElement(ab,{scope:t,open:a,onOpenChange:c,modal:o},x.createElement(G2,ge({},l,{dir:i,open:a,onOpenChange:c,modal:o}),r))},lb="ContextMenuTrigger",ub=x.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:n=!1,...i}=e,o=q2(lb,r),a=Bu(r),s=x.useRef({x:0,y:0}),l=x.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),u=x.useRef(0),c=x.useCallback(()=>window.clearTimeout(u.current),[]),f=d=>{s.current={x:d.clientX,y:d.clientY},o.onOpenChange(!0)};return x.useEffect(()=>c,[c]),x.useEffect(()=>void(n&&c()),[n,c]),x.createElement(x.Fragment,null,x.createElement(j2,ge({},a,{virtualRef:l})),x.createElement(Ie.span,ge({"data-state":o.open?"open":"closed","data-disabled":n?"":void 0},i,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:Se(e.onContextMenu,d=>{c(),f(d),d.preventDefault()}),onPointerDown:n?e.onPointerDown:Se(e.onPointerDown,js(d=>{c(),u.current=window.setTimeout(()=>f(d),700)})),onPointerMove:n?e.onPointerMove:Se(e.onPointerMove,js(c)),onPointerCancel:n?e.onPointerCancel:Se(e.onPointerCancel,js(c)),onPointerUp:n?e.onPointerUp:Se(e.onPointerUp,js(c))})))}),cb=e=>{const{__scopeContextMenu:t,...r}=e,n=Bu(t);return x.createElement(X2,ge({},n,r))},fb="ContextMenuContent",db=x.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,i=q2(fb,r),o=Bu(r),a=x.useRef(!1);return x.createElement(K2,ge({},o,n,{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)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))});function js(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const hb=sb,pb=ub,gb=cb,mb=db,Q2=x.createContext({dragDropManager:void 0});function rr(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var x1=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Gc=function(){return Math.random().toString(36).substring(7).split("").join(".")},w1={INIT:"@@redux/INIT"+Gc(),REPLACE:"@@redux/REPLACE"+Gc(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Gc()}};function vb(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Z2(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(rr(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(rr(1));return r(Z2)(e,t)}if(typeof e!="function")throw new Error(rr(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(rr(3));return o}function f(p){if(typeof p!="function")throw new Error(rr(4));if(l)throw new Error(rr(5));var g=!0;return u(),s.push(p),function(){if(g){if(l)throw new Error(rr(6));g=!1,u();var w=s.indexOf(p);s.splice(w,1),a=null}}}function d(p){if(!vb(p))throw new Error(rr(7));if(typeof p.type>"u")throw new Error(rr(8));if(l)throw new Error(rr(9));try{l=!0,o=i(o,p)}finally{l=!1}for(var g=a=s,v=0;vn&&n[i]?n[i]:r||null,e)}function yb(e,t){return e.filter(r=>r!==t)}function J2(e){return typeof e=="object"}function Eb(e,t){const r=new Map,n=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);const i=[];return r.forEach((o,a)=>{o===1&&i.push(a)}),i}function Sb(e,t){return e.filter(r=>t.indexOf(r)>-1)}const ch="dnd-core/INIT_COORDS",Uu="dnd-core/BEGIN_DRAG",fh="dnd-core/PUBLISH_DRAG_SOURCE",Hu="dnd-core/HOVER",Vu="dnd-core/DROP",Wu="dnd-core/END_DRAG";function y1(e,t){return{type:ch,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const _b={type:ch,payload:{clientOffset:null,sourceClientOffset:null}};function Tb(e){return function(r=[],n={publishSource:!0}){const{publishSource:i=!0,clientOffset:o,getSourceClientOffset:a}=n,s=e.getMonitor(),l=e.getRegistry();e.dispatch(y1(o)),Cb(r,s,l);const u=Ob(r,s);if(u==null){e.dispatch(_b);return}let c=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");Ab(a),c=a(u)}e.dispatch(y1(o,c));const d=l.getSource(u).beginDrag(s,u);if(d==null)return;Rb(d),l.pinSource(u);const h=l.getSourceType(u);return{type:Uu,payload:{itemType:h,item:d,sourceId:u,clientOffset:o||null,sourceClientOffset:c||null,isSourcePublic:!!i}}}}function Cb(e,t,r){Fe(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Fe(r.getSource(n),"Expected sourceIds to be registered.")})}function Ab(e){Fe(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Rb(e){Fe(J2(e),"Item must be an object.")}function Ob(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Fb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Db(e){for(var t=1;t{const l=bb(a,s,i,n),u={type:Vu,payload:{dropResult:Db({},r,l)}};e.dispatch(u)})}}function Ib(e){Fe(e.isDragging(),"Cannot call drop while not dragging."),Fe(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function bb(e,t,r,n){const i=r.getTarget(e);let o=i?i.drop(n,e):void 0;return kb(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function kb(e){Fe(typeof e>"u"||J2(e),"Drop result must either be an object or undefined.")}function $b(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Nb(e){return function(){const r=e.getMonitor(),n=e.getRegistry();Mb(r);const i=r.getSourceId();return i!=null&&(n.getSource(i,!0).endDrag(r,i),n.unpinSource()),{type:Wu}}}function Mb(e){Fe(e.isDragging(),"Cannot call endDrag while not dragging.")}function p0(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Lb(e){return function(r,{clientOffset:n}={}){Bb(r);const i=r.slice(0),o=e.getMonitor(),a=e.getRegistry(),s=o.getItemType();return Hb(i,a,s),Ub(i,o,a),Vb(i,o,a),{type:Hu,payload:{targetIds:i,clientOffset:n||null}}}}function Bb(e){Fe(Array.isArray(e),"Expected targetIds to be an array.")}function Ub(e,t,r){Fe(t.isDragging(),"Cannot call hover while not dragging."),Fe(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n=0;n--){const i=e[n],o=t.getTargetType(i);p0(o,r)||e.splice(n,1)}}function Vb(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function Wb(e){return function(){if(e.getMonitor().isDragging())return{type:fh}}}function zb(e){return{beginDrag:Tb(e),publishDragSource:Wb(e),hover:Lb(e),drop:Pb(e),endDrag:Nb(e)}}class Gb{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function n(o){return(...a)=>{const s=o.apply(t,a);typeof s<"u"&&r(s)}}const i=zb(this);return Object.keys(i).reduce((o,a)=>{const s=i[a];return o[a]=n(s),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function jb(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ey(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xb(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:ey(jb(t,n),r)}function Kb(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:ey(t,r)}const Sa=[],dh=[];Sa.__IS_NONE__=!0;dh.__IS_ALL__=!0;function Yb(e,t){return e===Sa?!1:e===dh||typeof t>"u"?!0:Sb(t,e).length>0}class qb{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Fe(typeof t=="function","listener must be a function."),Fe(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const o=()=>{const a=this.store.getState(),s=a.stateId;try{s===i||s===i+1&&!Yb(a.dirtyHandlerIds,n)||t()}finally{i=s}};return this.store.subscribe(o)}subscribeToOffsetChange(t){Fe(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const i=this.store.getState().dragOffset;i!==r&&(r=i,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Fe(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Fe(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),i=this.getItemType();return p0(n,i)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Fe(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),i=this.getItemType();return n!==i?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const i=this.registry.getTargetType(t),o=this.getItemType();if(o&&!p0(i,o))return!1;const a=this.getTargetIds();if(!a.length)return!1;const s=a.indexOf(t);return n?s===a.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Xb(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Kb(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const E1=typeof global<"u"?global:self,ty=E1.MutationObserver||E1.WebKitMutationObserver;function ry(e){return function(){const r=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(r),clearInterval(n),e()}}}function Qb(e){let t=1;const r=new ty(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const Zb=typeof ty=="function"?Qb:ry;class Jb{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.indexthis.capacity){for(let n=0,i=t.length-this.index;n{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Zb(this.flush),this.requestErrorThrow=ry(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class e8{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class t8{create(t){const r=this.freeTasks,n=r.length?r.pop():new e8(this.onError,i=>r[r.length]=i);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const ny=new Jb,r8=new t8(ny.registerPendingError);function n8(e){ny.enqueueTask(r8.create(e))}const hh="dnd-core/ADD_SOURCE",ph="dnd-core/ADD_TARGET",gh="dnd-core/REMOVE_SOURCE",zu="dnd-core/REMOVE_TARGET";function i8(e){return{type:hh,payload:{sourceId:e}}}function o8(e){return{type:ph,payload:{targetId:e}}}function a8(e){return{type:gh,payload:{sourceId:e}}}function s8(e){return{type:zu,payload:{targetId:e}}}function l8(e){Fe(typeof e.canDrag=="function","Expected canDrag to be a function."),Fe(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Fe(typeof e.endDrag=="function","Expected endDrag to be a function.")}function u8(e){Fe(typeof e.canDrop=="function","Expected canDrop to be a function."),Fe(typeof e.hover=="function","Expected hover to be a function."),Fe(typeof e.drop=="function","Expected beginDrag to be a function.")}function g0(e,t){if(t&&Array.isArray(e)){e.forEach(r=>g0(r,!1));return}Fe(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var ar;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(ar||(ar={}));let c8=0;function f8(){return c8++}function d8(e){const t=f8().toString();switch(e){case ar.SOURCE:return`S${t}`;case ar.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function S1(e){switch(e[0]){case"S":return ar.SOURCE;case"T":return ar.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function _1(e,t){const r=e.entries();let n=!1;do{const{done:i,value:[,o]}=r.next();if(o===t)return!0;n=!!i}while(!n);return!1}class h8{addSource(t,r){g0(t),l8(r);const n=this.addHandler(ar.SOURCE,t,r);return this.store.dispatch(i8(n)),n}addTarget(t,r){g0(t,!0),u8(r);const n=this.addHandler(ar.TARGET,t,r);return this.store.dispatch(o8(n)),n}containsHandler(t){return _1(this.dragSources,t)||_1(this.dropTargets,t)}getSource(t,r=!1){return Fe(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Fe(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Fe(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Fe(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return S1(t)===ar.SOURCE}isTargetId(t){return S1(t)===ar.TARGET}removeSource(t){Fe(this.getSource(t),"Expected an existing source."),this.store.dispatch(a8(t)),n8(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Fe(this.getTarget(t),"Expected an existing target."),this.store.dispatch(s8(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Fe(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Fe(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const i=d8(t);return this.types.set(i,r),t===ar.SOURCE?this.dragSources.set(i,n):t===ar.TARGET&&this.dropTargets.set(i,n),i}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const p8=(e,t)=>e===t;function g8(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function m8(e,t,r=p8){if(e.length!==t.length)return!1;for(let n=0;n0||!m8(r,n)))return Sa;const a=n[n.length-1],s=r[r.length-1];return a!==s&&(a&&i.push(a),s&&i.push(s)),i}function x8(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w8(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function I8(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}let C1=0;const ul=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var b8=x.memo(function(t){var{children:r}=t,n=P8(t,["children"]);const[i,o]=k8(n);return x.useEffect(()=>{if(o){const a=iy();return++C1,()=>{--C1===0&&(a[ul]=null)}}},[]),X(Q2.Provider,{value:i,children:r})});function k8(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=$8(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function $8(e,t=iy(),r,n){const i=t;return i[ul]||(i[ul]={dragDropManager:F8(e,t,r,n)}),i[ul]}function iy(){return typeof global<"u"?global:window}var N8=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r};const M8=Ka(N8),ci=typeof window<"u"?x.useLayoutEffect:x.useEffect;function L8(e,t,r){const[n,i]=x.useState(()=>t(e)),o=x.useCallback(()=>{const a=t(e);M8(n,a)||(i(a),r&&r())},[n,e,r]);return ci(o),[n,o]}function B8(e,t,r){const[n,i]=L8(e,t,r);return ci(function(){const a=e.getHandlerId();if(a!=null)return e.subscribeToStateChange(i,{handlerIds:[a]})},[e,i]),n}function oy(e,t,r){return B8(t,e||(()=>({})),()=>r.reconnect())}function ay(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),x.useMemo(()=>typeof e=="function"?e():e,r)}function U8(e){return x.useMemo(()=>e.hooks.dragSource(),[e])}function H8(e){return x.useMemo(()=>e.hooks.dragPreview(),[e])}let jc=!1,Xc=!1;class V8{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Fe(!jc,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return jc=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{jc=!1}}isDragging(){if(!this.sourceId)return!1;Fe(!Xc,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Xc=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Xc=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Kc=!1;class W8{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Fe(!Kc,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Kc=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Kc=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function z8(e,t,r){const n=r.getRegistry(),i=n.addTarget(e,t);return[i,()=>n.removeTarget(i)]}function G8(e,t,r){const n=r.getRegistry(),i=n.addSource(e,t);return[i,()=>n.removeSource(i)]}function m0(e,t,r,n){let i=r?r.call(n,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l, or turn it into a drag source or a drop target itself.`)}function X8(e){return(t=null,r=null)=>{if(!x.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return j8(n),K8(n,r?o=>e(o,r):e)}}function sy(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const i=X8(n);t[r]=()=>i}}),t}function A1(e,t){typeof e=="function"?e(t):e.current=t}function K8(e,t){const r=e.ref;return Fe(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?x.cloneElement(e,{ref:n=>{A1(r,n),A1(t,n)}}):x.cloneElement(e,{ref:t})}class Y8{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,n=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!m0(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!m0(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=sy({dragSource:(r,n)=>{this.clearDragSource(),this.dragSourceOptions=n||null,v0(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,n)=>{this.clearDragPreview(),this.dragPreviewOptions=n||null,v0(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class q8{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!m0(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=sy({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,v0(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Io(){const{dragDropManager:e}=x.useContext(Q2);return Fe(e!=null,"Expected drag drop context"),e}function Q8(e,t){const r=Io(),n=x.useMemo(()=>new Y8(r.getBackend()),[r]);return ci(()=>(n.dragSourceOptions=e||null,n.reconnect(),()=>n.disconnectDragSource()),[n,e]),ci(()=>(n.dragPreviewOptions=t||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,t]),n}function Z8(){const e=Io();return x.useMemo(()=>new V8(e),[e])}class J8{beginDrag(){const t=this.spec,r=this.monitor;let n=null;return typeof t.item=="object"?n=t.item:typeof t.item=="function"?n=t.item(r):n={},n??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const n=this.spec,i=this.monitor,{isDragging:o}=n;return o?o(i):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,n=this.connector,{end:i}=t;i&&i(r.getItem(),r),n.reconnect()}constructor(t,r,n){this.spec=t,this.monitor=r,this.connector=n}}function ek(e,t,r){const n=x.useMemo(()=>new J8(e,t,r),[t,r]);return x.useEffect(()=>{n.spec=e},[e]),n}function tk(e){return x.useMemo(()=>{const t=e.type;return Fe(t!=null,"spec.type must be defined"),t},[e])}function rk(e,t,r){const n=Io(),i=ek(e,t,r),o=tk(e);ci(function(){if(o!=null){const[s,l]=G8(o,i,n);return t.receiveHandlerId(s),r.receiveHandlerId(s),l}},[n,t,r,i,o])}function nk(e,t){const r=ay(e,t);Fe(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const n=Z8(),i=Q8(r.options,r.previewOptions);return rk(r,n,i),[oy(r.collect,n,i),U8(i),H8(i)]}function ik(e){return x.useMemo(()=>e.hooks.dropTarget(),[e])}function ok(e){const t=Io(),r=x.useMemo(()=>new q8(t.getBackend()),[t]);return ci(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function ak(){const e=Io();return x.useMemo(()=>new W8(e),[e])}function sk(e){const{accept:t}=e;return x.useMemo(()=>(Fe(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class lk{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function uk(e,t){const r=x.useMemo(()=>new lk(e,t),[t]);return x.useEffect(()=>{r.spec=e},[e]),r}function ck(e,t,r){const n=Io(),i=uk(e,t),o=sk(e);ci(function(){const[s,l]=z8(o,i,n);return t.receiveHandlerId(s),r.receiveHandlerId(s),l},[n,t,i,r,o.map(a=>a.toString()).join("|")])}function fk(e,t){const r=ay(e,t),n=ak(),i=ok(r.options);return ck(r,n,i),[oy(r.collect,n,i),ik(i)]}const ly=new RegExp("^([0-9]+)(\\s)([kKmMbBtT])$"),_a=new RegExp("^\\d{4}$"),dk=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}|\\d{4}-\\d{2}-\\d{2}$");function hk({column:e,table:t,numberOfColumns:r}){function n(f){if(!f)return null;const d=new Date(f),h=d.toISOString().split("T")[0],m=d.toTimeString().split(" ")[0];return`${h} ${m}`}const i=t.getPreFilteredRowModel().flatRows.map(f=>f.original[e.id]),o=i.every(f=>typeof f=="string"||f===null),a=i.every(f=>typeof f=="number"||ly.test(f)||f===null||f===""),s=i.some(f=>typeof f=="string"&&f.includes(" ")),l=e.getFilterValue();let u="date";const c=i.every(f=>{const d=f==null?void 0:f.toString().replace(/[^0-9]/g,"").trim();return dk.test(f==null?void 0:f.toString())&&(u="datetime-local"),_a.test(f==null?void 0:f.toString())&&(u="number"),(d==null?void 0:d.length)>=4&&(Yl(e.id)||e.id.toLowerCase()==="index"&&!s)});return c&&u==="number"?Ce("div",{className:"flex gap-2 h-6",children:[X("input",{type:u,value:(l==null?void 0:l[0])??"",onChange:f=>{e.setFilterValue(d=>[`${f.target.value}`,`${d==null?void 0:d[1]}`])},min:i.reduce((f,d)=>Math.min(f,parseInt(d,10)),1/0),max:i.reduce((f,d)=>Math.max(f,parseInt(d,10)),-1/0),placeholder:"Start year",className:"_input",title:"Start year"}),X("input",{type:u,value:(l==null?void 0:l[1])??"",onChange:f=>{e.setFilterValue(d=>[`${d==null?void 0:d[0]}`,`${f.target.value}`])},min:i.reduce((f,d)=>Math.min(f,parseInt(d,10)),1/0),max:i.reduce((f,d)=>Math.max(f,parseInt(d,10)),-1/0),placeholder:"End year",className:"_input",title:"End year"})]}):c&&u!=="number"?Ce("div",{className:"flex gap-2 h-6",children:[X("input",{type:u,value:n(l==null?void 0:l[0])??"",onChange:f=>{const d=new Date(f.target.value).getTime();e.setFilterValue(h=>[d,h==null?void 0:h[1]])},placeholder:"Start date",className:"_input",title:"Start date"}),X("input",{type:u,value:n(l==null?void 0:l[1])??"",onChange:f=>{const d=new Date(f.target.value).getTime();e.setFilterValue(h=>[h==null?void 0:h[0],d])},placeholder:"End date",className:"_input",title:"End date"})]}):a?Ce("div",{className:"flex gap-0.5 h-6",children:[X("input",{type:"number",value:(l==null?void 0:l[0])??"",onChange:f=>e.setFilterValue(d=>[f.target.value,d==null?void 0:d[1]]),placeholder:"Min",className:"_input p-0.5",title:"Min"}),X("input",{type:"number",value:(l==null?void 0:l[1])??"",onChange:f=>e.setFilterValue(d=>[d==null?void 0:d[0],f.target.value]),placeholder:"Max",className:"_input p-0.5",title:"Max"})]}):o?X("div",{className:"h-6",children:X("input",{type:"text",value:l??"",onChange:f=>e.setFilterValue(f.target.value),placeholder:"Search...",className:"_input",title:"Search"})}):X("div",{className:"h-6"})}const pk=(e,t,r)=>(r.splice(r.indexOf(t),0,r.splice(r.indexOf(e),1)[0]),[...r]),gk=({header:e,table:t,advanced:r,idx:n,lockFirstColumn:i,setLockFirstColumn:o})=>{const{getState:a,setColumnOrder:s}=t,{columnOrder:l}=a(),{column:u}=e,[,c]=fk({accept:"column",drop:p=>{const g=pk(p.id,u.id,l);s(g)}}),[{isDragging:f},d,h]=nk({collect:p=>({isDragging:p.isDragging()}),item:()=>u,type:"column"}),m=()=>X("div",{ref:h,className:"flex gap-1 flex-col",children:e.isPlaceholder?null:Ce(q1,{children:[Ce("div",{className:"font-bold uppercase text-grey-700 dark:text-white tracking-widest flex gap-2 whitespace-nowrap justify-between",children:[Ce("div",{onClick:u.getToggleSortingHandler(),className:kt("flex gap-1",{"cursor-pointer select-none":u.getCanSort()}),children:[Kf(u.columnDef.header,e.getContext()),u.getCanSort()&&Ce("div",{className:"flex flex-col gap-0.5 items-center justify-center",children:[X("button",{className:kt({"text-[#669DCB]":u.getIsSorted()==="asc","text-grey-600":u.getIsSorted()!=="asc"}),children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"4",fill:"none",viewBox:"0 0 11 5",children:X("path",{fill:"currentColor",d:"M10.333 5l-5-5-5 5"})})}),X("button",{className:kt({"text-[#669DCB]":e.column.getIsSorted()==="desc","text-grey-600":e.column.getIsSorted()!=="desc"}),children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"4",fill:"none",viewBox:"0 0 11 5",children:X("path",{fill:"currentColor",d:"M.333 0l5 5 5-5"})})})]})]}),r&&u.id!=="select"&&X("button",{ref:d,className:"text-grey-600 hover:text-grey-800 dark:hover:text-white",children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"11",fill:"none",viewBox:"0 0 17 16",children:X("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M3.667 6l-2 2 2 2M6.333 3.333l2-2 2 2M10.333 12.667l-2 2-2-2M13 6l2 2-2 2M1.667 8H15M8.333 1.333v13.334"})})})]}),r&&u.getCanFilter()?X("div",{children:X(hk,{column:u,table:t,numberOfColumns:(l==null?void 0:l.length)??0})}):null]})});return Ce("th",{className:kt("h-[70px] p-4 sticky",{"left-0 z-50 bg-white dark:bg-grey-900":n===0&&i}),colSpan:e.colSpan,style:{width:e.getSize()+10,opacity:f?.5:1},ref:c,children:[n===0?Ce(hb,{children:[X(pb,{asChild:!0,children:m()}),X(gb,{children:X(mb,{className:"bg-white text-black dark:text-white dark:bg-grey-900 border border-grey-200 dark:border-grey-800 rounded-md shadow-lg p-2 z-50 text-xs",children:X("div",{className:"flex flex-col gap-2",children:Ce("button",{onClick:()=>{o(!i)},className:"hover:bg-grey-300 dark:hover:bg-grey-800 rounded-md p-2",children:[i?"Unlock":"Lock"," first column"]})})})})]}):m(),X("button",{className:"resizer bg-grey-300/20 dark:hover:bg-white absolute top-0 right-0 w-0.5 h-full",onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler()})]})};function mk({open:e,close:t}){const r=window.download_path||"~/OpenBBUserData/exports";return Ce(jv,{open:e,onOpenChange:t,children:[Ce("div",{id:"loading",className:"saving",children:[X("div",{id:"loading_text",className:"loading_text"}),X("div",{id:"loader",className:"loader"})]}),X(Xv,{onClick:t,className:"_modal-overlay"}),Ce(Kv,{className:"_modal",children:[X(Wf,{children:X(ql,{})}),X(Wf,{className:"_modal-close",onClick:t,style:{float:"right",marginTop:20},children:X(ql,{className:"w-6 h-6"})}),X(Yv,{className:"_modal-title",children:"Success"}),Ce("div",{id:"popup_title",className:"popup_content",style:{padding:"0px 2px 2px 5px",marginTop:5},children:[X("div",{style:{display:"flex",flexDirection:"column",gap:0,fontSize:14},children:X("div",{children:Ce("label",{htmlFor:"title_text",children:[X("b",{children:window.title})," has been downloaded to",X("br",{}),X("br",{}),X("a",{style:{color:"#FFDD00",marginTop:15},href:`${r}`,onClick:n=>{n.preventDefault(),window.pywry.open_file(r)},children:r})]})})}),X("div",{style:{float:"right",marginTop:20},children:X("button",{className:"_btn",style:{padding:"8px 16px",width:"100%"},onClick:t,children:"Close"})})]})]})]})}function vk({columns:e,data:t,type:r,setType:n,downloadFinished:i}){const o=()=>{switch(r){case"csv":Qg("csv",e,t,i);break;case"xlsx":Qg("xlsx",e,t,i);break;case"png":sP("table",i);break}};return Ce("div",{className:"flex gap-2 items-center",children:[X(Xi,{labelType:"row",value:r,onChange:a=>{n(a)},label:"Type",placeholder:"Select type",groups:[{label:"Type",items:w0.map(a=>({label:a,value:a}))}]}),X("button",{onClick:o,className:"_btn",children:"Export"})]})}const uy="DropdownMenu",[xk,a$]=sn(uy,[Lu]),Ri=Lu(),[wk,cy]=xk(uy),yk=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=Ri(t),u=x.useRef(null),[c=!1,f]=go({prop:i,defaultProp:o,onChange:a});return x.createElement(wk,{scope:t,triggerId:Kr(),triggerRef:u,contentId:Kr(),open:c,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(d=>!d),[f]),modal:s},x.createElement(G2,ge({},l,{open:c,onOpenChange:f,dir:n,modal:s}),r))},Ek="DropdownMenuTrigger",Sk=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,o=cy(Ek,r),a=Ri(r);return x.createElement(j2,ge({asChild:!0},a),x.createElement(Ie.button,ge({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n},i,{ref:xd(t,o.triggerRef),onPointerDown:Se(e.onPointerDown,s=>{!n&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Se(e.onKeyDown,s=>{n||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})))}),_k=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Ri(t);return x.createElement(X2,ge({},n,r))},Tk="DropdownMenuContent",Ck=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=cy(Tk,r),o=Ri(r),a=x.useRef(!1);return x.createElement(K2,ge({id:i.contentId,"aria-labelledby":i.triggerId},o,n,{ref:t,onCloseAutoFocus:Se(e.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Se(e.onInteractOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Ak=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return x.createElement(rb,ge({},i,n,{ref:t}))}),Rk=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return x.createElement(nb,ge({},i,n,{ref:t}))}),Ok=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return x.createElement(ib,ge({},i,n,{ref:t}))}),Fk=yk,R1=Sk,Dk=_k,Pk=Ck,Ik=Ak,bk=Rk,Yc=Ok;function kk(e,t){x.useEffect(()=>{const r=n=>{!e.current||e.current.contains(n.target)||t(n)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}function O1({label:e,table:t,onlyIconTrigger:r=!1}){const[n,i]=x.useState(!1),o=x.useRef(null);kk(o,()=>i(!1)),x.useEffect(()=>{const s=l=>{l.key==="Escape"&&i(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[]);function a(){t.resetColumnFilters(),i(!1)}return Ce(Fk,{open:n,children:[r?X(R1,{title:"Filter columns",onClick:()=>i(!n),children:X("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-7 h-7",children:X("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"})})}):Ce(Ik,{className:"flex flex-row items-center gap-2",children:[X(bk,{className:"whitespace-nowrap",children:e}),Ce(R1,{onClick:()=>i(!n),className:"bg-white text-black dark:bg-grey-900 dark:text-white whitespace-nowrap h-[36px] border-[1.5px] border-grey-700 rounded p-3 inline-flex items-center justify-center leading-none gap-[5px] shadow-[0_2px_10px] shadow-black/10 focus:shadow-[0_0_0_2px] focus:shadow-black data-[placeholder]:text-white outline-none","aria-label":e,children:[X("span",{children:"Filter columns"}),X(s0,{className:kt({"transform rotate-180 duration-200 transition":n})})]})]}),X(Dk,{children:Ce(Pk,{sideOffset:10,ref:o,className:"z-50 bg-white/80 dark:bg-grey-900/80 backdrop-filter backdrop-blur flex flex-col gap-4 overflow-auto border-[1.5px] border-grey-700 rounded p-3 max-h-[500px] text-black dark:text-white",children:[X(Yc,{children:X("button",{className:"_btn w-full",onClick:a,children:"Clear Filters"})}),X(Yc,{children:Ce("label",{className:"flex items-center gap-2",children:[X("input",{type:"checkbox",checked:t.getIsAllColumnsVisible(),onChange:t.getToggleAllColumnsVisibilityHandler()}),"Toggle All"]})}),t.getAllLeafColumns().filter(s=>s.id!=="select").map(s=>X(Yc,{children:Ce("label",{className:"flex items-center gap-2",children:[X("input",{type:"checkbox",checked:s.getIsVisible(),onChange:s.getToggleVisibilityHandler()}),s.id]})},s.id))]})})]})}function fy(e){return typeof e!="number"?typeof e=="string"&&e.includes("All")?e:x0:e<1?x0:e}function $k({table:e,currentPage:t,setCurrentPage:r}){const n=e.getFilteredRowModel().rows.length||0;return Ce("div",{className:"hidden md:flex items-center gap-3",children:[X(Xi,{value:t,onChange:i=>{const o=fy(i);r(o),o.toString().includes("All")?e.setPageSize(n):e.setPageSize(o)},labelType:"row",label:"Rows per page",placeholder:"Select rows per page",groups:[{label:"Rows per page",items:[10,20,30,40,50,`All (${n})`].map(i=>({label:`${i}`,value:i}))}]}),Ce("span",{className:"flex items-center gap-1",children:[X("strong",{children:e.getState().pagination.pageIndex+1}),"of",X("strong",{children:e.getPageCount()})]}),Ce("div",{className:"hidden mdl:block",children:[X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanPreviousPage(),"dark:text-white":e.getCanPreviousPage()}),onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:"<<"}),X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanPreviousPage(),"dark:text-white":e.getCanPreviousPage()}),onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:"<"}),X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanNextPage(),"dark:text-white":e.getCanNextPage()}),onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:">"}),X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanNextPage(),"dark:text-white":e.getCanNextPage()}),onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:">>"})]})]})}const Nk=new Date,Mk=50,x0=30;function Lk(e,t){try{const r=e.hasOwnProperty("index")?"index":e.hasOwnProperty("Index")?"Index":null,n=r?e[r]:null,i=e[t],o=typeof i,a=i==null?void 0:i.toString().replace(/[^0-9]/g,""),s=(a==null?void 0:a.length)>=4&&(Yl(t)||t.toLowerCase()==="index"||n&&typeof n=="string"&&(n.toLowerCase().includes("date")||n.toLowerCase().includes("day")||n.toLowerCase().includes("time")||n.toLowerCase().includes("timestamp")||n.toLowerCase().includes("year")||n.toLowerCase().includes("month")||n.toLowerCase().includes("week")||n.toLowerCase().includes("hour")||n.toLowerCase().includes("minute")));if(o==="string"&&i.startsWith("http")||!s)return(i==null?void 0:i.toString().length)??0;if(s&&!isNaN(new Date(i).getTime())&&!_a.test(i==null?void 0:i.toString())){if(typeof i=="string")return(i==null?void 0:i.toString().length)??0;try{const u=new Date(i);let c="";return u.getUTCHours()===0&&u.getUTCMinutes()===0&&u.getUTCSeconds()===0&&u.getMilliseconds()===0?c=u.toISOString().split("T")[0]:(c=u.toISOString(),c=`${c.split("T")[0]} ${c.split("T")[1].split(".")[0]}`),(c==null?void 0:c.toString().length)??0}catch{return(i==null?void 0:i.toString().length)??0}}return(i==null?void 0:i.toString().length)??0}catch{return 0}}const w0=["csv","xlsx","png"];function Bk({data:e,columns:t,title:r,initialTheme:n,cmd:i=""}){const[o,a]=qo("exportType",w0[0]),[s,l]=x.useState(!1),[u,c]=JC(n),[f,d]=x.useState(u==="dark"),h=W=>{c(u),d(W)},[m,p]=qo("rowsPerPage",x0,fy),[g,v]=qo("advanced",!1),[w,y]=qo("colors",!1),[E,b]=x.useState([]),[k,_]=x.useState(""),[C,A]=qo("fontSize","1"),[L,B]=x.useState(!1),U=t.reduce((W,Q,le)=>(W[Q]=le{const ie=Math.max(...W.map($e=>Lk($e,Q)),le!=null&&le.length?(le==null?void 0:le.length)+8:0);return Math.min(180,ie*5)},ae=x.useMemo(()=>[...t.map((W,Q)=>({accessorKey:W,accessorFn:le=>{const me=le.hasOwnProperty("index")?"index":le.hasOwnProperty("Index")?"Index":t[0],_e=me?le[me]:null,ie=le[W],$e=(ie==null?void 0:ie.toString().replace(/[^0-9]/g,""))??"",Pe=($e==null?void 0:$e.length)>=4&&(Yl(W)||W.toLowerCase()==="index"||_e&&typeof _e=="string"&&(_e.toLowerCase().includes("date")||_e.toLowerCase().includes("time")||_e.toLowerCase().includes("timestamp")||_e.toLowerCase().includes("year")||_e.toLowerCase().includes("month")||_e.toLowerCase().includes("week")||_e.toLowerCase().includes("hour")||_e.toLowerCase().includes("minute")));return Pe&&_a.test(ie==null?void 0:ie.toString())?ie:Pe?typeof ie=="number"?ie:new Date(ie).getTime():ie},id:W,header:W,size:ee(e,W,W),footer:W,cell:({row:le})=>{var Bt;const me=le.original.hasOwnProperty("index")?"index":le.original.hasOwnProperty("Index")?"Index":t[0],_e=me?le.original[me]:null,ie=le.original[W],$e=typeof ie,Pe=(ie==null?void 0:ie.toString().replace(/[^0-9]/g,""))??"",ve=(Pe==null?void 0:Pe.length)>=4&&(Yl(W)||W.toLowerCase()==="index"||_e&&typeof _e=="string"&&(_e.toLowerCase().includes("date")||_e.toLowerCase().includes("time")||_e.toLowerCase().includes("timestamp")||_e.toLowerCase().includes("year")));if($e==="string"&&ie.startsWith("http"))return X("a",{className:"_hyper-link",href:ie,target:"_blank",rel:"noreferrer",children:(ie==null?void 0:ie.length)>25?`${ie.substring(0,25)}...`:ie});if(ve&&_a.test(ie==null?void 0:ie.toString()))return X("p",{children:ie});if(ve&&!isNaN(new Date(ie).getTime())&&!_a.test(ie==null?void 0:ie.toString())){if(typeof ie=="string"){const Ne=ie.split("T")[0],Ze=(Bt=ie.split("T")[1])==null?void 0:Bt.split(".")[0];return Ze==="00:00:00"?X("p",{children:Ne}):Ce("p",{children:[Ne," ",Ze]})}try{const Ne=new Date(ie);let Ze="";return Ne.getUTCHours()===0&&Ne.getUTCMinutes()===0&&Ne.getUTCSeconds()===0&&Ne.getMilliseconds()===0?Ze=Ne.toISOString().split("T")[0]:(Ze=Ne.toISOString(),Ze=`${Ze.split("T")[0]} ${Ze.split("T")[1].split(".")[0]}`),X("p",{children:Ze})}catch{return X("p",{children:ie})}}if($e==="number"||ly.test(ie==null?void 0:ie.toString())){let Ne=tP(ie,W);const Ze=Number(t0(ie));if(typeof _e=="string"&&n2(_e)){Ne=Number(t0(ie));const us=Ne<2?4:2;Ne=Ne.toLocaleString("en-US",{maximumFractionDigits:us,minimumFractionDigits:2})}return X("p",{className:kt("whitespace-nowrap",{"text-black dark:text-white":!w,"text-[#16A34A]":Ze>0&&w,"text-[#F87171]":Ze<0&&w,"text-[#404040]":Ze===0&&w}),title:r2(ie).toString()??"",children:Ze!==0?Ze>0?`${Ne}`:`${Ne}`:Ne})}else if($e==="string")return X("div",{dangerouslySetInnerHTML:{__html:ZC(ie)}});return X("p",{children:ie})}}))],[g,w]),[he,Te]=x.useState(!1),[oe,ye]=x.useState(ae.map(W=>W.id)),te=()=>ye(t.map(W=>W.id)),O=x.useMemo(()=>{const W=oe.map(le=>le),Q=ae.map(le=>le.id);return!rP(W,Q)},[oe,ae]),M=aC({data:e,columns:ae,getCoreRowModel:YT(),getSortedRowModel:eC(),getFilteredRowModel:JT(),getPaginationRowModel:rC(),columnResizeMode:"onChange",onColumnVisibilityChange:G,onColumnOrderChange:ye,onSortingChange:b,onGlobalFilterChange:_,globalFilterFn:nP,state:{sorting:E,globalFilter:k,columnOrder:oe,columnVisibility:H},initialState:{pagination:{pageIndex:0,pageSize:typeof m=="string"?m.includes("All")?e==null?void 0:e.length:parseInt(m):m}}}),N=x.useRef(null),{rows:F}=M.getRowModel(),V=M.getVisibleFlatColumns(),[Y,J]=x.useState(!1);return x.useEffect(()=>{s&&(l(!1),J(!0))},[s]),Ce(q1,{children:[X(f5,{toast:{id:"max-columns",title:"Max 12 columns are visible by default",description:"You can change this by clicking on advanced and then top right 'Filter' button",status:"info"},open:L,setOpen:B}),X(mk,{open:Y,close:()=>J(!1)}),Ce("div",{ref:N,className:kt("overflow-x-hidden h-screen"),children:[Ce("div",{className:"relative p-4",id:"table",children:[X("div",{className:"absolute -inset-0.5 bg-gradient-to-r rounded-md blur-md from-[#072e49]/30 via-[#0d345f]/30 to-[#0d3362]/30"}),Ce("div",{className:"border border-grey-500/60 dark:border-grey-200/60 bg-white dark:bg-grey-900 rounded overflow-hidden relative z-20",children:[Ce("div",{className:"_header relative gap-4 py-2 text-center text-xs flex items-center justify-between px-4 text-white",style:{fontSize:`${Number(C)*90}%`},children:[X("div",{className:"w-1/3",children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"40",fill:"none",viewBox:"0 0 64 40",children:X("path",{fill:"#fff",d:"M61.283 3.965H33.608v27.757h25.699V19.826H37.561v-3.965H63.26V3.965h-1.977zM39.538 23.792h15.815v3.965H37.561v-3.965h1.977zM59.306 9.913v1.983H37.561V7.931h21.745v1.982zM33.606 0h-3.954v3.965H33.606V0zM25.7 3.966H0V15.86h25.7v3.965H3.953v11.896h25.7V3.966h-3.955zm0 21.808v1.983H7.907v-3.965h17.791v1.982zm0-15.86v1.982H3.953V7.931h21.745v1.982zM37.039 35.693v2.952l-.246-.246-.245-.245-.245-.247-.245-.246-.246-.246-.245-.245-.245-.247-.247-.246-.245-.246-.245-.246-.245-.246-.246-.246h-.49v3.936h.49v-3.198l.246.246.245.246.245.246.245.246.246.246.246.246.245.247.246.245.245.246.245.247.245.246.246.245.245.246h.245v-3.936h-.49zM44.938 37.17h-.491v-1.477h-2.944v3.937h3.93v-2.46h-.495zm-2.944-.246v-.739h1.962v.984h-1.962v-.245zm2.944.984v1.23h-2.944V37.66h2.944v.247zM52.835 37.17h-.49v-1.477h-2.946v3.937h3.925v-2.46h-.489zm-2.944-.246v-.739h1.963v.984h-1.965l.002-.245zm2.944.984v1.23H49.89V37.66h2.946v.247zM29.174 35.693H25.739v3.936H29.663v-.491H26.229v-.984h2.943v-.493H26.229v-1.476h3.434v-.492h-.489zM13.37 35.693H9.934v3.937h3.925v-3.937h-.49zm0 .738v2.709h-2.945v-2.955h2.943l.001.246zM21.276 35.693h-3.435v3.937h.491v-1.476h3.434v-2.461h-.49zm0 .738v1.23h-2.944v-1.476h2.944v.246z"})})}),X("p",{className:"font-bold w-1/3 flex flex-col gap-0.5 items-center",children:r}),Ce("p",{className:"w-1/3 text-right text-xs",children:[new Intl.DateTimeFormat("en-GB",{dateStyle:"full",timeStyle:"long"}).format(Nk).replace(/:\d\d /," "),X("br",{}),X("span",{className:"text-grey-400",children:i})]})]}),X("div",{className:"overflow-auto max-h-[calc(100vh-170px)] smh:max-h-[calc(100vh-95px)]",children:Ce("table",{className:"text-sm relative",children:[X("thead",{className:"sticky top-0 bg-white dark:bg-grey-900",style:{fontSize:`${Number(C)*75}%`},children:M.getHeaderGroups().map((W,Q)=>X("tr",{children:W.headers.map((le,me)=>X(gk,{setLockFirstColumn:Te,lockFirstColumn:he,idx:me,advanced:g,header:le,table:M},le.id))},W.id))}),X("tbody",{children:M.getRowModel().rows.map((W,Q)=>X("tr",{className:"!h-[64px] border-b border-grey-400",style:{fontSize:`${Number(C)*100}%`},children:W.getVisibleCells().map((le,me)=>X("td",{className:kt("whitespace-normal p-4 text-black dark:text-white",{"bg-white dark:bg-grey-850":Q%2===0,"bg-grey-100 dark:bg-[#202020]":Q%2===1,"sticky left-0 z-10":me===0&&he}),style:{width:le.column.getSize()},children:Kf(le.column.columnDef.cell,le.getContext())},le.id))},W.id))}),(F==null?void 0:F.length)>30&&(V==null?void 0:V.length)>4&&X("tfoot",{children:M.getFooterGroups().map(W=>X("tr",{children:W.headers.map(Q=>X("th",{colSpan:Q.colSpan,className:"text-grey-500 bg-grey-100 dark:bg-grey-850 font-normal text-left text-sm h-10 p-4",style:{width:Q.getSize(),fontSize:`${Number(C)*100}%`},children:Q.isPlaceholder?null:Kf(Q.column.columnDef.footer,Q.getContext())},Q.id))},W.id))})]})})]})]}),Ce("div",{className:"smh:hidden flex max-h-[68px] overflow-x-auto bg-white/70 dark:bg-grey-900/70 backdrop-filter backdrop-blur z-20 bottom-0 left-0 w-full gap-10 justify-between py-4 px-4 text-sm",children:[Ce("div",{className:"flex items-center gap-10",children:[Ce(jv,{children:[X(pT,{className:"_btn",children:"Settings"}),Ce(gT,{children:[X(Xv,{className:"_modal-overlay"}),Ce(Kv,{className:"_modal",children:[X(Wf,{className:"absolute top-[40px] right-[46px] text-grey-200 hover:text-white rounded-[4px] focus:outline focus:outline-2 focus:outline-grey-500",children:X(ql,{className:"w-6 h-6"})}),X(Yv,{className:"uppercase font-bold tracking-widest",children:"Settings"}),Ce("div",{className:"grid grid-cols-2 gap-2 mt-10 text-sm",children:[O&&X("button",{onClick:()=>te(),className:"_btn h-9",children:"Reset Order"}),X(Xi,{labelType:"row",value:f?"light":"dark",onChange:W=>{h(W!=="dark")},label:"Theme",placeholder:"Select theme",groups:[{label:"Theme",items:[{label:"Dark",value:"dark"},{label:"Light",value:"light"}]}]}),X(Xi,{labelType:"row",value:o,onChange:W=>{a(W)},label:"Export type",placeholder:"Select export type",groups:[{label:"Export type",items:w0.map(W=>({label:W,value:W}))}]}),X(Xi,{labelType:"row",value:C,onChange:A,label:"Font size",placeholder:"Select font size",groups:[{label:"Font size",items:[{label:"50%",value:"0.5"},{label:"75%",value:"0.75"},{label:"100%",value:"1"},{label:"125%",value:"1.25"},{label:"150%",value:"1.5"},{label:"175%",value:"1.75"},{label:"200%",value:"2"}]}]}),X(O1,{table:M,label:"Filter"}),X("div",{className:"flex gap-2 items-center",children:X(Xi,{labelType:"row",value:g?"advanced":"simple",onChange:W=>{v(W==="advanced")},label:"Type",placeholder:"Select type",groups:[{label:"Type",items:[{label:"Simple",value:"simple"},{label:"Advanced",value:"advanced"}]}]})}),Ce("div",{className:"flex gap-2 items-center",children:[X("label",{htmlFor:"colors",children:"Colors"}),X("input",{id:"colors",type:"checkbox",checked:w,onChange:()=>y(!w)})]})]})]})]})]}),X(O1,{onlyIconTrigger:!0,table:M,label:""})]}),X($k,{currentPage:m,setCurrentPage:p,table:M}),X(vk,{setType:a,type:o,columns:t,data:e,downloadFinished:l})]})]})]})}function dy(e){let t=null;return()=>(t==null&&(t=e()),t)}function Uk(e,t){return e.filter(r=>r!==t)}function Hk(e,t){const r=new Set,n=o=>r.add(o);e.forEach(n),t.forEach(n);const i=[];return r.forEach(o=>i.push(o)),i}class Vk{enter(t){const r=this.entered.length,n=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=Hk(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Uk(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Wk{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(n=>{const i=this.config.exposeProperties[n];i!=null&&(r[n]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const hy="__NATIVE_FILE__",py="__NATIVE_URL__",gy="__NATIVE_TEXT__",my="__NATIVE_HTML__",F1=Object.freeze(Object.defineProperty({__proto__:null,FILE:hy,HTML:my,TEXT:gy,URL:py},Symbol.toStringTag,{value:"Module"}));function qc(e,t,r){const n=t.reduce((i,o)=>i||e.getData(o),"");return n??r}const y0={[hy]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[my]:{exposeProperties:{html:(e,t)=>qc(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[py]:{exposeProperties:{urls:(e,t)=>qc(e,t,"").split(` +`),c=new Blob([u],{type:"text/csv;charset=utf-8;"}),f=`${window.title}.csv`;try{const d=await i2({filename:f});let h="csv";d!==null&&(h=d.name.split(".").pop()),await ji(`Saving ${h.toUpperCase()}`),r0(async function(){o2(c,f,d).then(async function(){await new Promise(m=>setTimeout(m,1500)),await ji("",!0),d||n(!0)})},2)()}catch(d){console.error(d)}return}const s=Uc.book_new(),l=Uc.aoa_to_sheet(a);Uc.book_append_sheet(s,l,"Sheet1"),await ji("Saving XLSX"),r0(async function(){await new Promise(u=>setTimeout(u,1500)),V6(s,`${window.title}.xlsx`),await ji("",!0),n==null||n(!0)},2)()}async function sP(e,t){const r=document.getElementById(e),n=`${window.title}.png`;try{const i=await i2({filename:n,is_image:!0});let o="png";i!==null&&(o=i.name.split(".").pop()),await ji(`Saving ${o.toUpperCase()}`),r0(async function(){c4.toBlob(r).then(function(a){o2(a,n,i).then(async function(){await new Promise(s=>setTimeout(s,1500)),await ji("",!0),i||t(!0)})})},2)()}catch(i){console.error(i)}}const r0=(e,t)=>{let r;return function(){const n=this,i=arguments;clearTimeout(r),r=setTimeout(()=>e.apply(n,i),t)}},ql=({title:e,titleId:t,...r})=>X("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,...r,children:X("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});function Zg(e,[t,r]){return Math.min(r,Math.max(t,e))}function Ou(e){const t=e+"CollectionProvider",[r,n]=sn(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:m,children:p}=h,g=ir.useRef(null),v=ir.useRef(new Map).current;return ir.createElement(i,{scope:m,itemMap:v,collectionRef:g},p)},s=e+"CollectionSlot",l=ir.forwardRef((h,m)=>{const{scope:p,children:g}=h,v=o(s,p),w=We(m,v.collectionRef);return ir.createElement(oi,{ref:w},g)}),u=e+"CollectionItemSlot",c="data-radix-collection-item",f=ir.forwardRef((h,m)=>{const{scope:p,children:g,...v}=h,w=ir.useRef(null),y=We(m,w),E=o(u,p);return ir.useEffect(()=>(E.itemMap.set(w,{ref:w,...v}),()=>void E.itemMap.delete(w))),ir.createElement(oi,{[c]:"",ref:y},g)});function d(h){const m=o(e+"CollectionConsumer",h);return ir.useCallback(()=>{const g=m.collectionRef.current;if(!g)return[];const v=Array.from(g.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((E,b)=>v.indexOf(E.ref.current)-v.indexOf(b.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:f},d,n]}const lP=x.createContext(void 0);function Zd(e){const t=x.useContext(lP);return e||t||"ltr"}function Do(e){return e.split("-")[1]}function Jd(e){return e==="y"?"height":"width"}function Zr(e){return e.split("-")[0]}function _i(e){return["top","bottom"].includes(Zr(e))?"x":"y"}function Jg(e,t,r){let{reference:n,floating:i}=e;const o=n.x+n.width/2-i.width/2,a=n.y+n.height/2-i.height/2,s=_i(t),l=Jd(s),u=n[l]/2-i[l]/2,c=s==="x";let f;switch(Zr(t)){case"top":f={x:o,y:n.y-i.height};break;case"bottom":f={x:o,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:a};break;case"left":f={x:n.x-i.width,y:a};break;default:f={x:n.x,y:n.y}}switch(Do(t)){case"start":f[s]-=u*(r&&c?-1:1);break;case"end":f[s]+=u*(r&&c?-1:1)}return f}const uP=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=Jg(u,n,l),d=n,h={},m=0;for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:a,elements:s}=t,{element:l,padding:u=0}=on(e,t)||{};if(l==null)return{};const c=a2(u),f={x:r,y:n},d=_i(i),h=Jd(d),m=await a.getDimensions(l),p=d==="y",g=p?"top":"left",v=p?"bottom":"right",w=p?"clientHeight":"clientWidth",y=o.reference[h]+o.reference[d]-f[d]-o.floating[h],E=f[d]-o.reference[d],b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let k=b?b[w]:0;k&&await(a.isElement==null?void 0:a.isElement(b))||(k=s.floating[w]||o.floating[h]);const _=y/2-E/2,C=k/2-m[h]/2-1,A=ja(c[g],C),L=ja(c[v],C),B=A,U=k-m[h]-L,H=k/2-m[h]/2+_,G=n0(B,H,U),ee=Do(i)!=null&&H!=G&&o.reference[h]/2-(He.concat(t,t+"-start",t+"-end"),[]);const cP={left:"right",right:"left",bottom:"top",top:"bottom"};function Zl(e){return e.replace(/left|right|bottom|top/g,t=>cP[t])}function fP(e,t,r){r===void 0&&(r=!1);const n=Do(e),i=_i(e),o=Jd(i);let a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Zl(a)),{main:a,cross:Zl(a)}}const dP={start:"end",end:"start"};function Hc(e){return e.replace(/start|end/g,t=>dP[t])}const hP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r;const{placement:n,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...p}=on(e,t),g=Zr(n),v=Zr(a)===a,w=await(s.isRTL==null?void 0:s.isRTL(l.floating)),y=f||(v||!m?[Zl(a)]:function(B){const U=Zl(B);return[Hc(B),U,Hc(U)]}(a));f||h==="none"||y.push(...function(B,U,H,G){const ee=Do(B);let ae=function(he,Te,oe){const ye=["left","right"],te=["right","left"],O=["top","bottom"],M=["bottom","top"];switch(he){case"top":case"bottom":return oe?Te?te:ye:Te?ye:te;case"left":case"right":return Te?O:M;default:return[]}}(Zr(B),H==="start",G);return ee&&(ae=ae.map(he=>he+"-"+ee),U&&(ae=ae.concat(ae.map(Hc)))),ae}(a,m,h,w));const E=[a,...y],b=await Ga(t,p),k=[];let _=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(b[g]),c){const{main:B,cross:U}=fP(n,o,w);k.push(b[B],b[U])}if(_=[..._,{placement:n,overflows:k}],!k.every(B=>B<=0)){var C,A;const B=(((C=i.flip)==null?void 0:C.index)||0)+1,U=E[B];if(U)return{data:{index:B,overflows:_},reset:{placement:U}};let H=(A=_.filter(G=>G.overflows[0]<=0).sort((G,ee)=>G.overflows[1]-ee.overflows[1])[0])==null?void 0:A.placement;if(!H)switch(d){case"bestFit":{var L;const G=(L=_.map(ee=>[ee.placement,ee.overflows.filter(ae=>ae>0).reduce((ae,he)=>ae+he,0)]).sort((ee,ae)=>ee[1]-ae[1])[0])==null?void 0:L[0];G&&(H=G);break}case"initialPlacement":H=a}if(n!==H)return{reset:{placement:H}}}return{}}}};function t1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function r1(e){return s2.some(t=>e[t]>=0)}const pP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=on(e,t);switch(n){case"referenceHidden":{const o=t1(await Ga(t,{...i,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:r1(o)}}}case"escaped":{const o=t1(await Ga(t,{...i,altBoundary:!0}),r.floating);return{data:{escapedOffsets:o,escaped:r1(o)}}}default:return{}}}}},gP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,c=await(l.isRTL==null?void 0:l.isRTL(u.floating)),f=Zr(s),d=Do(s),h=_i(s)==="x",m=["left","top"].includes(f)?-1:1,p=c&&h?-1:1,g=on(a,o);let{mainAxis:v,crossAxis:w,alignmentAxis:y}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return d&&typeof y=="number"&&(w=d==="end"?-1*y:y),h?{x:w*p,y:v*m}:{x:v*m,y:w*p}}(t,e);return{x:r+i.x,y:n+i.y,data:i}}}};function l2(e){return e==="x"?"y":"x"}const mP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:v,y:w}=g;return{x:v,y:w}}},...l}=on(e,t),u={x:r,y:n},c=await Ga(t,l),f=_i(Zr(i)),d=l2(f);let h=u[f],m=u[d];if(o){const g=f==="y"?"bottom":"right";h=n0(h+c[f==="y"?"top":"left"],h,h-c[g])}if(a){const g=d==="y"?"bottom":"right";m=n0(m+c[d==="y"?"top":"left"],m,m-c[g])}const p=s.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-r,y:p.y-n}}}}},vP=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=on(e,t),c={x:r,y:n},f=_i(i),d=l2(f);let h=c[f],m=c[d];const p=on(s,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const y=f==="y"?"height":"width",E=o.reference[f]-o.floating[y]+g.mainAxis,b=o.reference[f]+o.reference[y]-g.mainAxis;hb&&(h=b)}if(u){var v,w;const y=f==="y"?"width":"height",E=["top","left"].includes(Zr(i)),b=o.reference[d]-o.floating[y]+(E&&((v=a.offset)==null?void 0:v[d])||0)+(E?0:g.crossAxis),k=o.reference[d]+o.reference[y]+(E?0:((w=a.offset)==null?void 0:w[d])||0)-(E?g.crossAxis:0);mk&&(m=k)}return{[f]:h,[d]:m}}}},xP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:i,elements:o}=t,{apply:a=()=>{},...s}=on(e,t),l=await Ga(t,s),u=Zr(r),c=Do(r),f=_i(r)==="x",{width:d,height:h}=n.floating;let m,p;u==="top"||u==="bottom"?(m=u,p=c===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(p=u,m=c==="end"?"top":"bottom");const g=h-l[m],v=d-l[p],w=!t.middlewareData.shift;let y=g,E=v;if(f){const k=d-l.left-l.right;E=c||w?ja(v,k):k}else{const k=h-l.top-l.bottom;y=c||w?ja(g,k):k}if(w&&!c){const k=jn(l.left,0),_=jn(l.right,0),C=jn(l.top,0),A=jn(l.bottom,0);f?E=d-2*(k!==0||_!==0?k+_:jn(l.left,l.right)):y=h-2*(C!==0||A!==0?C+A:jn(l.top,l.bottom))}await a({...t,availableWidth:E,availableHeight:y});const b=await i.getDimensions(o.floating);return d!==b.width||h!==b.height?{reset:{rects:!0}}:{}}}};function Zt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Nr(e){return Zt(e).getComputedStyle(e)}function u2(e){return e instanceof Zt(e).Node}function Ln(e){return u2(e)?(e.nodeName||"").toLowerCase():"#document"}function Cr(e){return e instanceof HTMLElement||e instanceof Zt(e).HTMLElement}function n1(e){return typeof ShadowRoot<"u"&&(e instanceof Zt(e).ShadowRoot||e instanceof ShadowRoot)}function Xa(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Nr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function wP(e){return["table","td","th"].includes(Ln(e))}function i0(e){const t=eh(),r=Nr(e);return r.transform!=="none"||r.perspective!=="none"||!!r.containerType&&r.containerType!=="normal"||!t&&!!r.backdropFilter&&r.backdropFilter!=="none"||!t&&!!r.filter&&r.filter!=="none"||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function eh(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Fu(e){return["html","body","#document"].includes(Ln(e))}const o0=Math.min,lo=Math.max,Jl=Math.round,Ws=Math.floor,Bn=e=>({x:e,y:e});function c2(e){const t=Nr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=Cr(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=Jl(r)!==o||Jl(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function Jr(e){return e instanceof Element||e instanceof Zt(e).Element}function th(e){return Jr(e)?e:e.contextElement}function uo(e){const t=th(e);if(!Cr(t))return Bn(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=c2(t);let a=(o?Jl(r.width):r.width)/n,s=(o?Jl(r.height):r.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const yP=Bn(0);function f2(e){const t=Zt(e);return eh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:yP}function ui(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=th(e);let a=Bn(1);t&&(n?Jr(n)&&(a=uo(n)):a=uo(e));const s=function(d,h,m){return h===void 0&&(h=!1),!(!m||h&&m!==Zt(d))&&h}(o,r,n)?f2(o):Bn(0);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o){const d=Zt(o),h=n&&Jr(n)?Zt(n):n;let m=d.frameElement;for(;m&&n&&h!==d;){const p=uo(m),g=m.getBoundingClientRect(),v=getComputedStyle(m),w=g.left+(m.clientLeft+parseFloat(v.paddingLeft))*p.x,y=g.top+(m.clientTop+parseFloat(v.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,f*=p.y,l+=w,u+=y,m=Zt(m).frameElement}}return Ql({width:c,height:f,x:l,y:u})}function Du(e){return Jr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function en(e){var t;return(t=(u2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function d2(e){return ui(en(e)).left+Du(e).scrollLeft}function vo(e){if(Ln(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n1(e)&&e.host||en(e);return n1(t)?t.host:t}function h2(e){const t=vo(e);return Fu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cr(t)&&Xa(t)?t:h2(t)}function eu(e,t){var r;t===void 0&&(t=[]);const n=h2(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),o=Zt(n);return i?t.concat(o,o.visualViewport||[],Xa(n)?n:[]):t.concat(n,eu(n))}function i1(e,t,r){let n;if(t==="viewport")n=function(i,o){const a=Zt(i),s=en(i),l=a.visualViewport;let u=s.clientWidth,c=s.clientHeight,f=0,d=0;if(l){u=l.width,c=l.height;const h=eh();(!h||h&&o==="fixed")&&(f=l.offsetLeft,d=l.offsetTop)}return{width:u,height:c,x:f,y:d}}(e,r);else if(t==="document")n=function(i){const o=en(i),a=Du(i),s=i.ownerDocument.body,l=lo(o.scrollWidth,o.clientWidth,s.scrollWidth,s.clientWidth),u=lo(o.scrollHeight,o.clientHeight,s.scrollHeight,s.clientHeight);let c=-a.scrollLeft+d2(i);const f=-a.scrollTop;return Nr(s).direction==="rtl"&&(c+=lo(o.clientWidth,s.clientWidth)-l),{width:l,height:u,x:c,y:f}}(en(e));else if(Jr(t))n=function(i,o){const a=ui(i,!0,o==="fixed"),s=a.top+i.clientTop,l=a.left+i.clientLeft,u=Cr(i)?uo(i):Bn(1);return{width:i.clientWidth*u.x,height:i.clientHeight*u.y,x:l*u.x,y:s*u.y}}(t,r);else{const i=f2(e);n={...t,x:t.x-i.x,y:t.y-i.y}}return Ql(n)}function p2(e,t){const r=vo(e);return!(r===t||!Jr(r)||Fu(r))&&(Nr(r).position==="fixed"||p2(r,t))}function EP(e,t,r){const n=Cr(t),i=en(t),o=r==="fixed",a=ui(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Bn(0);if(n||!n&&!o)if((Ln(t)!=="body"||Xa(i))&&(s=Du(t)),Cr(t)){const u=ui(t,!0,o,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else i&&(l.x=d2(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function o1(e,t){return Cr(e)&&Nr(e).position!=="fixed"?t?t(e):e.offsetParent:null}function a1(e,t){const r=Zt(e);if(!Cr(e))return r;let n=o1(e,t);for(;n&&wP(n)&&Nr(n).position==="static";)n=o1(n,t);return n&&(Ln(n)==="html"||Ln(n)==="body"&&Nr(n).position==="static"&&!i0(n))?r:n||function(i){let o=vo(i);for(;Cr(o)&&!Fu(o);){if(i0(o))return o;o=vo(o)}return null}(e)||r}const SP={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:r,strategy:n}=e;const i=Cr(r),o=en(r);if(r===o)return t;let a={scrollLeft:0,scrollTop:0},s=Bn(1);const l=Bn(0);if((i||!i&&n!=="fixed")&&((Ln(r)!=="body"||Xa(o))&&(a=Du(r)),Cr(r))){const u=ui(r);s=uo(r),l.x=u.x+r.clientLeft,l.y=u.y+r.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:en,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[...r==="clippingAncestors"?function(l,u){const c=u.get(l);if(c)return c;let f=eu(l).filter(p=>Jr(p)&&Ln(p)!=="body"),d=null;const h=Nr(l).position==="fixed";let m=h?vo(l):l;for(;Jr(m)&&!Fu(m);){const p=Nr(m),g=i0(m);g||p.position!=="fixed"||(d=null),(h?!g&&!d:!g&&p.position==="static"&&d&&["absolute","fixed"].includes(d.position)||Xa(m)&&!g&&p2(l,m))?f=f.filter(v=>v!==m):d=p,m=vo(m)}return u.set(l,f),f}(t,this._c):[].concat(r),n],a=o[0],s=o.reduce((l,u)=>{const c=i1(t,u,i);return l.top=lo(c.top,l.top),l.right=o0(c.right,l.right),l.bottom=o0(c.bottom,l.bottom),l.left=lo(c.left,l.left),l},i1(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:a1,getElementRects:async function(e){let{reference:t,floating:r,strategy:n}=e;const i=this.getOffsetParent||a1,o=this.getDimensions;return{reference:EP(t,await i(r),n),floating:{x:0,y:0,...await o(r)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return c2(e)},getScale:uo,isElement:Jr,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function _P(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=th(e),c=i||o?[...u?eu(u):[],...eu(t)]:[];c.forEach(g=>{i&&g.addEventListener("scroll",r,{passive:!0}),o&&g.addEventListener("resize",r)});const f=u&&s?function(g,v){let w,y=null;const E=en(g);function b(){clearTimeout(w),y&&y.disconnect(),y=null}return function k(_,C){_===void 0&&(_=!1),C===void 0&&(C=1),b();const{left:A,top:L,width:B,height:U}=g.getBoundingClientRect();if(_||v(),!B||!U)return;const H={rootMargin:-Ws(L)+"px "+-Ws(E.clientWidth-(A+B))+"px "+-Ws(E.clientHeight-(L+U))+"px "+-Ws(A)+"px",threshold:lo(0,o0(1,C))||1};let G=!0;function ee(ae){const he=ae[0].intersectionRatio;if(he!==C){if(!G)return k();he?k(!1,he):w=setTimeout(()=>{k(!1,1e-7)},100)}G=!1}try{y=new IntersectionObserver(ee,{...H,root:E.ownerDocument})}catch{y=new IntersectionObserver(ee,H)}y.observe(g)}(!0),b}(u,r):null;let d,h=-1,m=null;a&&(m=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{m&&m.observe(t)})),r()}),u&&!l&&m.observe(u),m.observe(t));let p=l?ui(e):null;return l&&function g(){const v=ui(e);!p||v.x===p.x&&v.y===p.y&&v.width===p.width&&v.height===p.height||r(),p=v,d=requestAnimationFrame(g)}(),r(),()=>{c.forEach(g=>{i&&g.removeEventListener("scroll",r),o&&g.removeEventListener("resize",r)}),f&&f(),m&&m.disconnect(),m=null,l&&cancelAnimationFrame(d)}}const TP=(e,t,r)=>{const n=new Map,i={platform:SP,...r},o={...i.platform,_c:n};return uP(e,t,{...i,platform:o})},CP=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?e1({element:n.current,padding:i}).fn(r):{}:n?e1({element:n,padding:i}).fn(r):{}}}};var ll=typeof document<"u"?x.useLayoutEffect:x.useEffect;function tu(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 r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!tu(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!tu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function g2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s1(e,t){const r=g2(e);return Math.round(t*r)/r}function l1(e){const t=x.useRef(e);return ll(()=>{t.current=e}),t}function AP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,f]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=x.useState(n);tu(d,n)||h(n);const[m,p]=x.useState(null),[g,v]=x.useState(null),w=x.useCallback(ae=>{ae!=k.current&&(k.current=ae,p(ae))},[p]),y=x.useCallback(ae=>{ae!==_.current&&(_.current=ae,v(ae))},[v]),E=o||m,b=a||g,k=x.useRef(null),_=x.useRef(null),C=x.useRef(c),A=l1(l),L=l1(i),B=x.useCallback(()=>{if(!k.current||!_.current)return;const ae={placement:t,strategy:r,middleware:d};L.current&&(ae.platform=L.current),TP(k.current,_.current,ae).then(he=>{const Te={...he,isPositioned:!0};U.current&&!tu(C.current,Te)&&(C.current=Te,gi.flushSync(()=>{f(Te)}))})},[d,t,r,L]);ll(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(ae=>({...ae,isPositioned:!1})))},[u]);const U=x.useRef(!1);ll(()=>(U.current=!0,()=>{U.current=!1}),[]),ll(()=>{if(E&&(k.current=E),b&&(_.current=b),E&&b){if(A.current)return A.current(E,b,B);B()}},[E,b,B,A]);const H=x.useMemo(()=>({reference:k,floating:_,setReference:w,setFloating:y}),[w,y]),G=x.useMemo(()=>({reference:E,floating:b}),[E,b]),ee=x.useMemo(()=>{const ae={position:r,left:0,top:0};if(!G.floating)return ae;const he=s1(G.floating,c.x),Te=s1(G.floating,c.y);return s?{...ae,transform:"translate("+he+"px, "+Te+"px)",...g2(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:he,top:Te}},[r,s,G.floating,c.x,c.y]);return x.useMemo(()=>({...c,update:B,refs:H,elements:G,floatingStyles:ee}),[c,B,H,G,ee])}function RP(e){const[t,r]=x.useState(void 0);return Mt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=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;r({width:a,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}const m2="Popper",[v2,Pu]=sn(m2),[OP,x2]=v2(m2),FP=e=>{const{__scopePopper:t,children:r}=e,[n,i]=x.useState(null);return x.createElement(OP,{scope:t,anchor:n,onAnchorChange:i},r)},DP="PopperAnchor",PP=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=x2(DP,r),a=x.useRef(null),s=We(t,a);return x.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:x.createElement(Ie.div,ge({},i,{ref:s}))}),w2="PopperContent",[IP,r$]=v2(w2),bP=x.forwardRef((e,t)=>{var r,n,i,o,a,s,l,u;const{__scopePopper:c,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:m=0,arrowPadding:p=0,collisionBoundary:g=[],collisionPadding:v=0,sticky:w="partial",hideWhenDetached:y=!1,avoidCollisions:E=!0,onPlaced:b,...k}=e,_=x2(w2,c),[C,A]=x.useState(null),L=We(t,ie=>A(ie)),[B,U]=x.useState(null),H=RP(B),G=(r=H==null?void 0:H.width)!==null&&r!==void 0?r:0,ee=(n=H==null?void 0:H.height)!==null&&n!==void 0?n:0,ae=f+(h!=="center"?"-"+h:""),he=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},Te=Array.isArray(g)?g:[g],oe=Te.length>0,ye={padding:he,boundary:Te.filter(kP),altBoundary:oe},{refs:te,floatingStyles:O,placement:M,isPositioned:N,middlewareData:F}=AP({strategy:"fixed",placement:ae,whileElementsMounted:_P,elements:{reference:_.anchor},middleware:[gP({mainAxis:d+ee,alignmentAxis:m}),E&&mP({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?vP():void 0,...ye}),E&&hP({...ye}),xP({...ye,apply:({elements:ie,rects:$e,availableWidth:Pe,availableHeight:ve})=>{const{width:Pt,height:Bt}=$e.reference,Ne=ie.floating.style;Ne.setProperty("--radix-popper-available-width",`${Pe}px`),Ne.setProperty("--radix-popper-available-height",`${ve}px`),Ne.setProperty("--radix-popper-anchor-width",`${Pt}px`),Ne.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),B&&CP({element:B,padding:p}),$P({arrowWidth:G,arrowHeight:ee}),y&&pP({strategy:"referenceHidden"})]}),[V,Y]=y2(M),J=Dt(b);Mt(()=>{N&&(J==null||J())},[N,J]);const W=(i=F.arrow)===null||i===void 0?void 0:i.x,Q=(o=F.arrow)===null||o===void 0?void 0:o.y,le=((a=F.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[me,_e]=x.useState();return Mt(()=>{C&&_e(window.getComputedStyle(C).zIndex)},[C]),x.createElement("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:N?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(s=F.transformOrigin)===null||s===void 0?void 0:s.x,(l=F.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},x.createElement(IP,{scope:c,placedSide:V,onArrowChange:U,arrowX:W,arrowY:Q,shouldHideArrow:le},x.createElement(Ie.div,ge({"data-side":V,"data-align":Y},k,{ref:L,style:{...k.style,animation:N?void 0:"none",opacity:(u=F.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function kP(e){return e!==null}const $P=e=>({name:"transformOrigin",options:e,fn(t){var r,n,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,f=((r=u.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:e.arrowWidth,h=f?0:e.arrowHeight,[m,p]=y2(s),g={start:"0%",center:"50%",end:"100%"}[p],v=((n=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,w=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+h/2;let y="",E="";return m==="bottom"?(y=f?g:`${v}px`,E=`${-h}px`):m==="top"?(y=f?g:`${v}px`,E=`${l.floating.height+h}px`):m==="right"?(y=`${-h}px`,E=f?g:`${w}px`):m==="left"&&(y=`${l.floating.width+h}px`,E=f?g:`${w}px`),{data:{x:y,y:E}}}});function y2(e){const[t,r="center"]=e.split("-");return[t,r]}const E2=FP,S2=PP,_2=bP;function NP(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const rh=x.forwardRef((e,t)=>x.createElement(Ie.span,ge({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),MP=[" ","Enter","ArrowUp","ArrowDown"],LP=[" ","Enter"],Iu="Select",[bu,ku,BP]=Ou(Iu),[Po,n$]=sn(Iu,[BP,Pu]),nh=Pu(),[UP,Ti]=Po(Iu),[HP,VP]=Po(Iu),WP=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:u,name:c,autoComplete:f,disabled:d,required:h}=e,m=nh(t),[p,g]=x.useState(null),[v,w]=x.useState(null),[y,E]=x.useState(!1),b=Zd(u),[k=!1,_]=go({prop:n,defaultProp:i,onChange:o}),[C,A]=go({prop:a,defaultProp:s,onChange:l}),L=x.useRef(null),B=p?!!p.closest("form"):!0,[U,H]=x.useState(new Set),G=Array.from(U).map(ee=>ee.props.value).join(";");return x.createElement(E2,m,x.createElement(UP,{required:h,scope:t,trigger:p,onTriggerChange:g,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:y,onValueNodeHasChildrenChange:E,contentId:Kr(),value:C,onValueChange:A,open:k,onOpenChange:_,dir:b,triggerPointerDownPosRef:L,disabled:d},x.createElement(bu.Provider,{scope:t},x.createElement(HP,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(ee=>{H(ae=>new Set(ae).add(ee))},[]),onNativeOptionRemove:x.useCallback(ee=>{H(ae=>{const he=new Set(ae);return he.delete(ee),he})},[])},r)),B?x.createElement(R2,{key:G,"aria-hidden":!0,required:h,tabIndex:-1,name:c,autoComplete:f,value:C,onChange:ee=>A(ee.target.value),disabled:d},C===void 0?x.createElement("option",{value:""}):null,Array.from(U)):null))},zP="SelectTrigger",GP=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,o=nh(r),a=Ti(zP,r),s=a.disabled||n,l=We(t,a.onTriggerChange),u=ku(r),[c,f,d]=O2(m=>{const p=u().filter(w=>!w.disabled),g=p.find(w=>w.value===a.value),v=F2(p,m,g);v!==void 0&&a.onValueChange(v.value)}),h=()=>{s||(a.onOpenChange(!0),d())};return x.createElement(S2,ge({asChild:!0},o),x.createElement(Ie.button,ge({type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":a.value===void 0?"":void 0},i,{ref:l,onClick:Se(i.onClick,m=>{m.currentTarget.focus()}),onPointerDown:Se(i.onPointerDown,m=>{const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&(h(),a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:Se(i.onKeyDown,m=>{const p=c.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(p&&m.key===" ")&&MP.includes(m.key)&&(h(),m.preventDefault())})})))}),jP="SelectValue",XP=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:o,placeholder:a,...s}=e,l=Ti(jP,r),{onValueNodeHasChildrenChange:u}=l,c=o!==void 0,f=We(t,l.onValueNodeChange);return Mt(()=>{u(c)},[u,c]),x.createElement(Ie.span,ge({},s,{ref:f,style:{pointerEvents:"none"}}),l.value===void 0&&a!==void 0?a:o)}),KP=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return x.createElement(Ie.span,ge({"aria-hidden":!0},i,{ref:t}),n||"▼")}),YP=e=>x.createElement(vu,ge({asChild:!0},e)),xo="SelectContent",qP=x.forwardRef((e,t)=>{const r=Ti(xo,e.__scopeSelect),[n,i]=x.useState();if(Mt(()=>{i(new DocumentFragment)},[]),!r.open){const o=n;return o?gi.createPortal(x.createElement(T2,{scope:e.__scopeSelect},x.createElement(bu.Slot,{scope:e.__scopeSelect},x.createElement("div",null,e.children))),o):null}return x.createElement(QP,ge({},e,{ref:t}))}),Hr=10,[T2,Ci]=Po(xo),QP=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:g,...v}=e,w=Ti(xo,r),[y,E]=x.useState(null),[b,k]=x.useState(null),_=We(t,Y=>E(Y)),[C,A]=x.useState(null),[L,B]=x.useState(null),U=ku(r),[H,G]=x.useState(!1),ee=x.useRef(!1);x.useEffect(()=>{if(y)return _d(y)},[y]),Ed();const ae=x.useCallback(Y=>{const[J,...W]=U().map(me=>me.ref.current),[Q]=W.slice(-1),le=document.activeElement;for(const me of Y)if(me===le||(me==null||me.scrollIntoView({block:"nearest"}),me===J&&b&&(b.scrollTop=0),me===Q&&b&&(b.scrollTop=b.scrollHeight),me==null||me.focus(),document.activeElement!==le))return},[U,b]),he=x.useCallback(()=>ae([C,y]),[ae,C,y]);x.useEffect(()=>{H&&he()},[H,he]);const{onOpenChange:Te,triggerPointerDownPosRef:oe}=w;x.useEffect(()=>{if(y){let Y={x:0,y:0};const J=Q=>{var le,me,_e,ie;Y={x:Math.abs(Math.round(Q.pageX)-((le=(me=oe.current)===null||me===void 0?void 0:me.x)!==null&&le!==void 0?le:0)),y:Math.abs(Math.round(Q.pageY)-((_e=(ie=oe.current)===null||ie===void 0?void 0:ie.y)!==null&&_e!==void 0?_e:0))}},W=Q=>{Y.x<=10&&Y.y<=10?Q.preventDefault():y.contains(Q.target)||Te(!1),document.removeEventListener("pointermove",J),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",W,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",W,{capture:!0})}}},[y,Te,oe]),x.useEffect(()=>{const Y=()=>Te(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[Te]);const[ye,te]=O2(Y=>{const J=U().filter(le=>!le.disabled),W=J.find(le=>le.ref.current===document.activeElement),Q=F2(J,Y,W);Q&&setTimeout(()=>Q.ref.current.focus())}),O=x.useCallback((Y,J,W)=>{const Q=!ee.current&&!W;(w.value!==void 0&&w.value===J||Q)&&(A(Y),Q&&(ee.current=!0))},[w.value]),M=x.useCallback(()=>y==null?void 0:y.focus(),[y]),N=x.useCallback((Y,J,W)=>{const Q=!ee.current&&!W;(w.value!==void 0&&w.value===J||Q)&&B(Y)},[w.value]),F=n==="popper"?u1:ZP,V=F===u1?{side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:g}:{};return x.createElement(T2,{scope:r,content:y,viewport:b,onViewportChange:k,itemRefCallback:O,selectedItem:C,onItemLeave:M,itemTextRefCallback:N,focusSelectedItem:he,selectedItemText:L,position:n,isPositioned:H,searchRef:ye},x.createElement(Sd,{as:oi,allowPinchZoom:!0},x.createElement(yd,{asChild:!0,trapped:w.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Se(i,Y=>{var J;(J=w.trigger)===null||J===void 0||J.focus({preventScroll:!0}),Y.preventDefault()})},x.createElement(mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>w.onOpenChange(!1)},x.createElement(F,ge({role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Y=>Y.preventDefault()},v,V,{onPlaced:()=>G(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Se(v.onKeyDown,Y=>{const J=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!J&&Y.key.length===1&&te(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let Q=U().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(Q=Q.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const le=Y.target,me=Q.indexOf(le);Q=Q.slice(me+1)}setTimeout(()=>ae(Q)),Y.preventDefault()}})}))))))}),ZP=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,o=Ti(xo,r),a=Ci(xo,r),[s,l]=x.useState(null),[u,c]=x.useState(null),f=We(t,_=>c(_)),d=ku(r),h=x.useRef(!1),m=x.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:v,focusSelectedItem:w}=a,y=x.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&p&&g&&v){const _=o.trigger.getBoundingClientRect(),C=u.getBoundingClientRect(),A=o.valueNode.getBoundingClientRect(),L=v.getBoundingClientRect();if(o.dir!=="rtl"){const le=L.left-C.left,me=A.left-le,_e=_.left-me,ie=_.width+_e,$e=Math.max(ie,C.width),Pe=window.innerWidth-Hr,ve=Zg(me,[Hr,Pe-$e]);s.style.minWidth=ie+"px",s.style.left=ve+"px"}else{const le=C.right-L.right,me=window.innerWidth-A.right-le,_e=window.innerWidth-_.right-me,ie=_.width+_e,$e=Math.max(ie,C.width),Pe=window.innerWidth-Hr,ve=Zg(me,[Hr,Pe-$e]);s.style.minWidth=ie+"px",s.style.right=ve+"px"}const B=d(),U=window.innerHeight-Hr*2,H=p.scrollHeight,G=window.getComputedStyle(u),ee=parseInt(G.borderTopWidth,10),ae=parseInt(G.paddingTop,10),he=parseInt(G.borderBottomWidth,10),Te=parseInt(G.paddingBottom,10),oe=ee+ae+H+Te+he,ye=Math.min(g.offsetHeight*5,oe),te=window.getComputedStyle(p),O=parseInt(te.paddingTop,10),M=parseInt(te.paddingBottom,10),N=_.top+_.height/2-Hr,F=U-N,V=g.offsetHeight/2,Y=g.offsetTop+V,J=ee+ae+Y,W=oe-J;if(J<=N){const le=g===B[B.length-1].ref.current;s.style.bottom="0px";const me=u.clientHeight-p.offsetTop-p.offsetHeight,_e=Math.max(F,V+(le?M:0)+me+he),ie=J+_e;s.style.height=ie+"px"}else{const le=g===B[0].ref.current;s.style.top="0px";const _e=Math.max(N,ee+p.offsetTop+(le?O:0)+V)+W;s.style.height=_e+"px",p.scrollTop=J-N+p.offsetTop}s.style.margin=`${Hr}px 0`,s.style.minHeight=ye+"px",s.style.maxHeight=U+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[d,o.trigger,o.valueNode,s,u,p,g,v,o.dir,n]);Mt(()=>y(),[y]);const[E,b]=x.useState();Mt(()=>{u&&b(window.getComputedStyle(u).zIndex)},[u]);const k=x.useCallback(_=>{_&&m.current===!0&&(y(),w==null||w(),m.current=!1)},[y,w]);return x.createElement(JP,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:k},x.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E}},x.createElement(Ie.div,ge({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),u1=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Hr,...o}=e,a=nh(r);return x.createElement(_2,ge({},a,o,{ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[JP,ih]=Po(xo,{}),c1="SelectViewport",eI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Ci(c1,r),o=ih(c1,r),a=We(t,i.onViewportChange),s=x.useRef(0);return x.createElement(x.Fragment,null,x.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),x.createElement(bu.Slot,{scope:r},x.createElement(Ie.div,ge({"data-radix-select-viewport":"",role:"presentation"},n,{ref:a,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:Se(n.onScroll,l=>{const u=l.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&c){const d=Math.abs(s.current-u.scrollTop);if(d>0){const h=window.innerHeight-Hr*2,m=parseFloat(c.style.minHeight),p=parseFloat(c.style.height),g=Math.max(m,p);if(g0?y:0,c.style.justifyContent="flex-end")}}}s.current=u.scrollTop})}))))}),tI="SelectGroup",[rI,nI]=Po(tI),iI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Kr();return x.createElement(rI,{scope:r,id:i},x.createElement(Ie.div,ge({role:"group","aria-labelledby":i},n,{ref:t})))}),oI="SelectLabel",aI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=nI(oI,r);return x.createElement(Ie.div,ge({id:i.id},n,{ref:t}))}),a0="SelectItem",[sI,C2]=Po(a0),lI=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:o,...a}=e,s=Ti(a0,r),l=Ci(a0,r),u=s.value===n,[c,f]=x.useState(o??""),[d,h]=x.useState(!1),m=We(t,v=>{var w;return(w=l.itemRefCallback)===null||w===void 0?void 0:w.call(l,v,n,i)}),p=Kr(),g=()=>{i||(s.onValueChange(n),s.onOpenChange(!1))};return x.createElement(sI,{scope:r,value:n,disabled:i,textId:p,isSelected:u,onItemTextChange:x.useCallback(v=>{f(w=>{var y;return w||((y=v==null?void 0:v.textContent)!==null&&y!==void 0?y:"").trim()})},[])},x.createElement(bu.ItemSlot,{scope:r,value:n,disabled:i,textValue:c},x.createElement(Ie.div,ge({role:"option","aria-labelledby":p,"data-highlighted":d?"":void 0,"aria-selected":u&&d,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},a,{ref:m,onFocus:Se(a.onFocus,()=>h(!0)),onBlur:Se(a.onBlur,()=>h(!1)),onPointerUp:Se(a.onPointerUp,g),onPointerMove:Se(a.onPointerMove,v=>{if(i){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}else v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(a.onPointerLeave,v=>{if(v.currentTarget===document.activeElement){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}}),onKeyDown:Se(a.onKeyDown,v=>{var w;((w=l.searchRef)===null||w===void 0?void 0:w.current)!==""&&v.key===" "||(LP.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})}))))}),zs="SelectItemText",uI=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...o}=e,a=Ti(zs,r),s=Ci(zs,r),l=C2(zs,r),u=VP(zs,r),[c,f]=x.useState(null),d=We(t,v=>f(v),l.onItemTextChange,v=>{var w;return(w=s.itemTextRefCallback)===null||w===void 0?void 0:w.call(s,v,l.value,l.disabled)}),h=c==null?void 0:c.textContent,m=x.useMemo(()=>x.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},h),[l.disabled,l.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return Mt(()=>(p(m),()=>g(m)),[p,g,m]),x.createElement(x.Fragment,null,x.createElement(Ie.span,ge({id:l.textId},o,{ref:d})),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?gi.createPortal(o.children,a.valueNode):null)}),cI="SelectItemIndicator",fI=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return C2(cI,r).isSelected?x.createElement(Ie.span,ge({"aria-hidden":!0},n,{ref:t})):null}),f1="SelectScrollUpButton",dI=x.forwardRef((e,t)=>{const r=Ci(f1,e.__scopeSelect),n=ih(f1,e.__scopeSelect),[i,o]=x.useState(!1),a=We(t,n.onScrollButtonChange);return Mt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=l.scrollTop>0;o(c)};var s=u;const l=r.viewport;return u(),l.addEventListener("scroll",u),()=>l.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?x.createElement(A2,ge({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}})):null}),d1="SelectScrollDownButton",hI=x.forwardRef((e,t)=>{const r=Ci(d1,e.__scopeSelect),n=ih(d1,e.__scopeSelect),[i,o]=x.useState(!1),a=We(t,n.onScrollButtonChange);return Mt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?x.createElement(A2,ge({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}})):null}),A2=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,o=Ci("SelectScrollButton",r),a=x.useRef(null),s=ku(r),l=x.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return x.useEffect(()=>()=>l(),[l]),Mt(()=>{var u;const c=s().find(f=>f.ref.current===document.activeElement);c==null||(u=c.ref.current)===null||u===void 0||u.scrollIntoView({block:"nearest"})},[s]),x.createElement(Ie.div,ge({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Se(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:Se(i.onPointerMove,()=>{var u;(u=o.onItemLeave)===null||u===void 0||u.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:Se(i.onPointerLeave,()=>{l()})}))}),R2=x.forwardRef((e,t)=>{const{value:r,...n}=e,i=x.useRef(null),o=We(t,i),a=NP(r);return x.useEffect(()=>{const s=i.current,l=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==r&&c){const f=new Event("change",{bubbles:!0});c.call(s,r),s.dispatchEvent(f)}},[a,r]),x.createElement(rh,{asChild:!0},x.createElement("select",ge({},n,{ref:o,defaultValue:r})))});R2.displayName="BubbleSelect";function O2(e){const t=Dt(e),r=x.useRef(""),n=x.useRef(0),i=x.useCallback(a=>{const s=r.current+a;t(s),function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,o]}function F2(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=pI(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function pI(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const gI=WP,mI=GP,vI=XP,xI=KP,wI=YP,yI=qP,EI=eI,Vc=iI,h1=aI,SI=lI,_I=uI,TI=fI,CI=dI,AI=hI;function oh(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}var RI=["color"],OI=x.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,RI);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),FI=["color"],s0=x.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,FI);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),DI=["color"],PI=x.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,DI);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))});const Xi=({value:e,onChange:t,label:r="Select",placeholder:n="Select a fruit…",groups:i,labelType:o="col"})=>{const a=(i==null?void 0:i.length)===1;return Ce(gI,{value:e,onValueChange:t,children:[Ce(Vc,{className:kt("flex gap-1",{"flex-row items-center gap-2":o==="row","flex-col":o==="col"}),children:[X(h1,{className:"whitespace-nowrap",children:r}),Ce(mI,{className:"justify-between bg-white text-black dark:text-white dark:bg-grey-900 whitespace-nowrap h-[36px] border-[1.5px] border-grey-700 rounded p-3 inline-flex items-center leading-none gap-[5px] shadow-[0_2px_10px] shadow-black/10 focus:shadow-[0_0_0_2px] focus:shadow-black data-[placeholder]:text-white outline-none","aria-label":r,children:[X(vI,{placeholder:n}),X(xI,{children:X(s0,{})})]})]}),X(wI,{children:Ce(yI,{className:"z-50 bg-white/80 dark:bg-grey-900/80 backdrop-filter backdrop-blur overflow-hidden border-[1.5px] border-grey-700 rounded p-3 shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)]",children:[X(CI,{className:"flex items-center justify-center h-[25px] cursor-default dark:text-white text-black",children:X(PI,{})}),X(EI,{className:"p-[5px]",children:a?X(Vc,{children:i[0].items.map(s=>X(p1,{value:s.value,disabled:s.disabled,children:s.label}))}):i.map((s,l)=>Ce(Vc,{children:[X(h1,{className:"text-xs leading-[25px]",children:s.label}),s.items.map(u=>X(p1,{value:u.value,disabled:u.disabled,children:u.label},u.value))]},s.label))}),X(AI,{className:"flex items-center justify-center h-[25px] cursor-default dark:text-white text-black",children:X(s0,{})})]})})]})},p1=x.forwardRef(({children:e,className:t,...r},n)=>Ce(SI,{className:kt("text-[13px] leading-none rounded-[3px] flex items-center h-[25px] pr-[35px] pl-[25px] relative select-none data-[disabled]:text-grey-400 data-[disabled]:pointer-events-none data-[highlighted]:outline-none data-[highlighted]:bg-grey-600 data-[highlighted]:text-white text-black dark:text-white",t),...r,ref:n,children:[X(_I,{children:e}),X(TI,{className:"absolute left-0 w-[25px] inline-flex items-center justify-center",children:X(OI,{})})]})),D2="ToastProvider",[ah,II,bI]=Ou("Toast"),[P2,i$]=sn("Toast",[bI]),[kI,$u]=P2(D2),I2=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:a}=e,[s,l]=x.useState(null),[u,c]=x.useState(0),f=x.useRef(!1),d=x.useRef(!1);return x.createElement(ah.Provider,{scope:t},x.createElement(kI,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:o,toastCount:u,viewport:s,onViewportChange:l,onToastAdd:x.useCallback(()=>c(h=>h+1),[]),onToastRemove:x.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:d},a))};I2.propTypes={label(e){if(e.label&&typeof e.label=="string"&&!e.label.trim()){const t=`Invalid prop \`label\` supplied to \`${D2}\`. Expected non-empty \`string\`.`;return new Error(t)}return null}};const $I="ToastViewport",NI=["F8"],l0="toast.viewportPause",u0="toast.viewportResume",MI=x.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=NI,label:i="Notifications ({hotkey})",...o}=e,a=$u($I,r),s=II(r),l=x.useRef(null),u=x.useRef(null),c=x.useRef(null),f=x.useRef(null),d=We(t,f,a.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=a.toastCount>0;x.useEffect(()=>{const g=v=>{var w;n.every(E=>v[E]||v.code===E)&&((w=f.current)===null||w===void 0||w.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),x.useEffect(()=>{const g=l.current,v=f.current;if(m&&g&&v){const w=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent(l0);v.dispatchEvent(k),a.isClosePausedRef.current=!0}},y=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(u0);v.dispatchEvent(k),a.isClosePausedRef.current=!1}},E=k=>{!g.contains(k.relatedTarget)&&y()},b=()=>{g.contains(document.activeElement)||y()};return g.addEventListener("focusin",w),g.addEventListener("focusout",E),g.addEventListener("pointermove",w),g.addEventListener("pointerleave",b),window.addEventListener("blur",w),window.addEventListener("focus",y),()=>{g.removeEventListener("focusin",w),g.removeEventListener("focusout",E),g.removeEventListener("pointermove",w),g.removeEventListener("pointerleave",b),window.removeEventListener("blur",w),window.removeEventListener("focus",y)}}},[m,a.isClosePausedRef]);const p=x.useCallback(({tabbingDirection:g})=>{const w=s().map(y=>{const E=y.ref.current,b=[E,...e5(E)];return g==="forwards"?b:b.reverse()});return(g==="forwards"?w.reverse():w).flat()},[s]);return x.useEffect(()=>{const g=f.current;if(g){const v=w=>{const y=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!y){const C=document.activeElement,A=w.shiftKey;if(w.target===g&&A){var b;(b=u.current)===null||b===void 0||b.focus();return}const U=p({tabbingDirection:A?"backwards":"forwards"}),H=U.findIndex(G=>G===C);if(Wc(U.slice(H+1)))w.preventDefault();else{var k,_;A?(k=u.current)===null||k===void 0||k.focus():(_=c.current)===null||_===void 0||_.focus()}}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[s,p]),x.createElement(s_,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:m?void 0:"none"}},m&&x.createElement(g1,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});Wc(g)}}),x.createElement(ah.Slot,{scope:r},x.createElement(Ie.ol,ge({tabIndex:-1},o,{ref:d}))),m&&x.createElement(g1,{ref:c,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});Wc(g)}}))}),LI="ToastFocusProxy",g1=x.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,o=$u(LI,r);return x.createElement(rh,ge({"aria-hidden":!0,tabIndex:0},i,{ref:t,style:{position:"fixed"},onFocus:a=>{var s;const l=a.relatedTarget;!((s=o.viewport)!==null&&s!==void 0&&s.contains(l))&&n()}}))}),Nu="Toast",BI="toast.swipeStart",UI="toast.swipeMove",HI="toast.swipeCancel",VI="toast.swipeEnd",WI=x.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:o,...a}=e,[s=!0,l]=go({prop:n,defaultProp:i,onChange:o});return x.createElement(mi,{present:r||s},x.createElement(b2,ge({open:s},a,{ref:t,onClose:()=>l(!1),onPause:Dt(e.onPause),onResume:Dt(e.onResume),onSwipeStart:Se(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Se(e.onSwipeMove,u=>{const{x:c,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Se(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Se(e.onSwipeEnd,u=>{const{x:c,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})))}),[zI,GI]=P2(Nu,{onClose(){}}),b2=x.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...m}=e,p=$u(Nu,r),[g,v]=x.useState(null),w=We(t,G=>v(G)),y=x.useRef(null),E=x.useRef(null),b=i||p.duration,k=x.useRef(0),_=x.useRef(b),C=x.useRef(0),{onToastAdd:A,onToastRemove:L}=p,B=Dt(()=>{var G;(g==null?void 0:g.contains(document.activeElement))&&((G=p.viewport)===null||G===void 0||G.focus()),a()}),U=x.useCallback(G=>{!G||G===1/0||(window.clearTimeout(C.current),k.current=new Date().getTime(),C.current=window.setTimeout(B,G))},[B]);x.useEffect(()=>{const G=p.viewport;if(G){const ee=()=>{U(_.current),u==null||u()},ae=()=>{const he=new Date().getTime()-k.current;_.current=_.current-he,window.clearTimeout(C.current),l==null||l()};return G.addEventListener(l0,ae),G.addEventListener(u0,ee),()=>{G.removeEventListener(l0,ae),G.removeEventListener(u0,ee)}}},[p.viewport,b,l,u,U]),x.useEffect(()=>{o&&!p.isClosePausedRef.current&&U(b)},[o,b,p.isClosePausedRef,U]),x.useEffect(()=>(A(),()=>L()),[A,L]);const H=x.useMemo(()=>g?N2(g):null,[g]);return p.viewport?x.createElement(x.Fragment,null,H&&x.createElement(jI,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},H),x.createElement(zI,{scope:r,onClose:B},gi.createPortal(x.createElement(ah.ItemSlot,{scope:r},x.createElement(a_,{asChild:!0,onEscapeKeyDown:Se(s,()=>{p.isFocusedToastEscapeKeyDownRef.current||B(),p.isFocusedToastEscapeKeyDownRef.current=!1})},x.createElement(Ie.li,ge({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection},m,{ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Se(e.onKeyDown,G=>{G.key==="Escape"&&(s==null||s(G.nativeEvent),G.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:Se(e.onPointerDown,G=>{G.button===0&&(y.current={x:G.clientX,y:G.clientY})}),onPointerMove:Se(e.onPointerMove,G=>{if(!y.current)return;const ee=G.clientX-y.current.x,ae=G.clientY-y.current.y,he=!!E.current,Te=["left","right"].includes(p.swipeDirection),oe=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,ye=Te?oe(0,ee):0,te=Te?0:oe(0,ae),O=G.pointerType==="touch"?10:2,M={x:ye,y:te},N={originalEvent:G,delta:M};he?(E.current=M,Gs(UI,f,N,{discrete:!1})):m1(M,p.swipeDirection,O)?(E.current=M,Gs(BI,c,N,{discrete:!1}),G.target.setPointerCapture(G.pointerId)):(Math.abs(ee)>O||Math.abs(ae)>O)&&(y.current=null)}),onPointerUp:Se(e.onPointerUp,G=>{const ee=E.current,ae=G.target;if(ae.hasPointerCapture(G.pointerId)&&ae.releasePointerCapture(G.pointerId),E.current=null,y.current=null,ee){const he=G.currentTarget,Te={originalEvent:G,delta:ee};m1(ee,p.swipeDirection,p.swipeThreshold)?Gs(VI,h,Te,{discrete:!0}):Gs(HI,d,Te,{discrete:!0}),he.addEventListener("click",oe=>oe.preventDefault(),{once:!0})}})})))),p.viewport))):null});b2.propTypes={type(e){if(e.type&&!["foreground","background"].includes(e.type)){const t=`Invalid prop \`type\` supplied to \`${Nu}\`. Expected \`foreground | background\`.`;return new Error(t)}return null}};const jI=e=>{const{__scopeToast:t,children:r,...n}=e,i=$u(Nu,t),[o,a]=x.useState(!1),[s,l]=x.useState(!1);return ZI(()=>a(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),s?null:x.createElement(vu,{asChild:!0},x.createElement(rh,n,o&&x.createElement(x.Fragment,null,i.label," ",r)))},XI=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return x.createElement(Ie.div,ge({},n,{ref:t}))}),KI=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return x.createElement(Ie.div,ge({},n,{ref:t}))}),YI="ToastAction",qI=x.forwardRef((e,t)=>{const{altText:r,...n}=e;return r?x.createElement($2,{altText:r,asChild:!0},x.createElement(k2,ge({},n,{ref:t}))):null});qI.propTypes={altText(e){return e.altText?null:new Error(`Missing prop \`altText\` expected on \`${YI}\``)}};const QI="ToastClose",k2=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=GI(QI,r);return x.createElement($2,{asChild:!0},x.createElement(Ie.button,ge({type:"button"},n,{ref:t,onClick:Se(e.onClick,i.onClose)})))}),$2=x.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...i}=e;return x.createElement(Ie.div,ge({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:t}))});function N2(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),JI(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...N2(n))}}),t}function Gs(e,t,r,{discrete:n}){const i=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?wd(i,o):i.dispatchEvent(o)}const m1=(e,t,r=0)=>{const n=Math.abs(e.x),i=Math.abs(e.y),o=n>i;return t==="left"||t==="right"?o&&n>r:!o&&i>r};function ZI(e=()=>{}){const t=Dt(e);Mt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function JI(e){return e.nodeType===e.ELEMENT_NODE}function e5(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Wc(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}const t5=I2,r5=MI,n5=WI,i5=XI,o5=KI,a5=k2,s5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 18 18",width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M9 16.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15ZM11.25 6.75l-4.5 4.5M6.75 6.75l4.5 4.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),l5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM12 16v-4M12 8h.01",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),u5=({title:e,titleId:t,...r})=>Ce("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M16.5 8.31V9a7.5 7.5 0 1 1-4.447-6.855",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),X("path",{d:"M16.5 3 9 10.508l-2.25-2.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),c5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 18 18",width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?X("title",{id:t,children:e}):null,X("path",{d:"M7.718 2.895 1.366 13.5a1.5 1.5 0 0 0 1.282 2.25h12.705a1.5 1.5 0 0 0 1.283-2.25L10.283 2.895a1.5 1.5 0 0 0-2.565 0v0ZM9 6.75v3M9 12.75h.008",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),f5=({toast:e,open:t,setOpen:r})=>Ce(t5,{children:[Ce(n5,{open:t,onOpenChange:n=>{e.preventClose||r(n)},className:kt("z-50 fixed bottom-4 md:left-1/2 md:-translate-x-[50%] inset-x-4 w-auto shadow-lg md:max-w-[658px] duration-300","radix-state-open:animate-fade-in","radix-state-closed:animate-toast-hide","radix-swipe-end:animate-toast-swipe-out","translate-x-radix-toast-swipe-move-x","radix-swipe-cancel:translate-x-0 radix-swipe-cancel:duration-200 radix-swipe-cancel:ease-[ease]","px-[40px] md:px-[58px] py-6 flex flex-col border rounded-[4px]",{"bg-green-100 text-green-600 border-green-600":e.status==="success","bg-red-200 text-red-600 border-red-600":e.status==="error","bg-blue-100 text-blue-700 border-blue-600":e.status==="info","bg-orange-200 text-orange-600 border-orange-600":e.status==="warning"},{"h-[72px]":!e.description}),children:[e.status==="success"?X(u5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):e.status==="warning"?X(c5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):e.status==="error"?X(s5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):X(l5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}),X(i5,{className:"text-grey-900 font-bold text-sm",children:e.title}),e.description&&X(o5,{className:"mt-2 text-[10px] md:text-xs text-grey-800",children:e.description}),X(a5,{className:"absolute top-7 right-5 md:right-7",children:X(ql,{className:"w-4 h-4 text-grey-900"})})]}),X(r5,{})]}),zc="rovingFocusGroup.onEntryFocus",d5={bubbles:!1,cancelable:!0},sh="RovingFocusGroup",[c0,M2,h5]=Ou(sh),[p5,L2]=sn(sh,[h5]),[g5,m5]=p5(sh),v5=x.forwardRef((e,t)=>x.createElement(c0.Provider,{scope:e.__scopeRovingFocusGroup},x.createElement(c0.Slot,{scope:e.__scopeRovingFocusGroup},x.createElement(x5,ge({},e,{ref:t}))))),x5=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...c}=e,f=x.useRef(null),d=We(t,f),h=Zd(o),[m=null,p]=go({prop:a,defaultProp:s,onChange:l}),[g,v]=x.useState(!1),w=Dt(u),y=M2(r),E=x.useRef(!1),[b,k]=x.useState(0);return x.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(zc,w),()=>_.removeEventListener(zc,w)},[w]),x.createElement(g5,{scope:r,orientation:n,dir:h,loop:i,currentTabStopId:m,onItemFocus:x.useCallback(_=>p(_),[p]),onItemShiftTab:x.useCallback(()=>v(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(_=>_+1),[]),onFocusableItemRemove:x.useCallback(()=>k(_=>_-1),[])},x.createElement(Ie.div,ge({tabIndex:g||b===0?-1:0,"data-orientation":n},c,{ref:d,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{E.current=!0}),onFocus:Se(e.onFocus,_=>{const C=!E.current;if(_.target===_.currentTarget&&C&&!g){const A=new CustomEvent(zc,d5);if(_.currentTarget.dispatchEvent(A),!A.defaultPrevented){const L=y().filter(ee=>ee.focusable),B=L.find(ee=>ee.active),U=L.find(ee=>ee.id===m),G=[B,U,...L].filter(Boolean).map(ee=>ee.ref.current);B2(G)}}E.current=!1}),onBlur:Se(e.onBlur,()=>v(!1))})))}),w5="RovingFocusGroupItem",y5=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,...a}=e,s=Kr(),l=o||s,u=m5(w5,r),c=u.currentTabStopId===l,f=M2(r),{onFocusableItemAdd:d,onFocusableItemRemove:h}=u;return x.useEffect(()=>{if(n)return d(),()=>h()},[n,d,h]),x.createElement(c0.ItemSlot,{scope:r,id:l,focusable:n,active:i},x.createElement(Ie.span,ge({tabIndex:c?0:-1,"data-orientation":u.orientation},a,{ref:t,onMouseDown:Se(e.onMouseDown,m=>{n?u.onItemFocus(l):m.preventDefault()}),onFocus:Se(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Se(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const p=_5(m,u.orientation,u.dir);if(p!==void 0){m.preventDefault();let v=f().filter(w=>w.focusable).map(w=>w.ref.current);if(p==="last")v.reverse();else if(p==="prev"||p==="next"){p==="prev"&&v.reverse();const w=v.indexOf(m.currentTarget);v=u.loop?T5(v,w+1):v.slice(w+1)}setTimeout(()=>B2(v))}})})))}),E5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function S5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _5(e,t,r){const n=S5(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return E5[n]}function B2(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function T5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const C5=v5,A5=y5,R5=["Enter"," "],O5=["ArrowDown","PageUp","Home"],U2=["ArrowUp","PageDown","End"],F5=[...O5,...U2],Mu="Menu",[f0,D5,P5]=Ou(Mu),[Ai,Lu]=sn(Mu,[P5,Pu,L2]),lh=Pu(),H2=L2(),[I5,ls]=Ai(Mu),[b5,uh]=Ai(Mu),k5=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:o,modal:a=!0}=e,s=lh(t),[l,u]=x.useState(null),c=x.useRef(!1),f=Dt(o),d=Zd(i);return x.useEffect(()=>{const h=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),x.createElement(E2,s,x.createElement(I5,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:u},x.createElement(b5,{scope:t,onClose:x.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:d,modal:a},n)))},$5=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=lh(r);return x.createElement(S2,ge({},i,n,{ref:t}))}),V2="MenuPortal",[N5,M5]=Ai(V2,{forceMount:void 0}),L5=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,o=ls(V2,t);return x.createElement(N5,{scope:t,forceMount:r},x.createElement(mi,{present:r||o.open},x.createElement(vu,{asChild:!0,container:i},n)))},On="MenuContent",[B5,W2]=Ai(On),U5=x.forwardRef((e,t)=>{const r=M5(On,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=ls(On,e.__scopeMenu),a=uh(On,e.__scopeMenu);return x.createElement(f0.Provider,{scope:e.__scopeMenu},x.createElement(mi,{present:n||o.open},x.createElement(f0.Slot,{scope:e.__scopeMenu},a.modal?x.createElement(H5,ge({},i,{ref:t})):x.createElement(V5,ge({},i,{ref:t})))))}),H5=x.forwardRef((e,t)=>{const r=ls(On,e.__scopeMenu),n=x.useRef(null),i=We(t,n);return x.useEffect(()=>{const o=n.current;if(o)return _d(o)},[]),x.createElement(z2,ge({},e,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)}))}),V5=x.forwardRef((e,t)=>{const r=ls(On,e.__scopeMenu);return x.createElement(z2,ge({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)}))}),z2=x.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:d,onDismiss:h,disableOutsideScroll:m,...p}=e,g=ls(On,r),v=uh(On,r),w=lh(r),y=H2(r),E=D5(r),[b,k]=x.useState(null),_=x.useRef(null),C=We(t,_,g.onContentChange),A=x.useRef(0),L=x.useRef(""),B=x.useRef(0),U=x.useRef(null),H=x.useRef("right"),G=x.useRef(0),ee=m?Sd:x.Fragment,ae=m?{as:oi,allowPinchZoom:!0}:void 0,he=oe=>{var ye,te;const O=L.current+oe,M=E().filter(W=>!W.disabled),N=document.activeElement,F=(ye=M.find(W=>W.ref.current===N))===null||ye===void 0?void 0:ye.textValue,V=M.map(W=>W.textValue),Y=J5(V,O,F),J=(te=M.find(W=>W.textValue===Y))===null||te===void 0?void 0:te.ref.current;(function W(Q){L.current=Q,window.clearTimeout(A.current),Q!==""&&(A.current=window.setTimeout(()=>W(""),1e3))})(O),J&&setTimeout(()=>J.focus())};x.useEffect(()=>()=>window.clearTimeout(A.current),[]),Ed();const Te=x.useCallback(oe=>{var ye,te;return H.current===((ye=U.current)===null||ye===void 0?void 0:ye.side)&&tb(oe,(te=U.current)===null||te===void 0?void 0:te.area)},[]);return x.createElement(B5,{scope:r,searchRef:L,onItemEnter:x.useCallback(oe=>{Te(oe)&&oe.preventDefault()},[Te]),onItemLeave:x.useCallback(oe=>{var ye;Te(oe)||((ye=_.current)===null||ye===void 0||ye.focus(),k(null))},[Te]),onTriggerLeave:x.useCallback(oe=>{Te(oe)&&oe.preventDefault()},[Te]),pointerGraceTimerRef:B,onPointerGraceIntentChange:x.useCallback(oe=>{U.current=oe},[])},x.createElement(ee,ae,x.createElement(yd,{asChild:!0,trapped:i,onMountAutoFocus:Se(o,oe=>{var ye;oe.preventDefault(),(ye=_.current)===null||ye===void 0||ye.focus()}),onUnmountAutoFocus:a},x.createElement(mu,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:d,onDismiss:h},x.createElement(C5,ge({asChild:!0},y,{dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:b,onCurrentTabStopIdChange:k,onEntryFocus:Se(l,oe=>{v.isUsingKeyboardRef.current||oe.preventDefault()})}),x.createElement(_2,ge({role:"menu","aria-orientation":"vertical","data-state":q5(g.open),"data-radix-menu-content":"",dir:v.dir},w,p,{ref:C,style:{outline:"none",...p.style},onKeyDown:Se(p.onKeyDown,oe=>{const te=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,O=oe.ctrlKey||oe.altKey||oe.metaKey,M=oe.key.length===1;te&&(oe.key==="Tab"&&oe.preventDefault(),!O&&M&&he(oe.key));const N=_.current;if(oe.target!==N||!F5.includes(oe.key))return;oe.preventDefault();const V=E().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);U2.includes(oe.key)&&V.reverse(),Q5(V)}),onBlur:Se(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(A.current),L.current="")}),onPointerMove:Se(e.onPointerMove,h0(oe=>{const ye=oe.target,te=G.current!==oe.clientX;if(oe.currentTarget.contains(ye)&&te){const O=oe.clientX>G.current?"right":"left";H.current=O,G.current=oe.clientX}}))})))))))}),W5=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return x.createElement(Ie.div,ge({role:"group"},n,{ref:t}))}),z5=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return x.createElement(Ie.div,ge({},n,{ref:t}))}),d0="MenuItem",v1="menu.itemSelect",G5=x.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,o=x.useRef(null),a=uh(d0,e.__scopeMenu),s=W2(d0,e.__scopeMenu),l=We(t,o),u=x.useRef(!1),c=()=>{const f=o.current;if(!r&&f){const d=new CustomEvent(v1,{bubbles:!0,cancelable:!0});f.addEventListener(v1,h=>n==null?void 0:n(h),{once:!0}),wd(f,d),d.defaultPrevented?u.current=!1:a.onClose()}};return x.createElement(j5,ge({},i,{ref:l,disabled:r,onClick:Se(e.onClick,c),onPointerDown:f=>{var d;(d=e.onPointerDown)===null||d===void 0||d.call(e,f),u.current=!0},onPointerUp:Se(e.onPointerUp,f=>{var d;u.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:Se(e.onKeyDown,f=>{const d=s.searchRef.current!=="";r||d&&f.key===" "||R5.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),j5=x.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...o}=e,a=W2(d0,r),s=H2(r),l=x.useRef(null),u=We(t,l),[c,f]=x.useState(!1),[d,h]=x.useState("");return x.useEffect(()=>{const m=l.current;if(m){var p;h(((p=m.textContent)!==null&&p!==void 0?p:"").trim())}},[o.children]),x.createElement(f0.ItemSlot,{scope:r,disabled:n,textValue:i??d},x.createElement(A5,ge({asChild:!0},s,{focusable:!n}),x.createElement(Ie.div,ge({role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},o,{ref:u,onPointerMove:Se(e.onPointerMove,h0(m=>{n?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus())})),onPointerLeave:Se(e.onPointerLeave,h0(m=>a.onItemLeave(m))),onFocus:Se(e.onFocus,()=>f(!0)),onBlur:Se(e.onBlur,()=>f(!1))}))))}),X5="MenuRadioGroup";Ai(X5,{value:void 0,onValueChange:()=>{}});const K5="MenuItemIndicator";Ai(K5,{checked:!1});const Y5="MenuSub";Ai(Y5);function q5(e){return e?"open":"closed"}function Q5(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Z5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function J5(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=Z5(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function eb(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,a=t.length-1;on!=c>n&&r<(u-s)*(n-l)/(c-l)+s&&(i=!i)}return i}function tb(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return eb(r,t)}function h0(e){return t=>t.pointerType==="mouse"?e(t):void 0}const G2=k5,j2=$5,X2=L5,K2=U5,rb=W5,nb=z5,ib=G5,Y2="ContextMenu",[ob,o$]=sn(Y2,[Lu]),Bu=Lu(),[ab,q2]=ob(Y2),sb=e=>{const{__scopeContextMenu:t,children:r,onOpenChange:n,dir:i,modal:o=!0}=e,[a,s]=x.useState(!1),l=Bu(t),u=Dt(n),c=x.useCallback(f=>{s(f),u(f)},[u]);return x.createElement(ab,{scope:t,open:a,onOpenChange:c,modal:o},x.createElement(G2,ge({},l,{dir:i,open:a,onOpenChange:c,modal:o}),r))},lb="ContextMenuTrigger",ub=x.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:n=!1,...i}=e,o=q2(lb,r),a=Bu(r),s=x.useRef({x:0,y:0}),l=x.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),u=x.useRef(0),c=x.useCallback(()=>window.clearTimeout(u.current),[]),f=d=>{s.current={x:d.clientX,y:d.clientY},o.onOpenChange(!0)};return x.useEffect(()=>c,[c]),x.useEffect(()=>void(n&&c()),[n,c]),x.createElement(x.Fragment,null,x.createElement(j2,ge({},a,{virtualRef:l})),x.createElement(Ie.span,ge({"data-state":o.open?"open":"closed","data-disabled":n?"":void 0},i,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:Se(e.onContextMenu,d=>{c(),f(d),d.preventDefault()}),onPointerDown:n?e.onPointerDown:Se(e.onPointerDown,js(d=>{c(),u.current=window.setTimeout(()=>f(d),700)})),onPointerMove:n?e.onPointerMove:Se(e.onPointerMove,js(c)),onPointerCancel:n?e.onPointerCancel:Se(e.onPointerCancel,js(c)),onPointerUp:n?e.onPointerUp:Se(e.onPointerUp,js(c))})))}),cb=e=>{const{__scopeContextMenu:t,...r}=e,n=Bu(t);return x.createElement(X2,ge({},n,r))},fb="ContextMenuContent",db=x.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,i=q2(fb,r),o=Bu(r),a=x.useRef(!1);return x.createElement(K2,ge({},o,n,{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)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))});function js(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const hb=sb,pb=ub,gb=cb,mb=db,Q2=x.createContext({dragDropManager:void 0});function rr(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var x1=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Gc=function(){return Math.random().toString(36).substring(7).split("").join(".")},w1={INIT:"@@redux/INIT"+Gc(),REPLACE:"@@redux/REPLACE"+Gc(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Gc()}};function vb(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Z2(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(rr(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(rr(1));return r(Z2)(e,t)}if(typeof e!="function")throw new Error(rr(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(rr(3));return o}function f(p){if(typeof p!="function")throw new Error(rr(4));if(l)throw new Error(rr(5));var g=!0;return u(),s.push(p),function(){if(g){if(l)throw new Error(rr(6));g=!1,u();var w=s.indexOf(p);s.splice(w,1),a=null}}}function d(p){if(!vb(p))throw new Error(rr(7));if(typeof p.type>"u")throw new Error(rr(8));if(l)throw new Error(rr(9));try{l=!0,o=i(o,p)}finally{l=!1}for(var g=a=s,v=0;vn&&n[i]?n[i]:r||null,e)}function yb(e,t){return e.filter(r=>r!==t)}function J2(e){return typeof e=="object"}function Eb(e,t){const r=new Map,n=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);const i=[];return r.forEach((o,a)=>{o===1&&i.push(a)}),i}function Sb(e,t){return e.filter(r=>t.indexOf(r)>-1)}const ch="dnd-core/INIT_COORDS",Uu="dnd-core/BEGIN_DRAG",fh="dnd-core/PUBLISH_DRAG_SOURCE",Hu="dnd-core/HOVER",Vu="dnd-core/DROP",Wu="dnd-core/END_DRAG";function y1(e,t){return{type:ch,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const _b={type:ch,payload:{clientOffset:null,sourceClientOffset:null}};function Tb(e){return function(r=[],n={publishSource:!0}){const{publishSource:i=!0,clientOffset:o,getSourceClientOffset:a}=n,s=e.getMonitor(),l=e.getRegistry();e.dispatch(y1(o)),Cb(r,s,l);const u=Ob(r,s);if(u==null){e.dispatch(_b);return}let c=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");Ab(a),c=a(u)}e.dispatch(y1(o,c));const d=l.getSource(u).beginDrag(s,u);if(d==null)return;Rb(d),l.pinSource(u);const h=l.getSourceType(u);return{type:Uu,payload:{itemType:h,item:d,sourceId:u,clientOffset:o||null,sourceClientOffset:c||null,isSourcePublic:!!i}}}}function Cb(e,t,r){Fe(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Fe(r.getSource(n),"Expected sourceIds to be registered.")})}function Ab(e){Fe(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Rb(e){Fe(J2(e),"Item must be an object.")}function Ob(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Fb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Db(e){for(var t=1;t{const l=bb(a,s,i,n),u={type:Vu,payload:{dropResult:Db({},r,l)}};e.dispatch(u)})}}function Ib(e){Fe(e.isDragging(),"Cannot call drop while not dragging."),Fe(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function bb(e,t,r,n){const i=r.getTarget(e);let o=i?i.drop(n,e):void 0;return kb(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function kb(e){Fe(typeof e>"u"||J2(e),"Drop result must either be an object or undefined.")}function $b(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Nb(e){return function(){const r=e.getMonitor(),n=e.getRegistry();Mb(r);const i=r.getSourceId();return i!=null&&(n.getSource(i,!0).endDrag(r,i),n.unpinSource()),{type:Wu}}}function Mb(e){Fe(e.isDragging(),"Cannot call endDrag while not dragging.")}function p0(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Lb(e){return function(r,{clientOffset:n}={}){Bb(r);const i=r.slice(0),o=e.getMonitor(),a=e.getRegistry(),s=o.getItemType();return Hb(i,a,s),Ub(i,o,a),Vb(i,o,a),{type:Hu,payload:{targetIds:i,clientOffset:n||null}}}}function Bb(e){Fe(Array.isArray(e),"Expected targetIds to be an array.")}function Ub(e,t,r){Fe(t.isDragging(),"Cannot call hover while not dragging."),Fe(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n=0;n--){const i=e[n],o=t.getTargetType(i);p0(o,r)||e.splice(n,1)}}function Vb(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function Wb(e){return function(){if(e.getMonitor().isDragging())return{type:fh}}}function zb(e){return{beginDrag:Tb(e),publishDragSource:Wb(e),hover:Lb(e),drop:Pb(e),endDrag:Nb(e)}}class Gb{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function n(o){return(...a)=>{const s=o.apply(t,a);typeof s<"u"&&r(s)}}const i=zb(this);return Object.keys(i).reduce((o,a)=>{const s=i[a];return o[a]=n(s),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function jb(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ey(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xb(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:ey(jb(t,n),r)}function Kb(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:ey(t,r)}const Sa=[],dh=[];Sa.__IS_NONE__=!0;dh.__IS_ALL__=!0;function Yb(e,t){return e===Sa?!1:e===dh||typeof t>"u"?!0:Sb(t,e).length>0}class qb{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Fe(typeof t=="function","listener must be a function."),Fe(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const o=()=>{const a=this.store.getState(),s=a.stateId;try{s===i||s===i+1&&!Yb(a.dirtyHandlerIds,n)||t()}finally{i=s}};return this.store.subscribe(o)}subscribeToOffsetChange(t){Fe(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const i=this.store.getState().dragOffset;i!==r&&(r=i,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Fe(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Fe(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),i=this.getItemType();return p0(n,i)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Fe(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),i=this.getItemType();return n!==i?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const i=this.registry.getTargetType(t),o=this.getItemType();if(o&&!p0(i,o))return!1;const a=this.getTargetIds();if(!a.length)return!1;const s=a.indexOf(t);return n?s===a.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Xb(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Kb(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const E1=typeof global<"u"?global:self,ty=E1.MutationObserver||E1.WebKitMutationObserver;function ry(e){return function(){const r=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(r),clearInterval(n),e()}}}function Qb(e){let t=1;const r=new ty(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const Zb=typeof ty=="function"?Qb:ry;class Jb{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.indexthis.capacity){for(let n=0,i=t.length-this.index;n{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Zb(this.flush),this.requestErrorThrow=ry(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class e8{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class t8{create(t){const r=this.freeTasks,n=r.length?r.pop():new e8(this.onError,i=>r[r.length]=i);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const ny=new Jb,r8=new t8(ny.registerPendingError);function n8(e){ny.enqueueTask(r8.create(e))}const hh="dnd-core/ADD_SOURCE",ph="dnd-core/ADD_TARGET",gh="dnd-core/REMOVE_SOURCE",zu="dnd-core/REMOVE_TARGET";function i8(e){return{type:hh,payload:{sourceId:e}}}function o8(e){return{type:ph,payload:{targetId:e}}}function a8(e){return{type:gh,payload:{sourceId:e}}}function s8(e){return{type:zu,payload:{targetId:e}}}function l8(e){Fe(typeof e.canDrag=="function","Expected canDrag to be a function."),Fe(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Fe(typeof e.endDrag=="function","Expected endDrag to be a function.")}function u8(e){Fe(typeof e.canDrop=="function","Expected canDrop to be a function."),Fe(typeof e.hover=="function","Expected hover to be a function."),Fe(typeof e.drop=="function","Expected beginDrag to be a function.")}function g0(e,t){if(t&&Array.isArray(e)){e.forEach(r=>g0(r,!1));return}Fe(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var ar;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(ar||(ar={}));let c8=0;function f8(){return c8++}function d8(e){const t=f8().toString();switch(e){case ar.SOURCE:return`S${t}`;case ar.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function S1(e){switch(e[0]){case"S":return ar.SOURCE;case"T":return ar.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function _1(e,t){const r=e.entries();let n=!1;do{const{done:i,value:[,o]}=r.next();if(o===t)return!0;n=!!i}while(!n);return!1}class h8{addSource(t,r){g0(t),l8(r);const n=this.addHandler(ar.SOURCE,t,r);return this.store.dispatch(i8(n)),n}addTarget(t,r){g0(t,!0),u8(r);const n=this.addHandler(ar.TARGET,t,r);return this.store.dispatch(o8(n)),n}containsHandler(t){return _1(this.dragSources,t)||_1(this.dropTargets,t)}getSource(t,r=!1){return Fe(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Fe(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Fe(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Fe(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return S1(t)===ar.SOURCE}isTargetId(t){return S1(t)===ar.TARGET}removeSource(t){Fe(this.getSource(t),"Expected an existing source."),this.store.dispatch(a8(t)),n8(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Fe(this.getTarget(t),"Expected an existing target."),this.store.dispatch(s8(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Fe(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Fe(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const i=d8(t);return this.types.set(i,r),t===ar.SOURCE?this.dragSources.set(i,n):t===ar.TARGET&&this.dropTargets.set(i,n),i}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const p8=(e,t)=>e===t;function g8(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function m8(e,t,r=p8){if(e.length!==t.length)return!1;for(let n=0;n0||!m8(r,n)))return Sa;const a=n[n.length-1],s=r[r.length-1];return a!==s&&(a&&i.push(a),s&&i.push(s)),i}function x8(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w8(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function I8(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}let C1=0;const ul=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var b8=x.memo(function(t){var{children:r}=t,n=P8(t,["children"]);const[i,o]=k8(n);return x.useEffect(()=>{if(o){const a=iy();return++C1,()=>{--C1===0&&(a[ul]=null)}}},[]),X(Q2.Provider,{value:i,children:r})});function k8(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=$8(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function $8(e,t=iy(),r,n){const i=t;return i[ul]||(i[ul]={dragDropManager:F8(e,t,r,n)}),i[ul]}function iy(){return typeof global<"u"?global:window}var N8=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r};const M8=Ka(N8),ci=typeof window<"u"?x.useLayoutEffect:x.useEffect;function L8(e,t,r){const[n,i]=x.useState(()=>t(e)),o=x.useCallback(()=>{const a=t(e);M8(n,a)||(i(a),r&&r())},[n,e,r]);return ci(o),[n,o]}function B8(e,t,r){const[n,i]=L8(e,t,r);return ci(function(){const a=e.getHandlerId();if(a!=null)return e.subscribeToStateChange(i,{handlerIds:[a]})},[e,i]),n}function oy(e,t,r){return B8(t,e||(()=>({})),()=>r.reconnect())}function ay(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),x.useMemo(()=>typeof e=="function"?e():e,r)}function U8(e){return x.useMemo(()=>e.hooks.dragSource(),[e])}function H8(e){return x.useMemo(()=>e.hooks.dragPreview(),[e])}let jc=!1,Xc=!1;class V8{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Fe(!jc,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return jc=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{jc=!1}}isDragging(){if(!this.sourceId)return!1;Fe(!Xc,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Xc=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Xc=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Kc=!1;class W8{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Fe(!Kc,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Kc=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Kc=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function z8(e,t,r){const n=r.getRegistry(),i=n.addTarget(e,t);return[i,()=>n.removeTarget(i)]}function G8(e,t,r){const n=r.getRegistry(),i=n.addSource(e,t);return[i,()=>n.removeSource(i)]}function m0(e,t,r,n){let i=r?r.call(n,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l, or turn it into a drag source or a drop target itself.`)}function X8(e){return(t=null,r=null)=>{if(!x.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return j8(n),K8(n,r?o=>e(o,r):e)}}function sy(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const i=X8(n);t[r]=()=>i}}),t}function A1(e,t){typeof e=="function"?e(t):e.current=t}function K8(e,t){const r=e.ref;return Fe(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?x.cloneElement(e,{ref:n=>{A1(r,n),A1(t,n)}}):x.cloneElement(e,{ref:t})}class Y8{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,n=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!m0(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!m0(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=sy({dragSource:(r,n)=>{this.clearDragSource(),this.dragSourceOptions=n||null,v0(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,n)=>{this.clearDragPreview(),this.dragPreviewOptions=n||null,v0(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class q8{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!m0(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=sy({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,v0(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Io(){const{dragDropManager:e}=x.useContext(Q2);return Fe(e!=null,"Expected drag drop context"),e}function Q8(e,t){const r=Io(),n=x.useMemo(()=>new Y8(r.getBackend()),[r]);return ci(()=>(n.dragSourceOptions=e||null,n.reconnect(),()=>n.disconnectDragSource()),[n,e]),ci(()=>(n.dragPreviewOptions=t||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,t]),n}function Z8(){const e=Io();return x.useMemo(()=>new V8(e),[e])}class J8{beginDrag(){const t=this.spec,r=this.monitor;let n=null;return typeof t.item=="object"?n=t.item:typeof t.item=="function"?n=t.item(r):n={},n??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const n=this.spec,i=this.monitor,{isDragging:o}=n;return o?o(i):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,n=this.connector,{end:i}=t;i&&i(r.getItem(),r),n.reconnect()}constructor(t,r,n){this.spec=t,this.monitor=r,this.connector=n}}function ek(e,t,r){const n=x.useMemo(()=>new J8(e,t,r),[t,r]);return x.useEffect(()=>{n.spec=e},[e]),n}function tk(e){return x.useMemo(()=>{const t=e.type;return Fe(t!=null,"spec.type must be defined"),t},[e])}function rk(e,t,r){const n=Io(),i=ek(e,t,r),o=tk(e);ci(function(){if(o!=null){const[s,l]=G8(o,i,n);return t.receiveHandlerId(s),r.receiveHandlerId(s),l}},[n,t,r,i,o])}function nk(e,t){const r=ay(e,t);Fe(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const n=Z8(),i=Q8(r.options,r.previewOptions);return rk(r,n,i),[oy(r.collect,n,i),U8(i),H8(i)]}function ik(e){return x.useMemo(()=>e.hooks.dropTarget(),[e])}function ok(e){const t=Io(),r=x.useMemo(()=>new q8(t.getBackend()),[t]);return ci(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function ak(){const e=Io();return x.useMemo(()=>new W8(e),[e])}function sk(e){const{accept:t}=e;return x.useMemo(()=>(Fe(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class lk{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function uk(e,t){const r=x.useMemo(()=>new lk(e,t),[t]);return x.useEffect(()=>{r.spec=e},[e]),r}function ck(e,t,r){const n=Io(),i=uk(e,t),o=sk(e);ci(function(){const[s,l]=z8(o,i,n);return t.receiveHandlerId(s),r.receiveHandlerId(s),l},[n,t,i,r,o.map(a=>a.toString()).join("|")])}function fk(e,t){const r=ay(e,t),n=ak(),i=ok(r.options);return ck(r,n,i),[oy(r.collect,n,i),ik(i)]}const ly=new RegExp("^([0-9]+)(\\s)([kKmMbBtT])$"),_a=new RegExp("^\\d{4}$"),dk=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}|\\d{4}-\\d{2}-\\d{2}$");function hk({column:e,table:t,numberOfColumns:r}){function n(f){if(!f)return null;const d=new Date(f),h=d.toISOString().split("T")[0],m=d.toTimeString().split(" ")[0];return`${h} ${m}`}const i=t.getPreFilteredRowModel().flatRows.map(f=>f.original[e.id]),o=i.every(f=>typeof f=="string"||f===null),a=i.every(f=>typeof f=="number"||ly.test(f)||f===null||f===""),s=i.some(f=>typeof f=="string"&&f.includes(" ")),l=e.getFilterValue();let u="date";const c=i.every(f=>{const d=f==null?void 0:f.toString().replace(/[^0-9]/g,"").trim();return dk.test(f==null?void 0:f.toString())&&(u="datetime-local"),_a.test(f==null?void 0:f.toString())&&(u="number"),(d==null?void 0:d.length)>=4&&(Yl(e.id)||e.id.toLowerCase()==="index"&&!s)});return c&&u==="number"?Ce("div",{className:"flex gap-2 h-6",children:[X("input",{type:u,value:(l==null?void 0:l[0])??"",onChange:f=>{e.setFilterValue(d=>[`${f.target.value}`,`${d==null?void 0:d[1]}`])},min:i.reduce((f,d)=>Math.min(f,parseInt(d,10)),1/0),max:i.reduce((f,d)=>Math.max(f,parseInt(d,10)),-1/0),placeholder:"Start year",className:"_input",title:"Start year"}),X("input",{type:u,value:(l==null?void 0:l[1])??"",onChange:f=>{e.setFilterValue(d=>[`${d==null?void 0:d[0]}`,`${f.target.value}`])},min:i.reduce((f,d)=>Math.min(f,parseInt(d,10)),1/0),max:i.reduce((f,d)=>Math.max(f,parseInt(d,10)),-1/0),placeholder:"End year",className:"_input",title:"End year"})]}):c&&u!=="number"?Ce("div",{className:"flex gap-2 h-6",children:[X("input",{type:u,value:n(l==null?void 0:l[0])??"",onChange:f=>{const d=new Date(f.target.value).getTime();e.setFilterValue(h=>[d,h==null?void 0:h[1]])},placeholder:"Start date",className:"_input",title:"Start date"}),X("input",{type:u,value:n(l==null?void 0:l[1])??"",onChange:f=>{const d=new Date(f.target.value).getTime();e.setFilterValue(h=>[h==null?void 0:h[0],d])},placeholder:"End date",className:"_input",title:"End date"})]}):a?Ce("div",{className:"flex gap-0.5 h-6",children:[X("input",{type:"number",value:(l==null?void 0:l[0])??"",onChange:f=>e.setFilterValue(d=>[f.target.value,d==null?void 0:d[1]]),placeholder:"Min",className:"_input p-0.5",title:"Min"}),X("input",{type:"number",value:(l==null?void 0:l[1])??"",onChange:f=>e.setFilterValue(d=>[d==null?void 0:d[0],f.target.value]),placeholder:"Max",className:"_input p-0.5",title:"Max"})]}):o?X("div",{className:"h-6",children:X("input",{type:"text",value:l??"",onChange:f=>e.setFilterValue(f.target.value),placeholder:"Search...",className:"_input",title:"Search"})}):X("div",{className:"h-6"})}const pk=(e,t,r)=>(r.splice(r.indexOf(t),0,r.splice(r.indexOf(e),1)[0]),[...r]),gk=({header:e,table:t,advanced:r,idx:n,lockFirstColumn:i,setLockFirstColumn:o})=>{const{getState:a,setColumnOrder:s}=t,{columnOrder:l}=a(),{column:u}=e,[,c]=fk({accept:"column",drop:p=>{const g=pk(p.id,u.id,l);s(g)}}),[{isDragging:f},d,h]=nk({collect:p=>({isDragging:p.isDragging()}),item:()=>u,type:"column"}),m=()=>X("div",{ref:h,className:"flex gap-1 flex-col",children:e.isPlaceholder?null:Ce(q1,{children:[Ce("div",{className:"font-bold uppercase text-grey-700 dark:text-white tracking-widest flex gap-2 whitespace-nowrap justify-between",children:[Ce("div",{onClick:u.getToggleSortingHandler(),className:kt("flex gap-1",{"cursor-pointer select-none":u.getCanSort()}),children:[Kf(u.columnDef.header,e.getContext()),u.getCanSort()&&Ce("div",{className:"flex flex-col gap-0.5 items-center justify-center",children:[X("button",{className:kt({"text-[#669DCB]":u.getIsSorted()==="asc","text-grey-600":u.getIsSorted()!=="asc"}),children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"4",fill:"none",viewBox:"0 0 11 5",children:X("path",{fill:"currentColor",d:"M10.333 5l-5-5-5 5"})})}),X("button",{className:kt({"text-[#669DCB]":e.column.getIsSorted()==="desc","text-grey-600":e.column.getIsSorted()!=="desc"}),children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"4",fill:"none",viewBox:"0 0 11 5",children:X("path",{fill:"currentColor",d:"M.333 0l5 5 5-5"})})})]})]}),r&&u.id!=="select"&&X("button",{ref:d,className:"text-grey-600 hover:text-grey-800 dark:hover:text-white",children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"11",fill:"none",viewBox:"0 0 17 16",children:X("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M3.667 6l-2 2 2 2M6.333 3.333l2-2 2 2M10.333 12.667l-2 2-2-2M13 6l2 2-2 2M1.667 8H15M8.333 1.333v13.334"})})})]}),r&&u.getCanFilter()?X("div",{children:X(hk,{column:u,table:t,numberOfColumns:(l==null?void 0:l.length)??0})}):null]})});return Ce("th",{className:kt("h-[70px] p-4 sticky",{"left-0 z-50 bg-white dark:bg-grey-900":n===0&&i}),colSpan:e.colSpan,style:{width:e.getSize()+10,opacity:f?.5:1},ref:c,children:[n===0?Ce(hb,{children:[X(pb,{asChild:!0,children:m()}),X(gb,{children:X(mb,{className:"bg-white text-black dark:text-white dark:bg-grey-900 border border-grey-200 dark:border-grey-800 rounded-md shadow-lg p-2 z-50 text-xs",children:X("div",{className:"flex flex-col gap-2",children:Ce("button",{onClick:()=>{o(!i)},className:"hover:bg-grey-300 dark:hover:bg-grey-800 rounded-md p-2",children:[i?"Unlock":"Lock"," first column"]})})})})]}):m(),X("button",{className:"resizer bg-grey-300/20 dark:hover:bg-white absolute top-0 right-0 w-0.5 h-full",onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler()})]})};function mk({open:e,close:t}){const r=window.download_path||"~/OpenBBUserData/exports";return Ce(jv,{open:e,onOpenChange:t,children:[Ce("div",{id:"loading",className:"saving",children:[X("div",{id:"loading_text",className:"loading_text"}),X("div",{id:"loader",className:"loader"})]}),X(Xv,{onClick:t,className:"_modal-overlay"}),Ce(Kv,{className:"_modal",children:[X(Wf,{children:X(ql,{})}),X(Wf,{className:"_modal-close",onClick:t,style:{float:"right",marginTop:20},children:X(ql,{className:"w-6 h-6"})}),X(Yv,{className:"_modal-title",children:"Success"}),Ce("div",{id:"popup_title",className:"popup_content",style:{padding:"0px 2px 2px 5px",marginTop:5},children:[X("div",{style:{display:"flex",flexDirection:"column",gap:0,fontSize:14},children:X("div",{children:Ce("label",{htmlFor:"title_text",children:[X("b",{children:window.title})," has been downloaded to",X("br",{}),X("br",{}),X("a",{style:{color:"#FFDD00",marginTop:15},href:`${r}`,onClick:n=>{n.preventDefault(),window.pywry.open_file(r)},children:r})]})})}),X("div",{style:{float:"right",marginTop:20},children:X("button",{className:"_btn",style:{padding:"8px 16px",width:"100%"},onClick:t,children:"Close"})})]})]})]})}function vk({columns:e,data:t,type:r,setType:n,downloadFinished:i}){const o=()=>{switch(r){case"csv":Qg("csv",e,t,i);break;case"xlsx":Qg("xlsx",e,t,i);break;case"png":sP("table",i);break}};return Ce("div",{className:"flex gap-2 items-center",children:[X(Xi,{labelType:"row",value:r,onChange:a=>{n(a)},label:"Type",placeholder:"Select type",groups:[{label:"Type",items:w0.map(a=>({label:a,value:a}))}]}),X("button",{onClick:o,className:"_btn",children:"Export"})]})}const uy="DropdownMenu",[xk,a$]=sn(uy,[Lu]),Ri=Lu(),[wk,cy]=xk(uy),yk=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=Ri(t),u=x.useRef(null),[c=!1,f]=go({prop:i,defaultProp:o,onChange:a});return x.createElement(wk,{scope:t,triggerId:Kr(),triggerRef:u,contentId:Kr(),open:c,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(d=>!d),[f]),modal:s},x.createElement(G2,ge({},l,{open:c,onOpenChange:f,dir:n,modal:s}),r))},Ek="DropdownMenuTrigger",Sk=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,o=cy(Ek,r),a=Ri(r);return x.createElement(j2,ge({asChild:!0},a),x.createElement(Ie.button,ge({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n},i,{ref:xd(t,o.triggerRef),onPointerDown:Se(e.onPointerDown,s=>{!n&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Se(e.onKeyDown,s=>{n||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})))}),_k=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Ri(t);return x.createElement(X2,ge({},n,r))},Tk="DropdownMenuContent",Ck=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=cy(Tk,r),o=Ri(r),a=x.useRef(!1);return x.createElement(K2,ge({id:i.contentId,"aria-labelledby":i.triggerId},o,n,{ref:t,onCloseAutoFocus:Se(e.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Se(e.onInteractOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Ak=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return x.createElement(rb,ge({},i,n,{ref:t}))}),Rk=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return x.createElement(nb,ge({},i,n,{ref:t}))}),Ok=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return x.createElement(ib,ge({},i,n,{ref:t}))}),Fk=yk,R1=Sk,Dk=_k,Pk=Ck,Ik=Ak,bk=Rk,Yc=Ok;function kk(e,t){x.useEffect(()=>{const r=n=>{!e.current||e.current.contains(n.target)||t(n)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}function O1({label:e,table:t,onlyIconTrigger:r=!1}){const[n,i]=x.useState(!1),o=x.useRef(null);kk(o,()=>i(!1)),x.useEffect(()=>{const s=l=>{l.key==="Escape"&&i(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[]);function a(){t.resetColumnFilters(),i(!1)}return Ce(Fk,{open:n,children:[r?X(R1,{title:"Filter columns",onClick:()=>i(!n),children:X("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-7 h-7",children:X("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"})})}):Ce(Ik,{className:"flex flex-row items-center gap-2",children:[X(bk,{className:"whitespace-nowrap",children:e}),Ce(R1,{onClick:()=>i(!n),className:"bg-white text-black dark:bg-grey-900 dark:text-white whitespace-nowrap h-[36px] border-[1.5px] border-grey-700 rounded p-3 inline-flex items-center justify-center leading-none gap-[5px] shadow-[0_2px_10px] shadow-black/10 focus:shadow-[0_0_0_2px] focus:shadow-black data-[placeholder]:text-white outline-none","aria-label":e,children:[X("span",{children:"Filter columns"}),X(s0,{className:kt({"transform rotate-180 duration-200 transition":n})})]})]}),X(Dk,{children:Ce(Pk,{sideOffset:10,ref:o,className:"z-50 bg-white/80 dark:bg-grey-900/80 backdrop-filter backdrop-blur flex flex-col gap-4 overflow-auto border-[1.5px] border-grey-700 rounded p-3 max-h-[500px] text-black dark:text-white",children:[X(Yc,{children:X("button",{className:"_btn w-full",onClick:a,children:"Clear Filters"})}),X(Yc,{children:Ce("label",{className:"flex items-center gap-2",children:[X("input",{type:"checkbox",checked:t.getIsAllColumnsVisible(),onChange:t.getToggleAllColumnsVisibilityHandler()}),"Toggle All"]})}),t.getAllLeafColumns().filter(s=>s.id!=="select").map(s=>X(Yc,{children:Ce("label",{className:"flex items-center gap-2",children:[X("input",{type:"checkbox",checked:s.getIsVisible(),onChange:s.getToggleVisibilityHandler()}),s.id]})},s.id))]})})]})}function fy(e){return typeof e!="number"?typeof e=="string"&&e.includes("All")?e:x0:e<1?x0:e}function $k({table:e,currentPage:t,setCurrentPage:r}){const n=e.getFilteredRowModel().rows.length||0;return Ce("div",{className:"hidden md:flex items-center gap-3",children:[X(Xi,{value:t,onChange:i=>{const o=fy(i);r(o),o.toString().includes("All")?e.setPageSize(n):e.setPageSize(o)},labelType:"row",label:"Rows per page",placeholder:"Select rows per page",groups:[{label:"Rows per page",items:[10,20,30,40,50,`All (${n})`].map(i=>({label:`${i}`,value:i}))}]}),Ce("span",{className:"flex items-center gap-1",children:[X("strong",{children:e.getState().pagination.pageIndex+1}),"of",X("strong",{children:e.getPageCount()})]}),Ce("div",{className:"hidden mdl:block",children:[X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanPreviousPage(),"dark:text-white":e.getCanPreviousPage()}),onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:"<<"}),X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanPreviousPage(),"dark:text-white":e.getCanPreviousPage()}),onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:"<"}),X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanNextPage(),"dark:text-white":e.getCanNextPage()}),onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:">"}),X("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanNextPage(),"dark:text-white":e.getCanNextPage()}),onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:">>"})]})]})}const Nk=new Date,Mk=50,x0=30;function Lk(e,t){try{const r=e.hasOwnProperty("index")?"index":e.hasOwnProperty("Index")?"Index":null,n=r?e[r]:null,i=e[t],o=typeof i,a=i==null?void 0:i.toString().replace(/[^0-9]/g,""),s=(a==null?void 0:a.length)>=4&&(Yl(t)||t.toLowerCase()==="index"||n&&typeof n=="string"&&(n.toLowerCase().includes("date")||n.toLowerCase().includes("day")||n.toLowerCase().includes("time")||n.toLowerCase().includes("timestamp")||n.toLowerCase().includes("year")||n.toLowerCase().includes("month")||n.toLowerCase().includes("week")||n.toLowerCase().includes("hour")||n.toLowerCase().includes("minute")));if(o==="string"&&i.startsWith("http")||!s)return(i==null?void 0:i.toString().length)??0;if(s&&!isNaN(new Date(i).getTime())&&!_a.test(i==null?void 0:i.toString())){if(typeof i=="string")return(i==null?void 0:i.toString().length)??0;try{const u=new Date(i);let c="";return u.getUTCHours()===0&&u.getUTCMinutes()===0&&u.getUTCSeconds()===0&&u.getMilliseconds()===0?c=u.toISOString().split("T")[0]:(c=u.toISOString(),c=`${c.split("T")[0]} ${c.split("T")[1].split(".")[0]}`),(c==null?void 0:c.toString().length)??0}catch{return(i==null?void 0:i.toString().length)??0}}return(i==null?void 0:i.toString().length)??0}catch{return 0}}const w0=["csv","xlsx","png"];function Bk({data:e,columns:t,title:r,initialTheme:n,cmd:i=""}){const[o,a]=qo("exportType",w0[0]),[s,l]=x.useState(!1),[u,c]=JC(n),[f,d]=x.useState(u==="dark"),h=W=>{c(u),d(W)},[m,p]=qo("rowsPerPage",x0,fy),[g,v]=qo("advanced",!1),[w,y]=qo("colors",!1),[E,b]=x.useState([]),[k,_]=x.useState(""),[C,A]=qo("fontSize","1"),[L,B]=x.useState(!1),U=t.reduce((W,Q,le)=>(W[Q]=le{const ie=Math.max(...W.map($e=>Lk($e,Q)),le!=null&&le.length?(le==null?void 0:le.length)+8:0);return Math.min(200,ie*12)},ae=x.useMemo(()=>[...t.map((W,Q)=>({accessorKey:W,accessorFn:le=>{const me=le.hasOwnProperty("index")?"index":le.hasOwnProperty("Index")?"Index":t[0],_e=me?le[me]:null,ie=le[W],$e=(ie==null?void 0:ie.toString().replace(/[^0-9]/g,""))??"",Pe=($e==null?void 0:$e.length)>=4&&(Yl(W)||W.toLowerCase()==="index"||_e&&typeof _e=="string"&&(_e.toLowerCase().includes("date")||_e.toLowerCase().includes("time")||_e.toLowerCase().includes("timestamp")||_e.toLowerCase().includes("year")||_e.toLowerCase().includes("month")||_e.toLowerCase().includes("week")||_e.toLowerCase().includes("hour")||_e.toLowerCase().includes("minute")));return Pe&&_a.test(ie==null?void 0:ie.toString())?ie:Pe?typeof ie=="number"?ie:new Date(ie).getTime():ie},id:W,header:W,size:ee(e,W,W),footer:W,cell:({row:le})=>{var Bt;const me=le.original.hasOwnProperty("index")?"index":le.original.hasOwnProperty("Index")?"Index":t[0],_e=me?le.original[me]:null,ie=le.original[W],$e=typeof ie,Pe=(ie==null?void 0:ie.toString().replace(/[^0-9]/g,""))??"",ve=(Pe==null?void 0:Pe.length)>=4&&(Yl(W)||W.toLowerCase()==="index"||_e&&typeof _e=="string"&&(_e.toLowerCase().includes("date")||_e.toLowerCase().includes("time")||_e.toLowerCase().includes("timestamp")||_e.toLowerCase().includes("year")));if($e==="string"&&ie.startsWith("http"))return X("a",{className:"_hyper-link",href:ie,target:"_blank",rel:"noreferrer",children:(ie==null?void 0:ie.length)>25?`${ie.substring(0,25)}...`:ie});if(ve&&_a.test(ie==null?void 0:ie.toString()))return X("p",{children:ie});if(ve&&!isNaN(new Date(ie).getTime())&&!_a.test(ie==null?void 0:ie.toString())){if(typeof ie=="string"){const Ne=ie.split("T")[0],Ze=(Bt=ie.split("T")[1])==null?void 0:Bt.split(".")[0];return Ze==="00:00:00"?X("p",{children:Ne}):Ce("p",{children:[Ne," ",Ze]})}try{const Ne=new Date(ie);let Ze="";return Ne.getUTCHours()===0&&Ne.getUTCMinutes()===0&&Ne.getUTCSeconds()===0&&Ne.getMilliseconds()===0?Ze=Ne.toISOString().split("T")[0]:(Ze=Ne.toISOString(),Ze=`${Ze.split("T")[0]} ${Ze.split("T")[1].split(".")[0]}`),X("p",{children:Ze})}catch{return X("p",{children:ie})}}if($e==="number"||ly.test(ie==null?void 0:ie.toString())){let Ne=tP(ie,W);const Ze=Number(t0(ie));if(typeof _e=="string"&&n2(_e)){Ne=Number(t0(ie));const us=Ne<2?4:2;Ne=Ne.toLocaleString("en-US",{maximumFractionDigits:us,minimumFractionDigits:2})}return X("p",{className:kt("whitespace-nowrap",{"text-black dark:text-white":!w,"text-[#16A34A]":Ze>0&&w,"text-[#F87171]":Ze<0&&w,"text-[#404040]":Ze===0&&w}),title:r2(ie).toString()??"",children:Ze!==0?Ze>0?`${Ne}`:`${Ne}`:Ne})}else if($e==="string")return X("div",{dangerouslySetInnerHTML:{__html:ZC(ie)}});return X("p",{children:ie})}}))],[g,w]),[he,Te]=x.useState(!1),[oe,ye]=x.useState(ae.map(W=>W.id)),te=()=>ye(t.map(W=>W.id)),O=x.useMemo(()=>{const W=oe.map(le=>le),Q=ae.map(le=>le.id);return!rP(W,Q)},[oe,ae]),M=aC({data:e,columns:ae,getCoreRowModel:YT(),getSortedRowModel:eC(),getFilteredRowModel:JT(),getPaginationRowModel:rC(),columnResizeMode:"onChange",onColumnVisibilityChange:G,onColumnOrderChange:ye,onSortingChange:b,onGlobalFilterChange:_,globalFilterFn:nP,state:{sorting:E,globalFilter:k,columnOrder:oe,columnVisibility:H},initialState:{pagination:{pageIndex:0,pageSize:typeof m=="string"?m.includes("All")?e==null?void 0:e.length:parseInt(m):m}}}),N=x.useRef(null),{rows:F}=M.getRowModel(),V=M.getVisibleFlatColumns(),[Y,J]=x.useState(!1);return x.useEffect(()=>{s&&(l(!1),J(!0))},[s]),Ce(q1,{children:[X(f5,{toast:{id:"max-columns",title:"Max 12 columns are visible by default",description:"You can change this by clicking on advanced and then top right 'Filter' button",status:"info"},open:L,setOpen:B}),X(mk,{open:Y,close:()=>J(!1)}),Ce("div",{ref:N,className:kt("overflow-x-hidden h-screen"),children:[Ce("div",{className:"relative p-4",id:"table",children:[X("div",{className:"absolute -inset-0.5 bg-gradient-to-r rounded-md blur-md from-[#072e49]/30 via-[#0d345f]/30 to-[#0d3362]/30"}),Ce("div",{className:"border border-grey-500/60 dark:border-grey-200/60 bg-white dark:bg-grey-900 rounded overflow-hidden relative z-20",children:[Ce("div",{className:"_header relative gap-4 py-2 text-center text-xs flex items-center justify-between px-4 text-white",style:{fontSize:`${Number(C)*90}%`},children:[X("div",{className:"w-1/3",children:X("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"40",fill:"none",viewBox:"0 0 64 40",children:X("path",{fill:"#fff",d:"M61.283 3.965H33.608v27.757h25.699V19.826H37.561v-3.965H63.26V3.965h-1.977zM39.538 23.792h15.815v3.965H37.561v-3.965h1.977zM59.306 9.913v1.983H37.561V7.931h21.745v1.982zM33.606 0h-3.954v3.965H33.606V0zM25.7 3.966H0V15.86h25.7v3.965H3.953v11.896h25.7V3.966h-3.955zm0 21.808v1.983H7.907v-3.965h17.791v1.982zm0-15.86v1.982H3.953V7.931h21.745v1.982zM37.039 35.693v2.952l-.246-.246-.245-.245-.245-.247-.245-.246-.246-.246-.245-.245-.245-.247-.247-.246-.245-.246-.245-.246-.245-.246-.246-.246h-.49v3.936h.49v-3.198l.246.246.245.246.245.246.245.246.246.246.246.246.245.247.246.245.245.246.245.247.245.246.246.245.245.246h.245v-3.936h-.49zM44.938 37.17h-.491v-1.477h-2.944v3.937h3.93v-2.46h-.495zm-2.944-.246v-.739h1.962v.984h-1.962v-.245zm2.944.984v1.23h-2.944V37.66h2.944v.247zM52.835 37.17h-.49v-1.477h-2.946v3.937h3.925v-2.46h-.489zm-2.944-.246v-.739h1.963v.984h-1.965l.002-.245zm2.944.984v1.23H49.89V37.66h2.946v.247zM29.174 35.693H25.739v3.936H29.663v-.491H26.229v-.984h2.943v-.493H26.229v-1.476h3.434v-.492h-.489zM13.37 35.693H9.934v3.937h3.925v-3.937h-.49zm0 .738v2.709h-2.945v-2.955h2.943l.001.246zM21.276 35.693h-3.435v3.937h.491v-1.476h3.434v-2.461h-.49zm0 .738v1.23h-2.944v-1.476h2.944v.246z"})})}),X("p",{className:"font-bold w-1/3 flex flex-col gap-0.5 items-center",children:r}),Ce("p",{className:"w-1/3 text-right text-xs",children:[new Intl.DateTimeFormat("en-GB",{dateStyle:"full",timeStyle:"long"}).format(Nk).replace(/:\d\d /," "),X("br",{}),X("span",{className:"text-grey-400",children:i})]})]}),X("div",{className:"overflow-auto max-h-[calc(100vh-170px)] smh:max-h-[calc(100vh-95px)]",children:Ce("table",{className:"text-sm relative",children:[X("thead",{className:"sticky top-0 bg-white dark:bg-grey-900",style:{fontSize:`${Number(C)*100}%`},children:M.getHeaderGroups().map((W,Q)=>X("tr",{children:W.headers.map((le,me)=>X(gk,{setLockFirstColumn:Te,lockFirstColumn:he,idx:me,advanced:g,header:le,table:M},le.id))},W.id))}),X("tbody",{children:M.getRowModel().rows.map((W,Q)=>X("tr",{className:"!h-[64px] border-b border-grey-400",style:{fontSize:`${Number(C)*100}%`},children:W.getVisibleCells().map((le,me)=>X("td",{className:kt("whitespace-normal p-4 text-black dark:text-white",{"bg-white dark:bg-grey-850":Q%2===0,"bg-grey-100 dark:bg-[#202020]":Q%2===1,"sticky left-0 z-10":me===0&&he}),style:{width:le.column.getSize()},children:Kf(le.column.columnDef.cell,le.getContext())},le.id))},W.id))}),(F==null?void 0:F.length)>30&&(V==null?void 0:V.length)>4&&X("tfoot",{children:M.getFooterGroups().map(W=>X("tr",{children:W.headers.map(Q=>X("th",{colSpan:Q.colSpan,className:"text-grey-500 bg-grey-100 dark:bg-grey-850 font-normal text-left text-sm h-10 p-4",style:{width:Q.getSize(),fontSize:`${Number(C)*100}%`},children:Q.isPlaceholder?null:Kf(Q.column.columnDef.footer,Q.getContext())},Q.id))},W.id))})]})})]})]}),Ce("div",{className:"smh:hidden flex max-h-[68px] overflow-x-auto bg-white/70 dark:bg-grey-900/70 backdrop-filter backdrop-blur z-20 bottom-0 left-0 w-full gap-10 justify-between py-4 px-4 text-sm",children:[Ce("div",{className:"flex items-center gap-10",children:[Ce(jv,{children:[X(pT,{className:"_btn",children:"Settings"}),Ce(gT,{children:[X(Xv,{className:"_modal-overlay"}),Ce(Kv,{className:"_modal",children:[X(Wf,{className:"absolute top-[40px] right-[46px] text-grey-200 hover:text-white rounded-[4px] focus:outline focus:outline-2 focus:outline-grey-500",children:X(ql,{className:"w-6 h-6"})}),X(Yv,{className:"uppercase font-bold tracking-widest",children:"Settings"}),Ce("div",{className:"grid grid-cols-2 gap-2 mt-10 text-sm",children:[O&&X("button",{onClick:()=>te(),className:"_btn h-9",children:"Reset Order"}),X(Xi,{labelType:"row",value:f?"light":"dark",onChange:W=>{h(W!=="dark")},label:"Theme",placeholder:"Select theme",groups:[{label:"Theme",items:[{label:"Dark",value:"dark"},{label:"Light",value:"light"}]}]}),X(Xi,{labelType:"row",value:o,onChange:W=>{a(W)},label:"Export type",placeholder:"Select export type",groups:[{label:"Export type",items:w0.map(W=>({label:W,value:W}))}]}),X(Xi,{labelType:"row",value:C,onChange:A,label:"Font size",placeholder:"Select font size",groups:[{label:"Font size",items:[{label:"50%",value:"0.5"},{label:"75%",value:"0.75"},{label:"100%",value:"1"},{label:"125%",value:"1.25"},{label:"150%",value:"1.5"},{label:"175%",value:"1.75"},{label:"200%",value:"2"}]}]}),X(O1,{table:M,label:"Filter"}),X("div",{className:"flex gap-2 items-center",children:X(Xi,{labelType:"row",value:g?"advanced":"simple",onChange:W=>{v(W==="advanced")},label:"Type",placeholder:"Select type",groups:[{label:"Type",items:[{label:"Simple",value:"simple"},{label:"Advanced",value:"advanced"}]}]})}),Ce("div",{className:"flex gap-2 items-center",children:[X("label",{htmlFor:"colors",children:"Colors"}),X("input",{id:"colors",type:"checkbox",checked:w,onChange:()=>y(!w)})]})]})]})]})]}),X(O1,{onlyIconTrigger:!0,table:M,label:""})]}),X($k,{currentPage:m,setCurrentPage:p,table:M}),X(vk,{setType:a,type:o,columns:t,data:e,downloadFinished:l})]})]})]})}function dy(e){let t=null;return()=>(t==null&&(t=e()),t)}function Uk(e,t){return e.filter(r=>r!==t)}function Hk(e,t){const r=new Set,n=o=>r.add(o);e.forEach(n),t.forEach(n);const i=[];return r.forEach(o=>i.push(o)),i}class Vk{enter(t){const r=this.entered.length,n=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=Hk(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Uk(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Wk{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(n=>{const i=this.config.exposeProperties[n];i!=null&&(r[n]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const hy="__NATIVE_FILE__",py="__NATIVE_URL__",gy="__NATIVE_TEXT__",my="__NATIVE_HTML__",F1=Object.freeze(Object.defineProperty({__proto__:null,FILE:hy,HTML:my,TEXT:gy,URL:py},Symbol.toStringTag,{value:"Module"}));function qc(e,t,r){const n=t.reduce((i,o)=>i||e.getData(o),"");return n??r}const y0={[hy]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[my]:{exposeProperties:{html:(e,t)=>qc(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[py]:{exposeProperties:{urls:(e,t)=>qc(e,t,"").split(` `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[gy]:{exposeProperties:{text:(e,t)=>qc(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function zk(e,t){const r=y0[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new Wk(r);return n.loadDataTransfer(t),n}function Qc(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(y0).filter(r=>{const n=y0[r];return n!=null&&n.matchesTypes?n.matchesTypes.some(i=>t.indexOf(i)>-1):!1})[0]||null}const Gk=dy(()=>/firefox/i.test(navigator.userAgent)),vy=dy(()=>!!window.safari);class D1{interpolate(t){const{xs:r,ys:n,c1s:i,c2s:o,c3s:a}=this;let s=r.length-1;if(t===r[s])return n[s];let l=0,u=a.length-1,c;for(;l<=u;){c=Math.floor(.5*(l+u));const h=r[c];if(ht)u=c-1;else return n[c]}s=Math.max(0,u);const f=t-r[s],d=f*f;return n[s]+i[s]*f+o[s]*d+a[s]*f*d}constructor(t,r){const{length:n}=t,i=[];for(let h=0;ht[h]{let k=new D1([0,.5,1],[l.y,l.y/c*m,l.y+m-c]).interpolate(d);return vy()&&o&&(k+=(window.devicePixelRatio-1)*m),k},g=()=>new D1([0,.5,1],[l.x,l.x/u*h,l.x+h-u]).interpolate(f),{offsetX:v,offsetY:w}=i,y=v===0||v,E=w===0||w;return{x:y?v:g(),y:E?w:p()}}class qk{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function Qk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P1(e){for(var t=1;t{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,n){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,n);const i=a=>this.handleDragStart(a,t),o=a=>this.handleSelectStart(a);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",i),r.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",i),r.removeEventListener("selectstart",o),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const n=a=>this.handleDragEnter(a,t),i=a=>this.handleDragOver(a,t),o=a=>this.handleDrop(a,t);return r.addEventListener("dragenter",n),r.addEventListener("dragover",i),r.addEventListener("drop",o),()=>{r.removeEventListener("dragenter",n),r.removeEventListener("dragover",i),r.removeEventListener("drop",o)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return P1({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return P1({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(F1).some(r=>F1[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=zk(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var n;return(n=this.rootElement)===null||n===void 0?void 0:n.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const o=this.sourceNodes.get(i);return o&&xy(o)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:o}=this;this.dragStartSourceIds=null;const a=Xs(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:a});const{dataTransfer:s}=i,l=Qc(s);if(this.monitor.isDragging()){if(s&&typeof s.setDragImage=="function"){const c=this.monitor.getSourceId(),f=this.sourceNodes.get(c),d=this.sourcePreviewNodes.get(c)||f;if(d){const{anchorX:h,anchorY:m,offsetX:p,offsetY:g}=this.getCurrentSourcePreviewNodeOptions(),y=Yk(f,d,a,{anchorX:h,anchorY:m},{offsetX:p,offsetY:g});s.setDragImage(d,y.x,y.y)}}try{s==null||s.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(s&&!s.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:s}=i,l=Qc(s);l&&this.beginDragNativeItem(l,s)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:o}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,o.length>0&&this.actions.hover(o,{clientOffset:Xs(i)}),o.some(s=>this.monitor.canDropOnTarget(s))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:o}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Xs(i),this.scheduleHover(o),(o||[]).some(s=>this.monitor.canDropOnTarget(s))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var o;i.preventDefault(),(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}else Qc(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:Xs(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const o=i.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(i.preventDefault(),o.dragDrop()))},this.options=new qk(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Vk(this.isNodeInDocument)}}const Jk=function(t,r,n){return new Zk(t,r,n)};function e$(){const[e,t]=x.useState(null),[r,n]=x.useState("Interactive Table");x.useEffect(()=>{const a=setInterval(()=>{if(window.json_data){const s=JSON.parse(window.json_data);console.log(s),t(s),s.title&&typeof s.title=="string"&&n(s.title),clearInterval(a)}},100);return()=>clearInterval(a)},[]);const o=(a=>{var h;if(!a)return null;const s=(h=a.title)==null?void 0:h.replace(/|<\/b>/g,"").replace(/ /g,"_"),l=new Date().toISOString().slice(0,10).replace(/-/g,""),u=new Date().toISOString().slice(11,19).replace(/:/g,"");window.title=`openbb_${s}_${l}_${u}`;const c=a.columns;a.index;const d=a.data.map((m,p)=>{const g={};return m.forEach((v,w)=>{g[c[w]]=v||(v===0?0:"")}),g});return{columns:c,data:d}})(e);return X("div",{className:"relative h-full bg-white dark:bg-black text-black dark:text-white",children:X(b8,{backend:Jk,children:o&&X(Bk,{title:r,data:o.data,columns:o.columns,initialTheme:e.theme&&typeof e.theme=="string"&&e.theme==="dark"?"dark":"light",cmd:(e==null?void 0:e.command_location)??""})})})}Ov.render(X(ir.StrictMode,{children:X(e$,{})}),document.getElementById("root")); From 90a82204162c6a48f0a44f31e158a9c3a3ba44bc Mon Sep 17 00:00:00 2001 From: tehcoderer Date: Fri, 21 Jul 2023 20:17:33 -0400 Subject: [PATCH 09/28] fix for economy treasury / usdli --- openbb_terminal/core/plots/plotly_helper.py | 10 ++++++---- openbb_terminal/economy/fedreserve_view.py | 5 +++-- openbb_terminal/economy/fred_model.py | 6 +++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/openbb_terminal/core/plots/plotly_helper.py b/openbb_terminal/core/plots/plotly_helper.py index 09f8eceeb55..0fa0d73cae6 100644 --- a/openbb_terminal/core/plots/plotly_helper.py +++ b/openbb_terminal/core/plots/plotly_helper.py @@ -1300,9 +1300,10 @@ class OpenBBFigure(go.Figure): "col": col, "secondary_y": secondary_y, } - self._subplot_xdates.setdefault(row, {}).setdefault( - col, [] - ).append(trace.x) + if trace.type != "scatter": + self._subplot_xdates.setdefault(row, {}).setdefault( + col, [] + ).append(trace.x) # We convert the dateindex to a list of datetime objects if it's a numpy array if output is not None and isinstance(output[0], np.datetime64): @@ -1350,7 +1351,8 @@ class OpenBBFigure(go.Figure): rangebreaks: List[Dict[str, Any]] = [dict(values=dt_missing_days)] # We get the frequency of the data to hide intra-day gaps - if (freq := df_data.index[1] - df_data.index[0]).days == 0: + if df_data.index[-1].time() != df_data.index[-2].time(): + freq = df_data.index[1] - df_data.index[0] freq_mins = int(freq.seconds / 60) break_values = ( df_data.resample(f"{freq_mins}T") diff --git a/openbb_terminal/economy/fedreserve_view.py b/openbb_terminal/economy/fedreserve_view.py index f205256067e..cd24cdcd41d 100644 --- a/openbb_terminal/economy/fedreserve_view.py +++ b/openbb_terminal/economy/fedreserve_view.py @@ -83,9 +83,10 @@ def show_treasuries( ) for col in treasury_data.columns: + non_nan = treasury_data[col].notna() fig.add_scatter( - x=treasury_data.index, - y=treasury_data[col], + x=treasury_data.index[non_nan], + y=treasury_data[col][non_nan], mode="lines", name=col.replace("m", " Month").replace("y", " Year"), ) diff --git a/openbb_terminal/economy/fred_model.py b/openbb_terminal/economy/fred_model.py index b2110488ab5..620b08b8048 100644 --- a/openbb_terminal/economy/fred_model.py +++ b/openbb_terminal/economy/fred_model.py @@ -425,9 +425,9 @@ def get_usd_liquidity(overlay: str = "", show: bool = False) -> pd.DataFrame: ) data = pd.DataFrame() - data["WALCL"] = get_series_data("WALCL").astype(int) * 1000000 - data["WLRRAL"] = get_series_data("WLRRAL").astype(int) * 1000000 - data["WDTGAL"] = get_series_data("WDTGAL").astype(int) * 1000000 + data["WALCL"] = get_series_data("WALCL").astype("int64") * 1000000 + data["WLRRAL"] = get_series_data("WLRRAL").astype("int64") * 1000000 + data["WDTGAL"] = get_series_data("WDTGAL").astype("int64") * 1000000 data["USD Liquidity Index (Billions of USD)"] = round( (data["WALCL"] - data["WLRRAL"] - data["WDTGAL"]) / 1000000000, 2 ) From 2a086db30e33a166cc266e2afe6c9e23b92d6e46 Mon Sep 17 00:00:00 2001 From: tehcoderer Date: Fri, 21 Jul 2023 20:45:07 -0400 Subject: [PATCH 10/28] limit rangebreaks --- openbb_terminal/core/plots/plotly_helper.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openbb_terminal/core/plots/plotly_helper.py b/openbb_terminal/core/plots/plotly_helper.py index 0fa0d73cae6..a28b47975f1 100644 --- a/openbb_terminal/core/plots/plotly_helper.py +++ b/openbb_terminal/core/plots/plotly_helper.py @@ -1300,10 +1300,9 @@ class OpenBBFigure(go.Figure): "col": col, "secondary_y": secondary_y, } - if trace.type != "scatter": - self._subplot_xdates.setdefault(row, {}).setdefault( - col, [] - ).append(trace.x) + self._subplot_xdates.setdefault(row, {}).setdefault( + col, [] + ).append(trace.x) # We convert the dateindex to a list of datetime objects if it's a numpy array if output is not None and isinstance(output[0], np.datetime64): @@ -1332,6 +1331,7 @@ class OpenBBFigure(go.Figure): """ # We get the min and max dates dt_start, dt_end = df_data.index.min(), df_data.index.max() + rangebreaks: List[Dict[str, Any]] = [] # if weekly or monthly data, we don't need to hide gaps # this prevents distortions in the plot @@ -1348,7 +1348,8 @@ class OpenBBFigure(go.Figure): ) dt_missing_days = pd.to_datetime(dt_missing_days) - rangebreaks: List[Dict[str, Any]] = [dict(values=dt_missing_days)] + if len(dt_missing_days) < 2_000: + rangebreaks: List[Dict[str, Any]] = [dict(values=dt_missing_days)] # We get the frequency of the data to hide intra-day gaps if df_data.index[-1].time() != df_data.index[-2].time(): From 6185159ed4080ea43e8dbe444f7fd0fe9243997d Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Fri, 21 Jul 2023 20:55:59 -0700 Subject: [PATCH 11/28] fix integer division or modulo by zero --- .../cryptocurrency/defi/defi_controller.py | 12 +++-- .../cryptocurrency/defi/llama_view.py | 46 +++++++++---------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/openbb_terminal/cryptocurrency/defi/defi_controller.py b/openbb_terminal/cryptocurrency/defi/defi_controller.py index 67b646d2dcf..300d093ae1f 100644 --- a/openbb_terminal/cryptocurrency/defi/defi_controller.py +++ b/openbb_terminal/cryptocurrency/defi/defi_controller.py @@ -397,7 +397,7 @@ class DefiController(BaseController): "-d", "--dapps", dest="dapps", - type=str, + choices=["anchor", "sushiswap", "pancakeswap"], required="-h" not in other_args, help="dApps to search historical TVL. Should be split by , e.g.: anchor,sushiswap,pancakeswap", ) @@ -405,11 +405,17 @@ class DefiController(BaseController): other_args.insert(0, "-d") ns_parser = self.parse_known_args_and_warn( - parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED + parser, other_args, EXPORT_BOTH_RAW_DATA_AND_FIGURES ) if ns_parser: - llama_view.display_historical_tvl(dapps=ns_parser.dapps) + llama_view.display_historical_tvl( + dapps=ns_parser.dapps, + export=ns_parser.export, + sheet_name=" ".join(ns_parser.sheet_name) + if ns_parser.sheet_name + else None, + ) @log_start_end(log=logger) def call_ldapps(self, other_args: List[str]): diff --git a/openbb_terminal/cryptocurrency/defi/llama_view.py b/openbb_terminal/cryptocurrency/defi/llama_view.py index 9a9d3170eac..dfc86362450 100644 --- a/openbb_terminal/cryptocurrency/defi/llama_view.py +++ b/openbb_terminal/cryptocurrency/defi/llama_view.py @@ -128,8 +128,8 @@ def display_defi_protocols( @log_start_end(log=logger) def display_historical_tvl( - dapps: str = "", - export: str = "", + dapps: str = "sushiswap", + export: Optional[str] = "", sheet_name: Optional[str] = None, external_axes: bool = False, ) -> Union[OpenBBFigure, None]: @@ -155,6 +155,7 @@ def display_historical_tvl( for dapp in dapps.split(","): if dapp in available_protocols: df = llama_model.get_defi_protocol(dapp) + df = df.query("`totalLiquidityUSD` > 0") if not df.empty: fig.add_scatter( x=df.index, @@ -163,25 +164,23 @@ def display_historical_tvl( ) else: print(f"{dapp} not found\n") - - export_data( - export, - os.path.dirname(os.path.abspath(__file__)), - "dtvl", - None, - sheet_name, - fig, - ) - + if export and export != "": + return export_data( + export, + os.path.dirname(os.path.abspath(__file__)), + f"dtvl_{dapp}", + df, + sheet_name, + fig, + ) return fig.show(external=external_axes) - return None @log_start_end(log=logger) def display_defi_tvl( limit: int = 5, - export: str = "", + export: Optional[str] = "", sheet_name: Optional[str] = None, external_axes: bool = False, ) -> Union[OpenBBFigure, None]: @@ -205,15 +204,16 @@ def display_defi_tvl( df_data = df.copy() df = df.tail(limit) + if export and export != "": + return export_data( + export, + os.path.dirname(os.path.abspath(__file__)), + "stvl", + df_data, + sheet_name, + fig, + ) + fig.add_scatter(x=df["date"], y=df["totalLiquidityUSD"], name="TVL") - export_data( - export, - os.path.dirname(os.path.abspath(__file__)), - "stvl", - df_data, - sheet_name, - fig, - ) - return fig.show(external=external_axes) From 969d5cee429fe005bcbaccc5665cf40ba0a88fa1 Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Fri, 21 Jul 2023 21:22:08 -0700 Subject: [PATCH 12/28] nftpricefloor_view - fix integer division or modulo by zero --- openbb_terminal/cryptocurrency/defi/llama_view.py | 5 ++++- openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/openbb_terminal/cryptocurrency/defi/llama_view.py b/openbb_terminal/cryptocurrency/defi/llama_view.py index dfc86362450..6c84198cd9a 100644 --- a/openbb_terminal/cryptocurrency/defi/llama_view.py +++ b/openbb_terminal/cryptocurrency/defi/llama_view.py @@ -5,6 +5,8 @@ import logging import os from typing import Optional, Union +import pandas as pd + from openbb_terminal import OpenBBFigure, theme from openbb_terminal.cryptocurrency.cryptocurrency_helpers import read_data_file from openbb_terminal.cryptocurrency.defi import llama_model @@ -128,7 +130,7 @@ def display_defi_protocols( @log_start_end(log=logger) def display_historical_tvl( - dapps: str = "sushiswap", + dapps: str = "", export: Optional[str] = "", sheet_name: Optional[str] = None, external_axes: bool = False, @@ -156,6 +158,7 @@ def display_historical_tvl( if dapp in available_protocols: df = llama_model.get_defi_protocol(dapp) df = df.query("`totalLiquidityUSD` > 0") + df.index = pd.DatetimeIndex(df.index.strftime("%Y-%m-%d")) if not df.empty: fig.add_scatter( x=df.index, diff --git a/openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py b/openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py index 133891a55d9..3ed11e1624c 100644 --- a/openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py +++ b/openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py @@ -5,6 +5,7 @@ __docformat__ = "numpy" import logging import os +import pandas as pd from typing import Optional, Union from openbb_terminal import OpenBBFigure, theme @@ -56,6 +57,9 @@ def display_collections( fig.set_title("Collections Floor Price" if show_fp else "Collections Sales") for collection in df["slug"].head(limit).values: df_collection = nftpricefloor_model.get_floor_price(collection) + df_collection.index = pd.DatetimeIndex( + df_collection.index.rename("date").strftime("%Y-%m-%d") + ) if not df_collection.empty: values = ( df_collection["floorEth"].values From 330f439aed79d48ef8b41e20d32559abe8ab8fc7 Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Fri, 21 Jul 2023 21:32:04 -0700 Subject: [PATCH 13/28] mypy --- openbb_terminal/core/plots/plotly_helper.py | 2 +- openbb_terminal/cryptocurrency/defi/llama_view.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openbb_terminal/core/plots/plotly_helper.py b/openbb_terminal/core/plots/plotly_helper.py index a28b47975f1..68fb219d311 100644 --- a/openbb_terminal/core/plots/plotly_helper.py +++ b/openbb_terminal/core/plots/plotly_helper.py @@ -1349,7 +1349,7 @@ class OpenBBFigure(go.Figure): dt_missing_days = pd.to_datetime(dt_missing_days) if len(dt_missing_days) < 2_000: - rangebreaks: List[Dict[str, Any]] = [dict(values=dt_missing_days)] + rangebreaks = [dict(values=dt_missing_days)] # We get the frequency of the data to hide intra-day gaps if df_data.index[-1].time() != df_data.index[-2].time(): diff --git a/openbb_terminal/cryptocurrency/defi/llama_view.py b/openbb_terminal/cryptocurrency/defi/llama_view.py index 6c84198cd9a..5ee2fecbf8c 100644 --- a/openbb_terminal/cryptocurrency/defi/llama_view.py +++ b/openbb_terminal/cryptocurrency/defi/llama_view.py @@ -168,7 +168,7 @@ def display_historical_tvl( else: print(f"{dapp} not found\n") if export and export != "": - return export_data( + export_data( export, os.path.dirname(os.path.abspath(__file__)), f"dtvl_{dapp}", @@ -176,6 +176,7 @@ def display_historical_tvl( sheet_name, fig, ) + return None return fig.show(external=external_axes) return None @@ -208,7 +209,7 @@ def display_defi_tvl( df = df.tail(limit) if export and export != "": - return export_data( + export_data( export, os.path.dirname(os.path.abspath(__file__)), "stvl", @@ -216,7 +217,7 @@ def display_defi_tvl( sheet_name, fig, ) - + return None fig.add_scatter(x=df["date"], y=df["totalLiquidityUSD"], name="TVL") return fig.show(external=external_axes) From 6367369b39ff7e24bf06a7a9f455f356cb6a5aff Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Fri, 21 Jul 2023 21:42:40 -0700 Subject: [PATCH 14/28] pylint --- openbb_terminal/cryptocurrency/defi/llama_view.py | 4 ++-- openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openbb_terminal/cryptocurrency/defi/llama_view.py b/openbb_terminal/cryptocurrency/defi/llama_view.py index 5ee2fecbf8c..d3db45cd6f4 100644 --- a/openbb_terminal/cryptocurrency/defi/llama_view.py +++ b/openbb_terminal/cryptocurrency/defi/llama_view.py @@ -130,7 +130,7 @@ def display_defi_protocols( @log_start_end(log=logger) def display_historical_tvl( - dapps: str = "", + dapps: str, export: Optional[str] = "", sheet_name: Optional[str] = None, external_axes: bool = False, @@ -152,7 +152,7 @@ def display_historical_tvl( fig.set_title("TVL in dApps") available_protocols = read_data_file("defillama_dapps.json") - + dapp: str = "" if isinstance(available_protocols, dict): for dapp in dapps.split(","): if dapp in available_protocols: diff --git a/openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py b/openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py index 3ed11e1624c..c6d7bf985c5 100644 --- a/openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py +++ b/openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py @@ -5,8 +5,8 @@ __docformat__ = "numpy" import logging import os -import pandas as pd from typing import Optional, Union +import pandas as pd from openbb_terminal import OpenBBFigure, theme from openbb_terminal.cryptocurrency.nft import nftpricefloor_model From fedbbdb86988fbc1a42d96df4bd6d20c1aeca2a7 Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Fri, 21 Jul 2023 22:15:42 -0700 Subject: [PATCH 15/28] fix display_floor_price --- openbb_terminal/cryptocurrency/nft/nftpricefloor_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openbb_terminal/cryptocurrency/nft/nftpricefloor_model.py b/openbb_terminal/cryptocurrency/nft/nftpricefloor_model.py index 682bbbe5b63..7d496f88691 100644 --- a/openbb_terminal/cryptocurrency/nft/nftpricefloor_model.py +++ b/openbb_terminal/cryptocurrency/nft/nftpricefloor_model.py @@ -65,5 +65,7 @@ def get_floor_price(slug: str) -> pd.DataFrame: ) df = df.set_index("timestamps") df.index = pd.to_datetime(df.index * 1_000_000) - return df + df.index = pd.DatetimeIndex(df.index.rename("date").strftime("%Y-%m-%d")) + df = df.reset_index().drop_duplicates(subset=["date"]) + return df.set_index("date") return pd.DataFrame() From 31f595bc994d16ead99054fc20b9c26f2b7c41c8 Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Fri, 21 Jul 2023 22:30:11 -0700 Subject: [PATCH 16/28] update test_get_floor_price --- .../test_get_floor_price[cryptopunks].csv | 411 +----------------- .../nft/test_nftpricefloor_model.py | 2 +- 2 files changed, 3 insertions(+), 410 deletions(-) diff --git a/tests/openbb_terminal/cryptocurrency/nft/csv/test_nftpricefloor_model/test_get_floor_price[cryptopunks].csv b/tests/openbb_terminal/cryptocurrency/nft/csv/test_nftpricefloor_model/test_get_floor_price[cryptopunks].csv index 00f6f28f6bb..60c6d5c654e 100644 --- a/tests/openbb_terminal/cryptocurrency/nft/csv/test_nftpricefloor_model/test_get_floor_price[cryptopunks].csv +++ b/tests/openbb_terminal/cryptocurrency/nft/csv/test_nftpricefloor_model/test_get_floor_price[cryptopunks].csv @@ -1,409 +1,2 @@ -timestamps,floorEth,volumeEth,salesCount -2021-08-03 00:00:00.000,31.450000000000003,1304.77,26 -2021-08-04 00:00:00.000,33.0,5283.160999999999,75 -2021-08-05 00:00:00.000,32.0,8365.669999999996,128 -2021-08-06 00:00:00.000,34.49,12519.731899999992,210 -2021-08-07 00:00:00.000,43.99,14737.215999999991,205 -2021-08-08 00:00:00.000,48.0,3606.9509999999996,49 -2021-08-09 00:00:00.000,45.5,2236.78,34 -2021-08-10 00:00:00.000,39.35,1812.98,26 -2021-08-11 00:00:00.000,41.99,2478.1400000000003,41 -2021-08-12 00:00:00.000,46.68000000000001,2582.34,38 -2021-08-13 00:00:00.000,46.5,1882.6100000000001,25 -2021-08-14 00:00:00.000,43.75,878.89,13 -2021-08-15 00:00:00.000,41.800000000000004,1144.3900000000003,19 -2021-08-16 00:00:00.000,41.800000000000004,1096.3900363399998,26 -2021-08-17 00:00:00.000,41.5,1710.6799999999998,19 -2021-08-18 00:00:00.000,41.5,1392.784,20 -2021-08-19 00:00:00.000,39.95,1698.351,35 -2021-08-20 00:00:00.000,42.0,1981.4900000000005,39 -2021-08-21 00:00:00.000,42.0,3371.0400000000004,47 -2021-08-22 00:00:00.000,42.0,2362.96,36 -2021-08-23 00:00:00.000,42.0,2276.257,35 -2021-08-24 00:00:00.000,52.400000000000006,27066.086866666665,341 -2021-08-25 00:00:00.000,60.00000000000001,11081.929999999997,101 -2021-08-26 00:00:00.000,74.25,6746.669999999999,67 -2021-08-27 00:00:00.000,74.33,4594.996659999999,40 -2021-08-28 00:00:00.000,41.0,19123.551000000007,188 -2021-08-29 00:00:00.000,87.0,43261.40999999901,302 -2021-08-30 00:00:00.000,122.50000000000001,14027.8079,93 -2021-08-31 00:00:00.000,108.9,3947.3700000000003,31 -2021-09-01 00:00:00.000,115.00000000000001,2567.6000000000004,21 -2021-09-02 00:00:00.000,90.0,2666.2471,24 -2021-09-03 00:00:00.000,92.0,2647.3700000000003,25 -2021-09-04 00:00:00.000,93.25,2325.48,21 -2021-09-05 00:00:00.000,92.0,4273.0,19 -2021-09-06 00:00:00.000,99.0,1354.24,13 -2021-09-07 00:00:00.000,96.5,1460.4400000000003,14 -2021-09-08 00:00:00.000,88.88000000000001,2066.5200000000004,18 -2021-09-09 00:00:00.000,86.5,614.99,6 -2021-09-10 00:00:00.000,86.5,522.63,5 -2021-09-11 00:00:00.000,84.0,1063.46,10 -2021-09-12 00:00:00.000,82.99000000000001,2748.9600000000005,9 -2021-09-13 00:00:00.000,82.99000000000001,1064.1,10 -2021-09-14 00:00:00.000,78.0,1074.38,11 -2021-09-15 00:00:00.000,75.0,622.7,7 -2021-09-16 00:00:00.000,74.5,1747.65,16 -2021-09-17 00:00:00.000,74.5,9940.359999999999,90 -2021-09-18 00:00:00.000,101.50000000000001,811.19,7 -2021-09-19 00:00:00.000,97.99000000000001,103.00000000000001,1 -2021-09-20 00:00:00.000,97.99000000000001,851.99,8 -2021-09-21 00:00:00.000,94.99000000000001,1041.23,9 -2021-09-22 00:00:00.000,99.99000000000001,1069.5,10 -2021-09-23 00:00:00.000,95.0,1072.68,10 -2021-09-24 00:00:00.000,96.0,2290.6,19 -2021-09-25 00:00:00.000,96.0,3239.090000000001,25 -2021-09-26 00:00:00.000,102.00000000000001,3440.58,26 -2021-09-27 00:00:00.000,105.00000000000001,1294.39,11 -2021-09-28 00:00:00.000,104.99000000000001,861.6400000000001,7 -2021-09-29 00:00:00.000,103.00000000000001,1891.66,16 -2021-09-30 00:00:00.000,107.50000000000001,3390.71,21 -2021-10-01 00:00:00.000,107.50000000000001,5479.040000000001,43 -2021-10-02 00:00:00.000,110.00000000000001,6733.239999999998,47 -2021-10-03 00:00:00.000,123.49000000000001,2466.03,17 -2021-10-04 00:00:00.000,120.00000000000001,1912.3400000000001,12 -2021-10-05 00:00:00.000,112.00000000000001,3370.5000000000005,27 -2021-10-06 00:00:00.000,115.00000000000001,2207.9300000000003,15 -2021-10-07 00:00:00.000,114.00000000000001,827.4000000000001,6 -2021-10-08 00:00:00.000,116.50000000000001,682.99,5 -2021-10-09 00:00:00.000,113.9,1137.67,9 -2021-10-10 00:00:00.000,107.00000000000001,342.0,3 -2021-10-11 00:00:00.000,109.77000000000001,1030.5,5 -2021-10-12 00:00:00.000,103.69690000000001,675.5,6 -2021-10-13 00:00:00.000,101.69000000000001,943.5200000000001,8 -2021-10-14 00:00:00.000,101.69000000000001,778.8100000000001,6 -2021-10-15 00:00:00.000,103.23,895.4300000000001,8 -2021-10-16 00:00:00.000,105.00000000000001,679.84,6 -2021-10-17 00:00:00.000,103.95,933.2069,8 -2021-10-18 00:00:00.000,103.95,1625.17,13 -2021-10-19 00:00:00.000,104.80000000000001,671.0,5 -2021-10-20 00:00:00.000,99.0,1191.71,9 -2021-10-21 00:00:00.000,96.5,1715.53,15 -2021-10-22 00:00:00.000,90.0,1260.1200000000001,11 -2021-10-23 00:00:00.000,89.69000000000001,1008.4300000000002,9 -2021-10-24 00:00:00.000,90.95,1993.7800000000002,14 -2021-10-25 00:00:00.000,94.95,1017.69,9 -2021-10-26 00:00:00.000,90.95,1327.15,11 -2021-10-27 00:00:00.000,96.0,1581.75,9 -2021-10-28 00:00:00.000,94.95,1599.3600000000004,10 -2021-10-29 00:00:00.000,94.99000000000001,125922.10752488603,14 -2021-10-30 00:00:00.000,93.5,1896.2100000000003,17 -2021-10-31 00:00:00.000,96.9,745.1100000000001,7 -2021-11-01 00:00:00.000,96.5,724.99,6 -2021-11-02 00:00:00.000,96.5,929.794,9 -2021-11-03 00:00:00.000,94.9,582.45,5 -2021-11-04 00:00:00.000,93.5,1189.6200000000001,11 -2021-11-05 00:00:00.000,91.95,832.000223,9 -2021-11-06 00:00:00.000,91.95,314.95,3 -2021-11-07 00:00:00.000,89.95,1542.9,13 -2021-11-08 00:00:00.000,87.0,1147.8600000000001,10 -2021-11-09 00:00:00.000,79.42,2089.69,13 -2021-11-10 00:00:00.000,77.77000000000001,1398.0900000000001,10 -2021-11-11 00:00:00.000,82.5,1502.5,15 -2021-11-12 00:00:00.000,78.88000000000001,1527.33,12 -2021-11-13 00:00:00.000,75.0,843.59,9 -2021-11-14 00:00:00.000,77.0,1055.8200000000002,11 -2021-11-15 00:00:00.000,80.0,2205.12,24 -2021-11-16 00:00:00.000,85.0,1811.8000000000002,17 -2021-11-17 00:00:00.000,83.0,1270.3500000000001,10 -2021-11-18 00:00:00.000,87.99000000000001,1269.48,12 -2021-11-19 00:00:00.000,88.5,856.3,9 -2021-11-20 00:00:00.000,88.95,592.49,6 -2021-11-21 00:00:00.000,89.0,859.44,7 -2021-11-22 00:00:00.000,87.5,894.86,8 -2021-11-23 00:00:00.000,85.0,1062.1000000000001,9 -2021-11-24 00:00:00.000,84.5,834.4000000000001,8 -2021-11-25 00:00:00.000,83.0,995.38,9 -2021-11-26 00:00:00.000,84.95,1153.5,10 -2021-11-27 00:00:00.000,85.95,375.221,5 -2021-11-28 00:00:00.000,82.95,396.95,4 -2021-11-29 00:00:00.000,82.95,452.0,4 -2021-11-30 00:00:00.000,81.75,272.95000000000005,3 -2021-12-01 00:00:00.000,80.0,580.0,7 -2021-12-02 00:00:00.000,78.95,1036.3400000000001,11 -2021-12-03 00:00:00.000,75.0,1021.85,11 -2021-12-04 00:00:00.000,67.0,2602.4100000000003,31 -2021-12-05 00:00:00.000,66.0,1072.25,14 -2021-12-06 00:00:00.000,66.0,1557.5,15 -2021-12-07 00:00:00.000,66.66000000000001,2791.2199999999993,33 -2021-12-08 00:00:00.000,68.69000000000001,815.0900000000001,9 -2021-12-09 00:00:00.000,72.95,1119.3900000000003,13 -2021-12-10 00:00:00.000,70.95,3807.9799999999996,16 -2021-12-11 00:00:00.000,68.0,1271.3400100000001,15 -2021-12-12 00:00:00.000,67.95,638.83,8 -2021-12-13 00:00:00.000,68.0,595.79,7 -2021-12-14 00:00:00.000,63.00000000000001,1653.38,18 -2021-12-15 00:00:00.000,63.00000000000001,1064.900000001,13 -2021-12-16 00:00:00.000,62.00000000000001,1043.81,14 -2021-12-17 00:00:00.000,60.00000000000001,1029.91,15 -2021-12-18 00:00:00.000,60.00000000000001,1482.13,15 -2021-12-19 00:00:00.000,60.980000000000004,240.00000000000003,3 -2021-12-20 00:00:00.000,59.690000000000005,510.16,6 -2021-12-21 00:00:00.000,59.95,706.0,7 -2021-12-22 00:00:00.000,55.00000000000001,1430.36,18 -2021-12-23 00:00:00.000,52.690000000000005,1680.181,27 -2021-12-24 00:00:00.000,51.99,962.94,16 -2021-12-25 00:00:00.000,55.00000000000001,4990.149999999999,63 -2021-12-26 00:00:00.000,65.0,1231.16,15 -2021-12-27 00:00:00.000,65.45,1084.2200000000003,14 -2021-12-28 00:00:00.000,66.95,550.98,7 -2021-12-29 00:00:00.000,65.0,671.31,10 -2021-12-30 00:00:00.000,65.0,575.8399999999999,8 -2021-12-31 00:00:00.000,65.0,1911.1300000000003,23 -2022-01-01 00:00:00.000,63.88,2150.38,24 -2022-01-02 00:00:00.000,62.50000000000001,1427.8169000000003,22 -2022-01-03 00:00:00.000,66.7,740.9000000000001,7 -2022-01-04 00:00:00.000,67.69000000000001,719.4100000000001,8 -2022-01-05 00:00:00.000,66.69,202.14000000000001,3 -2022-01-06 00:00:00.000,62.00000000000001,464.06,7 -2022-01-07 00:00:00.000,59.95,1386.9,8 -2022-01-08 00:00:00.000,59.95,734.6201,11 -2022-01-09 00:00:00.000,58.95,959.9200000000002,12 -2022-01-10 00:00:00.000,60.95,182.34500000000003,2 -2022-01-11 00:00:00.000,60.00000000000001,782.94,11 -2022-01-12 00:00:00.000,60.690000000000005,588.25,8 -2022-01-13 00:00:00.000,59.95,473.12,7 -2022-01-14 00:00:00.000,59.95,128.88000000000002,2 -2022-01-15 00:00:00.000,59.95,630.9620000000001,10 -2022-01-16 00:00:00.000,59.95,593.89,9 -2022-01-17 00:00:00.000,62.00000000000001,265.18,4 -2022-01-18 00:00:00.000,61.95,737.4200000000001,10 -2022-01-19 00:00:00.000,60.49,779.47,8 -2022-01-20 00:00:00.000,60.00000000000001,982.14,15 -2022-01-21 00:00:00.000,61.95,1517.3200000000004,21 -2022-01-22 00:00:00.000,63.95,1134.66,14 -2022-01-23 00:00:00.000,63.550000000000004,1671.4266000000005,23 -2022-01-24 00:00:00.000,67.5,2219.2200000000003,28 -2022-01-25 00:00:00.000,66.25,1126.92,14 -2022-01-26 00:00:00.000,66.25,8464.919999999996,105 -2022-01-27 00:00:00.000,77.95,3642.51,33 -2022-01-28 00:00:00.000,79.5,1071.5100000000002,12 -2022-01-29 00:00:00.000,79.5,3892.79,43 -2022-01-30 00:00:00.000,83.76,1642.2900000000002,16 -2022-01-31 00:00:00.000,81.0,2107.2200000000003,10 -2022-02-01 00:00:00.000,79.0,2474.6000000000004,24 -2022-02-02 00:00:00.000,82.45,1339.3,15 -2022-02-03 00:00:00.000,74.95,1882.94,18 -2022-02-04 00:00:00.000,68.95,946.6400000000001,12 -2022-02-05 00:00:00.000,66.95,690.9000000000001,9 -2022-02-06 00:00:00.000,65.32,753.1600000000001,10 -2022-02-07 00:00:00.000,69.95,564.13,7 -2022-02-08 00:00:00.000,68.0,1133.3700000000001,14 -2022-02-09 00:00:00.000,67.45,837.29,10 -2022-02-10 00:00:00.000,66.95,3555.8500000000004,13 -2022-02-11 00:00:00.000,66.95,369.3500000000001,5 -2022-02-12 00:00:00.000,64.99,878.58,8 -2022-02-13 00:00:00.000,63.00000000000001,8962.570000000002,13 -2022-02-14 00:00:00.000,68.45,1866.2100000000003,23 -2022-02-15 00:00:00.000,72.5,376.45000000000005,4 -2022-02-16 00:00:00.000,71.5,412.72,5 -2022-02-17 00:00:00.000,69.45,167.48000000000002,2 -2022-02-18 00:00:00.000,67.95,357.08000000000015,5 -2022-02-19 00:00:00.000,67.69000000000001,423.12,6 -2022-02-20 00:00:00.000,67.2,359.0,4 -2022-02-21 00:00:00.000,65.0,562.15,7 -2022-02-22 00:00:00.000,66.5,513.9000000000003,6 -2022-02-23 00:00:00.000,65.0,447.9000000000001,5 -2022-02-24 00:00:00.000,65.0,469.95,6 -2022-02-25 00:00:00.000,59.0,1007.6500000000002,15 -2022-02-26 00:00:00.000,61.99,509.99,6 -2022-02-27 00:00:00.000,62.690000000000005,592.52,6 -2022-02-28 00:00:00.000,61.95,1381.92,18 -2022-03-01 00:00:00.000,67.98,702.45,8 -2022-03-02 00:00:00.000,68.0,428.3400000000001,6 -2022-03-03 00:00:00.000,68.5,776.3000000000001,11 -2022-03-04 00:00:00.000,68.8,748.51,10 -2022-03-05 00:00:00.000,67.5,794.08,10 -2022-03-06 00:00:00.000,68.4,208.0,3 -2022-03-07 00:00:00.000,66.95,270.4500000000002,4 -2022-03-08 00:00:00.000,65.0,136.96,2 -2022-03-09 00:00:00.000,64.95,371.34000000000003,5 -2022-03-10 00:00:00.000,64.95,1290.89,17 -2022-03-11 00:00:00.000,65.95,349.359994,5 -2022-03-12 00:00:00.000,66.5,4091.83,53 -2022-03-13 00:00:00.000,70.4,4068.5,46 -2022-03-14 00:00:00.000,66.75,754.2000000000002,10 -2022-03-15 00:00:00.000,69.5,561.19,7 -2022-03-16 00:00:00.000,67.0,317.5,4 -2022-03-17 00:00:00.000,62.25,729.9400000000003,10 -2022-03-18 00:00:00.000,62.25,1294.0500000000002,18 -2022-03-19 00:00:00.000,66.9,2239.4400000000005,30 -2022-03-20 00:00:00.000,69.9,2206.5700000000006,28 -2022-03-21 00:00:00.000,69.9,1043.43,14 -2022-03-22 00:00:00.000,71.76,940.9400000000002,12 -2022-03-23 00:00:00.000,72.5,641.61,8 -2022-03-24 00:00:00.000,69.9,565.5,6 -2022-03-25 00:00:00.000,71.95,824.6800000000001,10 -2022-03-26 00:00:00.000,71.0,390.20000000000005,3 -2022-03-27 00:00:00.000,70.95,376.99,5 -2022-03-28 00:00:00.000,70.95,399.43,5 -2022-03-29 00:00:00.000,71.0,983.8900000000003,12 -2022-03-30 00:00:00.000,71.0,217.00000000000003,1 -2022-03-31 00:00:00.000,69.0,671.08,8 -2022-04-01 00:00:00.000,68.89,281.5000000000001,4 -2022-04-02 00:00:00.000,67.5,288.45,4 -2022-04-03 00:00:00.000,67.0,1183.77,16 -2022-04-04 00:00:00.000,67.95,881.1300000000001,7 -2022-04-05 00:00:00.000,68.4,672.0000000000005,9 -2022-04-06 00:00:00.000,67.5,583.5000000000002,8 -2022-04-07 00:00:00.000,66.0,282.0000000000002,4 -2022-04-08 00:00:00.000,66.5,271.19,4 -2022-04-09 00:00:00.000,66.0,200.91,3 -2022-04-10 00:00:00.000,66.0,202.0,3 -2022-04-11 00:00:00.000,63.0,349.66,3 -2022-04-12 00:00:00.000,64.95,517.6000000000003,7 -2022-04-13 00:00:00.000,59.0,644.6700000000003,9 -2022-04-14 00:00:00.000,58.88,2053.8390000000004,15 -2022-04-15 00:00:00.000,62.0,703.994,10 -2022-04-16 00:00:00.000,63.0,526.0,5 -2022-04-17 00:00:00.000,63.69,409.1899,6 -2022-04-18 00:00:00.000,62.99,427.93,6 -2022-04-19 00:00:00.000,61.0,403.16,5 -2022-04-20 00:00:00.000,61.75,340.64,5 -2022-04-21 00:00:00.000,58.0,1365.7700000000016,18 -2022-04-22 00:00:00.000,56.95,845.6800000000001,13 -2022-04-23 00:00:00.000,55.2,1374.3300000000004,19 -2022-04-24 00:00:00.000,59.0,733.5000000000001,8 -2022-04-25 00:00:00.000,59.95,551.87,8 -2022-04-26 00:00:00.000,60.0,815.3000000000006,11 -2022-04-27 00:00:00.000,61.3,901.4900000000001,11 -2022-04-28 00:00:00.000,59.95,538.3800000000005,7 -2022-04-29 00:00:00.000,61.94,817.7900000000001,12 -2022-04-30 00:00:00.000,58.9,910.1100000000022,14 -2022-05-01 00:00:00.000,60.95,610.0500000000012,9 -2022-05-02 00:00:00.000,60.95,402.18,5 -2022-05-03 00:00:00.000,60.94,625.8399999999999,7 -2022-05-04 00:00:00.000,60.0,392.34999999999997,6 -2022-05-05 00:00:00.000,61.0,605.2100000000008,7 -2022-05-06 00:00:00.000,60.95,198.16000000000003,3 -2022-05-07 00:00:00.000,58.95,188.0,3 -2022-05-08 00:00:00.000,55.97,193.9500000000017,3 -2022-05-09 00:00:00.000,54.9,397.82000000000005,7 -2022-05-10 00:00:00.000,49.99,643.8521000000009,10 -2022-05-11 00:00:00.000,52.55,416.90000000000003,7 -2022-05-12 00:00:00.000,49.69,519.6800000000001,9 -2022-05-13 00:00:00.000,49.95,951.5600000000029,16 -2022-05-14 00:00:00.000,47.5,581.7300000000001,10 -2022-05-15 00:00:00.000,48.85,419.20000000000005,5 -2022-05-16 00:00:00.000,48.85,1783.108,30 -2022-05-17 00:00:00.000,53.8,550.9300000000001,9 -2022-05-18 00:00:00.000,51.51,220.75000000000003,4 -2022-05-19 00:00:00.000,51.51,342.96000000000004,6 -2022-05-20 00:00:00.000,51.9,447.86,6 -2022-05-21 00:00:00.000,50.8,156.85000000000002,3 -2022-05-22 00:00:00.000,50.9,124.0,2 -2022-05-23 00:00:00.000,50.8,132.2,2 -2022-05-24 00:00:00.000,47.9,952.6000000000008,11 -2022-05-25 00:00:00.000,45.55,257.5500000000008,5 -2022-05-26 00:00:00.000,45.69,248.54999999999998,5 -2022-05-27 00:00:00.000,44.69,570.48,11 -2022-05-28 00:00:00.000,43.0,775.8300000000002,13 -2022-05-29 00:00:00.000,44.0,247.0,4 -2022-05-30 00:00:00.000,45.89,73.99000000000001,1 -2022-05-31 00:00:00.000,44.95,415.59000000000003,8 -2022-06-01 00:00:00.000,47.65,419.11000000000007,8 -2022-06-02 00:00:00.000,45.99,327.43,6 -2022-06-03 00:00:00.000,48.9,309.69,5 -2022-06-04 00:00:00.000,48.9,121.69000000000003,2 -2022-06-05 00:00:00.000,48.9,160.96,3 -2022-06-06 00:00:00.000,47.95,57.10000000000021,3 -2022-06-07 00:00:00.000,47.95,53.00000000000001,1 -2022-06-08 00:00:00.000,47.95,348.25000000000006,6 -2022-06-09 00:00:00.000,45.99,366.34000000000003,7 -2022-06-10 00:00:00.000,45.69,458.94000000000113,9 -2022-06-11 00:00:00.000,47.45,522.8000000000001,10 -2022-06-12 00:00:00.000,48.0,373.2900000000011,7 -2022-06-13 00:00:00.000,48.24,646.619,12 -2022-06-14 00:00:00.000,46.95,1117.8600000000001,17 -2022-06-15 00:00:00.000,46.5,1899.1600000000012,31 -2022-06-16 00:00:00.000,47.99,1099.1190000000026,20 -2022-06-17 00:00:00.000,48.5,578.99,10 -2022-06-18 00:00:00.000,48.85,1007.4290000000001,18 -2022-06-19 00:00:00.000,49.45,6828.319899999994,97 -2022-06-20 00:00:00.000,61.0,7816.869999999994,94 -2022-06-21 00:00:00.000,66.65,3120.5741999999996,37 -2022-06-22 00:00:00.000,65.6,1277.0400000000002,12 -2022-06-23 00:00:00.000,65.0,1052.5,4 -2022-06-24 00:00:00.000,62.95,637.4794200000001,8 -2022-06-25 00:00:00.000,62.95,755.2566600000023,9 -2022-06-26 00:00:00.000,63.95,1191.73,15 -2022-06-27 00:00:00.000,65.95,1472.8506900000002,19 -2022-06-28 00:00:00.000,66.95,419.92,5 -2022-06-29 00:00:00.000,66.0,854.6900000000011,11 -2022-06-30 00:00:00.000,65.95,820.5300000000022,6 -2022-07-01 00:00:00.000,65.95,394.0,4 -2022-07-02 00:00:00.000,65.95,447.9,6 -2022-07-03 00:00:00.000,65.95,499.35,7 -2022-07-04 00:00:00.000,66.49,430.99,6 -2022-07-05 00:00:00.000,65.0,147.3,2 -2022-07-06 00:00:00.000,66.95,302.38,4 -2022-07-07 00:00:00.000,66.95,368.99,4 -2022-07-08 00:00:00.000,66.95,427.99,5 -2022-07-09 00:00:00.000,67.45,1047.38,14 -2022-07-10 00:00:00.000,71.95,4540.429999999999,49 -2022-07-11 00:00:00.000,74.65,2446.4200000000005,28 -2022-07-12 00:00:00.000,75.95,951.07,11 -2022-07-13 00:00:00.000,75.85,4348.990000000001,19 -2022-07-14 00:00:00.000,76.8,1887.2991435185188,20 -2022-07-15 00:00:00.000,77.93,1597.5400000000002,18 -2022-07-16 00:00:00.000,77.93,5751.009999999999,30 -2022-07-17 00:00:00.000,78.95,3534.7000000000003,36 -2022-07-18 00:00:00.000,83.4,4668.233699999998,40 -2022-07-19 00:00:00.000,83.0,1425.4,16 -2022-07-20 00:00:00.000,80.95,580.9500000000022,6 -2022-07-21 00:00:00.000,81.0,814.1400000000119,9 -2022-07-22 00:00:00.000,79.45,433.370000000013,5 -2022-07-23 00:00:00.000,79.4,177.0,2 -2022-07-24 00:00:00.000,78.95,198.0,2 -2022-07-25 00:00:00.000,75.95,316.500000000013,4 -2022-07-26 00:00:00.000,74.95,410.40000000000003,5 -2022-07-27 00:00:00.000,69.0,462.4000000000401,6 -2022-07-28 00:00:00.000,69.69,327.89,4 -2022-07-29 00:00:00.000,70.69,302.5,3 -2022-07-30 00:00:00.000,68.95,411.95000000000005,5 -2022-07-31 00:00:00.000,68.4,225.00000000003007,3 -2022-08-01 00:00:00.000,67.67,587.75,5 -2022-08-02 00:00:00.000,67.0,1114.8700000000001,14 -2022-08-03 00:00:00.000,73.95,235.95,3 -2022-08-04 00:00:00.000,74.69,946.29,11 -2022-08-05 00:00:00.000,75.95,743.95,6 -2022-08-06 00:00:00.000,74.69,406.58,5 -2022-08-07 00:00:00.000,73.5,1241.68,11 -2022-08-08 00:00:00.000,73.95,648.1200000000001,7 -2022-08-09 00:00:00.000,74.5,336.19,4 -2022-08-10 00:00:00.000,73.95,750.49,7 -2022-08-11 00:00:00.000,73.94,1113.75,12 -2022-08-12 00:00:00.000,74.0,756.3,7 -2022-08-13 00:00:00.000,71.95,921.950000000015,10 -2022-08-14 00:00:00.000,69.95,723.35,5 -2022-08-15 00:00:00.000,69.95,397.3200000000151,5 -2022-08-16 00:00:00.000,69.5,542.4200000000001,7 -2022-08-17 00:00:00.000,68.5,217.57,3 -2022-08-18 00:00:00.000,68.5,582.1,7 -2022-08-19 00:00:00.000,67.45,370.20000000002,4 -2022-08-20 00:00:00.000,65.5,125.99000000003201,2 -2022-08-21 00:00:00.000,65.5,281.5,4 -2022-08-22 00:00:00.000,66.45,443.950000000102,4 -2022-08-23 00:00:00.000,66.0,526.5000000001061,8 -2022-08-24 00:00:00.000,66.0,257.91,3 -2022-08-25 00:00:00.000,65.95,281.25000000004206,4 -2022-08-26 00:00:00.000,67.45,229.4,3 -2022-08-27 00:00:00.000,67.49,167.5,2 -2022-08-28 00:00:00.000,67.49,243.48000000000002,3 -2022-08-29 00:00:00.000,67.45,70.0,1 -2022-08-30 00:00:00.000,67.45,175.00000000004206,2 -2022-08-31 00:00:00.000,67.0,205.45,3 -2022-09-01 00:00:00.000,66.95,67.45,1 -2022-09-02 00:00:00.000,66.45,71.0,1 -2022-09-03 00:00:00.000,65.95,0.0,0 -2022-09-04 00:00:00.000,65.0,249.0,3 -2022-09-05 00:00:00.000,64.95,71.0,1 -2022-09-06 00:00:00.000,63.0,243.00000000008407,3 -2022-09-07 00:00:00.000,61.95,312.90000000003204,5 -2022-09-08 00:00:00.000,62.95,507.34,7 -2022-09-09 00:00:00.000,62.0,135.81,2 -2022-09-10 00:00:00.000,61.95,390.39000000000004,6 -2022-09-11 00:00:00.000,61.95,0.0,0 -2022-09-12 00:00:00.000,61.95,272.94,4 -2022-09-13 00:00:00.000,61.95,62.00000000000001,1 -2022-09-13 11:15:28.616,61.95,240.00000000000003,1 +date,floorEth,volumeEth,salesCount +2021-08-03,31.450000000000003,1304.77,26 diff --git a/tests/openbb_terminal/cryptocurrency/nft/test_nftpricefloor_model.py b/tests/openbb_terminal/cryptocurrency/nft/test_nftpricefloor_model.py index 07cddb1dc08..d2f7f529029 100644 --- a/tests/openbb_terminal/cryptocurrency/nft/test_nftpricefloor_model.py +++ b/tests/openbb_terminal/cryptocurrency/nft/test_nftpricefloor_model.py @@ -12,7 +12,7 @@ from openbb_terminal.cryptocurrency.nft import nftpricefloor_model ) def test_get_floor_price(slug, recorder): df_floor_price = nftpricefloor_model.get_floor_price(slug) - recorder.capture(df_floor_price) + recorder.capture(df_floor_price.head(1)) @pytest.mark.vcr From d85cae6193da4bf610aa2f3de4064eb8e58427d7 Mon Sep 17 00:00:00 2001 From: OpenBB Date: Sat, 22 Jul 2023 09:01:40 -0700 Subject: [PATCH 17/28] fix windows int overflow economy/edebt --- openbb_terminal/economy/commodity_model.py | 8 ++++---- .../economy/csv/test_commodity_model/test_get_debt.csv | 4 ++-- .../economy/txt/test_commodity_view/test_display_debt.txt | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openbb_terminal/economy/commodity_model.py b/openbb_terminal/economy/commodity_model.py index d28884f478d..883f42666c6 100644 --- a/openbb_terminal/economy/commodity_model.py +++ b/openbb_terminal/economy/commodity_model.py @@ -44,15 +44,15 @@ def get_debt() -> pd.DataFrame: "Date": "As Of", } ) - df["USD Debt"] = df["USD Debt"].apply(lambda x: format_number(x)).astype(int) - df["USD Per Capita"] = df["USD Per Capita"].astype(int) - df["Rank"] = df["USD Debt"].rank(ascending=False).astype(int) + df["USD Debt"] = df["USD Debt"].apply(lambda x: format_number(x)).astype("int64") + df["USD Per Capita"] = df["USD Per Capita"].astype("int64") + df["Rank"] = df["USD Debt"].rank(ascending=False).astype("int64") date = df["As Of"].astype(str) dates = [] for i in date.index: dates.append(date[i].split("[")[0]) df["As Of"] = dates - df["As Of"] = df["As Of"].str.replace("31 September", "30 September") + df["As Of"] = df["As Of"].str.replace("31 September", "30 September").str.strip() indexes = ["Rank", "As Of", "Country", "USD Per Capita", "USD Debt", "% of GDP"] df = df[indexes] diff --git a/tests/openbb_terminal/economy/csv/test_commodity_model/test_get_debt.csv b/tests/openbb_terminal/economy/csv/test_commodity_model/test_get_debt.csv index 557eb157da3..c26d8bbbcb2 100644 --- a/tests/openbb_terminal/economy/csv/test_commodity_model/test_get_debt.csv +++ b/tests/openbb_terminal/economy/csv/test_commodity_model/test_get_debt.csv @@ -23,7 +23,7 @@ 21,22,January 2023,Indonesia,1431,518000000000,39.5 22,23,30 June 2017,Denmark,85700,492000000000,158.0 23,24,1 September 2021,Russia,3700,489000000000,32.0 -24,25,31 March 2022 ,Turkey,5155,444000000000,55.0 +24,25,31 March 2022,Turkey,5155,444000000000,55.0 25,26,30 September 2022,Argentina,6037,382000000000,79.3 26,27,September 2022,Greece,42800,350000000000,175.7 27,28,December 2022,Poland,9500,344000000000,49.3 @@ -104,7 +104,7 @@ 102,103,31 December 2016 est.,Laos,1700,12000000000,53.0 103,104,31 December 2016 est.,Nicaragua,1800,11100000000,83.0 104,105,31 December 2016 est.,Zimbabwe,670,10900000000,77.0 -105,106,31 March 2020 ,Luxembourg,114704,10600000000,22.1 +105,106,31 March 2020,Luxembourg,114704,10600000000,22.1 106,107,31 December 2020,Albania,3634,10500000000,66.0 107,108,31 December 2015,Ivory Coast,420,10000000000,24.0 108,109,31 December 2016,Cambodia,600,9820000000,57.0 diff --git a/tests/openbb_terminal/economy/txt/test_commodity_view/test_display_debt.txt b/tests/openbb_terminal/economy/txt/test_commodity_view/test_display_debt.txt index 21f6f41f465..c36000a8759 100644 --- a/tests/openbb_terminal/economy/txt/test_commodity_view/test_display_debt.txt +++ b/tests/openbb_terminal/economy/txt/test_commodity_view/test_display_debt.txt @@ -23,7 +23,7 @@ 21 22 January 2023 Indonesia 1431 518000000000 39.50 22 23 30 June 2017 Denmark 85700 492000000000 158.00 23 24 1 September 2021 Russia 3700 489000000000 32.00 -24 25 31 March 2022 Turkey 5155 444000000000 55.00 +24 25 31 March 2022 Turkey 5155 444000000000 55.00 25 26 30 September 2022 Argentina 6037 382000000000 79.30 26 27 September 2022 Greece 42800 350000000000 175.70 27 28 December 2022 Poland 9500 344000000000 49.30 @@ -104,7 +104,7 @@ 102 103 31 December 2016 est. Laos 1700 12000000000 53.00 103 104 31 December 2016 est. Nicaragua 1800 11100000000 83.00 104 105 31 December 2016 est. Zimbabwe 670 10900000000 77.00 -105 106 31 March 2020 Luxembourg 114704 10600000000 22.10 +105 106 31 March 2020 Luxembourg 114704 10600000000 22.10 106 107 31 December 2020 Albania 3634 10500000000 66.00 107 108 31 December 2015 Ivory Coast 420 10000000000 24.00 108 109 31 December 2016 Cambodia 600 9820000000 57.00 From 7121abf7d68143bcc1aac8a56b483bc3697c560a Mon Sep 17 00:00:00 2001 From: OpenBB Date: Sat, 22 Jul 2023 09:22:46 -0700 Subject: [PATCH 18/28] rename 1Year column to fix returning as 1970-01-01 --- openbb_terminal/economy/finviz_view.py | 11 ++++++++++- .../test_display_performance[False].txt | 2 +- .../test_display_performance[True].txt | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/openbb_terminal/economy/finviz_view.py b/openbb_terminal/economy/finviz_view.py index b39af3b5d80..4d913b2dea0 100644 --- a/openbb_terminal/economy/finviz_view.py +++ b/openbb_terminal/economy/finviz_view.py @@ -91,7 +91,16 @@ def display_performance( Export data to csv,json,xlsx or png,jpg,pdf,svg file """ df_group = finviz_model.get_performance_data(group, sortby, ascend) - df_group = df_group.rename(columns={"Name": ""}) + df_group = df_group.rename( + columns={ + "Name": "", + "Week": "1W", + "Month": "1M", + "3Month": "3M", + "6Month": "6M", + "1Year": "1Y", + } + ) if df_group.empty: return print_rich_table( diff --git a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[False].txt b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[False].txt index 4d3bca4aa90..c5e93bbbce3 100644 --- a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[False].txt +++ b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[False].txt @@ -1,4 +1,4 @@ - Week Month 3Month 6Month 1Year YTD Recom AvgVolume RelVolume Change Volume + 1W 1M 3M 6M 1Y YTD Recom AvgVolume RelVolume Change Volume 0 Basic Materials 0.0303 0.0337 0.0721 0.1212 0.1058 0.0419 2.21 5.643900e+08 1.70 0.0070 9.613600e+08 1 Communication Services 0.0637 -0.0258 -0.1031 -0.1558 -0.0248 -0.1145 1.88 7.649600e+08 1.78 0.0169 1.360000e+09 2 Consumer Cyclical 0.1093 -0.0505 -0.0915 -0.1022 -0.0962 -0.1226 2.06 1.340000e+09 1.78 0.0256 2.390000e+09 diff --git a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[True].txt b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[True].txt index 4d3bca4aa90..c5e93bbbce3 100644 --- a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[True].txt +++ b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[True].txt @@ -1,4 +1,4 @@ - Week Month 3Month 6Month 1Year YTD Recom AvgVolume RelVolume Change Volume + 1W 1M 3M 6M 1Y YTD Recom AvgVolume RelVolume Change Volume 0 Basic Materials 0.0303 0.0337 0.0721 0.1212 0.1058 0.0419 2.21 5.643900e+08 1.70 0.0070 9.613600e+08 1 Communication Services 0.0637 -0.0258 -0.1031 -0.1558 -0.0248 -0.1145 1.88 7.649600e+08 1.78 0.0169 1.360000e+09 2 Consumer Cyclical 0.1093 -0.0505 -0.0915 -0.1022 -0.0962 -0.1226 2.06 1.340000e+09 1.78 0.0256 2.390000e+09 From 2b1e04679cbc2b93f88190e7731033d605880619 Mon Sep 17 00:00:00 2001 From: OpenBB Date: Sat, 22 Jul 2023 09:57:51 -0700 Subject: [PATCH 19/28] fix Finviz screener Perf 1Y returning as 1970-01-01 --- .../comparison_analysis/finviz_compare_model.py | 17 ++++++++++++++++- openbb_terminal/stocks/screener/finviz_model.py | 14 ++++++++++++++ openbb_terminal/stocks/screener/finviz_view.py | 16 ++++++++-------- .../stocks/screener/screener_controller.py | 2 +- .../test_get_comparison_data[performance].csv | 2 +- .../test_get_screener_data[performance].csv | 2 +- 6 files changed, 41 insertions(+), 12 deletions(-) diff --git a/openbb_terminal/stocks/comparison_analysis/finviz_compare_model.py b/openbb_terminal/stocks/comparison_analysis/finviz_compare_model.py index cc89e4186e0..899b40019be 100644 --- a/openbb_terminal/stocks/comparison_analysis/finviz_compare_model.py +++ b/openbb_terminal/stocks/comparison_analysis/finviz_compare_model.py @@ -79,6 +79,7 @@ def get_comparison_data(similar: List[str], data_type: str = "overview"): screen = ownership.Ownership() elif data_type == "performance": screen = performance.Performance() + elif data_type == "technical": screen = technical.Technical() else: @@ -87,7 +88,21 @@ def get_comparison_data(similar: List[str], data_type: str = "overview"): screen.set_filter(ticker=",".join(similar)) try: - return screen.screener_view(verbose=0) + screen_df = screen.screener_view(verbose=0) + screen_df.columns = screen_df.columns.str.strip() + screen_df = screen_df.rename( + columns={ + "Perf Week": "1W", + "Perf Month": "1M", + "Perf Quart": "3M", + "Perf Half": "6M", + "Perf Year": "1Y", + "Perf YTD": "YTD", + "Volatility W": "1W Volatility", + "Volatility M": "1M Volatility", + } + ) + return screen_df except IndexError: console.print("[red]Invalid data from website[red]\n") return pd.DataFrame() diff --git a/openbb_terminal/stocks/screener/finviz_model.py b/openbb_terminal/stocks/screener/finviz_model.py index 65ab9b3aed4..5f825739626 100644 --- a/openbb_terminal/stocks/screener/finviz_model.py +++ b/openbb_terminal/stocks/screener/finviz_model.py @@ -191,6 +191,20 @@ def get_screener_data( df_screen.columns = [val.strip("\n") for val in df_screen.columns] if "Company" in df_screen.columns: df_screen["Company"] = df_screen["Company"].str.replace(",", "") + df_screen.columns = df_screen.columns.str.strip() + if data_type == "performance": + df_screen = df_screen.rename( + columns={ + "Perf Week": "1W", + "Perf Month": "1M", + "Perf Quart": "3M", + "Perf Half": "6M", + "Perf Year": "1Y", + "Perf YTD": "YTD", + "Volatility W": "1W Volatility", + "Volatility M": "1M Volatility", + } + ) return df_screen diff --git a/openbb_terminal/stocks/screener/finviz_view.py b/openbb_terminal/stocks/screener/finviz_view.py index 30da375525f..fdc8f786aa8 100644 --- a/openbb_terminal/stocks/screener/finviz_view.py +++ b/openbb_terminal/stocks/screener/finviz_view.py @@ -90,14 +90,14 @@ d_cols_to_sort = { ], "performance": [ "Ticker", - "Perf Week", - "Perf Month", - "Perf Quart", - "Perf Half", - "Perf Year", - "Perf YTD", - "Volatility W", - "Volatility M", + "1W", + "1M", + "3M", + "6M", + "1Y", + "YTD", + "1W Volatility", + "1M Volatility", "Recom", "Avg Volume", "Rel Volume", diff --git a/openbb_terminal/stocks/screener/screener_controller.py b/openbb_terminal/stocks/screener/screener_controller.py index 49c804e2c20..36e32e42e02 100644 --- a/openbb_terminal/stocks/screener/screener_controller.py +++ b/openbb_terminal/stocks/screener/screener_controller.py @@ -540,7 +540,7 @@ class ScreenerController(BaseController): choices=screener_helper.finviz_choices("performance"), type=str.lower, dest="sort", - default="perfytd", + default="ytd", metavar="SORTBY", help="Sort elements of the table.", ) diff --git a/tests/openbb_terminal/stocks/comparison_analysis/csv/test_finviz_compare_model/test_get_comparison_data[performance].csv b/tests/openbb_terminal/stocks/comparison_analysis/csv/test_finviz_compare_model/test_get_comparison_data[performance].csv index 2a01191baf2..bce2ad61cfb 100644 --- a/tests/openbb_terminal/stocks/comparison_analysis/csv/test_finviz_compare_model/test_get_comparison_data[performance].csv +++ b/tests/openbb_terminal/stocks/comparison_analysis/csv/test_finviz_compare_model/test_get_comparison_data[performance].csv @@ -1,2 +1,2 @@ -,Ticker,Perf Week,Perf Month,Perf Quart,Perf Half,Perf Year,Perf YTD,Volatility W,Volatility M,Recom,Avg Volume,Rel Volume,Price,Change,Volume +,Ticker,1W,1M,3M,6M,1Y,YTD,1W Volatility,1M Volatility,Recom,Avg Volume,Rel Volume,Price,Change,Volume 0,GM,-0.07769999999999999,-0.002,0.051100000000000007,0.0063,-0.3714,0.0508,0.0255,0.0277,2.2,13360000.0,0.0,35.35,0.0,0.0 diff --git a/tests/openbb_terminal/stocks/screener/csv/test_finviz_model/test_get_screener_data[performance].csv b/tests/openbb_terminal/stocks/screener/csv/test_finviz_model/test_get_screener_data[performance].csv index 1bef1f71b77..66cd4f7feac 100644 --- a/tests/openbb_terminal/stocks/screener/csv/test_finviz_model/test_get_screener_data[performance].csv +++ b/tests/openbb_terminal/stocks/screener/csv/test_finviz_model/test_get_screener_data[performance].csv @@ -1,4 +1,4 @@ -,Ticker,Perf Week,Perf Month,Perf Quart,Perf Half,Perf Year,Perf YTD,Volatility W,Volatility M,Recom,Avg Volume,Rel Volume,Price,Change,Volume +,Ticker,1W,1M,3M,6M,1Y,YTD,1W Volatility,1M Volatility,Recom,Avg Volume,Rel Volume,Price,Change,Volume 0,CDIO,2.1081,2.3173,0.725,-0.6526000000000001,,2.2547,0.1937,0.2682,2.0,2130000.0,194.21,3.45,1.5847,100099160.0 1,LION,1.2992,0.4106,0.44549999999999995,0.46880000000000005,,0.4328,0.6442,0.2623,,65860.0,13.79,14.6,1.0563,739802.0 2,CHS,0.1783,0.1079,-0.0496,-0.0987,0.1711,0.16870000000000002,0.0602,0.0466,3.0,2420000.0,2.87,5.75,0.1616,6759202.0 From c4478039d2f76b6ea598716803bdefd3863c3e4d Mon Sep 17 00:00:00 2001 From: OpenBB Date: Sat, 22 Jul 2023 10:09:35 -0700 Subject: [PATCH 20/28] mypy --- openbb_terminal/stocks/screener/finviz_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbb_terminal/stocks/screener/finviz_model.py b/openbb_terminal/stocks/screener/finviz_model.py index 5f825739626..ae9880067f8 100644 --- a/openbb_terminal/stocks/screener/finviz_model.py +++ b/openbb_terminal/stocks/screener/finviz_model.py @@ -108,6 +108,7 @@ def get_screener_data( pd.DataFrame Dataframe with loaded filtered stocks """ + df_screen = pd.DataFrame() if data_type == "overview": screen = overview.Overview() elif data_type == "valuation": @@ -191,7 +192,6 @@ def get_screener_data( df_screen.columns = [val.strip("\n") for val in df_screen.columns] if "Company" in df_screen.columns: df_screen["Company"] = df_screen["Company"].str.replace(",", "") - df_screen.columns = df_screen.columns.str.strip() if data_type == "performance": df_screen = df_screen.rename( columns={ From f113fc27e3668375501430f059eb0e42187daca7 Mon Sep 17 00:00:00 2001 From: OpenBB Date: Sat, 22 Jul 2023 11:06:21 -0700 Subject: [PATCH 21/28] put spaces in columns for econ/performance and valuation and make sortby work --- openbb_terminal/economy/economy_controller.py | 68 +++++++++---------- openbb_terminal/economy/finviz_model.py | 23 +++---- .../test_get_performance_data.csv | 2 +- .../test_get_valuation_data.csv | 2 +- .../test_display_performance[False].txt | 24 +++---- .../test_display_performance[True].txt | 24 +++---- .../test_display_valuation[False].txt | 24 +++---- .../test_display_valuation[True].txt | 24 +++---- 8 files changed, 95 insertions(+), 96 deletions(-) diff --git a/openbb_terminal/economy/economy_controller.py b/openbb_terminal/economy/economy_controller.py index 5e082951328..a7df0b5e213 100644 --- a/openbb_terminal/economy/economy_controller.py +++ b/openbb_terminal/economy/economy_controller.py @@ -115,36 +115,36 @@ class EconomyController(BaseController): ] overview_options = ["indices", "usbonds", "glbonds", "currencies"] tyld_maturity = ["3m", "5y", "10y", "30y"] - valuation_sort_cols = [ - "Name", - "MarketCap", - "P/E", - "FwdP/E", - "PEG", - "P/S", - "P/B", - "P/C", - "P/FCF", - "EPSpast5Y", - "EPSnext5Y", - "Salespast5Y", - "Change", - "Volume", - ] - performance_sort_list = [ - "Name", - "Week", - "Month", - "3Month", - "6Month", - "1Year", - "YTD", - "Recom", - "AvgVolume", - "RelVolume", - "Change", - "Volume", - ] + valuation_sort_cols_dict = { + "Name": "Name", + "MarketCap": "Market Cap", + "P/E": "P/E", + "FwdP/E": "Fwd P/E", + "PEG": "PEG", + "P/S": "P/S", + "P/B": "P/B", + "P/C": "P/C", + "P/FCF": "P/FCF", + "EPSpast5Y": "EPS past 5Y", + "EPSnext5Y": "EPS next 5Y", + "Salespast5Y": "Sales past 5Y", + "Change": "Chage", + "Volume": "Volume", + } + performance_sort_dict = { + "Name": "Name", + "1W": "1W", + "1M": "1M", + "3M": "3M", + "6M": "6M", + "1Y": "1Y", + "YTD": "YTD", + "Recom": "Recom", + "AvgVolume": "Avg Volume", + "RelVolume": "Rel Volume", + "Change": "Change", + "Volume": "Volume", + } index_interval = [ "1m", "2m", @@ -2213,7 +2213,7 @@ class EconomyController(BaseController): "--sortby", dest="sortby", type=str, - choices=self.valuation_sort_cols, + choices=list(self.valuation_sort_cols_dict.keys()), default="Name", help="Column to sort by", ) @@ -2243,7 +2243,7 @@ class EconomyController(BaseController): ) finviz_view.display_valuation( group=ns_group, - sortby=ns_parser.sortby, + sortby=self.valuation_sort_cols_dict[ns_parser.sortby], ascend=ns_parser.reverse, export=ns_parser.export, sheet_name=" ".join(ns_parser.sheet_name) @@ -2275,7 +2275,7 @@ class EconomyController(BaseController): "-s", "--sortby", dest="sortby", - choices=self.performance_sort_list, + choices=list(self.performance_sort_dict.keys()), default="Name", help="Column to sort by", ) @@ -2304,7 +2304,7 @@ class EconomyController(BaseController): ) finviz_view.display_performance( group=ns_group, - sortby=ns_parser.sortby, + sortby=self.performance_sort_dict[ns_parser.sortby], ascend=ns_parser.reverse, export=ns_parser.export, sheet_name=" ".join(ns_parser.sheet_name) diff --git a/openbb_terminal/economy/finviz_model.py b/openbb_terminal/economy/finviz_model.py index 8281a7bfc28..8e28c209429 100644 --- a/openbb_terminal/economy/finviz_model.py +++ b/openbb_terminal/economy/finviz_model.py @@ -92,7 +92,7 @@ def get_valuation_data( try: group = GROUPS[group] df_group = valuation.Valuation().screener_view(group=group) - df_group.columns = [col.replace(" ", "").strip() for col in df_group.columns] + df_group.columns = [col.strip() for col in df_group.columns] df_group = df_group.sort_values(by=sortby, ascending=ascend) df_group.fillna("", inplace=True) @@ -100,7 +100,7 @@ def get_valuation_data( if get_current_user().preferences.USE_INTERACTIVE_DF: return df_group print(df_group.head()) - df_group["MarketCap"] = df_group["MarketCap"].apply( + df_group["Market Cap"] = df_group["Market Cap"].apply( lambda x: float(x.strip("B")) if x.endswith("B") else float(x.strip("M")) / 1000 @@ -146,18 +146,17 @@ def get_performance_data( df_group = performance.Performance().screener_view(group=group) df_group = df_group.rename( columns={ - "Perf Week": "Week", - "Perf Month": "Month", - "Perf Quart": "3Month", - "Perf Half": "6Month", - "Perf Year": "1Year", + "Perf Week": "1W", + "Perf Month": "1M", + "Perf Quart": "3M", + "Perf Half": "6M", + "Perf Year": "1Y", "Perf YTD": "YTD", - "Avg Volume": "AvgVolume", - "Rel Volume": "RelVolume", + "Avg Volume": "Avg Volume", } ) df_group.columns = [col.strip() for col in df_group.columns] - df_group["Week"] = df_group["Week"].apply(lambda x: float(x.strip("%")) / 100) + df_group["1W"] = df_group["1W"].apply(lambda x: float(x.strip("%")) / 100) df_group = df_group.sort_values(by=sortby, ascending=ascend) df_group.fillna("", inplace=True) @@ -166,9 +165,9 @@ def get_performance_data( return df_group df_group["Volume"] = df_group["Volume"] / 1_000_000 - df_group["AvgVolume"] = df_group["AvgVolume"] / 1_000_000 + df_group["Avg Volume"] = df_group["Avg Volume"] / 1_000_000 df_group = df_group.rename( - columns={"Volume": "Volume [1M]", "AvgVolume": "AvgVolume [1M]"} + columns={"Volume": "Volume [1M]", "Avg Volume": "Avg Volume [1M]"} ) return df_group diff --git a/tests/openbb_terminal/economy/csv/test_finviz_model/test_get_performance_data.csv b/tests/openbb_terminal/economy/csv/test_finviz_model/test_get_performance_data.csv index 0b83def096c..c2696c55dd5 100644 --- a/tests/openbb_terminal/economy/csv/test_finviz_model/test_get_performance_data.csv +++ b/tests/openbb_terminal/economy/csv/test_finviz_model/test_get_performance_data.csv @@ -1,4 +1,4 @@ -,Name,Week,Month,3Month,6Month,1Year,YTD,Recom,AvgVolume,RelVolume,Change,Volume +,Name,1W,1M,3M,6M,1Y,YTD,Recom,Avg Volume,Rel Volume,Change,Volume 0,Basic Materials,0.015300000000000001,0.0603,-0.0966,-0.07629999999999999,-0.1213,-0.11689999999999999,2.2,496760000.0,1.0,0.0123,198760000.0 1,Communication Services,0.0297,0.006500000000000001,-0.0002,-0.18309999999999998,-0.26780000000000004,-0.2419,1.94,766430000.0,1.25,0.0109,384640000.0 2,Consumer Cyclical,0.0213,0.10189999999999999,0.0603,-0.1272,-0.192,-0.20809999999999998,2.11,1380000000.0,1.53,0.013500000000000002,848690000.0 diff --git a/tests/openbb_terminal/economy/csv/test_finviz_model/test_get_valuation_data.csv b/tests/openbb_terminal/economy/csv/test_finviz_model/test_get_valuation_data.csv index a1a35cd6d99..edcaa0a455c 100644 --- a/tests/openbb_terminal/economy/csv/test_finviz_model/test_get_valuation_data.csv +++ b/tests/openbb_terminal/economy/csv/test_finviz_model/test_get_valuation_data.csv @@ -1,4 +1,4 @@ -,Name,MarketCap,P/E,FwdP/E,PEG,P/S,P/B,P/C,P/FCF,EPSpast5Y,EPSnext5Y,Salespast5Y,Change,Volume +,Name,Market Cap,P/E,Fwd P/E,PEG,P/S,P/B,P/C,P/FCF,EPS past 5Y,EPS next 5Y,Sales past 5Y,Change,Volume 0,Basic Materials,1864.89B,8.8,10.57,0.88,1.25,1.86,10.9,15.01,0.2824,0.0999,0.1259,0.0123,198760000.0 1,Communication Services,6295.06B,18.52,15.86,1.27,2.64,2.75,12.65,33.58,0.20600000000000002,0.1461,0.1942,0.0109,384640000.0 2,Consumer Cyclical,6695.57B,24.52,13.15,0.96,0.98,3.26,10.64,46.69,0.3063,0.2551,0.22469999999999998,0.013500000000000002,848690000.0 diff --git a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[False].txt b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[False].txt index c5e93bbbce3..9edbbc68906 100644 --- a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[False].txt +++ b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[False].txt @@ -1,12 +1,12 @@ - 1W 1M 3M 6M 1Y YTD Recom AvgVolume RelVolume Change Volume -0 Basic Materials 0.0303 0.0337 0.0721 0.1212 0.1058 0.0419 2.21 5.643900e+08 1.70 0.0070 9.613600e+08 -1 Communication Services 0.0637 -0.0258 -0.1031 -0.1558 -0.0248 -0.1145 1.88 7.649600e+08 1.78 0.0169 1.360000e+09 -2 Consumer Cyclical 0.1093 -0.0505 -0.0915 -0.1022 -0.0962 -0.1226 2.06 1.340000e+09 1.78 0.0256 2.390000e+09 -3 Consumer Defensive 0.0475 -0.0126 -0.0218 0.0161 0.0506 -0.0392 2.23 4.557200e+08 1.71 0.0063 7.792700e+08 -4 Energy -0.0182 0.0352 0.2454 0.3398 0.3865 0.2319 2.23 8.874100e+08 1.38 -0.0003 1.230000e+09 -5 Financial 0.0690 -0.0310 -0.0012 0.0172 0.0777 -0.0049 2.23 1.050000e+09 1.67 0.0059 1.750000e+09 -6 Healthcare 0.0669 0.0299 -0.0388 -0.0592 0.0399 -0.0565 2.05 1.420000e+09 1.66 0.0086 2.360000e+09 -7 Industrials 0.0541 0.0143 -0.0165 0.0164 0.0458 -0.0400 2.26 6.727100e+08 1.56 0.0062 1.050000e+09 -8 Real Estate 0.0291 0.0155 -0.0515 -0.0096 0.1091 -0.0902 2.22 3.552600e+08 1.98 0.0031 7.028400e+08 -9 Technology 0.0889 -0.0306 -0.0989 -0.0704 0.1030 -0.1294 1.98 1.650000e+09 1.91 0.0251 3.160000e+09 -10 Utilities 0.0090 0.0609 0.0065 0.0638 0.1145 -0.0122 2.32 1.613700e+08 2.25 -0.0063 3.625100e+08 + 1W 1M 3M 6M 1Y YTD Recom Avg Volume Rel Volume Change Volume +0 Basic Materials 0.0303 0.0337 0.0721 0.1212 0.1058 0.0419 2.21 5.643900e+08 1.70 0.0070 9.613600e+08 +1 Communication Services 0.0637 -0.0258 -0.1031 -0.1558 -0.0248 -0.1145 1.88 7.649600e+08 1.78 0.0169 1.360000e+09 +2 Consumer Cyclical 0.1093 -0.0505 -0.0915 -0.1022 -0.0962 -0.1226 2.06 1.340000e+09 1.78 0.0256 2.390000e+09 +3 Consumer Defensive 0.0475 -0.0126 -0.0218 0.0161 0.0506 -0.0392 2.23 4.557200e+08 1.71 0.0063 7.792700e+08 +4 Energy -0.0182 0.0352 0.2454 0.3398 0.3865 0.2319 2.23 8.874100e+08 1.38 -0.0003 1.230000e+09 +5 Financial 0.0690 -0.0310 -0.0012 0.0172 0.0777 -0.0049 2.23 1.050000e+09 1.67 0.0059 1.750000e+09 +6 Healthcare 0.0669 0.0299 -0.0388 -0.0592 0.0399 -0.0565 2.05 1.420000e+09 1.66 0.0086 2.360000e+09 +7 Industrials 0.0541 0.0143 -0.0165 0.0164 0.0458 -0.0400 2.26 6.727100e+08 1.56 0.0062 1.050000e+09 +8 Real Estate 0.0291 0.0155 -0.0515 -0.0096 0.1091 -0.0902 2.22 3.552600e+08 1.98 0.0031 7.028400e+08 +9 Technology 0.0889 -0.0306 -0.0989 -0.0704 0.1030 -0.1294 1.98 1.650000e+09 1.91 0.0251 3.160000e+09 +10 Utilities 0.0090 0.0609 0.0065 0.0638 0.1145 -0.0122 2.32 1.613700e+08 2.25 -0.0063 3.625100e+08 diff --git a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[True].txt b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[True].txt index c5e93bbbce3..9edbbc68906 100644 --- a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[True].txt +++ b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[True].txt @@ -1,12 +1,12 @@ - 1W 1M 3M 6M 1Y YTD Recom AvgVolume RelVolume Change Volume -0 Basic Materials 0.0303 0.0337 0.0721 0.1212 0.1058 0.0419 2.21 5.643900e+08 1.70 0.0070 9.613600e+08 -1 Communication Services 0.0637 -0.0258 -0.1031 -0.1558 -0.0248 -0.1145 1.88 7.649600e+08 1.78 0.0169 1.360000e+09 -2 Consumer Cyclical 0.1093 -0.0505 -0.0915 -0.1022 -0.0962 -0.1226 2.06 1.340000e+09 1.78 0.0256 2.390000e+09 -3 Consumer Defensive 0.0475 -0.0126 -0.0218 0.0161 0.0506 -0.0392 2.23 4.557200e+08 1.71 0.0063 7.792700e+08 -4 Energy -0.0182 0.0352 0.2454 0.3398 0.3865 0.2319 2.23 8.874100e+08 1.38 -0.0003 1.230000e+09 -5 Financial 0.0690 -0.0310 -0.0012 0.0172 0.0777 -0.0049 2.23 1.050000e+09 1.67 0.0059 1.750000e+09 -6 Healthcare 0.0669 0.0299 -0.0388 -0.0592 0.0399 -0.0565 2.05 1.420000e+09 1.66 0.0086 2.360000e+09 -7 Industrials 0.0541 0.0143 -0.0165 0.0164 0.0458 -0.0400 2.26 6.727100e+08 1.56 0.0062 1.050000e+09 -8 Real Estate 0.0291 0.0155 -0.0515 -0.0096 0.1091 -0.0902 2.22 3.552600e+08 1.98 0.0031 7.028400e+08 -9 Technology 0.0889 -0.0306 -0.0989 -0.0704 0.1030 -0.1294 1.98 1.650000e+09 1.91 0.0251 3.160000e+09 -10 Utilities 0.0090 0.0609 0.0065 0.0638 0.1145 -0.0122 2.32 1.613700e+08 2.25 -0.0063 3.625100e+08 + 1W 1M 3M 6M 1Y YTD Recom Avg Volume Rel Volume Change Volume +0 Basic Materials 0.0303 0.0337 0.0721 0.1212 0.1058 0.0419 2.21 5.643900e+08 1.70 0.0070 9.613600e+08 +1 Communication Services 0.0637 -0.0258 -0.1031 -0.1558 -0.0248 -0.1145 1.88 7.649600e+08 1.78 0.0169 1.360000e+09 +2 Consumer Cyclical 0.1093 -0.0505 -0.0915 -0.1022 -0.0962 -0.1226 2.06 1.340000e+09 1.78 0.0256 2.390000e+09 +3 Consumer Defensive 0.0475 -0.0126 -0.0218 0.0161 0.0506 -0.0392 2.23 4.557200e+08 1.71 0.0063 7.792700e+08 +4 Energy -0.0182 0.0352 0.2454 0.3398 0.3865 0.2319 2.23 8.874100e+08 1.38 -0.0003 1.230000e+09 +5 Financial 0.0690 -0.0310 -0.0012 0.0172 0.0777 -0.0049 2.23 1.050000e+09 1.67 0.0059 1.750000e+09 +6 Healthcare 0.0669 0.0299 -0.0388 -0.0592 0.0399 -0.0565 2.05 1.420000e+09 1.66 0.0086 2.360000e+09 +7 Industrials 0.0541 0.0143 -0.0165 0.0164 0.0458 -0.0400 2.26 6.727100e+08 1.56 0.0062 1.050000e+09 +8 Real Estate 0.0291 0.0155 -0.0515 -0.0096 0.1091 -0.0902 2.22 3.552600e+08 1.98 0.0031 7.028400e+08 +9 Technology 0.0889 -0.0306 -0.0989 -0.0704 0.1030 -0.1294 1.98 1.650000e+09 1.91 0.0251 3.160000e+09 +10 Utilities 0.0090 0.0609 0.0065 0.0638 0.1145 -0.0122 2.32 1.613700e+08 2.25 -0.0063 3.625100e+08 diff --git a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_valuation[False].txt b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_valuation[False].txt index b77c1401764..ba08a991a54 100644 --- a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_valuation[False].txt +++ b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_valuation[False].txt @@ -1,12 +1,12 @@ - MarketCap P/E FwdP/E PEG P/S P/B P/C P/FCF EPSpast5Y EPSnext5Y Salespast5Y Change Volume -0 Basic Materials 2260.70B 11.05 14.06 0.74 1.63 2.30 13.15 20.31 0.3022 0.1501 0.1231 0.0070 9.613600e+08 -1 Communication Services 7417.63B 21.39 15.17 1.05 3.45 3.26 14.19 34.05 0.2059 0.2033 0.2022 0.0169 1.360000e+09 -2 Consumer Cyclical 7410.15B 25.88 14.36 1.14 1.10 3.56 10.19 41.54 0.2838 0.2265 0.2012 0.0256 2.390000e+09 -3 Consumer Defensive 3737.73B 24.83 21.23 2.68 1.39 4.09 20.36 43.20 0.0850 0.0925 0.0486 0.0063 7.792700e+08 -4 Energy 3488.00B 12.39 9.63 1.11 0.96 1.26 10.18 14.97 0.2792 0.1112 0.0878 -0.0003 1.230000e+09 -5 Financial 10142.30B 12.87 13.70 1.04 2.96 0.01 0.59 12.79 0.1888 0.1240 0.0734 0.0059 1.750000e+09 -6 Healthcare 7812.17B 24.97 15.52 2.22 2.23 3.66 12.91 29.47 0.1617 0.1123 0.1602 0.0086 2.360000e+09 -7 Industrials 4981.60B 23.34 17.07 1.56 2.02 4.00 13.74 32.77 0.1624 0.1492 0.0566 0.0062 1.050000e+09 -8 Real Estate 1786.12B 27.99 31.37 2.79 5.64 1.83 23.32 61.52 0.1051 0.1005 0.1014 0.0031 7.028400e+08 -9 Technology 14089.76B 30.43 22.63 1.76 5.14 4.53 16.32 35.65 0.2480 0.1731 0.1491 0.0251 3.160000e+09 -10 Utilities 1445.62B 26.13 3.29 3.71 1.82 1.42 32.47 65.99 0.0141 0.0704 0.0520 -0.0063 3.625100e+08 + Market Cap P/E Fwd P/E PEG P/S P/B P/C P/FCF EPS past 5Y EPS next 5Y Sales past 5Y Change Volume +0 Basic Materials 2260.70B 11.05 14.06 0.74 1.63 2.30 13.15 20.31 0.3022 0.1501 0.1231 0.0070 9.613600e+08 +1 Communication Services 7417.63B 21.39 15.17 1.05 3.45 3.26 14.19 34.05 0.2059 0.2033 0.2022 0.0169 1.360000e+09 +2 Consumer Cyclical 7410.15B 25.88 14.36 1.14 1.10 3.56 10.19 41.54 0.2838 0.2265 0.2012 0.0256 2.390000e+09 +3 Consumer Defensive 3737.73B 24.83 21.23 2.68 1.39 4.09 20.36 43.20 0.0850 0.0925 0.0486 0.0063 7.792700e+08 +4 Energy 3488.00B 12.39 9.63 1.11 0.96 1.26 10.18 14.97 0.2792 0.1112 0.0878 -0.0003 1.230000e+09 +5 Financial 10142.30B 12.87 13.70 1.04 2.96 0.01 0.59 12.79 0.1888 0.1240 0.0734 0.0059 1.750000e+09 +6 Healthcare 7812.17B 24.97 15.52 2.22 2.23 3.66 12.91 29.47 0.1617 0.1123 0.1602 0.0086 2.360000e+09 +7 Industrials 4981.60B 23.34 17.07 1.56 2.02 4.00 13.74 32.77 0.1624 0.1492 0.0566 0.0062 1.050000e+09 +8 Real Estate 1786.12B 27.99 31.37 2.79 5.64 1.83 23.32 61.52 0.1051 0.1005 0.1014 0.0031 7.028400e+08 +9 Technology 14089.76B 30.43 22.63 1.76 5.14 4.53 16.32 35.65 0.2480 0.1731 0.1491 0.0251 3.160000e+09 +10 Utilities 1445.62B 26.13 3.29 3.71 1.82 1.42 32.47 65.99 0.0141 0.0704 0.0520 -0.0063 3.625100e+08 diff --git a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_valuation[True].txt b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_valuation[True].txt index b77c1401764..ba08a991a54 100644 --- a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_valuation[True].txt +++ b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_valuation[True].txt @@ -1,12 +1,12 @@ - MarketCap P/E FwdP/E PEG P/S P/B P/C P/FCF EPSpast5Y EPSnext5Y Salespast5Y Change Volume -0 Basic Materials 2260.70B 11.05 14.06 0.74 1.63 2.30 13.15 20.31 0.3022 0.1501 0.1231 0.0070 9.613600e+08 -1 Communication Services 7417.63B 21.39 15.17 1.05 3.45 3.26 14.19 34.05 0.2059 0.2033 0.2022 0.0169 1.360000e+09 -2 Consumer Cyclical 7410.15B 25.88 14.36 1.14 1.10 3.56 10.19 41.54 0.2838 0.2265 0.2012 0.0256 2.390000e+09 -3 Consumer Defensive 3737.73B 24.83 21.23 2.68 1.39 4.09 20.36 43.20 0.0850 0.0925 0.0486 0.0063 7.792700e+08 -4 Energy 3488.00B 12.39 9.63 1.11 0.96 1.26 10.18 14.97 0.2792 0.1112 0.0878 -0.0003 1.230000e+09 -5 Financial 10142.30B 12.87 13.70 1.04 2.96 0.01 0.59 12.79 0.1888 0.1240 0.0734 0.0059 1.750000e+09 -6 Healthcare 7812.17B 24.97 15.52 2.22 2.23 3.66 12.91 29.47 0.1617 0.1123 0.1602 0.0086 2.360000e+09 -7 Industrials 4981.60B 23.34 17.07 1.56 2.02 4.00 13.74 32.77 0.1624 0.1492 0.0566 0.0062 1.050000e+09 -8 Real Estate 1786.12B 27.99 31.37 2.79 5.64 1.83 23.32 61.52 0.1051 0.1005 0.1014 0.0031 7.028400e+08 -9 Technology 14089.76B 30.43 22.63 1.76 5.14 4.53 16.32 35.65 0.2480 0.1731 0.1491 0.0251 3.160000e+09 -10 Utilities 1445.62B 26.13 3.29 3.71 1.82 1.42 32.47 65.99 0.0141 0.0704 0.0520 -0.0063 3.625100e+08 + Market Cap P/E Fwd P/E PEG P/S P/B P/C P/FCF EPS past 5Y EPS next 5Y Sales past 5Y Change Volume +0 Basic Materials 2260.70B 11.05 14.06 0.74 1.63 2.30 13.15 20.31 0.3022 0.1501 0.1231 0.0070 9.613600e+08 +1 Communication Services 7417.63B 21.39 15.17 1.05 3.45 3.26 14.19 34.05 0.2059 0.2033 0.2022 0.0169 1.360000e+09 +2 Consumer Cyclical 7410.15B 25.88 14.36 1.14 1.10 3.56 10.19 41.54 0.2838 0.2265 0.2012 0.0256 2.390000e+09 +3 Consumer Defensive 3737.73B 24.83 21.23 2.68 1.39 4.09 20.36 43.20 0.0850 0.0925 0.0486 0.0063 7.792700e+08 +4 Energy 3488.00B 12.39 9.63 1.11 0.96 1.26 10.18 14.97 0.2792 0.1112 0.0878 -0.0003 1.230000e+09 +5 Financial 10142.30B 12.87 13.70 1.04 2.96 0.01 0.59 12.79 0.1888 0.1240 0.0734 0.0059 1.750000e+09 +6 Healthcare 7812.17B 24.97 15.52 2.22 2.23 3.66 12.91 29.47 0.1617 0.1123 0.1602 0.0086 2.360000e+09 +7 Industrials 4981.60B 23.34 17.07 1.56 2.02 4.00 13.74 32.77 0.1624 0.1492 0.0566 0.0062 1.050000e+09 +8 Real Estate 1786.12B 27.99 31.37 2.79 5.64 1.83 23.32 61.52 0.1051 0.1005 0.1014 0.0031 7.028400e+08 +9 Technology 14089.76B 30.43 22.63 1.76 5.14 4.53 16.32 35.65 0.2480 0.1731 0.1491 0.0251 3.160000e+09 +10 Utilities 1445.62B 26.13 3.29 3.71 1.82 1.42 32.47 65.99 0.0141 0.0704 0.0520 -0.0063 3.625100e+08 From 10202c1e07630ece986f9d1d77caf8f7b25bcd38 Mon Sep 17 00:00:00 2001 From: OpenBB Date: Sat, 22 Jul 2023 11:13:35 -0700 Subject: [PATCH 22/28] codespell --- openbb_terminal/economy/economy_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbb_terminal/economy/economy_controller.py b/openbb_terminal/economy/economy_controller.py index a7df0b5e213..9c75d92e09f 100644 --- a/openbb_terminal/economy/economy_controller.py +++ b/openbb_terminal/economy/economy_controller.py @@ -128,7 +128,7 @@ class EconomyController(BaseController): "EPSpast5Y": "EPS past 5Y", "EPSnext5Y": "EPS next 5Y", "Salespast5Y": "Sales past 5Y", - "Change": "Chage", + "Change": "Change", "Volume": "Volume", } performance_sort_dict = { From a3427b0557ab3f9cc559bb4aebf20287a64f7054 Mon Sep 17 00:00:00 2001 From: OpenBB Date: Sat, 22 Jul 2023 11:53:21 -0700 Subject: [PATCH 23/28] fix test_economy_controller --- tests/openbb_terminal/economy/test_economy_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/openbb_terminal/economy/test_economy_controller.py b/tests/openbb_terminal/economy/test_economy_controller.py index 3b1c8c953cf..d51a88867b9 100644 --- a/tests/openbb_terminal/economy/test_economy_controller.py +++ b/tests/openbb_terminal/economy/test_economy_controller.py @@ -493,7 +493,7 @@ def test_call_func_expect_queue(expected_queue, func, queue): [], dict( group="sector", - sortby="MarketCap", + sortby="Market Cap", ascend=True, export="csv", sheet_name=None, From d4f4d9fc916f967aa1b6caa7aa8538ee77f52bcf Mon Sep 17 00:00:00 2001 From: OpenBB Date: Sat, 22 Jul 2023 11:59:37 -0700 Subject: [PATCH 24/28] fix assertion error with test_economy_controller: test_menu_with_queue[queue0-expected0] --- tests/openbb_terminal/economy/test_economy_controller.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/openbb_terminal/economy/test_economy_controller.py b/tests/openbb_terminal/economy/test_economy_controller.py index d51a88867b9..712ee9ef8ca 100644 --- a/tests/openbb_terminal/economy/test_economy_controller.py +++ b/tests/openbb_terminal/economy/test_economy_controller.py @@ -134,9 +134,8 @@ MOCK_DETAIL = { @pytest.mark.parametrize( "queue, expected", [ - (["load", "help"], ["help"]), - (["quit", "help"], ["help"]), - ], + (["quit", "help"], ["help"]) + ] ) def test_menu_with_queue(expected, mocker, queue): path_controller = "openbb_terminal.economy.economy_controller" From 5f9d07c39001dd86f9f509c466a1ef138004aa2e Mon Sep 17 00:00:00 2001 From: OpenBB Date: Sat, 22 Jul 2023 12:02:06 -0700 Subject: [PATCH 25/28] black --- tests/openbb_terminal/economy/test_economy_controller.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/openbb_terminal/economy/test_economy_controller.py b/tests/openbb_terminal/economy/test_economy_controller.py index 712ee9ef8ca..ad74d47977d 100644 --- a/tests/openbb_terminal/economy/test_economy_controller.py +++ b/tests/openbb_terminal/economy/test_economy_controller.py @@ -131,12 +131,7 @@ MOCK_DETAIL = { @pytest.mark.vcr(record_mode="none") -@pytest.mark.parametrize( - "queue, expected", - [ - (["quit", "help"], ["help"]) - ] -) +@pytest.mark.parametrize("queue, expected", [(["quit", "help"], ["help"])]) def test_menu_with_queue(expected, mocker, queue): path_controller = "openbb_terminal.economy.economy_controller" From 341061c349e04178342490d2bff6e0ac60a65d5c Mon Sep 17 00:00:00 2001 From: OpenBB Date: Sat, 22 Jul 2023 15:56:20 -0700 Subject: [PATCH 26/28] fix trail map for crypto.price() --- .../sdk/controllers/crypto_sdk_controller.py | 2 +- .../core/sdk/models/crypto_sdk_model.py | 4 +- openbb_terminal/core/sdk/sdk_helpers.py | 174 ++++++++++++++++++ openbb_terminal/core/sdk/sdk_init.py | 3 +- openbb_terminal/core/sdk/trail_map.csv | 2 +- openbb_terminal/sdk.py | 2 +- 6 files changed, 181 insertions(+), 6 deletions(-) diff --git a/openbb_terminal/core/sdk/controllers/crypto_sdk_controller.py b/openbb_terminal/core/sdk/controllers/crypto_sdk_controller.py index 42e31f24164..69f4f075c82 100644 --- a/openbb_terminal/core/sdk/controllers/crypto_sdk_controller.py +++ b/openbb_terminal/core/sdk/controllers/crypto_sdk_controller.py @@ -21,7 +21,7 @@ class CryptoController(model.CryptoRoot): `chart`: Load data for Technical Analysis\n `find`: Find similar coin by coin name,symbol or id.\n `load`: Load crypto currency to get data for\n - `price`: Returns price and confidence interval from pyth live feed. [Source: Pyth]\n + `price`: Displays live price from pyth live feed [Source: https://pyth.network/]\n """ @property diff --git a/openbb_terminal/core/sdk/models/crypto_sdk_model.py b/openbb_terminal/core/sdk/models/crypto_sdk_model.py index ca02d075c61..1c0f1bba4e3 100644 --- a/openbb_terminal/core/sdk/models/crypto_sdk_model.py +++ b/openbb_terminal/core/sdk/models/crypto_sdk_model.py @@ -13,7 +13,7 @@ class CryptoRoot(Category): `chart`: Load data for Technical Analysis\n `find`: Find similar coin by coin name,symbol or id.\n `load`: Load crypto currency to get data for\n - `price`: Returns price and confidence interval from pyth live feed. [Source: Pyth]\n + `price`: Displays live price from pyth live feed [Source: https://pyth.network/]\n """ _location_path = "crypto" @@ -24,7 +24,7 @@ class CryptoRoot(Category): self.chart = lib.crypto_helpers.plot_chart self.find = lib.crypto_models.find self.load = lib.crypto_helpers.load - self.price = lib.crypto_pyth_model.get_price + self.price = lib.crypto_pyth_view.display_price class CryptoDueDiligence(Category): diff --git a/openbb_terminal/core/sdk/sdk_helpers.py b/openbb_terminal/core/sdk/sdk_helpers.py index e2749caf64a..cf60141f780 100644 --- a/openbb_terminal/core/sdk/sdk_helpers.py +++ b/openbb_terminal/core/sdk/sdk_helpers.py @@ -2,23 +2,31 @@ import json + from inspect import signature + from logging import Logger, getLogger + from typing import Any, Callable, Dict, Optional + from openbb_terminal.core.config.paths import SETTINGS_ENV_FILE + from openbb_terminal.core.sdk.sdk_init import ( FORECASTING_TOOLKIT_ENABLED, FORECASTING_TOOLKIT_WARNING, OPTIMIZATION_TOOLKIT_ENABLED, OPTIMIZATION_TOOLKIT_WARNING, ) + from openbb_terminal.core.session.current_system import ( get_current_system, set_system_variable, ) + from openbb_terminal.rich_config import console + SETTINGS_ENV_FILE.parent.mkdir(parents=True, exist_ok=True) @@ -149,8 +157,12 @@ class Category: def __getattribute__(self, name: str): """We override the __getattribute__ method and wrap all callable + + attributes with a wrapper that logs the call and the result. + + """ attr = super().__getattribute__(name) @@ -260,36 +272,68 @@ class OperationLogger: def __merge_function_args(func: Callable, args: tuple, kwargs: dict) -> dict: """ + + Merge user input args and kwargs with signature defaults into a dictionary. + + + + Parameters + + ---------- + + func : Callable + + Function to get the args from + + args : tuple + + Positional args + + kwargs : dict + + Keyword args + + + + Returns + + ------- + + dict + + Merged user args and signature defaults + + """ import inspect # pylint: disable=C0415 @@ -316,39 +360,69 @@ class OperationLogger: def __remove_key_and_log_state(func_module: str, function_args: dict) -> dict: """ + + Remove API key from the function args and log state of keys. + + + + Parameters + + ---------- + + func_module : str + + Module of the function + + function_args : dict + + Function args + + + + Returns + + ------- + + dict + + Function args with API key removed + + """ if func_module == "openbb_terminal.keys_model": # pylint: disable=C0415 # from openbb_terminal.core.log.generation.settings_logger import ( + # log_credentials, + # ) # remove key if defined @@ -426,102 +500,202 @@ def get_sdk_imports_text() -> str: + + + + # ######### THIS FILE IS AUTO GENERATED - ANY CHANGES WILL BE VOID ######### # + + + + # flake8: noqa + + + + # pylint: disable=unused-import,wrong-import-order + + + + # pylint: disable=C0302,W0611,R0902,R0903,C0412,C0301,not-callable + + + + import logging + + + + import openbb_terminal.config_terminal as cfg + + + + from openbb_terminal import helper_funcs as helper # noqa: F401 + + + + from openbb_terminal.core.plots.plotly_helper import theme # noqa: F401 + + + + from openbb_terminal.cryptocurrency.due_diligence.pycoingecko_model import Coin + + + + from openbb_terminal.dashboards.dashboards_controller import DashboardsController + + + + from openbb_terminal.helper_classes import TerminalStyle # noqa: F401 + + + + from openbb_terminal.reports import widget_helpers as widgets # noqa: F401 + + + + from openbb_terminal.reports.reports_controller import ReportController + + + + import openbb_terminal.core.sdk.sdk_init as lib + + + + from openbb_terminal.core.sdk import ( + + controllers as ctrl, + + + + models as model, + + ) + + + + from openbb_terminal.core.session.current_system import get_current_system + + + + from openbb_terminal.core.session.current_user import is_local + + + + from openbb_terminal.terminal_helper import is_auth_enabled + + + + cfg.setup_config_terminal(is_sdk=True) + + + + logger = logging.getLogger(__name__) + + + + cfg.theme.applyMPLstyle() + + + + \r\r\r + + + + """ return "\r".join(sdk_imports.splitlines()) diff --git a/openbb_terminal/core/sdk/sdk_init.py b/openbb_terminal/core/sdk/sdk_init.py index 783b5c81946..571269da415 100644 --- a/openbb_terminal/core/sdk/sdk_init.py +++ b/openbb_terminal/core/sdk/sdk_init.py @@ -158,7 +158,7 @@ from openbb_terminal.common.technical_analysis import ( from openbb_terminal.cryptocurrency import ( crypto_models, - pyth_model as crypto_pyth_model, + pyth_view as crypto_pyth_view, ) @@ -541,6 +541,7 @@ from openbb_terminal.stocks.options import ( yfinance_view as stocks_options_yfinance_view, ) + from openbb_terminal.stocks.screener import ( finviz_model as stocks_screener_finviz_model, finviz_view as stocks_screener_finviz_view, diff --git a/openbb_terminal/core/sdk/trail_map.csv b/openbb_terminal/core/sdk/trail_map.csv index bbd58cc99c5..63682195424 100644 --- a/openbb_terminal/core/sdk/trail_map.csv +++ b/openbb_terminal/core/sdk/trail_map.csv @@ -163,7 +163,7 @@ crypto.ov.products,crypto_ov_pycoingecko_model.get_finance_products,crypto_ov_py crypto.ov.stables,crypto_ov_pycoingecko_model.get_stable_coins,crypto_ov_pycoingecko_view.display_stablecoins crypto.ov.wf,crypto_ov_withdrawalfees_model.get_overall_withdrawal_fees,crypto_ov_withdrawalfees_view.display_overall_withdrawal_fees crypto.ov.wfpe,crypto_ov_withdrawalfees_model.get_crypto_withdrawal_fees,crypto_ov_withdrawalfees_view.display_crypto_withdrawal_fees -crypto.price,crypto_pyth_model.get_price, +crypto.price,crypto_pyth_view.display_price, crypto.tools.apy,crypto_tools_model.calculate_apy,crypto_tools_view.display_apy crypto.tools.il,crypto_tools_model.calculate_il,crypto_tools_view.display_il econometrics.bgod,econometrics_regression_model.get_bgod,econometrics_regression_view.display_bgod diff --git a/openbb_terminal/sdk.py b/openbb_terminal/sdk.py index 05c225162ee..73165a28464 100644 --- a/openbb_terminal/sdk.py +++ b/openbb_terminal/sdk.py @@ -121,7 +121,7 @@ class OpenBBSDK: `chart`: Load data for Technical Analysis\n `find`: Find similar coin by coin name,symbol or id.\n `load`: Load crypto currency to get data for\n - `price`: Returns price and confidence interval from pyth live feed. [Source: Pyth]\n + `price`: Displays live price from pyth live feed [Source: https://pyth.network/]\n """ return ctrl.CryptoController() From 6a852c8be4aa916be80ab52f0823711eccfc9395 Mon Sep 17 00:00:00 2001 From: OpenBB Date: Sat, 22 Jul 2023 16:02:07 -0700 Subject: [PATCH 27/28] ruff --- openbb_terminal/core/sdk/sdk_helpers.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/openbb_terminal/core/sdk/sdk_helpers.py b/openbb_terminal/core/sdk/sdk_helpers.py index cf60141f780..0fc306974f3 100644 --- a/openbb_terminal/core/sdk/sdk_helpers.py +++ b/openbb_terminal/core/sdk/sdk_helpers.py @@ -2,31 +2,23 @@ import json - from inspect import signature - from logging import Logger, getLogger - from typing import Any, Callable, Dict, Optional - from openbb_terminal.core.config.paths import SETTINGS_ENV_FILE - from openbb_terminal.core.sdk.sdk_init import ( FORECASTING_TOOLKIT_ENABLED, FORECASTING_TOOLKIT_WARNING, OPTIMIZATION_TOOLKIT_ENABLED, OPTIMIZATION_TOOLKIT_WARNING, ) - from openbb_terminal.core.session.current_system import ( get_current_system, set_system_variable, ) - from openbb_terminal.rich_config import console - SETTINGS_ENV_FILE.parent.mkdir(parents=True, exist_ok=True) From 69b121eb71379cc91b1887f499dc49b239f07bca Mon Sep 17 00:00:00 2001 From: James Maslek Date: Mon, 24 Jul 2023 09:57:20 -0400 Subject: [PATCH 28/28] Andrew reveiw after 9 months --- .../forecast/forecast_controller.py | 32 ++++++++++++++----- openbb_terminal/forecast/helpers.py | 2 +- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/openbb_terminal/forecast/forecast_controller.py b/openbb_terminal/forecast/forecast_controller.py index 630d8e39e47..b4386fa6e75 100644 --- a/openbb_terminal/forecast/forecast_controller.py +++ b/openbb_terminal/forecast/forecast_controller.py @@ -1039,7 +1039,9 @@ class ForecastController(BaseController): if ns_parser: # check proper file name is provided if not ns_parser.target_dataset: - console.print("[red]Please enter valid dataset.\n[/red]") + console.print( + "[red]Please select a valid dataset with the -d flag.\n[/red]" + ) return df = self.datasets[ns_parser.target_dataset] @@ -1079,13 +1081,17 @@ class ForecastController(BaseController): return if not ns_parser.values: - console.print("[red]Please enter valid dataset.\n[/red]") + console.print( + "[red]Please select a valid dataset with the -d flag.\n[/red]" + ) return values = [x.strip() for x in ns_parser.values.split(",")] target_df = values[0].split(".")[0] if target_df not in self.datasets: - console.print("[red]Please enter valid dataset.\n[/red]") + console.print( + "[red]Please select a valid dataset with the -d flag.\n[/red]" + ) return for value in values: @@ -1148,7 +1154,9 @@ class ForecastController(BaseController): return if not ns_parser.values: - console.print("[red]Please enter valid dataset.\n[/red]") + console.print( + "[red]Please select a valid dataset with the -d flag.\n[/red]" + ) return try: @@ -1191,7 +1199,9 @@ class ForecastController(BaseController): if ns_parser: # check proper file name is provided if not ns_parser.target_dataset: - console.print("[red]Please enter valid dataset.\n[/red]") + console.print( + "[red]Please select a valid dataset with the -d flag.\n[/red]" + ) return data = self.datasets[ns_parser.target_dataset] @@ -1311,7 +1321,9 @@ class ForecastController(BaseController): if ns_parser: # check proper file name is provided if not ns_parser.target_dataset: - console.print("[red]Please enter valid dataset.\n[/red]") + console.print( + "[red]Please select a valid dataset with the -d flag.\n[/red]" + ) return ( @@ -1412,7 +1424,9 @@ class ForecastController(BaseController): if ns_parser: # check proper file name is provided if not ns_parser.target_dataset: - console.print("[red]Please enter valid dataset.\n[/red]") + console.print( + "[red]Please select a valid dataset with the -d flag.\n[/red]" + ) return df = forecast_model.add_sto( @@ -1499,7 +1513,9 @@ class ForecastController(BaseController): if ns_parser: # check proper file name is provided if not ns_parser.target_dataset: - console.print("[red]Please enter valid dataset.\n[/red]") + console.print( + "[red]Please select a valid dataset with the -d flag.\n[/red]" + ) return self.datasets[ns_parser.target_dataset] = forecast_model.add_rsi( diff --git a/openbb_terminal/forecast/helpers.py b/openbb_terminal/forecast/helpers.py index 238b6b33f1a..7c5d4193963 100644 --- a/openbb_terminal/forecast/helpers.py +++ b/openbb_terminal/forecast/helpers.py @@ -1153,7 +1153,7 @@ def check_parser_input(parser: argparse.ArgumentParser, datasets, *args) -> bool if not hasattr(parser, "target_dataset"): return False if not parser.target_dataset: # type: ignore - console.print("[red]Please enter valid dataset.\n[/red]") + console.print("[red]Please select a valid dataset with the -d flag.\n[/red]") return False if "ignore_column" in args: return True