diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..a5ee008 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,22 @@ +name: Lint +on: [push, pull_request] +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: chartboost/ruff-action@v1 + with: + args: 'format --check' + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9a3a6bb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.10 + + - name: Install Poetry + run: | + pip install poetry + poetry install + + - name: Build and Publish + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} + run: | + poetry publish --build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e515a3d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: Pytest with Playwright + +on: + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.10.12, 3.11] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip install poetry + poetry install + + - name: Install Playwright browsers + run: | + poetry run playwright install + + - name: Run pytest with Playwright + run: | + poetry run pytest e2e/ diff --git a/.lintstagedrc.json b/.lintstagedrc.json deleted file mode 100644 index aef0460..0000000 --- a/.lintstagedrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "*.{ts,js}": ["eslint --fix", "git add"], - "*.{html,css,scss,md,yml}": ["prettier --write", "git add"] -} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..1962bbb --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: +- repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.5.4 + hooks: + # Run the linter. + - id: ruff + args: [ --fix ] + # Run the formatter. + - id: ruff-format \ No newline at end of file diff --git a/.renovaterc.json b/.renovaterc.json index e44d0d1..86e3bae 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -2,16 +2,10 @@ "extends": [ "config:base", "group:all", - "monorepo:angular", "schedule:monthly", ":maintainLockFilesMonthly" ], - "ignoreDeps": [ - "typescript", - "semantic-release", - "@semantic-release/git", - "@semantic-release/changelog" - ], + "ignoreDeps": [], "pinVersions": false, "separatePatchReleases": false, "ignoreUnstable": true, @@ -23,18 +17,5 @@ "peerDependencies": { "versionStrategy": "widen" }, - "packageRules": [ - { - "sourceUrlPrefixes": ["https://github.com/babel/babel"], - "groupName": "babel monorepo" - }, - { - "packagePatterns": ["^eslint"], - "groupName": "eslint" - }, - { - "packagePatterns": ["jest"], - "groupName": "jest" - } - ] + "packageRules": [] } diff --git a/.vscode/launch.json b/.vscode/launch.json index 99ca681..7b5a0ec 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -19,13 +19,17 @@ "request": "launch", "module": "pytest", "args": [ - "${file}" + "${file}", + // "-vv", + // "--headed" ], "env": { "PYTHONPATH": "${workspaceFolder}" }, - "console": "integratedTerminal" + "console": "integratedTerminal", + "justMyCode": true }, + { "name": "Python: Debug Streamlit", "type": "debugpy", @@ -33,7 +37,7 @@ "module": "streamlit", "args": [ "run", - "example.py", + "${workspaceFolder}/textcomplete/example.py", "--server.headless=true", "--browser.gatherUsageStats=false" ], diff --git a/.vscode/settings.json b/.vscode/settings.json index 1d4bad2..73589c0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,8 +14,12 @@ "statusBarItem.remoteForeground": "#e7e7e7" }, "peacock.color": "#631661", - "python.defaultInterpreterPath": "/home/voznik/.cache/pypoetry/virtualenvs/streamlit-rxdb-dataframe-zuiqvGqO-py3.10", "flake8.args": ["--max-line-length=100"], "flake8.importStrategy": "fromEnvironment", - "black-formatter.args": ["--line-length=100"] + "black-formatter.args": [ + "--line-length=100" + ], + "python.analysis.extraPaths": [ + "./e2e" + ] } diff --git a/LICENSE b/LICENSE index d7e8cff..3b145f2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,6 @@ -Copyright (c) 2018-2021 Streamlit Inc. +MIT License + +Copyright (c) 2024 VoiceAPI.ai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index c38ee7d..c6fa18f 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ pip install streamlit-textcomplete To use Streamlit Textcomplete in your Streamlit application, follow these steps: 1. Import the [`textcomplete`] function from the package. -2. Define your autocomplete strategies. +2. Define your autocomplete (multiple) strategies. 3. Define standard streamlit textarea but give it a defined label 4. Initialize the textcomplete component with this label & your strategies. diff --git a/e2e/e2e_utils.py b/e2e/e2e_utils.py index 85fb4b5..16d6c25 100644 --- a/e2e/e2e_utils.py +++ b/e2e/e2e_utils.py @@ -12,7 +12,6 @@ import requests - LOGGER = logging.getLogger(__file__) @@ -27,8 +26,12 @@ def _find_free_port(): class AsyncSubprocess: """A context manager. Wraps subprocess. Popen to capture output safely.""" - def __init__(self, args: typing.List[str], cwd: typing.Optional[str] = None, - env: typing.Optional[typing.Dict[str, str]] = None): + def __init__( + self, + args: typing.List[str], + cwd: typing.Optional[str] = None, + env: typing.Optional[typing.Dict[str, str]] = None, + ): """Initialize an AsyncSubprocess instance. Args: @@ -97,9 +100,7 @@ def stop(self): class StreamlitRunner: """A context manager for running Streamlit scripts.""" - def __init__( - self, script_path: os.PathLike, server_port: typing.Optional[int] = None - ): + def __init__(self, script_path: os.PathLike, server_port: typing.Optional[int] = None): """Initialize a StreamlitRunner instance. Args: diff --git a/e2e/test_rxdb_dataframe.py b/e2e/test_rxdb_dataframe.py deleted file mode 100644 index 9800204..0000000 --- a/e2e/test_rxdb_dataframe.py +++ /dev/null @@ -1,36 +0,0 @@ -from pathlib import Path - -import pytest - -from playwright.sync_api import Page, expect - -from e2e_utils import StreamlitRunner - -ROOT_DIRECTORY = Path(__file__).parent.parent.absolute() -BASIC_EXAMPLE_FILE = ROOT_DIRECTORY / "textcomplete" / "example.py" - -@pytest.fixture(autouse=True, scope="module") -def streamlit_app(): - with StreamlitRunner(BASIC_EXAMPLE_FILE) as runner: - yield runner - - -@pytest.fixture(autouse=True, scope="function") -def go_to_app(page: Page, streamlit_app: StreamlitRunner): - page.goto(streamlit_app.server_url) - # Wait for app to load - page.get_by_role("img", name="Running...").is_hidden() - - -def test_should_render_dataframe(page: Page): - frame = page.frame_locator( - 'iframe[title="textcomplete\\.textcomplete"]' - ) - cell_in_frame = frame.get_by_role("cell", name="Jason") - expect(cell_in_frame).to_be_visible() - - st_table = page.get_by_test_id('stTable') - - frame.get_by_role("button", name="Return dataframe").click() - cell_generated = st_table.get_by_role("cell", name="Jason") - expect(cell_generated).to_be_visible() diff --git a/e2e/test_rxdb_textcomplete.py b/e2e/test_rxdb_textcomplete.py new file mode 100644 index 0000000..27719bb --- /dev/null +++ b/e2e/test_rxdb_textcomplete.py @@ -0,0 +1,52 @@ +import json +from pathlib import Path + +import pytest +from e2e_utils import StreamlitRunner +from playwright.sync_api import Page, expect + +ROOT_DIRECTORY = Path(__file__).parent.parent.absolute() +BASIC_EXAMPLE_FILE = ROOT_DIRECTORY / "textcomplete" / "example.py" + + +@pytest.fixture(autouse=True, scope="module") +def streamlit_app(): + with StreamlitRunner(BASIC_EXAMPLE_FILE, 8502) as runner: + yield runner + + +@pytest.fixture(autouse=True, scope="function") +def go_to_app(page: Page, streamlit_app: StreamlitRunner): + page.goto(streamlit_app.server_url) + # Wait for app to load + page.get_by_role("img", name="Running...").is_hidden() + + +def test_should_render_textcomplete(page: Page): + st_text_area = page.get_by_label("Streamlit Autocomplete") + expect(st_text_area).to_be_visible() + # Retrieve the value of the "data-textcomplete" attribute + data_textcomplete_value = st_text_area.get_attribute("data-textcomplete") + + # Parse the JSON value + assert isinstance( + json.loads(data_textcomplete_value), dict + ), "'data-textcomplete' is not a valid JSON object" + + # Append "s" to the textarea to trigger the dropdown + st_text_area.focus() + st_text_area.evaluate("e => e.setSelectionRange(-1, -1)") + st_text_area.type("s") + # Wait for the dropdown to become visible + dropdown = page.query_selector("ul.textcomplete-dropdown") + dropdown.wait_for_element_state("visible") + # Find li element in dropdown + dropdown_li = dropdown.query_selector("li.textcomplete-item") + assert dropdown_li.inner_text() == "πŸ§‘πŸ» Mrs. Dennis Schulist" + dropdown_li.press("Enter") + dropdown.wait_for_element_state("hidden") + assert st_text_area.input_value() == "Hello, this is textcomplete demo Mrs. Dennis Schulist" + # Append space to the textarea to make original react component state updated + st_text_area.type(" ") + st_text_area.blur() + assert st_text_area.input_value() == "Hello, this is textcomplete demo Mrs. Dennis Schulist " diff --git a/poetry.lock b/poetry.lock index c92722c..98de6d4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -43,50 +43,6 @@ tests = ["attrs[tests-no-zope]", "zope-interface"] tests-mypy = ["mypy (>=1.6)", "pytest-mypy-plugins"] tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "pytest (>=4.3.0)", "pytest-xdist[psutil]"] -[[package]] -name = "black" -version = "23.12.1" -description = "The uncompromising code formatter." -optional = false -python-versions = ">=3.8" -files = [ - {file = "black-23.12.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e0aaf6041986767a5e0ce663c7a2f0e9eaf21e6ff87a5f95cbf3675bfd4c41d2"}, - {file = "black-23.12.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c88b3711d12905b74206227109272673edce0cb29f27e1385f33b0163c414bba"}, - {file = "black-23.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a920b569dc6b3472513ba6ddea21f440d4b4c699494d2e972a1753cdc25df7b0"}, - {file = "black-23.12.1-cp310-cp310-win_amd64.whl", hash = "sha256:3fa4be75ef2a6b96ea8d92b1587dd8cb3a35c7e3d51f0738ced0781c3aa3a5a3"}, - {file = "black-23.12.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8d4df77958a622f9b5a4c96edb4b8c0034f8434032ab11077ec6c56ae9f384ba"}, - {file = "black-23.12.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:602cfb1196dc692424c70b6507593a2b29aac0547c1be9a1d1365f0d964c353b"}, - {file = "black-23.12.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c4352800f14be5b4864016882cdba10755bd50805c95f728011bcb47a4afd59"}, - {file = "black-23.12.1-cp311-cp311-win_amd64.whl", hash = "sha256:0808494f2b2df923ffc5723ed3c7b096bd76341f6213989759287611e9837d50"}, - {file = "black-23.12.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:25e57fd232a6d6ff3f4478a6fd0580838e47c93c83eaf1ccc92d4faf27112c4e"}, - {file = "black-23.12.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2d9e13db441c509a3763a7a3d9a49ccc1b4e974a47be4e08ade2a228876500ec"}, - {file = "black-23.12.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d1bd9c210f8b109b1762ec9fd36592fdd528485aadb3f5849b2740ef17e674e"}, - {file = "black-23.12.1-cp312-cp312-win_amd64.whl", hash = "sha256:ae76c22bde5cbb6bfd211ec343ded2163bba7883c7bc77f6b756a1049436fbb9"}, - {file = "black-23.12.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1fa88a0f74e50e4487477bc0bb900c6781dbddfdfa32691e780bf854c3b4a47f"}, - {file = "black-23.12.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a4d6a9668e45ad99d2f8ec70d5c8c04ef4f32f648ef39048d010b0689832ec6d"}, - {file = "black-23.12.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b18fb2ae6c4bb63eebe5be6bd869ba2f14fd0259bda7d18a46b764d8fb86298a"}, - {file = "black-23.12.1-cp38-cp38-win_amd64.whl", hash = "sha256:c04b6d9d20e9c13f43eee8ea87d44156b8505ca8a3c878773f68b4e4812a421e"}, - {file = "black-23.12.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3e1b38b3135fd4c025c28c55ddfc236b05af657828a8a6abe5deec419a0b7055"}, - {file = "black-23.12.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4f0031eaa7b921db76decd73636ef3a12c942ed367d8c3841a0739412b260a54"}, - {file = "black-23.12.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:97e56155c6b737854e60a9ab1c598ff2533d57e7506d97af5481141671abf3ea"}, - {file = "black-23.12.1-cp39-cp39-win_amd64.whl", hash = "sha256:dd15245c8b68fe2b6bd0f32c1556509d11bb33aec9b5d0866dd8e2ed3dba09c2"}, - {file = "black-23.12.1-py3-none-any.whl", hash = "sha256:78baad24af0f033958cad29731e27363183e140962595def56423e626f4bee3e"}, - {file = "black-23.12.1.tar.gz", hash = "sha256:4ce3ef14ebe8d9509188014d96af1c456a910d5b5cbf434a09fef7e024b3d0d5"}, -] - -[package.dependencies] -click = ">=8.0.0" -mypy-extensions = ">=0.4.3" -packaging = ">=22.0" -pathspec = ">=0.9.0" -platformdirs = ">=2" - -[package.extras] -colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"] -jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -uvloop = ["uvloop (>=0.15.2)"] - [[package]] name = "blinker" version = "1.8.2" @@ -100,13 +56,13 @@ files = [ [[package]] name = "cachetools" -version = "5.3.3" +version = "5.4.0" description = "Extensible memoizing collections and decorators" optional = false python-versions = ">=3.7" files = [ - {file = "cachetools-5.3.3-py3-none-any.whl", hash = "sha256:0abad1021d3f8325b2fc1d2e9c8b9c9d57b04c3932657a72465447332c24d945"}, - {file = "cachetools-5.3.3.tar.gz", hash = "sha256:ba29e2dfa0b8b556606f097407ed1aa62080ee108ab0dc5ec9d6a723a007d105"}, + {file = "cachetools-5.4.0-py3-none-any.whl", hash = "sha256:3ae3b49a3d5e28a77a0be2b37dbcb89005058959cb2323858c2657c4a8cab474"}, + {file = "cachetools-5.4.0.tar.gz", hash = "sha256:b8adc2e7c07f105ced7bc56dbb6dfbe7c4a00acce20e2227b3f355be89bc6827"}, ] [[package]] @@ -245,34 +201,21 @@ files = [ ] [[package]] -name = "flake8" -version = "7.1.0" -description = "the modular source code checker: pep8 pyflakes and co" -optional = false -python-versions = ">=3.8.1" -files = [ - {file = "flake8-7.1.0-py2.py3-none-any.whl", hash = "sha256:2e416edcc62471a64cea09353f4e7bdba32aeb079b6e360554c659a122b1bc6a"}, - {file = "flake8-7.1.0.tar.gz", hash = "sha256:48a07b626b55236e0fb4784ee69a465fbf59d79eec1f5b4785c3d3bc57d17aa5"}, -] - -[package.dependencies] -mccabe = ">=0.7.0,<0.8.0" -pycodestyle = ">=2.12.0,<2.13.0" -pyflakes = ">=3.2.0,<3.3.0" - -[[package]] -name = "flake8-annotations-complexity" -version = "0.0.8" -description = "A flake8 extension that checks for type annotations complexity" +name = "emoji" +version = "2.12.1" +description = "Emoji for Python" optional = false python-versions = ">=3.7" files = [ - {file = "flake8_annotations_complexity-0.0.8-py3-none-any.whl", hash = "sha256:44e299dac0ab64f3af4b478fac7feb635c113a606036de8b39dadab3531da7ed"}, - {file = "flake8_annotations_complexity-0.0.8.tar.gz", hash = "sha256:8914e76e31672c4063c928b0a250db6b935a16d1799de10457958a71d11bb665"}, + {file = "emoji-2.12.1-py3-none-any.whl", hash = "sha256:a00d62173bdadc2510967a381810101624a2f0986145b8da0cffa42e29430235"}, + {file = "emoji-2.12.1.tar.gz", hash = "sha256:4aa0488817691aa58d83764b6c209f8a27c0b3ab3f89d1b8dceca1a62e4973eb"}, ] [package.dependencies] -flake8 = "*" +typing-extensions = ">=4.7.0" + +[package.extras] +dev = ["coverage", "pytest (>=7.4.4)"] [[package]] name = "gitdb" @@ -558,17 +501,6 @@ files = [ {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, ] -[[package]] -name = "mccabe" -version = "0.7.0" -description = "McCabe checker, plugin for flake8" -optional = false -python-versions = ">=3.6" -files = [ - {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, - {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, -] - [[package]] name = "mdurl" version = "0.1.2" @@ -582,43 +514,43 @@ files = [ [[package]] name = "mypy" -version = "1.10.1" +version = "1.11.0" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" files = [ - {file = "mypy-1.10.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e36f229acfe250dc660790840916eb49726c928e8ce10fbdf90715090fe4ae02"}, - {file = "mypy-1.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:51a46974340baaa4145363b9e051812a2446cf583dfaeba124af966fa44593f7"}, - {file = "mypy-1.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:901c89c2d67bba57aaaca91ccdb659aa3a312de67f23b9dfb059727cce2e2e0a"}, - {file = "mypy-1.10.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0cd62192a4a32b77ceb31272d9e74d23cd88c8060c34d1d3622db3267679a5d9"}, - {file = "mypy-1.10.1-cp310-cp310-win_amd64.whl", hash = "sha256:a2cbc68cb9e943ac0814c13e2452d2046c2f2b23ff0278e26599224cf164e78d"}, - {file = "mypy-1.10.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:bd6f629b67bb43dc0d9211ee98b96d8dabc97b1ad38b9b25f5e4c4d7569a0c6a"}, - {file = "mypy-1.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a1bbb3a6f5ff319d2b9d40b4080d46cd639abe3516d5a62c070cf0114a457d84"}, - {file = "mypy-1.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8edd4e9bbbc9d7b79502eb9592cab808585516ae1bcc1446eb9122656c6066f"}, - {file = "mypy-1.10.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:6166a88b15f1759f94a46fa474c7b1b05d134b1b61fca627dd7335454cc9aa6b"}, - {file = "mypy-1.10.1-cp311-cp311-win_amd64.whl", hash = "sha256:5bb9cd11c01c8606a9d0b83ffa91d0b236a0e91bc4126d9ba9ce62906ada868e"}, - {file = "mypy-1.10.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d8681909f7b44d0b7b86e653ca152d6dff0eb5eb41694e163c6092124f8246d7"}, - {file = "mypy-1.10.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:378c03f53f10bbdd55ca94e46ec3ba255279706a6aacaecac52ad248f98205d3"}, - {file = "mypy-1.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bacf8f3a3d7d849f40ca6caea5c055122efe70e81480c8328ad29c55c69e93e"}, - {file = "mypy-1.10.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:701b5f71413f1e9855566a34d6e9d12624e9e0a8818a5704d74d6b0402e66c04"}, - {file = "mypy-1.10.1-cp312-cp312-win_amd64.whl", hash = "sha256:3c4c2992f6ea46ff7fce0072642cfb62af7a2484efe69017ed8b095f7b39ef31"}, - {file = "mypy-1.10.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:604282c886497645ffb87b8f35a57ec773a4a2721161e709a4422c1636ddde5c"}, - {file = "mypy-1.10.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37fd87cab83f09842653f08de066ee68f1182b9b5282e4634cdb4b407266bade"}, - {file = "mypy-1.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8addf6313777dbb92e9564c5d32ec122bf2c6c39d683ea64de6a1fd98b90fe37"}, - {file = "mypy-1.10.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5cc3ca0a244eb9a5249c7c583ad9a7e881aa5d7b73c35652296ddcdb33b2b9c7"}, - {file = "mypy-1.10.1-cp38-cp38-win_amd64.whl", hash = "sha256:1b3a2ffce52cc4dbaeee4df762f20a2905aa171ef157b82192f2e2f368eec05d"}, - {file = "mypy-1.10.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fe85ed6836165d52ae8b88f99527d3d1b2362e0cb90b005409b8bed90e9059b3"}, - {file = "mypy-1.10.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c2ae450d60d7d020d67ab440c6e3fae375809988119817214440033f26ddf7bf"}, - {file = "mypy-1.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6be84c06e6abd72f960ba9a71561c14137a583093ffcf9bbfaf5e613d63fa531"}, - {file = "mypy-1.10.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:2189ff1e39db399f08205e22a797383613ce1cb0cb3b13d8bcf0170e45b96cc3"}, - {file = "mypy-1.10.1-cp39-cp39-win_amd64.whl", hash = "sha256:97a131ee36ac37ce9581f4220311247ab6cba896b4395b9c87af0675a13a755f"}, - {file = "mypy-1.10.1-py3-none-any.whl", hash = "sha256:71d8ac0b906354ebda8ef1673e5fde785936ac1f29ff6987c7483cfbd5a4235a"}, - {file = "mypy-1.10.1.tar.gz", hash = "sha256:1f8f492d7db9e3593ef42d4f115f04e556130f2819ad33ab84551403e97dd4c0"}, + {file = "mypy-1.11.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a3824187c99b893f90c845bab405a585d1ced4ff55421fdf5c84cb7710995229"}, + {file = "mypy-1.11.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:96f8dbc2c85046c81bcddc246232d500ad729cb720da4e20fce3b542cab91287"}, + {file = "mypy-1.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1a5d8d8dd8613a3e2be3eae829ee891b6b2de6302f24766ff06cb2875f5be9c6"}, + {file = "mypy-1.11.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:72596a79bbfb195fd41405cffa18210af3811beb91ff946dbcb7368240eed6be"}, + {file = "mypy-1.11.0-cp310-cp310-win_amd64.whl", hash = "sha256:35ce88b8ed3a759634cb4eb646d002c4cef0a38f20565ee82b5023558eb90c00"}, + {file = "mypy-1.11.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:98790025861cb2c3db8c2f5ad10fc8c336ed2a55f4daf1b8b3f877826b6ff2eb"}, + {file = "mypy-1.11.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:25bcfa75b9b5a5f8d67147a54ea97ed63a653995a82798221cca2a315c0238c1"}, + {file = "mypy-1.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0bea2a0e71c2a375c9fa0ede3d98324214d67b3cbbfcbd55ac8f750f85a414e3"}, + {file = "mypy-1.11.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d2b3d36baac48e40e3064d2901f2fbd2a2d6880ec6ce6358825c85031d7c0d4d"}, + {file = "mypy-1.11.0-cp311-cp311-win_amd64.whl", hash = "sha256:d8e2e43977f0e09f149ea69fd0556623919f816764e26d74da0c8a7b48f3e18a"}, + {file = "mypy-1.11.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:1d44c1e44a8be986b54b09f15f2c1a66368eb43861b4e82573026e04c48a9e20"}, + {file = "mypy-1.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cea3d0fb69637944dd321f41bc896e11d0fb0b0aa531d887a6da70f6e7473aba"}, + {file = "mypy-1.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a83ec98ae12d51c252be61521aa5731f5512231d0b738b4cb2498344f0b840cd"}, + {file = "mypy-1.11.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:c7b73a856522417beb78e0fb6d33ef89474e7a622db2653bc1285af36e2e3e3d"}, + {file = "mypy-1.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:f2268d9fcd9686b61ab64f077be7ffbc6fbcdfb4103e5dd0cc5eaab53a8886c2"}, + {file = "mypy-1.11.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:940bfff7283c267ae6522ef926a7887305945f716a7704d3344d6d07f02df850"}, + {file = "mypy-1.11.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:14f9294528b5f5cf96c721f231c9f5b2733164e02c1c018ed1a0eff8a18005ac"}, + {file = "mypy-1.11.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d7b54c27783991399046837df5c7c9d325d921394757d09dbcbf96aee4649fe9"}, + {file = "mypy-1.11.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:65f190a6349dec29c8d1a1cd4aa71284177aee5949e0502e6379b42873eddbe7"}, + {file = "mypy-1.11.0-cp38-cp38-win_amd64.whl", hash = "sha256:dbe286303241fea8c2ea5466f6e0e6a046a135a7e7609167b07fd4e7baf151bf"}, + {file = "mypy-1.11.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:104e9c1620c2675420abd1f6c44bab7dd33cc85aea751c985006e83dcd001095"}, + {file = "mypy-1.11.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f006e955718ecd8d159cee9932b64fba8f86ee6f7728ca3ac66c3a54b0062abe"}, + {file = "mypy-1.11.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:becc9111ca572b04e7e77131bc708480cc88a911adf3d0239f974c034b78085c"}, + {file = "mypy-1.11.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6801319fe76c3f3a3833f2b5af7bd2c17bb93c00026a2a1b924e6762f5b19e13"}, + {file = "mypy-1.11.0-cp39-cp39-win_amd64.whl", hash = "sha256:c1a184c64521dc549324ec6ef7cbaa6b351912be9cb5edb803c2808a0d7e85ac"}, + {file = "mypy-1.11.0-py3-none-any.whl", hash = "sha256:56913ec8c7638b0091ef4da6fcc9136896914a9d60d54670a75880c3e5b99ace"}, + {file = "mypy-1.11.0.tar.gz", hash = "sha256:93743608c7348772fdc717af4aeee1997293a1ad04bc0ea6efa15bf65385c538"}, ] [package.dependencies] mypy-extensions = ">=1.0.0" -typing-extensions = ">=4.1.0" +typing-extensions = ">=4.6.0" [package.extras] dmypy = ["psutil (>=4.0)"] @@ -774,17 +706,6 @@ sql-other = ["SQLAlchemy (>=2.0.0)", "adbc-driver-postgresql (>=0.8.0)", "adbc-d test = ["hypothesis (>=6.46.1)", "pytest (>=7.3.2)", "pytest-xdist (>=2.2.0)"] xml = ["lxml (>=4.9.2)"] -[[package]] -name = "pathspec" -version = "0.12.1" -description = "Utility library for gitignore style pattern matching of file paths." -optional = false -python-versions = ">=3.8" -files = [ - {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, - {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, -] - [[package]] name = "pillow" version = "10.4.0" @@ -882,22 +803,6 @@ tests = ["check-manifest", "coverage", "defusedxml", "markdown2", "olefile", "pa typing = ["typing-extensions"] xmp = ["defusedxml"] -[[package]] -name = "platformdirs" -version = "4.2.2" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." -optional = false -python-versions = ">=3.8" -files = [ - {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, - {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, -] - -[package.extras] -docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] -type = ["mypy (>=1.8)"] - [[package]] name = "playwright" version = "1.45.0" @@ -955,62 +860,54 @@ files = [ [[package]] name = "pyarrow" -version = "16.1.0" +version = "17.0.0" description = "Python library for Apache Arrow" optional = false python-versions = ">=3.8" files = [ - {file = "pyarrow-16.1.0-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:17e23b9a65a70cc733d8b738baa6ad3722298fa0c81d88f63ff94bf25eaa77b9"}, - {file = "pyarrow-16.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4740cc41e2ba5d641071d0ab5e9ef9b5e6e8c7611351a5cb7c1d175eaf43674a"}, - {file = "pyarrow-16.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:98100e0268d04e0eec47b73f20b39c45b4006f3c4233719c3848aa27a03c1aef"}, - {file = "pyarrow-16.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f68f409e7b283c085f2da014f9ef81e885d90dcd733bd648cfba3ef265961848"}, - {file = "pyarrow-16.1.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:a8914cd176f448e09746037b0c6b3a9d7688cef451ec5735094055116857580c"}, - {file = "pyarrow-16.1.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:48be160782c0556156d91adbdd5a4a7e719f8d407cb46ae3bb4eaee09b3111bd"}, - {file = "pyarrow-16.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:9cf389d444b0f41d9fe1444b70650fea31e9d52cfcb5f818b7888b91b586efff"}, - {file = "pyarrow-16.1.0-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:d0ebea336b535b37eee9eee31761813086d33ed06de9ab6fc6aaa0bace7b250c"}, - {file = "pyarrow-16.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2e73cfc4a99e796727919c5541c65bb88b973377501e39b9842ea71401ca6c1c"}, - {file = "pyarrow-16.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf9251264247ecfe93e5f5a0cd43b8ae834f1e61d1abca22da55b20c788417f6"}, - {file = "pyarrow-16.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ddf5aace92d520d3d2a20031d8b0ec27b4395cab9f74e07cc95edf42a5cc0147"}, - {file = "pyarrow-16.1.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:25233642583bf658f629eb230b9bb79d9af4d9f9229890b3c878699c82f7d11e"}, - {file = "pyarrow-16.1.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:a33a64576fddfbec0a44112eaf844c20853647ca833e9a647bfae0582b2ff94b"}, - {file = "pyarrow-16.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:185d121b50836379fe012753cf15c4ba9638bda9645183ab36246923875f8d1b"}, - {file = "pyarrow-16.1.0-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:2e51ca1d6ed7f2e9d5c3c83decf27b0d17bb207a7dea986e8dc3e24f80ff7d6f"}, - {file = "pyarrow-16.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:06ebccb6f8cb7357de85f60d5da50e83507954af617d7b05f48af1621d331c9a"}, - {file = "pyarrow-16.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b04707f1979815f5e49824ce52d1dceb46e2f12909a48a6a753fe7cafbc44a0c"}, - {file = "pyarrow-16.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d32000693deff8dc5df444b032b5985a48592c0697cb6e3071a5d59888714e2"}, - {file = "pyarrow-16.1.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:8785bb10d5d6fd5e15d718ee1d1f914fe768bf8b4d1e5e9bf253de8a26cb1628"}, - {file = "pyarrow-16.1.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:e1369af39587b794873b8a307cc6623a3b1194e69399af0efd05bb202195a5a7"}, - {file = "pyarrow-16.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:febde33305f1498f6df85e8020bca496d0e9ebf2093bab9e0f65e2b4ae2b3444"}, - {file = "pyarrow-16.1.0-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:b5f5705ab977947a43ac83b52ade3b881eb6e95fcc02d76f501d549a210ba77f"}, - {file = "pyarrow-16.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:0d27bf89dfc2576f6206e9cd6cf7a107c9c06dc13d53bbc25b0bd4556f19cf5f"}, - {file = "pyarrow-16.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d07de3ee730647a600037bc1d7b7994067ed64d0eba797ac74b2bc77384f4c2"}, - {file = "pyarrow-16.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fbef391b63f708e103df99fbaa3acf9f671d77a183a07546ba2f2c297b361e83"}, - {file = "pyarrow-16.1.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:19741c4dbbbc986d38856ee7ddfdd6a00fc3b0fc2d928795b95410d38bb97d15"}, - {file = "pyarrow-16.1.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:f2c5fb249caa17b94e2b9278b36a05ce03d3180e6da0c4c3b3ce5b2788f30eed"}, - {file = "pyarrow-16.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:e6b6d3cd35fbb93b70ade1336022cc1147b95ec6af7d36906ca7fe432eb09710"}, - {file = "pyarrow-16.1.0-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:18da9b76a36a954665ccca8aa6bd9f46c1145f79c0bb8f4f244f5f8e799bca55"}, - {file = "pyarrow-16.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:99f7549779b6e434467d2aa43ab2b7224dd9e41bdde486020bae198978c9e05e"}, - {file = "pyarrow-16.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f07fdffe4fd5b15f5ec15c8b64584868d063bc22b86b46c9695624ca3505b7b4"}, - {file = "pyarrow-16.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ddfe389a08ea374972bd4065d5f25d14e36b43ebc22fc75f7b951f24378bf0b5"}, - {file = "pyarrow-16.1.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:3b20bd67c94b3a2ea0a749d2a5712fc845a69cb5d52e78e6449bbd295611f3aa"}, - {file = "pyarrow-16.1.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:ba8ac20693c0bb0bf4b238751d4409e62852004a8cf031c73b0e0962b03e45e3"}, - {file = "pyarrow-16.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:31a1851751433d89a986616015841977e0a188662fcffd1a5677453f1df2de0a"}, - {file = "pyarrow-16.1.0.tar.gz", hash = "sha256:15fbb22ea96d11f0b5768504a3f961edab25eaf4197c341720c4a387f6c60315"}, + {file = "pyarrow-17.0.0-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:a5c8b238d47e48812ee577ee20c9a2779e6a5904f1708ae240f53ecbee7c9f07"}, + {file = "pyarrow-17.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:db023dc4c6cae1015de9e198d41250688383c3f9af8f565370ab2b4cb5f62655"}, + {file = "pyarrow-17.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da1e060b3876faa11cee287839f9cc7cdc00649f475714b8680a05fd9071d545"}, + {file = "pyarrow-17.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75c06d4624c0ad6674364bb46ef38c3132768139ddec1c56582dbac54f2663e2"}, + {file = "pyarrow-17.0.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:fa3c246cc58cb5a4a5cb407a18f193354ea47dd0648194e6265bd24177982fe8"}, + {file = "pyarrow-17.0.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:f7ae2de664e0b158d1607699a16a488de3d008ba99b3a7aa5de1cbc13574d047"}, + {file = "pyarrow-17.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:5984f416552eea15fd9cee03da53542bf4cddaef5afecefb9aa8d1010c335087"}, + {file = "pyarrow-17.0.0-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:1c8856e2ef09eb87ecf937104aacfa0708f22dfeb039c363ec99735190ffb977"}, + {file = "pyarrow-17.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2e19f569567efcbbd42084e87f948778eb371d308e137a0f97afe19bb860ccb3"}, + {file = "pyarrow-17.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b244dc8e08a23b3e352899a006a26ae7b4d0da7bb636872fa8f5884e70acf15"}, + {file = "pyarrow-17.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b72e87fe3e1db343995562f7fff8aee354b55ee83d13afba65400c178ab2597"}, + {file = "pyarrow-17.0.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:dc5c31c37409dfbc5d014047817cb4ccd8c1ea25d19576acf1a001fe07f5b420"}, + {file = "pyarrow-17.0.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:e3343cb1e88bc2ea605986d4b94948716edc7a8d14afd4e2c097232f729758b4"}, + {file = "pyarrow-17.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:a27532c38f3de9eb3e90ecab63dfda948a8ca859a66e3a47f5f42d1e403c4d03"}, + {file = "pyarrow-17.0.0-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:9b8a823cea605221e61f34859dcc03207e52e409ccf6354634143e23af7c8d22"}, + {file = "pyarrow-17.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f1e70de6cb5790a50b01d2b686d54aaf73da01266850b05e3af2a1bc89e16053"}, + {file = "pyarrow-17.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0071ce35788c6f9077ff9ecba4858108eebe2ea5a3f7cf2cf55ebc1dbc6ee24a"}, + {file = "pyarrow-17.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:757074882f844411fcca735e39aae74248a1531367a7c80799b4266390ae51cc"}, + {file = "pyarrow-17.0.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:9ba11c4f16976e89146781a83833df7f82077cdab7dc6232c897789343f7891a"}, + {file = "pyarrow-17.0.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:b0c6ac301093b42d34410b187bba560b17c0330f64907bfa4f7f7f2444b0cf9b"}, + {file = "pyarrow-17.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:392bc9feabc647338e6c89267635e111d71edad5fcffba204425a7c8d13610d7"}, + {file = "pyarrow-17.0.0-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:af5ff82a04b2171415f1410cff7ebb79861afc5dae50be73ce06d6e870615204"}, + {file = "pyarrow-17.0.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:edca18eaca89cd6382dfbcff3dd2d87633433043650c07375d095cd3517561d8"}, + {file = "pyarrow-17.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7c7916bff914ac5d4a8fe25b7a25e432ff921e72f6f2b7547d1e325c1ad9d155"}, + {file = "pyarrow-17.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f553ca691b9e94b202ff741bdd40f6ccb70cdd5fbf65c187af132f1317de6145"}, + {file = "pyarrow-17.0.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:0cdb0e627c86c373205a2f94a510ac4376fdc523f8bb36beab2e7f204416163c"}, + {file = "pyarrow-17.0.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:d7d192305d9d8bc9082d10f361fc70a73590a4c65cf31c3e6926cd72b76bc35c"}, + {file = "pyarrow-17.0.0-cp38-cp38-win_amd64.whl", hash = "sha256:02dae06ce212d8b3244dd3e7d12d9c4d3046945a5933d28026598e9dbbda1fca"}, + {file = "pyarrow-17.0.0-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:13d7a460b412f31e4c0efa1148e1d29bdf18ad1411eb6757d38f8fbdcc8645fb"}, + {file = "pyarrow-17.0.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9b564a51fbccfab5a04a80453e5ac6c9954a9c5ef2890d1bcf63741909c3f8df"}, + {file = "pyarrow-17.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:32503827abbc5aadedfa235f5ece8c4f8f8b0a3cf01066bc8d29de7539532687"}, + {file = "pyarrow-17.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a155acc7f154b9ffcc85497509bcd0d43efb80d6f733b0dc3bb14e281f131c8b"}, + {file = "pyarrow-17.0.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:dec8d129254d0188a49f8a1fc99e0560dc1b85f60af729f47de4046015f9b0a5"}, + {file = "pyarrow-17.0.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:a48ddf5c3c6a6c505904545c25a4ae13646ae1f8ba703c4df4a1bfe4f4006bda"}, + {file = "pyarrow-17.0.0-cp39-cp39-win_amd64.whl", hash = "sha256:42bf93249a083aca230ba7e2786c5f673507fa97bbd9725a1e2754715151a204"}, + {file = "pyarrow-17.0.0.tar.gz", hash = "sha256:4beca9521ed2c0921c1023e68d097d0299b62c362639ea315572a58f3f50fd28"}, ] [package.dependencies] numpy = ">=1.16.6" -[[package]] -name = "pycodestyle" -version = "2.12.0" -description = "Python style guide checker" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pycodestyle-2.12.0-py2.py3-none-any.whl", hash = "sha256:949a39f6b86c3e1515ba1787c2022131d165a8ad271b11370a8819aa070269e4"}, - {file = "pycodestyle-2.12.0.tar.gz", hash = "sha256:442f950141b4f43df752dd303511ffded3a04c2b6fb7f65980574f0c31e6e79c"}, -] +[package.extras] +test = ["cffi", "hypothesis", "pandas", "pytest", "pytz"] [[package]] name = "pydeck" @@ -1048,17 +945,6 @@ typing-extensions = "*" [package.extras] dev = ["black", "build", "flake8", "flake8-black", "isort", "jupyter-console", "mkdocs", "mkdocs-include-markdown-plugin", "mkdocstrings[python]", "pytest", "pytest-asyncio", "pytest-trio", "sphinx", "toml", "tox", "trio", "trio", "trio-typing", "twine", "twisted", "validate-pyproject[all]"] -[[package]] -name = "pyflakes" -version = "3.2.0" -description = "passive checker of Python programs" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, - {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, -] - [[package]] name = "pygments" version = "2.18.0" @@ -1113,13 +999,13 @@ test = ["black (>=22.1.0)", "flake8 (>=4.0.1)", "pre-commit (>=2.17.0)", "pytest [[package]] name = "pytest-playwright" -version = "0.4.4" +version = "0.5.1" description = "A pytest wrapper with fixtures for Playwright to automate web browsers" optional = false python-versions = ">=3.8" files = [ - {file = "pytest-playwright-0.4.4.tar.gz", hash = "sha256:5488db4cc49028491c5130af0a2bb6b1d0b222a202217f6d14491d4c9aa67ff9"}, - {file = "pytest_playwright-0.4.4-py3-none-any.whl", hash = "sha256:df306f3a60a8631a3cfde1b95a2ed5a89203a3408dfa1154de049ca7de87c90b"}, + {file = "pytest-playwright-0.5.1.tar.gz", hash = "sha256:6b0683cbacd060f338b37d0c2cdac25d841e14f1440e986efcceaacd3d61a268"}, + {file = "pytest_playwright-0.5.1-py3-none-any.whl", hash = "sha256:54eb12742de16bf50d9630fe06ac398727e52d5c1e55269acb37e1ede91d9e00"}, ] [package.dependencies] @@ -1543,4 +1429,4 @@ watchmedo = ["PyYAML (>=3.10)"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "464eae5373b21526066e0853e8eb097c14108d4b3dfdd24f009fd05d3a341405" +content-hash = "7c1478f869516e83ae6d5d9b65876bee2b1d2609354272631be51e9d6c733ad4" diff --git a/pyproject.toml b/pyproject.toml index c87b1c7..40a130a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,35 +1,31 @@ [tool.poetry] name = "streamlit-textcomplete" version = "0.1.0" -description = "Textcomplete editor for HTMLTextAreaElement" +description = "Streamlit autocomplete Textcomplete editor for HTMLTextAreaElement" authors = ["voznik "] readme = "README.md" license = "MIT" homepage = "https://github.com/voznik/streamlit-textcomplete" repository = "https://github.com/voznik/streamlit-textcomplete" -keywords = ["streamlit", "indexedDB", "RxDB", "browser", "connection", "dataframe"] +keywords = ["streamlit", "textarea", "autocomplete", "textcomplete", "emoji"] packages = [{ include = "textcomplete" }] [tool.poetry.dependencies] -python = "^3.11" -pytest-playwright = "^0.4.4" -streamlit = "^1.31.0" -playwright = "^1.41.2" -pandas = "^2.2.1" -jsonschema = "^4.21.1" - +python = "^3.10" +streamlit = "^1.36.0" +pandas = "^2.2.2" +emoji = "^2.12.1" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.poetry.group.dev.dependencies] -pytest = "^7.1.3" -black = "^23.1.0" -isort = "^5.12.0" -mypy = "^1.0.0" -flake8 = "^7.0.0" -flake8-annotations-complexity = "^0.0.8" +playwright = "^1.45.0" +pytest-playwright = "^0.5.1" +pytest = "^7.4.4" +isort = "^5.13.2" +mypy = "^1.11.0" [tool.isort] profile = "black" @@ -62,7 +58,7 @@ files = ["**/*.py"] follow_imports = "silent" ignore_missing_imports = true scripts_are_modules = true -python_version = "3.9" +python_version = "3.10" [tool.ruff] diff --git a/setup.py b/setup.py deleted file mode 100644 index 0f59811..0000000 --- a/setup.py +++ /dev/null @@ -1,33 +0,0 @@ -import setuptools - -setuptools.setup( - name="streamlit-textcomplete", - version="0.0.1", - author="voznik", - author_email="", - author_url="github.com/voznik", - description="Textcomplete editor for HTMLTextAreaElement.", - long_description="Textcomplete editor for HTMLTextAreaElement.", - long_description_content_type="text/plain", - url="", - packages=setuptools.find_packages(), - include_package_data=True, - classifiers=[], - python_requires=">=3.7", - install_requires=[ - # By definition, a Custom Component depends on Streamlit. - # If your component has other Python dependencies, list - # them here. - "streamlit >= 0.66", - ], - extras_require={ - "devel": [ - "wheel", - "pytest==7.4.0", - "playwright==1.39.0", - "requests==2.31.0", - "pytest-playwright-snapshot==1.0", - "pytest-rerunfailures==12.0", - ] - } -) diff --git a/sonar-project.properties b/sonar-project.properties index 768a73b..a75ea3e 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1 +1,20 @@ -sonar.exclusions=example.py,textcomplete/frontend/vite.config.ts,textcomplete/frontend/build +sonar.projectKey=voznik_streamlit-textcomplete +sonar.organization=voznik + +# This is the name and version displayed in the SonarCloud UI. +#sonar.projectName=streamlit-textcomplete +#sonar.projectVersion=1.0 + + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +#sonar.sources=. + +# Encoding of the source code. Default is default system encoding +#sonar.sourceEncoding=UTF-8 + +sonar.exclusions=textcomplete/frontend/src/streamlit.js,textcomplete/frontend/build + +# This is by intention +sonar.issue.ignore.multicriteria=e1 +sonar.issue.ignore.multicriteria.e1.resourceKey=**/*.js +sonar.issue.ignore.multicriteria.e1.ruleKey=javascript:S1523 diff --git a/textcomplete/__init__.py b/textcomplete/__init__.py index 53e084d..38a0bf8 100644 --- a/textcomplete/__init__.py +++ b/textcomplete/__init__.py @@ -1,4 +1,8 @@ import os + +# import pyarrow as pa +# from streamlit.proto.Components_pb2 import SpecialArg +# from streamlit.elements import arrow from typing import ( # noqa: F401,E501 Any, Callable, @@ -7,22 +11,23 @@ List, Literal, Optional, - TypeVar, TypedDict, + TypeVar, Union, ) + +import pandas as pd import streamlit.components.v1 as components +from streamlit import session_state as ss # noqa: F401 from streamlit.elements.widgets.text_widgets import ( # noqa: F401 - LabelVisibility, - WidgetCallback, - WidgetArgs, - WidgetKwargs, Key, + LabelVisibility, SupportsStr, TextWidgetsMixin, + WidgetArgs, + WidgetCallback, + WidgetKwargs, ) -from streamlit import session_state as ss # noqa: F401 - from streamlit.runtime.caching import cache_data # noqa: F401 # Create a _RELEASE constant. We'll set this to False while we're developing @@ -78,8 +83,8 @@ def __init__( template: str = None, index: str = None, id: str = None, - data: List[Dict[str, Any]] = None, - comparator_keys: List[str] = [], + data: List[Dict[str, Any]] | pd.DataFrame = None, + comparator_keys: List[str] = None, ) -> None: self.match = match self.search = search @@ -90,10 +95,10 @@ def __init__( self.index = index self.id = id self.data = data - self.comparator_keys = comparator_keys + self.comparator_keys = comparator_keys if comparator_keys is not None else [] def to_dict(self) -> Dict[str, Any]: - return { + result = { "match": self.match, "search": self.search, "replace": self.replace, @@ -102,10 +107,16 @@ def to_dict(self) -> Dict[str, Any]: "template": self.template, "index": self.index, "id": self.id, - "data": self.data, "comparatorKeys": self.comparator_keys, } + if isinstance(self.data, pd.DataFrame): + result["data"] = self.data.to_dict(orient="records") + else: + result["data"] = self.data + + return result + def textcomplete( area_label: str, @@ -119,7 +130,7 @@ def textcomplete( max_count: int = 10, placement: Literal["auto"] | Literal["top"] | Literal["bottom"] = "bottom", rotate: bool = False, - # style: str | None = None, # TODO: CSSStyleDeclaration + stop_enter_propagation: bool = False, dynamic_width: bool = True, dropdown_style: str = "", ) -> Optional[TextcompleteResult]: @@ -149,6 +160,7 @@ def textcomplete( area_label=area_label, strategies=[strategy.to_dict() for strategy in strategies], dropdown_option=dropdown_option, + stop_enter_propagation=stop_enter_propagation, ) if on_select and result: @@ -156,13 +168,13 @@ def textcomplete( # We could modify the value returned from the component if we wanted. # There's no need to do this in our simple example - but it's an option. - return result + # return result __title__ = "Streamlit Textcomplete" -__desc__ = "Textcomplete editor for HTMLTextAreaElement." -__icon__ = "🏦" +__desc__ = "Streamlit autocomplete Textcomplete editor for HTMLTextAreaElement" +__icon__ = "πŸ“" # __examples__ = [example] __author__ = "voznik" -__streamlit_cloud_url__ = "https://st-textcomplete.streamlitapp.com/" +__streamlit_cloud_url__ = "https://textcomplete.streamlitapp.com/" __github_repo__ = "voznik/streamlit-textcomplete" diff --git a/example.py b/textcomplete/example.py similarity index 73% rename from example.py rename to textcomplete/example.py index e394f60..eea6512 100644 --- a/example.py +++ b/textcomplete/example.py @@ -1,38 +1,13 @@ import streamlit as st +from emoji.unicode_codes.data_dict import EMOJI_DATA -# import json # from streamlit.runtime.caching import cache_data from textcomplete import ( - TextcompleteResult, StrategyProps, + TextcompleteResult, textcomplete, ) - -if "txt" not in st.session_state: - st.session_state["txt"] = "Hello, this is textcomplete demo @mr" - - -def on_change(): - print(st.session_state.txt) - - -original_label: str = "Streamlit Autocomplete Textcomplete Example" -txt: str = st.text_area( - label=original_label, - help="Type @ to see the user list, type : to see the emoji list", - value=st.session_state.txt, - key="st_text_area_1", - on_change=on_change, -) -st.caption("Type @ to see the user list, type : to see the emoji list") -st.caption(f"You wrote {len(txt)} characters.") -st.write( - """:orange[⚠️ IMPORTANT: Always type a space after autocomplete. -There's no way to update streamlit react component state event though textarea value is updated :( ] -""" -) - username_strategy = StrategyProps( id="userFullName", match="\\B@(\\w*)$", @@ -49,44 +24,84 @@ def on_change(): template="""([fullName]) => `πŸ§‘πŸ» ${fullName}`""", ) -emojis = [ - {"name": "smile", "value": "😊"}, - {"name": "heart", "value": "❀️"}, - {"name": "sun", "value": "β˜€οΈ"}, - {"name": "star", "value": "⭐"}, - {"name": "moon", "value": "πŸŒ™"}, - {"name": "cloud", "value": "☁️"}, - {"name": "code", "value": "πŸ§‘πŸ»β€πŸ’»"}, - {"name": "fire", "value": "πŸ”₯"}, - {"name": "thumbs_up", "value": "πŸ‘"}, - {"name": "ukraine", "value": "πŸ‡ΊπŸ‡¦"}, +emoji_data = [ + {"name": properties["en"], "value": unicode_repr} + for unicode_repr, properties in EMOJI_DATA.items() ] # Example of strategy with default search & replace functions provided by the component # if search_data list is provided emoji_strategy = StrategyProps( id="emoji", match="\\B:(\\w*)$", - data=emojis, + data=emoji_data, comparator_keys=["name", "value"], template="""(emoji) => `${emoji['value']} :${emoji['name']}`""", ) +col1, col2 = st.columns(2, gap="medium") + + +if "txt" not in st.session_state: + st.session_state["txt"] = "Hello, this is textcomplete demo @mr" + + +def on_change(): + print(st.session_state["txt"]) + def on_select(textcomplete_result: TextcompleteResult): searchResult = textcomplete_result.get("searchResult", "") text = textcomplete_result.get("text", "") print(searchResult, text) - - -textcomplete( - area_label=original_label, - strategies=[username_strategy, emoji_strategy], - on_select=on_select, - max_count=5, -) - -st.markdown( - """# Streamlit Autocomplete Text with Textcomplete + st.session_state["txt"] = text + + +with col1: + st.header("Example: `st.text_area` with Autocomplete") + original_label: str = "Streamlit Autocomplete Textcomplete Example" + txt: str = st.text_area( + label=original_label, + help="Type @ to see the user list, type : to see the emoji list", + value=st.session_state.txt, + key="st_text_area_1", + on_change=on_change, + ) + st.caption("Type @ to see the user list, type : to see the emoji list") + st.caption(f"You wrote {len(txt)} characters.") + st.write( + """:orange[⚠️ IMPORTANT: Always type a space after autocomplete. + There's no way to update streamlit react component state event though textarea value is updated :( ]""" + ) + + textcomplete( + area_label=original_label, + strategies=[username_strategy, emoji_strategy], + on_select=on_select, + max_count=5, + stop_enter_propagation=True, + ) + +with col2: + st.header("Example: `st.chat_input` with Autocomplete") + chat_input_label = "Chat Input" + messages = st.container(height=300) + if prompt := st.chat_input( + placeholder=chat_input_label, + key="st_chat_input_1", + on_submit=on_change, + ): + messages.chat_message("user").write(prompt) + messages.chat_message("assistant").write(f"Echo: {prompt}") + # data-testid="stChatInputTextArea" + textcomplete( + area_label=chat_input_label, + strategies=[username_strategy, emoji_strategy], + on_select=on_select, + max_count=10, + stop_enter_propagation=True, + ) + +st.markdown(r"""# Streamlit Autocomplete Text with Textcomplete ## Vendor @@ -200,5 +215,4 @@ def on_select(textcomplete_result: TextcompleteResult): } } ``` -""" -) +""") # noqa: F401 diff --git a/.npmignore b/textcomplete/frontend/.npmignore similarity index 100% rename from .npmignore rename to textcomplete/frontend/.npmignore diff --git a/.prettierignore b/textcomplete/frontend/.prettierignore similarity index 85% rename from .prettierignore rename to textcomplete/frontend/.prettierignore index b81d297..af82fef 100644 --- a/.prettierignore +++ b/textcomplete/frontend/.prettierignore @@ -1,5 +1,4 @@ # Add files here to ignore them from prettier formatting /dist -/coverage - +/build diff --git a/.prettierrc b/textcomplete/frontend/.prettierrc similarity index 100% rename from .prettierrc rename to textcomplete/frontend/.prettierrc diff --git a/textcomplete/frontend/build/index.js b/textcomplete/frontend/build/index.js index 1648a42..cdb0ae0 100644 --- a/textcomplete/frontend/build/index.js +++ b/textcomplete/frontend/build/index.js @@ -1,4 +1,2 @@ -(()=>{var t={8344:function(t,e,r){"use strict";function i(t,e){for(var r=0;rn&&(t.left=n-i),this.el.style.left="".concat(t.left,"px")}else t.right&&(t.right-i<0&&(t.right=0),this.el.style.right="".concat(t.right,"px"));var s=!1,o=this.option.placement||e.DEFAULT_DROPDOWN_PLACEMENT;if("auto"===o){var a=this.items.length*t.lineHeight;s=null!=t.clientTop&&t.clientTop+a>r.clientHeight}"top"===o||s?(this.el.style.bottom="".concat(r.clientHeight-t.top+t.lineHeight,"px"),this.el.style.top="auto"):(this.el.style.top="".concat(t.top,"px"),this.el.style.bottom="auto")}return this}},{key:"getNextActiveIndex",value:function(){if(null==this.activeIndex)throw Error();return this.activeIndex0)||void 0===arguments[0]||arguments[0];return this.completer.destroy(),this.dropdown.destroy(),t&&this.editor.destroy(),this.stopListening(),this}},{key:"isShown",value:function(){return this.dropdown.isShown()}},{key:"hide",value:function(){return this.dropdown.hide(),this}},{key:"trigger",value:function(t){return this.isQueryInFlight?this.nextPendingQuery=t:(this.isQueryInFlight=!0,this.nextPendingQuery=null,this.completer.run(t)),this}},{key:"startListening",value:function(){var t=this;this.editor.on("move",this.handleMove).on("enter",this.handleEnter).on("esc",this.handleEsc).on("change",this.handleChange),this.dropdown.on("select",this.handleSelect);var e=!0,r=!1,i=void 0;try{for(var n,s,o,a=l[Symbol.iterator]();!(e=(o=a.next()).done);e=!0)s=this,function(){var e=o.value;s.dropdown.on(e,function(r){return t.emit(e,r)})}()}catch(t){r=!0,i=t}finally{try{!e&&null!=a.return&&a.return()}finally{if(r)throw i}}this.completer.on("hit",this.handleHit),null===(n=this.dropdown.el.ownerDocument.defaultView)||void 0===n||n.addEventListener("resize",this.handleResize)}},{key:"stopListening",value:function(){var t;null===(t=this.dropdown.el.ownerDocument.defaultView)||void 0===t||t.removeEventListener("resize",this.handleResize),this.completer.removeAllListeners(),this.dropdown.removeAllListeners(),this.editor.removeListener("move",this.handleMove).removeListener("enter",this.handleEnter).removeListener("esc",this.handleEsc).removeListener("change",this.handleChange)}}],i(o.prototype,c),f}(o.EventEmitter);e.Textcomplete=c},9973:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"!==r&&!Object.prototype.hasOwnProperty.call(e,r)&&i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8344),e),n(r(5329),e),n(r(8937),e),n(r(2363),e),n(r(5134),e),n(r(2946),e),n(r(4125),e)},4125:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createCustomEvent=void 0;var r="undefined"!=typeof window&&!!window.CustomEvent;e.createCustomEvent=function(t,e){if(r)return new CustomEvent(t,e);var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,!1,(null==e?void 0:e.cancelable)||!1,(null==e?void 0:e.detail)||void 0),i}},1248:function(t){"use strict";var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function s(t,e,i,s,o){if("function"!=typeof i)throw TypeError("The listener must be a function");var a=new n(i,s||t,o),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),!new i().__proto__&&(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,o=Array(s);nthis.minalign&&(this.minalign=t);for(var r=~(this.bb.capacity()-this.space+e)+1&t-1;this.space=0&&0==this.vtable[e];e--);for(var r=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var i=(r+2)*n.LN;this.addInt16(i);var s=0,o=this.space;t:for(e=0;e=0;s--)this.writeInt8(e.charCodeAt(s))}this.prep(this.minalign,n.Q4+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}},{key:"finishSizePrefixed",value:function(t,e){this.finish(t,e,!0)}},{key:"requiredField",value:function(t,e){var r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(!(0!=this.bb.readInt16(i+e)))throw Error("FlatBuffers: field "+e+" must be set")}},{key:"startVector",value:function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(n.Q4,t*e),this.prep(r,t*e)}},{key:"endVector",value:function(){return this.writeInt32(this.vector_num_elems),this.offset()}},{key:"createSharedString",value:function(t){if(!t)return 0;if(!this.string_maps&&(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);var e=this.createString(t);return this.string_maps.set(t,e),e}},{key:"createString",value:function(t){if(!t)return 0;if(e=t,null!=(r=Uint8Array)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r)i=t;else{i=[];for(var e,r,i,n=0;n=56320?o:(o<<10)+t.charCodeAt(n++)+-56613888)<128?i.push(s):(s<2048?i.push(s>>6&31|192):(s<65536?i.push(s>>12&15|224):i.push(s>>18&7|240,s>>12&63|128),i.push(s>>6&63|128)),i.push(63&s|128))}}this.addInt8(0),this.startVector(1,i.length,1),this.bb.setPosition(this.space-=i.length);for(var a=0,u=this.space,l=this.bb.bytes();a>24}},{key:"readUint8",value:function(t){return this.bytes_[t]}},{key:"readInt16",value:function(t){return this.readUint16(t)<<16>>16}},{key:"readUint16",value:function(t){return this.bytes_[t]|this.bytes_[t+1]<<8}},{key:"readInt32",value:function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}},{key:"readUint32",value:function(t){return this.readInt32(t)>>>0}},{key:"readInt64",value:function(t){return new n.d(this.readInt32(t),this.readInt32(t+4))}},{key:"readUint64",value:function(t){return new n.d(this.readUint32(t),this.readUint32(t+4))}},{key:"readFloat32",value:function(t){return s.LB["0"]=this.readInt32(t),s.vE["0"]}},{key:"readFloat64",value:function(t){return s.LB[s.r?0:1]=this.readInt32(t),s.LB[s.r?1:0]=this.readInt32(t+4),s.BZ["0"]}},{key:"writeInt8",value:function(t,e){this.bytes_[t]=e}},{key:"writeUint8",value:function(t,e){this.bytes_[t]=e}},{key:"writeInt16",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}},{key:"writeUint16",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}},{key:"writeInt32",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}},{key:"writeUint32",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}},{key:"writeInt64",value:function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)}},{key:"writeUint64",value:function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)}},{key:"writeFloat32",value:function(t,e){s.vE["0"]=e,this.writeInt32(t,s.LB["0"])}},{key:"writeFloat64",value:function(t,e){s.BZ["0"]=e,this.writeInt32(t,s.LB[s.r?0:1]),this.writeInt32(t+4,s.LB[s.r?1:0])}},{key:"getBufferIdentifier",value:function(){if(this.bytes_.length>10)+55296,(1023&a)+56320))}return n}},{key:"__union_with_string",value:function(t,e){return"string"==typeof t?this.__string(e):this.__union(t,e)}},{key:"__indirect",value:function(t){return t+this.readInt32(t)}},{key:"__vector",value:function(t){return t+this.readInt32(t)+i.Q4}},{key:"__vector_len",value:function(t){return this.readInt32(t+this.readInt32(t))}},{key:"__has_identifier",value:function(t){if(t.length!=i.jL)throw Error("FlatBuffers: file identifier must be length "+i.jL);for(var e=0;e>>0)+4294967296*this.high}},{key:"equals",value:function(t){return this.low==t.low&&this.high==t.high}}],r=[{key:"create",value:function(t,e){return 0==t&&0==e?n.ZERO:new n(t,e)}}],e&&i(t.prototype,e),r&&i(t,r),n}();n.ZERO=new n(0,0)},7658:function(t,e,r){"use strict";r.d(e,{BZ:function(){return s},LB:function(){return i},r:function(){return o},vE:function(){return n}});var i=new Int32Array(2),n=new Float32Array(i.buffer),s=new Float64Array(i.buffer),o=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0]},7101:function(t,e,r){"use strict";var i=r(7072),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function u(t){return i.isMemo(t)?o:a[t.$$typeof]||n}a[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[i.Memo]=o;var l=Object.defineProperty,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,y=Object.prototype;t.exports=function t(e,r,i){if("string"!=typeof r){if(y){var n=f(r);n&&n!==y&&t(e,n,i)}var o=c(r);h&&(o=o.concat(h(r)));for(var a=u(e),p=u(r),b=0;bE.length&&E.push(t)}function L(t,e,r){return null==t?0:function t(e,r,i,n){var s,u=void 0===e?"undefined":(s=e)&&"undefined"!=typeof Symbol&&s.constructor===Symbol?"symbol":typeof s;("undefined"===u||"boolean"===u)&&(e=null);var l=!1;if(null===e)l=!0;else switch(u){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case o:case a:l=!0}}if(l)return i(n,e,""===r?"."+U(e,0):r),1;if(l=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c=o.headerRows&&e=o.headerColumns;if(r){var s=["blank"];return e>0&&s.push("level"+t),{type:"blank",classNames:s.join(" "),content:""}}if(n){var a=e-o.headerColumns,s=["col_heading","level"+t,"col"+a];return{type:"columns",classNames:s.join(" "),content:o.getContent(o.columnsTable,a,t)}}if(i){var u=t-o.headerRows,s=["row_heading","level"+e,"row"+u];return{type:"index",id:"T_".concat(o.uuid,"level").concat(e,"_row").concat(u),classNames:s.join(" "),content:o.getContent(o.indexTable,u,e)}}else{var u=t-o.headerRows,a=e-o.headerColumns,s=["data","row"+u,"col"+a],l=o.styler?o.getContent(o.styler.displayValuesTable,u,a):o.getContent(o.dataTable,u,a);return{type:"data",id:"T_".concat(o.uuid,"row").concat(u,"_col").concat(a),classNames:s.join(" "),content:l}}},this.getContent=function(t,e,r){var n=t.getChildAt(r);if(null===n)return"";if(o.getColumnTypeId(t,r)===i.Dy.Timestamp)return o.nanosToDate(n.get(e));return n.get(e)},this.dataTable=(0,n.p)(t),this.indexTable=(0,n.p)(e),this.columnsTable=(0,n.p)(r),this.styler=s?{caption:s.caption,displayValuesTable:(0,n.p)(s.displayValues),styles:s.styles,uuid:s.uuid}:void 0}return Object.defineProperty(t.prototype,"rows",{get:function(){return this.indexTable.numRows+this.columnsTable.numCols},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return this.indexTable.numCols+this.columnsTable.numRows},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"headerRows",{get:function(){return this.rows-this.dataRows},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"headerColumns",{get:function(){return this.columns-this.dataColumns},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataRows",{get:function(){return this.dataTable.numRows},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataColumns",{get:function(){return this.dataTable.numCols},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uuid",{get:function(){return this.styler&&this.styler.uuid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this.styler&&this.styler.caption},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"styles",{get:function(){return this.styler&&this.styler.styles},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"table",{get:function(){return this.dataTable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){return this.indexTable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columnTable",{get:function(){return this.columnsTable},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{data:(0,n.U)(this.dataTable),index:(0,n.U)(this.indexTable),columns:(0,n.U)(this.columnsTable)}},t.prototype.getColumnTypeId=function(t,e){return t.schema.fields[e].type.typeId},t.prototype.nanosToDate=function(t){return new Date(t/1e6)},t}()},551:function(t,e,r){"use strict";r(7101);var i,n=r(3277),s=r(827);var o=(i=function(t,e){var r,n;return(i=Object.setPrototypeOf||(r={__proto__:[]},(null!=(n=Array)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?!!n[Symbol.hasInstance](r):r instanceof n)&&function(t,e){t.__proto__=e})||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}o(e,t),e.prototype.componentDidMount=function(){s.l.setFrameHeight()},e.prototype.componentDidUpdate=function(){s.l.setFrameHeight()}}(n.PureComponent)},4490:function(t,e,r){"use strict";r.d(e,{ll:function(){return i.l}}),r(551),r(7541);var i=r(827)},827:function(t,e,r){"use strict";r.d(e,{l:function(){return u}});var i,n,s=r(7541);function o(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}var a=function(){return(a=Object.assign||function(t){for(var e,r=1,i=arguments.length;r0?t.argsDataframeToObject(e.dfs):{};r=a(a({},r),i);var n=!!e.disabled,s=e.theme;s&&l(s);var o={disabled:n,args:r,theme:s},u=new CustomEvent(t.RENDER_EVENT,{detail:o});t.events.dispatchEvent(u)},t.argsDataframeToObject=function(e){return Object.fromEntries(e.map(function(e){var r=e.key,i=e.value;return[r,t.toArrowTable(i)]}))},t.toArrowTable=function(t){var e,r=(e=t.data).data,i=e.index,n=e.columns,o=e.styler;return new s.r(r,i,n,o)},t.sendBackMsg=function(t,e){window.parent.postMessage(a({isStreamlitMessage:!0,type:t},e),"*")},t}(),l=function(t){var e=document.createElement("style");document.head.appendChild(e),e.innerHTML="\n :root {\n --primary-color: ".concat(t.primaryColor,";\n --background-color: ").concat(t.backgroundColor,";\n --secondary-background-color: ").concat(t.secondaryBackgroundColor,";\n --text-color: ").concat(t.textColor,";\n --font: ").concat(t.font,";\n }\n\n body {\n background-color: var(--background-color);\n color: var(--text-color);\n }\n ")}},6713:function(t){!function(){var e=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],r="undefined"!=typeof window,i=r&&null!=window.mozInnerScreenX;function n(t,n,s){if(!r)throw Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var o=s&&s.debug||!1;if(o){var a=document.querySelector("#input-textarea-caret-position-mirror-div");a&&a.parentNode.removeChild(a)}var u=document.createElement("div");u.id="input-textarea-caret-position-mirror-div",document.body.appendChild(u);var l=u.style,c=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,h="INPUT"===t.nodeName;l.whiteSpace="pre-wrap",!h&&(l.wordWrap="break-word"),l.position="absolute",!o&&(l.visibility="hidden"),e.forEach(function(t){h&&"lineHeight"===t?l.lineHeight=c.height:l[t]=c[t]}),i?t.scrollHeight>parseInt(c.height)&&(l.overflowY="scroll"):l.overflow="hidden",u.textContent=t.value.substring(0,n),h&&(u.textContent=u.textContent.replace(/\s/g,"\xa0"));var d=document.createElement("span");d.textContent=t.value.substring(n)||".",u.appendChild(d);var f={top:d.offsetTop+parseInt(c.borderTopWidth),left:d.offsetLeft+parseInt(c.borderLeftWidth),height:parseInt(c.lineHeight)};return o?d.style.backgroundColor="#aaa":document.body.removeChild(u),f}void 0!==t.exports?t.exports=n:r&&(window.getCaretCoordinates=n)}()},4035:function(t,e,r){"use strict";r.d(e,{Vw:function(){return l},_l:function(){return h}});var i=r(6927),n=r(6306),s=r(8870),o=r(4e3),a=r(593),u=r(7031);class l{constructor(t,e,r,i,n,o=[],a){let u;this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1)),n instanceof l?(this.stride=n.stride,this.values=n.values,this.typeIds=n.typeIds,this.nullBitmap=n.nullBitmap,this.valueOffsets=n.valueOffsets):(this.stride=(0,s.oS)(t),n&&((u=n[0])&&(this.valueOffsets=u),(u=n[1])&&(this.values=u),(u=n[2])&&(this.nullBitmap=u),(u=n[3])&&(this.typeIds=u))),this.nullable=0!==this._nullCount&&this.nullBitmap&&this.nullBitmap.byteLength>0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0,{valueOffsets:e,values:r,nullBitmap:i,typeIds:n}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),this.children.reduce((t,e)=>t+e.byteLength,t)}get nullCount(){let t,e=this._nullCount;return e<=-1&&(t=this.nullBitmap)&&(this._nullCount=e=this.length-(0,o.SM)(t,this.offset,this.offset+this.length)),e}getValid(t){if(this.nullable&&this.nullCount>0){let e=this.offset+t;return(this.nullBitmap[e>>3]&1<>3){let{nullBitmap:t}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:t,_nullCount:0})}let{nullBitmap:r,offset:i}=this,n=i+t>>3,s=(i+t)%8,o=r[n]>>s&1;return e?0===o&&(r[n]|=1<>3).fill(255,0,e>>3);i[e>>3]=(1<0&&i.set((0,o.cB)(this.offset,e,this.nullBitmap),0);let s=this.buffers;return s[n.w0.VALIDITY]=i,this.clone(this.type,0,t,r+(t-e),s)}_sliceBuffers(t,e,r,i){let s;let{buffers:o}=this;return(s=o[n.w0.TYPE])&&(o[n.w0.TYPE]=s.subarray(t,t+e)),(s=o[n.w0.OFFSET])&&(o[n.w0.OFFSET]=s.subarray(t,t+e+1))||(s=o[n.w0.DATA])&&(o[n.w0.DATA]=6===i?s:s.subarray(r*t,r*(t+e))),o}_sliceChildren(t,e,r){return t.map(t=>t.slice(e,r))}}l.prototype.children=Object.freeze([]);class c extends a.a{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{type:e,offset:r=0,length:i=0}=t;return new l(e,r,i,0)}visitBool(t){let{type:e,offset:r=0}=t,i=(0,u._f)(t.nullBitmap),n=(0,u.AM)(e.ArrayType,t.data),{length:s=n.length>>3,nullCount:o=t.nullBitmap?-1:0}=t;return new l(e,r,s,o,[void 0,n,i])}visitInt(t){let{type:e,offset:r=0}=t,i=(0,u._f)(t.nullBitmap),n=(0,u.AM)(e.ArrayType,t.data),{length:s=n.length,nullCount:o=t.nullBitmap?-1:0}=t;return new l(e,r,s,o,[void 0,n,i])}visitFloat(t){let{type:e,offset:r=0}=t,i=(0,u._f)(t.nullBitmap),n=(0,u.AM)(e.ArrayType,t.data),{length:s=n.length,nullCount:o=t.nullBitmap?-1:0}=t;return new l(e,r,s,o,[void 0,n,i])}visitUtf8(t){let{type:e,offset:r=0}=t,i=(0,u._f)(t.data),n=(0,u._f)(t.nullBitmap),s=(0,u.vk)(t.valueOffsets),{length:o=s.length-1,nullCount:a=t.nullBitmap?-1:0}=t;return new l(e,r,o,a,[s,i,n])}visitBinary(t){let{type:e,offset:r=0}=t,i=(0,u._f)(t.data),n=(0,u._f)(t.nullBitmap),s=(0,u.vk)(t.valueOffsets),{length:o=s.length-1,nullCount:a=t.nullBitmap?-1:0}=t;return new l(e,r,o,a,[s,i,n])}visitFixedSizeBinary(t){let{type:e,offset:r=0}=t,i=(0,u._f)(t.nullBitmap),n=(0,u.AM)(e.ArrayType,t.data),{length:o=n.length/(0,s.oS)(e),nullCount:a=t.nullBitmap?-1:0}=t;return new l(e,r,o,a,[void 0,n,i])}visitDate(t){let{type:e,offset:r=0}=t,i=(0,u._f)(t.nullBitmap),n=(0,u.AM)(e.ArrayType,t.data),{length:o=n.length/(0,s.oS)(e),nullCount:a=t.nullBitmap?-1:0}=t;return new l(e,r,o,a,[void 0,n,i])}visitTimestamp(t){let{type:e,offset:r=0}=t,i=(0,u._f)(t.nullBitmap),n=(0,u.AM)(e.ArrayType,t.data),{length:o=n.length/(0,s.oS)(e),nullCount:a=t.nullBitmap?-1:0}=t;return new l(e,r,o,a,[void 0,n,i])}visitTime(t){let{type:e,offset:r=0}=t,i=(0,u._f)(t.nullBitmap),n=(0,u.AM)(e.ArrayType,t.data),{length:o=n.length/(0,s.oS)(e),nullCount:a=t.nullBitmap?-1:0}=t;return new l(e,r,o,a,[void 0,n,i])}visitDecimal(t){let{type:e,offset:r=0}=t,i=(0,u._f)(t.nullBitmap),n=(0,u.AM)(e.ArrayType,t.data),{length:o=n.length/(0,s.oS)(e),nullCount:a=t.nullBitmap?-1:0}=t;return new l(e,r,o,a,[void 0,n,i])}visitList(t){let{type:e,offset:r=0,child:i}=t,n=(0,u._f)(t.nullBitmap),s=(0,u.vk)(t.valueOffsets),{length:o=s.length-1,nullCount:a=t.nullBitmap?-1:0}=t;return new l(e,r,o,a,[s,void 0,n],[i])}visitStruct(t){let{type:e,offset:r=0,children:i=[]}=t,n=(0,u._f)(t.nullBitmap),{length:s=i.reduce((t,{length:e})=>Math.max(t,e),0),nullCount:o=t.nullBitmap?-1:0}=t;return new l(e,r,s,o,[void 0,void 0,n],i)}visitUnion(t){let{type:e,offset:r=0,children:i=[]}=t,n=(0,u._f)(t.nullBitmap),o=(0,u.AM)(e.ArrayType,t.typeIds),{length:a=o.length,nullCount:c=t.nullBitmap?-1:0}=t;return s.g.isSparseUnion(e)?new l(e,r,a,c,[void 0,void 0,n,o],i):new l(e,r,a,c,[(0,u.vk)(t.valueOffsets),void 0,n,o],i)}visitDictionary(t){let{type:e,offset:r=0}=t,n=(0,u._f)(t.nullBitmap),s=(0,u.AM)(e.indices.ArrayType,t.data),{dictionary:o=new i.O([new c().visit({type:e.dictionary})])}=t,{length:a=s.length,nullCount:h=t.nullBitmap?-1:0}=t;return new l(e,r,a,h,[void 0,s,n],[],o)}visitInterval(t){let{type:e,offset:r=0}=t,i=(0,u._f)(t.nullBitmap),n=(0,u.AM)(e.ArrayType,t.data),{length:o=n.length/(0,s.oS)(e),nullCount:a=t.nullBitmap?-1:0}=t;return new l(e,r,o,a,[void 0,n,i])}visitFixedSizeList(t){let{type:e,offset:r=0,child:i=new c().visit({type:e.valueType})}=t,n=(0,u._f)(t.nullBitmap),{length:o=i.length/(0,s.oS)(e),nullCount:a=t.nullBitmap?-1:0}=t;return new l(e,r,o,a,[void 0,void 0,n],[i])}visitMap(t){let{type:e,offset:r=0,child:i=new c().visit({type:e.childType})}=t,n=(0,u._f)(t.nullBitmap),s=(0,u.vk)(t.valueOffsets),{length:o=s.length-1,nullCount:a=t.nullBitmap?-1:0}=t;return new l(e,r,o,a,[s,void 0,n],[i])}}function h(t){return new c().visit(t)}},6306:function(t,e,r){"use strict";var i,n,s,o,a,u,l,c,h,d,f,y,p,b,v,m,g,_;r.d(e,{Bo:function(){return i},Dy:function(){return c},Gc:function(){return s},Ng:function(){return l},hQ:function(){return o},j1:function(){return a},w0:function(){return h},wK:function(){return u},yj:function(){return n}}),(d=i||(i={}))[d.V1=0]="V1",d[d.V2=1]="V2",d[d.V3=2]="V3",d[d.V4=3]="V4",d[d.V5=4]="V5",(f=n||(n={}))[f.Sparse=0]="Sparse",f[f.Dense=1]="Dense",(y=s||(s={}))[y.HALF=0]="HALF",y[y.SINGLE=1]="SINGLE",y[y.DOUBLE=2]="DOUBLE",(p=o||(o={}))[p.DAY=0]="DAY",p[p.MILLISECOND=1]="MILLISECOND",(b=a||(a={}))[b.SECOND=0]="SECOND",b[b.MILLISECOND=1]="MILLISECOND",b[b.MICROSECOND=2]="MICROSECOND",b[b.NANOSECOND=3]="NANOSECOND",(v=u||(u={}))[v.YEAR_MONTH=0]="YEAR_MONTH",v[v.DAY_TIME=1]="DAY_TIME",v[v.MONTH_DAY_NANO=2]="MONTH_DAY_NANO",(m=l||(l={}))[m.NONE=0]="NONE",m[m.Schema=1]="Schema",m[m.DictionaryBatch=2]="DictionaryBatch",m[m.RecordBatch=3]="RecordBatch",m[m.Tensor=4]="Tensor",m[m.SparseTensor=5]="SparseTensor",(g=c||(c={}))[g.NONE=0]="NONE",g[g.Null=1]="Null",g[g.Int=2]="Int",g[g.Float=3]="Float",g[g.Binary=4]="Binary",g[g.Utf8=5]="Utf8",g[g.Bool=6]="Bool",g[g.Decimal=7]="Decimal",g[g.Date=8]="Date",g[g.Time=9]="Time",g[g.Timestamp=10]="Timestamp",g[g.Interval=11]="Interval",g[g.List=12]="List",g[g.Struct=13]="Struct",g[g.Union=14]="Union",g[g.FixedSizeBinary=15]="FixedSizeBinary",g[g.FixedSizeList=16]="FixedSizeList",g[g.Map=17]="Map",g[g.Dictionary=-1]="Dictionary",g[g.Int8=-2]="Int8",g[g.Int16=-3]="Int16",g[g.Int32=-4]="Int32",g[g.Int64=-5]="Int64",g[g.Uint8=-6]="Uint8",g[g.Uint16=-7]="Uint16",g[g.Uint32=-8]="Uint32",g[g.Uint64=-9]="Uint64",g[g.Float16=-10]="Float16",g[g.Float32=-11]="Float32",g[g.Float64=-12]="Float64",g[g.DateDay=-13]="DateDay",g[g.DateMillisecond=-14]="DateMillisecond",g[g.TimestampSecond=-15]="TimestampSecond",g[g.TimestampMillisecond=-16]="TimestampMillisecond",g[g.TimestampMicrosecond=-17]="TimestampMicrosecond",g[g.TimestampNanosecond=-18]="TimestampNanosecond",g[g.TimeSecond=-19]="TimeSecond",g[g.TimeMillisecond=-20]="TimeMillisecond",g[g.TimeMicrosecond=-21]="TimeMicrosecond",g[g.TimeNanosecond=-22]="TimeNanosecond",g[g.DenseUnion=-23]="DenseUnion",g[g.SparseUnion=-24]="SparseUnion",g[g.IntervalDayTime=-25]="IntervalDayTime",g[g.IntervalYearMonth=-26]="IntervalYearMonth",(_=h||(h={}))[_.OFFSET=0]="OFFSET",_[_.DATA=1]="DATA",_[_.VALIDITY=2]="VALIDITY",_[_.TYPE=3]="TYPE"},3324:function(t,e,r){"use strict";r.d(e,{K:function(){return n}});var i=r(6400);class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBinary(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+i.XU),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return n.startBinary(t),n.endBinary(t)}}},7123:function(t,e,r){"use strict";r.d(e,{g:function(){return i}});class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,e,r,i){return t.prep(8,24),t.writeInt64(i),t.pad(4),t.writeInt32(r),t.writeInt64(e),t.offset()}}},230:function(t,e,r){"use strict";var i,n;r.d(e,{v:function(){return i}}),(n=i||(i={}))[n.BUFFER=0]="BUFFER"},3558:function(t,e,r){"use strict";r.d(e,{v:function(){return o}});var i=r(6400),n=r(230),s=r(1530);class o{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBodyCompression(t,e){return(e||new o).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+i.XU),(e||new o).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):s.J.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):n.v.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,s.J.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,n.v.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,r){return o.startBodyCompression(t),o.addCodec(t,e),o.addMethod(t,r),o.endBodyCompression(t)}}},1209:function(t,e,r){"use strict";r.d(e,{t:function(){return n}});var i=r(6400);class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBool(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+i.XU),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return n.startBool(t),n.endBool(t)}}},1052:function(t,e,r){"use strict";r.d(e,{l:function(){return i}});class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,e,r){return t.prep(8,16),t.writeInt64(r),t.writeInt64(e),t.offset()}}},1530:function(t,e,r){"use strict";var i,n;r.d(e,{J:function(){return i}}),(n=i||(i={}))[n.LZ4_FRAME=0]="LZ4_FRAME",n[n.ZSTD=1]="ZSTD"},1984:function(t,e,r){"use strict";var i,n;r.d(e,{h:function(){return i}}),(n=i||(i={}))[n.DAY=0]="DAY",n[n.MILLISECOND=1]="MILLISECOND"},3781:function(t,e,r){"use strict";r.d(e,{E:function(){return s}});var i=r(6400),n=r(1984);class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDate(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+i.XU),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):n.h.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,n.h.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return s.startDate(t),s.addUnit(t,e),s.endDate(t)}}},3603:function(t,e,r){"use strict";r.d(e,{t:function(){return n}});var i=r(6400);class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDecimal(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+i.XU),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,e){t.addFieldInt32(0,e,0)}static addScale(t,e){t.addFieldInt32(1,e,0)}static addBitWidth(t,e){t.addFieldInt32(2,e,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,e,r,i){return n.startDecimal(t),n.addPrecision(t,e),n.addScale(t,r),n.addBitWidth(t,i),n.endDecimal(t)}}},9623:function(t,e,r){"use strict";r.d(e,{I:function(){return s}});var i=r(6400),n=r(9547);class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryBatch(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+i.XU),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}data(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new n.Q).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}static startDictionaryBatch(t){t.startObject(3)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addData(t,e){t.addFieldOffset(1,e,0)}static addIsDelta(t,e){t.addFieldInt8(2,+e,0)}static endDictionaryBatch(t){return t.endObject()}}},7748:function(t,e,r){"use strict";r.d(e,{x:function(){return o}});var i=r(6400),n=r(4662),s=r(2039);class o{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryEncoding(t,e){return(e||new o).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+i.XU),(e||new o).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}indexType(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new s.J).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}dictionaryKind(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):n.P.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addIndexType(t,e){t.addFieldOffset(1,e,0)}static addIsOrdered(t,e){t.addFieldInt8(2,+e,0)}static addDictionaryKind(t,e){t.addFieldInt16(3,e,n.P.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}},4662:function(t,e,r){"use strict";var i,n;r.d(e,{P:function(){return i}}),(n=i||(i={}))[n.DenseArray=0]="DenseArray"},6601:function(t,e,r){"use strict";var i,n;r.d(e,{I:function(){return i}}),(n=i||(i={}))[n.Little=0]="Little",n[n.Big=1]="Big"},1415:function(t,e,r){"use strict";r.d(e,{w:function(){return i}});class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,e,r){return t.prep(8,16),t.writeInt64(r),t.writeInt64(e),t.offset()}}},2042:function(t,e,r){"use strict";r.d(e,{g:function(){return a}});var i=r(6400),n=r(7748),s=r(9708),o=r(2818);class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsField(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+i.XU),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):o.Dy.NONE}type(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(t){let e=this.bb.__offset(this.bb_pos,12);return e?(t||new n.x).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){let r=this.bb.__offset(this.bb_pos,14);return r?(e||new a).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,16);return r?(e||new s.c).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(t,e){t.addFieldInt8(2,e,o.Dy.NONE)}static addType(t,e){t.addFieldOffset(3,e,0)}static addDictionary(t,e){t.addFieldOffset(4,e,0)}static addChildren(t,e){t.addFieldOffset(5,e,0)}static createChildrenVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startChildrenVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(6,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}}},9022:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});var i=r(6400);class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeBinary(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+i.XU),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,e){return n.startFixedSizeBinary(t),n.addByteWidth(t,e),n.endFixedSizeBinary(t)}}},4596:function(t,e,r){"use strict";r.d(e,{t:function(){return n}});var i=r(6400);class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeList(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+i.XU),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,e){return n.startFixedSizeList(t),n.addListSize(t,e),n.endFixedSizeList(t)}}},345:function(t,e,r){"use strict";r.d(e,{j:function(){return s}});var i=r(6400),n=r(2507);class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFloatingPoint(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+i.XU),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):n.G.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,n.G.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return s.startFloatingPoint(t),s.addPrecision(t,e),s.endFloatingPoint(t)}}},1142:function(t,e,r){"use strict";r.d(e,{$:function(){return u}});var i=r(6400),n=r(7123),s=r(9708),o=r(2778),a=r(6966);class u{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFooter(t,e){return(e||new u).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+i.XU),(e||new u).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):o.B.V1}schema(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new a.V).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){let r=this.bb.__offset(this.bb_pos,8);return r?(e||new n.g).__init(this.bb.__vector(this.bb_pos+r)+24*t,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){let r=this.bb.__offset(this.bb_pos,10);return r?(e||new n.g).__init(this.bb.__vector(this.bb_pos+r)+24*t,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new s.c).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,o.B.V1)}static addSchema(t,e){t.addFieldOffset(1,e,0)}static addDictionaries(t,e){t.addFieldOffset(2,e,0)}static startDictionariesVector(t,e){t.startVector(24,e,8)}static addRecordBatches(t,e){t.addFieldOffset(3,e,0)}static startRecordBatchesVector(t,e){t.startVector(24,e,8)}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}static finishSizePrefixedFooterBuffer(t,e){t.finish(e,void 0,!0)}}},2039:function(t,e,r){"use strict";r.d(e,{J:function(){return n}});var i=r(6400);class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInt(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+i.XU),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}static startInt(t){t.startObject(2)}static addBitWidth(t,e){t.addFieldInt32(0,e,0)}static addIsSigned(t,e){t.addFieldInt8(1,+e,0)}static endInt(t){return t.endObject()}static createInt(t,e,r){return n.startInt(t),n.addBitWidth(t,e),n.addIsSigned(t,r),n.endInt(t)}}},7453:function(t,e,r){"use strict";var i,n;r.d(e,{w:function(){return i}}),(n=i||(i={}))[n.YEAR_MONTH=0]="YEAR_MONTH",n[n.DAY_TIME=1]="DAY_TIME",n[n.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"},7029:function(t,e,r){"use strict";r.d(e,{X:function(){return s}});var i=r(6400),n=r(7453);class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInterval(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+i.XU),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):n.w.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,n.w.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return s.startInterval(t),s.addUnit(t,e),s.endInterval(t)}}},9708:function(t,e,r){"use strict";r.d(e,{c:function(){return n}});var i=r(6400);class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKeyValue(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+i.XU),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}key(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}value(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,e){t.addFieldOffset(0,e,0)}static addValue(t,e){t.addFieldOffset(1,e,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,e,r){return n.startKeyValue(t),n.addKey(t,e),n.addValue(t,r),n.endKeyValue(t)}}},5219:function(t,e,r){"use strict";r.d(e,{a:function(){return n}});var i=r(6400);class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsList(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+i.XU),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return n.startList(t),n.endList(t)}}},7841:function(t,e,r){"use strict";r.d(e,{D:function(){return n}});var i=r(6400);class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMap(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+i.XU),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}static startMap(t){t.startObject(1)}static addKeysSorted(t,e){t.addFieldInt8(0,+e,0)}static endMap(t){return t.endObject()}static createMap(t,e){return n.startMap(t),n.addKeysSorted(t,e),n.endMap(t)}}},120:function(t,e,r){"use strict";var i,n;r.d(e,{Ng:function(){return i}}),(n=i||(i={}))[n.NONE=0]="NONE",n[n.Schema=1]="Schema",n[n.DictionaryBatch=2]="DictionaryBatch",n[n.RecordBatch=3]="RecordBatch",n[n.Tensor=4]="Tensor",n[n.SparseTensor=5]="SparseTensor"},6146:function(t,e,r){"use strict";r.d(e,{v:function(){return a}});var i=r(6400),n=r(9708),s=r(120),o=r(2778);class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+i.XU),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):o.B.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):s.Ng.NONE}header(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new n.c).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,o.B.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,s.Ng.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,t.createLong(0,0))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,r,i,n,s){return a.startMessage(t),a.addVersion(t,e),a.addHeaderType(t,r),a.addHeader(t,i),a.addBodyLength(t,n),a.addCustomMetadata(t,s),a.endMessage(t)}}},2778:function(t,e,r){"use strict";var i,n;r.d(e,{B:function(){return i}}),(n=i||(i={}))[n.V1=0]="V1",n[n.V2=1]="V2",n[n.V3=2]="V3",n[n.V4=3]="V4",n[n.V5=4]="V5"},210:function(t,e,r){"use strict";r.d(e,{p:function(){return n}});var i=r(6400);class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNull(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+i.XU),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return n.startNull(t),n.endNull(t)}}},2507:function(t,e,r){"use strict";var i,n;r.d(e,{G:function(){return i}}),(n=i||(i={}))[n.HALF=0]="HALF",n[n.SINGLE=1]="SINGLE",n[n.DOUBLE=2]="DOUBLE"},9547:function(t,e,r){"use strict";r.d(e,{Q:function(){return a}});var i=r(6400),n=r(3558),s=r(1052),o=r(1415);class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsRecordBatch(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+i.XU),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}nodes(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new o.w).__init(this.bb.__vector(this.bb_pos+r)+16*t,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,e){let r=this.bb.__offset(this.bb_pos,8);return r?(e||new s.l).__init(this.bb.__vector(this.bb_pos+r)+16*t,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let e=this.bb.__offset(this.bb_pos,10);return e?(t||new n.v).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addNodes(t,e){t.addFieldOffset(1,e,0)}static startNodesVector(t,e){t.startVector(16,e,8)}static addBuffers(t,e){t.addFieldOffset(2,e,0)}static startBuffersVector(t,e){t.startVector(16,e,8)}static addCompression(t,e){t.addFieldOffset(3,e,0)}static endRecordBatch(t){return t.endObject()}}},6966:function(t,e,r){"use strict";r.d(e,{V:function(){return a}});var i=r(6400),n=r(6601),s=r(2042),o=r(9708);class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+i.XU),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):n.I.Little}fields(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new s.g).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,8);return r?(e||new o.c).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,e){t.addFieldInt16(0,e,n.I.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startFieldsVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(2,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static addFeatures(t,e){t.addFieldOffset(3,e,0)}static createFeaturesVector(t,e){t.startVector(8,e.length,8);for(let r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startFeaturesVector(t,e){t.startVector(8,e,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}static finishSizePrefixedSchemaBuffer(t,e){t.finish(e,void 0,!0)}static createSchema(t,e,r,i,n){return a.startSchema(t),a.addEndianness(t,e),a.addFields(t,r),a.addCustomMetadata(t,i),a.addFeatures(t,n),a.endSchema(t)}}},8888:function(t,e,r){"use strict";r.d(e,{q:function(){return n}});var i=r(6400);class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsStruct_(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+i.XU),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return n.startStruct_(t),n.endStruct_(t)}}},2922:function(t,e,r){"use strict";var i,n;r.d(e,{j:function(){return i}}),(n=i||(i={}))[n.SECOND=0]="SECOND",n[n.MILLISECOND=1]="MILLISECOND",n[n.MICROSECOND=2]="MICROSECOND",n[n.NANOSECOND=3]="NANOSECOND"},7124:function(t,e,r){"use strict";r.d(e,{q:function(){return s}});var i=r(6400),n=r(2922);class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTime(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+i.XU),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):n.j.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,n.j.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,r){return s.startTime(t),s.addUnit(t,e),s.addBitWidth(t,r),s.endTime(t)}}},8725:function(t,e,r){"use strict";r.d(e,{E:function(){return s}});var i=r(6400),n=r(2922);class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTimestamp(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+i.XU),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):n.j.SECOND}timezone(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,n.j.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,r){return s.startTimestamp(t),s.addUnit(t,e),s.addTimezone(t,r),s.endTimestamp(t)}}},2818:function(t,e,r){"use strict";var i,n;r.d(e,{Dy:function(){return i}}),(n=i||(i={}))[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.FloatingPoint=3]="FloatingPoint",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct_=13]="Struct_",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Duration=18]="Duration",n[n.LargeBinary=19]="LargeBinary",n[n.LargeUtf8=20]="LargeUtf8",n[n.LargeList=21]="LargeList"},1999:function(t,e,r){"use strict";var i,n;r.d(e,{y:function(){return i}}),(n=i||(i={}))[n.Sparse=0]="Sparse",n[n.Dense=1]="Dense"},6154:function(t,e,r){"use strict";r.d(e,{E:function(){return s}});var i=r(6400),n=r(1999);class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUnion(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+i.XU),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}mode(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):n.y.Sparse}typeIds(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+4*t):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,e){t.addFieldInt16(0,e,n.y.Sparse)}static addTypeIds(t,e){t.addFieldOffset(1,e,0)}static createTypeIdsVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,r){return s.startUnion(t),s.addMode(t,e),s.addTypeIds(t,r),s.endUnion(t)}}},1784:function(t,e,r){"use strict";r.d(e,{d:function(){return n}});var i=r(6400);class n{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,e){return(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+i.XU),(e||new n).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return n.startUtf8(t),n.endUtf8(t)}}},8100:function(t,e,r){"use strict";var i=r(8395),n=r(7031);e.Z={fromIterable:t=>s(function*(t){let e,r=!1,i=[],s,o,a,u=0;({cmd:o,size:a}=yield null);let l=(0,n.iB)(t)[Symbol.iterator]();try{do if({done:e,value:s}=Number.isNaN(a-u)?l.next():l.next(a-u),!e&&s.byteLength>0&&(i.push(s),u+=s.byteLength),e||a<=u)do({cmd:o,size:a}=yield"peek"===o?(0,n.$Q)(i,a)[0]:([s,i,u]=(0,n.$Q)(i,a),s));while(as(function(t){return(0,i.FC)(this,arguments,function*(){let e,r=!1,s=[],o,a,u,l=0;({cmd:a,size:u}=yield yield(0,i.qq)(null));let c=(0,n.lJ)(t)[Symbol.asyncIterator]();try{do if({done:e,value:o}=Number.isNaN(u-l)?yield(0,i.qq)(c.next()):yield(0,i.qq)(c.next(u-l)),!e&&o.byteLength>0&&(s.push(o),l+=o.byteLength),e||u<=l)do({cmd:a,size:u}=yield yield(0,i.qq)("peek"===a?(0,n.$Q)(s,u)[0]:([o,s,l]=(0,n.$Q)(s,u),o)));while(us(function(t){return(0,i.FC)(this,arguments,function*(){let e=!1,r=!1,s=[],a,u,l,c=0;({cmd:u,size:l}=yield yield(0,i.qq)(null));let h=new o(t);try{do if({done:e,value:a}=Number.isNaN(l-c)?yield(0,i.qq)(h.read()):yield(0,i.qq)(h.read(l-c)),!e&&a.byteLength>0&&(s.push((0,n._f)(a)),c+=a.byteLength),e||l<=c)do({cmd:u,size:l}=yield yield(0,i.qq)("peek"===u?(0,n.$Q)(s,l)[0]:([a,s,c]=(0,n.$Q)(s,l),a)));while(ls(function(t){return(0,i.FC)(this,arguments,function*(){let e=[],r="error",s=!1,o=null,u,l,c=0,h=[],d;if({cmd:u,size:l}=yield yield(0,i.qq)(null),t.isTTY)return yield yield(0,i.qq)(new Uint8Array(0)),yield(0,i.qq)(null);try{e[0]=a(t,"end"),e[1]=a(t,"error");do{if(e[2]=a(t,"readable"),[r,o]=yield(0,i.qq)(Promise.race(e.map(t=>t[2]))),"error"===r)break;if(!(s="end"===r)&&(Number.isFinite(l-c)?(d=(0,n._f)(t.read(l-c))).byteLength0&&(h.push(d),c+=d.byteLength)),s||l<=c)do({cmd:u,size:l}=yield yield(0,i.qq)("peek"===u?(0,n.$Q)(h,l)[0]:([d,h,c]=(0,n.$Q)(h,l),d)));while(l{for(let[r,i]of e)t.off(r,i);try{let e=t.destroy;e&&e.call(t,r),r=void 0}catch(t){r=t||r}finally{null!=r?n(r):i()}})}(e,"error"===r?o:null))}return yield(0,i.qq)(null)})}(t)),toDOMStream(t,e){throw Error('"toDOMStream" not available in this environment')},toNodeStream(t,e){throw Error('"toNodeStream" not available in this environment')}};let s=t=>(t.next(),t);class o{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return(0,i.mG)(this,void 0,void 0,function*(){let{reader:e,source:r}=this;e&&(yield e.cancel(t).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(t){return(0,i.mG)(this,void 0,void 0,function*(){if(0===t)return{done:null==this.reader,value:new Uint8Array(0)};let e=yield this.reader.read();return e.done||(e.value=(0,n._f)(e)),e})}}let a=(t,e)=>{let r;let i=t=>r([e,t]);return[e,i,new Promise(n=>(r=n)&&t.once(e,i))]}},5241:function(t,e,r){"use strict";r.d(e,{O:function(){return o},U:function(){return a}});var i=r(8395),n=r(3129),s=r(7031);class o extends n.$W{constructor(t,e){super(),this.position=0,this.buffer=(0,s._f)(t),this.size=void 0===e?this.buffer.byteLength:e}readInt32(t){let{buffer:e,byteOffset:r}=this.readAt(t,4);return new DataView(e,r).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return(0,i.mG)(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){let{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(s);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return n.Z.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return n.Z.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return(0,i.mG)(this,void 0,void 0,function*(){return yield this.abort(t),s})}return(t){return(0,i.mG)(this,void 0,void 0,function*(){return yield this.close(),s})}read(t){return(0,i.mG)(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return(0,i.mG)(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){if(this._values.length>0)return Promise.resolve({done:!1,value:this._values.shift()});if(this._error)return Promise.reject({done:!0,value:this._error.error});if(!this._closedPromiseResolve)return Promise.resolve(s);else return new Promise((t,e)=>{this.resolvers.push({resolve:t,reject:e})})}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw Error("AsyncQueue is closed")}}},3129:function(t,e,r){"use strict";r.d(e,{$W:function(){return c},E2:function(){return l},zL:function(){return h}});var i=r(8395),n=r(8100),s=r(5098),o=r(2308),a=r(7031),u=r(886);class l extends o.zi{write(t){if((t=(0,a._f)(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?(0,s.F)(this.toUint8Array(!0)):this.toUint8Array(!1).then(s.F)}toUint8Array(t=!1){return t?(0,a.$Q)(this._values)[0]:(0,i.mG)(this,void 0,void 0,function*(){var t,e;let r=[],n=0;try{for(var s,o=(0,i.KL)(this);!(s=yield o.next()).done;){let t=s.value;r.push(t),n+=t.byteLength}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=o.return)&&(yield e.call(o))}finally{if(t)throw t.error}}return(0,a.$Q)(r,n)[0]})}}class c{constructor(t){t&&(this.source=new d(n.Z.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class h{constructor(t){t instanceof h?this.source=t.source:t instanceof l?this.source=new f(n.Z.fromAsyncIterable(t)):(0,u.v6)(t)?this.source=new f(n.Z.fromNodeStream(t)):(0,u.Dg)(t)?this.source=new f(n.Z.fromDOMStream(t)):(0,u.lK)(t)?this.source=new f(n.Z.fromDOMStream(t.body)):(0,u.TW)(t)?this.source=new f(n.Z.fromIterable(t)):(0,u.tI)(t)?this.source=new f(n.Z.fromAsyncIterable(t)):(0,u.D0)(t)&&(this.source=new f(n.Z.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class d{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||o.oA)}return(t){return Object.create(this.source.return&&this.source.return(t)||o.oA)}}class f{constructor(t){this.source=t,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(t){return(0,i.mG)(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return(0,i.mG)(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return(0,i.mG)(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,e="read"){return(0,i.mG)(this,void 0,void 0,function*(){return yield this.source.next({cmd:e,size:t})})}throw(t){return(0,i.mG)(this,void 0,void 0,function*(){let e=this.source.throw&&(yield this.source.throw(t))||o.oA;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return(0,i.mG)(this,void 0,void 0,function*(){let e=this.source.return&&(yield this.source.return(t))||o.oA;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}},4716:function(t,e,r){"use strict";r.d(e,{Iy:function(){return m},JO:function(){return D},Kt:function(){return w},SA:function(){return S},ZZ:function(){return v},_J:function(){return I},pH:function(){return A},sw:function(){return b}});var i=r(8395),n=r(6306),s=r(6400),o=r(1557),a=r(886),u=r(5241),l=r(7031),c=r(3129),h=r(2308);let d=t=>`Expected ${n.Ng[t]} Message in stream, but was null or length 0.`,f=t=>`Header pointer of flatbuffer-encoded ${n.Ng[t]} Message is null or length 0.`,y=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,p=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`;class b{constructor(t){this.source=t instanceof c.$W?t:new c.$W(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||-1===t.value&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?h.oA:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(null!=t&&e.value.headerType!==t)throw Error(d(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let e=(0,l._f)(this.source.read(t));if(e.byteLength[...e,...r.VALIDITY&&[r.VALIDITY]||[],...r.TYPE&&[r.TYPE]||[],...r.OFFSET&&[r.OFFSET]||[],...r.DATA&&[r.DATA]||[],...t(r.children)],[])}(this._body)}readMessage(t){let e;if((e=this.next()).done)return null;if(null!=t&&e.value.headerType!==t)throw Error(d(t));return e.value}readSchema(){let t=n.Ng.Schema,e=this.readMessage(t),r=null==e?void 0:e.header();if(!e||!r)throw Error(f(t));return r}}let g=4,_="ARROW1",w=new Uint8Array(_.length);for(let t=0;t<_.length;t+=1)w[t]=_.codePointAt(t);function S(t,e=0){for(let r=-1,i=w.length;++r=0&&t=0&&t=0&&t=0&&ti.g.fromJSON(t,e))}(t,e),d(t.customMetadata),e)}function u(t){return new s.Qh(t.count,function t(e){return(e||[]).reduce((e,r)=>[...e,new s.wm(r.count,function(t){return(t||[]).reduce((t,e)=>t+ +(0===e),0)}(r.VALIDITY)),...t(r.children)],[])}(t.columns),function t(e,r=[]){for(let i=-1,n=(e||[]).length;++ii.g.fromJSON(t,e))}function h(t,e){let r,s,o,a,u,l;return e&&(a=t.dictionary)?(e.has(r=a.id)?(s=(s=a.indexType)?f(s):new n.Vq,l=new n.Xy(e.get(r),s,r,a.isOrdered)):(s=(s=a.indexType)?f(s):new n.Vq,e.set(r,u=y(t,c(t,e))),l=new n.Xy(u,s,r,a.isOrdered)),o=new i.g(t.name,l,t.nullable,d(t.customMetadata))):(u=y(t,c(t,e)),o=new i.g(t.name,u,t.nullable,d(t.customMetadata))),o||null}function d(t){return new Map(Object.entries(t||{}))}function f(t){return new n.J7(t.isSigned,t.bitWidth)}function y(t,e){let r=t.type.name;switch(r){case"NONE":case"null":return new n.p2;case"binary":return new n.Kb;case"utf8":return new n.di;case"bool":return new n.tW;case"list":return new n.aV((e||[])[0]);case"struct":case"struct_":return new n.AU(e||[])}switch(r){case"int":{let e=t.type;return new n.J7(e.isSigned,e.bitWidth)}case"floatingpoint":{let e=t.type;return new n.bv(o.Gc[e.precision])}case"decimal":{let e=t.type;return new n.tA(e.scale,e.precision,e.bitWidth)}case"date":{let e=t.type;return new n.dN(o.hQ[e.unit])}case"time":{let e=t.type;return new n.qp(o.j1[e.unit],e.bitWidth)}case"timestamp":{let e=t.type;return new n.EK(o.j1[e.unit],e.timezone)}case"interval":{let e=t.type;return new n.Xp(o.wK[e.unit])}case"union":{let r=t.type;return new n.EJ(o.yj[r.mode],r.typeIds||[],e||[])}case"fixedsizebinary":{let e=t.type;return new n.ZY(e.byteWidth)}case"fixedsizelist":{let r=t.type;return new n.t7(r.listSize,(e||[])[0])}case"map":{let r=t.type;return new n.DB((e||[])[0],r.keysSorted)}}throw Error(`Unrecognized type: "${r}"`)}},1557:function(t,e,r){"use strict";r.d(e,{IM:function(){return C},Qh:function(){return U},mg:function(){return k},v0:function(){return L},wm:function(){return j}});var i=r(6400),n=r(6966),s=r(2039),o=r(9547),a=r(9623),u=r(1052),l=r(2042),c=r(1415),h=r(2818),d=r(9708),f=r(6601),y=r(345),p=r(3603),b=r(3781),v=r(7124),m=r(8725),g=r(7029),_=r(6154),w=r(9022),S=r(4596),I=r(7841),D=r(6146),A=r(693),O=r(7031),T=r(6306),B=r(8750),x=r(2989),M=r(8870),E=i.dK,F=i.Ib,N=i.cZ;class L{constructor(t,e,r,i){this._version=e,this._headerType=r,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength="number"==typeof t?t:t.low}static fromJSON(t,e){let r=new L(0,T.Bo.V4,e);return r._createHeader=function(t,e){return()=>{switch(e){case T.Ng.Schema:return A.V.fromJSON(t);case T.Ng.RecordBatch:return U.fromJSON(t);case T.Ng.DictionaryBatch:return C.fromJSON(t)}throw Error(`Unrecognized Message type: { name: ${T.Ng[e]}, type: ${e} }`)}}(t,e),r}static decode(t){t=new N((0,O._f)(t));let e=D.v.getRootAsMessage(t),r=e.bodyLength(),i=e.version(),s=e.headerType(),u=new L(r,i,s);return u._createHeader=function(t,e){return()=>{switch(e){case T.Ng.Schema:return A.V.decode(t.header(new n.V));case T.Ng.RecordBatch:return U.decode(t.header(new o.Q),t.version());case T.Ng.DictionaryBatch:return C.decode(t.header(new a.I),t.version())}throw Error(`Unrecognized Message type: { name: ${T.Ng[e]}, type: ${e} }`)}}(e,s),u}static encode(t){let e=new F,r=-1;return t.isSchema()?r=A.V.encode(e,t.header()):t.isRecordBatch()?r=U.encode(e,t.header()):t.isDictionaryBatch()&&(r=C.encode(e,t.header())),D.v.startMessage(e),D.v.addVersion(e,T.Bo.V4),D.v.addHeader(e,r),D.v.addHeaderType(e,t.headerType),D.v.addBodyLength(e,new E(t.bodyLength,0)),D.v.finishMessageBuffer(e,D.v.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof A.V)return new L(0,T.Bo.V4,T.Ng.Schema,t);if(t instanceof U)return new L(e,T.Bo.V4,T.Ng.RecordBatch,t);if(t instanceof C)return new L(e,T.Bo.V4,T.Ng.DictionaryBatch,t);throw Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===T.Ng.Schema}isRecordBatch(){return this.headerType===T.Ng.RecordBatch}isDictionaryBatch(){return this.headerType===T.Ng.DictionaryBatch}}class U{constructor(t,e,r){this._nodes=e,this._buffers=r,this._length="number"==typeof t?t:t.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}}class C{constructor(t,e,r=!1){this._data=t,this._isDelta=r,this._id="number"==typeof e?e:e.low}get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}}class k{constructor(t,e){this.offset="number"==typeof t?t:t.low,this.length="number"==typeof e?e:e.low}}class j{constructor(t,e){this.length="number"==typeof t?t:t.low,this.nullCount="number"==typeof e?e:e.low}}A.g.encode=function(t,e){let r=-1,i=-1,n=-1,s=e.type,o=e.typeId;M.g.isDictionary(s)?(o=s.dictionary.typeId,n=B.e.visit(s,t),i=B.e.visit(s.dictionary,t)):i=B.e.visit(s,t);let a=(s.children||[]).map(e=>A.g.encode(t,e)),u=l.g.createChildrenVector(t,a),c=e.metadata&&e.metadata.size>0?l.g.createCustomMetadataVector(t,[...e.metadata].map(([e,r])=>{let i=t.createString(`${e}`),n=t.createString(`${r}`);return d.c.startKeyValue(t),d.c.addKey(t,i),d.c.addValue(t,n),d.c.endKeyValue(t)})):-1;return e.name&&(r=t.createString(e.name)),l.g.startField(t),l.g.addType(t,i),l.g.addTypeType(t,o),l.g.addChildren(t,u),l.g.addNullable(t,!!e.nullable),-1!==r&&l.g.addName(t,r),-1!==n&&l.g.addDictionary(t,n),-1!==c&&l.g.addCustomMetadata(t,c),l.g.endField(t)},A.g.decode=function(t,e){let r,i,n,s,o,a;return e&&(a=t.dictionary())?(e.has(r=a.id().low)?(s=(s=a.indexType())?V(s):new M.Vq,o=new M.Xy(e.get(r),s,r,a.isOrdered())):(s=(s=a.indexType())?V(s):new M.Vq,e.set(r,n=z(t,P(t,e))),o=new M.Xy(n,s,r,a.isOrdered())),i=new A.g(t.name(),o,t.nullable(),R(t))):(n=z(t,P(t,e)),i=new A.g(t.name(),n,t.nullable(),R(t))),i||null},A.g.fromJSON=x.XJ,A.V.encode=function(t,e){let r=e.fields.map(e=>A.g.encode(t,e));n.V.startFieldsVector(t,r.length);let i=n.V.createFieldsVector(t,r),s=e.metadata&&e.metadata.size>0?n.V.createCustomMetadataVector(t,[...e.metadata].map(([e,r])=>{let i=t.createString(`${e}`),n=t.createString(`${r}`);return d.c.startKeyValue(t),d.c.addKey(t,i),d.c.addValue(t,n),d.c.endKeyValue(t)})):-1;return n.V.startSchema(t),n.V.addFields(t,i),n.V.addEndianness(t,$?f.I.Little:f.I.Big),-1!==s&&n.V.addCustomMetadata(t,s),n.V.endSchema(t)},A.V.decode=function(t,e=new Map){let r=function(t,e){let r=[];for(let i,n=-1,s=-1,o=t.fieldsLength();++n{let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256===new Int16Array(t)[0]})()},9066:function(t,e,r){"use strict";r.d(e,{so:function(){return v}});var i=r(8395),n=r(4035),s=r(6927),o=r(8870),a=r(6306),u=r(1827),l=r(8100),c=r(3129),h=r(5241),d=r(6467),f=r(814),y=r(2308),p=r(4716),b=r(886);class v extends y.yG{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){let e=this._impl.open(t);return(0,b.tI)(e)?e.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return l.Z.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return l.Z.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw Error('"throughDOM" not available in this environment')}static from(t){if(t instanceof v)return t;if((0,b.jq)(t))return function(t){return new m(new T(t))}(t);if((0,b.K0)(t))return function(t){return(0,i.mG)(this,void 0,void 0,function*(){let{size:e}=yield t.stat(),r=new h.U(t,e);return e>=p.pH&&(0,p.SA)((yield r.readAt(0,p._J+7&-8)))?new w(new O(r)):new g(new D(r))})}(t);else if((0,b.tI)(t))return(0,i.mG)(this,void 0,void 0,function*(){return yield v.from((yield t))});else if((0,b.lK)(t)||(0,b.Dg)(t)||(0,b.v6)(t)||(0,b.D0)(t))return function(t){return(0,i.mG)(this,void 0,void 0,function*(){let e=yield t.peek(p._J+7&-8);return e&&e.byteLength>=4?(0,p.SA)(e)?new _(new A((yield t.read()))):new g(new D(t)):new g(new D(function(){return(0,i.FC)(this,arguments,function*(){})}()))})}(new c.zL(t));return function(t){let e=t.peek(p._J+7&-8);return e&&e.byteLength>=4?(0,p.SA)(e)?new _(new A(t.read())):new m(new I(t)):new m(new I(function*(){}()))}(new c.$W(t))}static readAll(t){return t instanceof v?t.isSync()?x(t):M(t):(0,b.jq)(t)||ArrayBuffer.isView(t)||(0,b.TW)(t)||(0,b.Qy)(t)?x(t):M(t)}}class m extends v{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return(0,i.FC)(this,arguments,function*(){yield(0,i.qq)((yield*(0,i.V2)((0,i.KL)(this[Symbol.iterator]()))))})}}class g extends v{constructor(t){super(t),this._impl=t}readAll(){var t,e;return(0,i.mG)(this,void 0,void 0,function*(){let r=[];try{for(var n,s=(0,i.KL)(this);!(n=yield s.next()).done;){let t=n.value;r.push(t)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=s.return)&&(yield e.call(s))}finally{if(t)throw t.error}}return r})}[Symbol.iterator](){throw Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class _ extends m{constructor(t){super(t),this._impl=t}}class w extends g{constructor(t){super(t),this._impl=t}}class S{constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){let r=this._loadVectors(t,e,this.schema.fields),i=(0,n._l)({type:new o.AU(this.schema.fields),length:t.length,children:r});return new f.Q(this.schema,i)}_loadDictionaryBatch(t,e){let{id:r,isDelta:i}=t,{dictionaries:n,schema:o}=this,a=n.get(r);if(i||!a){let n=o.dictionaries.get(r),u=this._loadVectors(t.data,e,[n]);return(a&&i?a.concat(new s.O(u)):new s.O(u)).memoize()}return a.memoize()}_loadVectors(t,e,r){return new d.U(e,t.nodes,t.buffers,this.dictionaries).visitMany(r)}}class I extends S{constructor(t,e){super(e),this._reader=(0,b.jq)(t)?new p.Iy(this._handle=t):new p.sw(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return!this.closed&&(this.autoDestroy=B(this,t),!(this.schema||(this.schema=this._reader.readSchema()))&&this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):y.oA}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):y.oA}next(){let t;if(this.closed)return y.oA;let{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let r=t.header(),i=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),i=e.readMessageBody(t.bodyLength),n=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,n)}return this.schema&&0===this._recordBatchIndex?(this._recordBatchIndex++,{done:!1,value:new f.w(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class D extends S{constructor(t,e){super(e),this._reader=new p.ZZ(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return(0,i.mG)(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return(0,i.mG)(this,void 0,void 0,function*(){return!this.closed&&(this.autoDestroy=B(this,t),!(this.schema||(this.schema=yield this._reader.readSchema()))&&(yield this.cancel())),this})}throw(t){return(0,i.mG)(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):y.oA})}return(t){return(0,i.mG)(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):y.oA})}next(){return(0,i.mG)(this,void 0,void 0,function*(){let t;if(this.closed)return y.oA;let{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let r=t.header(),i=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),i=yield e.readMessageBody(t.bodyLength),n=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,n)}return this.schema&&0===this._recordBatchIndex?(this._recordBatchIndex++,{done:!1,value:new f.w(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return(0,i.mG)(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class A extends I{constructor(t,e){super(t instanceof h.O?t:new h.O(t),e)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer)for(let t of(this.schema=(this._footer=this._readFooter()).schema,this._footer.dictionaryBatches()))t&&this._readDictionaryBatch(this._dictionaryIndex++);return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;!this._footer&&this.open();let r=null===(e=this._footer)||void 0===e?void 0:e.getRecordBatch(t);if(r&&this._handle.seek(r.offset)){let t=this._reader.readMessage(a.Ng.RecordBatch);if(null==t?void 0:t.isRecordBatch()){let e=t.header(),r=this._reader.readMessageBody(t.bodyLength);return this._loadRecordBatch(e,r)}}return null}_readDictionaryBatch(t){var e;let r=null===(e=this._footer)||void 0===e?void 0:e.getDictionaryBatch(t);if(r&&this._handle.seek(r.offset)){let t=this._reader.readMessage(a.Ng.DictionaryBatch);if(null==t?void 0:t.isDictionaryBatch()){let e=t.header(),r=this._reader.readMessageBody(t.bodyLength),i=this._loadDictionaryBatch(e,r);this.dictionaries.set(e.id,i)}}}_readFooter(){let{_handle:t}=this,e=t.size-p.JO,r=t.readInt32(e),i=t.readAt(e-r,r);return u.$.decode(i)}_readNextMessageAndValidate(t){var e;if(!this._footer&&this.open(),this._footer&&this._recordBatchIndexsuper.open}});return(0,i.mG)(this,void 0,void 0,function*(){if(!this.closed&&!this._footer)for(let t of(this.schema=(this._footer=yield this._readFooter()).schema,this._footer.dictionaryBatches()))t&&(yield this._readDictionaryBatch(this._dictionaryIndex++));return yield e.open.call(this,t)})}readRecordBatch(t){var e;return(0,i.mG)(this,void 0,void 0,function*(){if(this.closed)return null;!this._footer&&(yield this.open());let r=null===(e=this._footer)||void 0===e?void 0:e.getRecordBatch(t);if(r&&(yield this._handle.seek(r.offset))){let t=yield this._reader.readMessage(a.Ng.RecordBatch);if(null==t?void 0:t.isRecordBatch()){let e=t.header(),r=yield this._reader.readMessageBody(t.bodyLength);return this._loadRecordBatch(e,r)}}return null})}_readDictionaryBatch(t){var e;return(0,i.mG)(this,void 0,void 0,function*(){let r=null===(e=this._footer)||void 0===e?void 0:e.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){let t=yield this._reader.readMessage(a.Ng.DictionaryBatch);if(null==t?void 0:t.isDictionaryBatch()){let e=t.header(),r=yield this._reader.readMessageBody(t.bodyLength),i=this._loadDictionaryBatch(e,r);this.dictionaries.set(e.id,i)}}})}_readFooter(){return(0,i.mG)(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let e=t.size-p.JO,r=yield t.readInt32(e),i=yield t.readAt(e-r,r);return u.$.decode(i)})}_readNextMessageAndValidate(t){return(0,i.mG)(this,void 0,void 0,function*(){if(!this._footer&&(yield this.open()),this._footer&&this._recordBatchIndext(e)):r.isAsync()?r.readAll().then(t=>new i.iA(t)):new i.iA(r.readAll())}}});var i=r(6418),n=r(886),s=r(9066),o=r(9916);function a(t,e="stream"){return("stream"===e?o.t_:o.Sx).writeAll(t).toUint8Array(!0)}},9916:function(t,e,r){"use strict";r.d(e,{Sx:function(){return g},t_:function(){return m}});var i=r(8395),n=r(6418),s=r(4716),o=r(6927);r(8870);var a=r(1557),u=r(1827),l=r(6306),c=r(1269),h=r(3129),d=r(9985);r(3163),r(1526);var f=r(7031),y=r(814),p=r(2308),b=r(886);class v extends p.yG{constructor(t){super(),this._position=0,this._started=!1,this._sink=new h.E2,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(0,b.Kn)(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy="boolean"!=typeof t.autoDestroy||t.autoDestroy,this._writeLegacyIpcFormat="boolean"==typeof t.writeLegacyIpcFormat&&t.writeLegacyIpcFormat}static throughNode(t){throw Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw Error('"throughDOM" not available in this environment')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return(0,b.tI)(t)?t.then(t=>this.writeAll(t)):(0,b.D0)(t)?w(this,t):_(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof h.E2?this._sink=t:(this._sink=new h.E2,t&&(0,b.FH)(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&(0,b.k$)(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!e||!(0,c.$F)(e,this._schema))&&(null==e?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(null==t)return this.finish()&&void 0;else if(t instanceof n.iA&&!(e=t.schema))return this.finish()&&void 0;else if(t instanceof y.Q&&!(e=t.schema))return this.finish()&&void 0}else throw Error("RecordBatchWriter is closed");if(e&&!(0,c.$F)(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof y.Q?!(t instanceof y.w)&&this._writeRecordBatch(t):t instanceof n.iA?this.writeAll(t.batches):(0,b.TW)(t)&&this.writeAll(t)}_writeMessage(t,e=8){let r=e-1,i=a.v0.encode(t),n=i.byteLength,s=this._writeLegacyIpcFormat?4:8,o=n+s+r&~r;return t.headerType===l.Ng.RecordBatch?this._recordBatchBlocks.push(new u.D(o,t.bodyLength,this._position)):t.headerType===l.Ng.DictionaryBatch&&this._dictionaryBlocks.push(new u.D(o,t.bodyLength,this._position)),!this._writeLegacyIpcFormat&&this._write(Int32Array.of(-1)),this._write(Int32Array.of(o-s)),n>0&&this._write(i),this._writePadding(o-n-s)}_write(t){if(this._started){let e=(0,f._f)(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(a.v0.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(s.Kt)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:e,nodes:r,bufferRegions:i,buffers:n}=d.M.assemble(t),s=new a.Qh(t.numRows,r,i),o=a.v0.from(s,e);return this._writeDictionaries(t)._writeMessage(o)._writeBodyBuffers(n)}_writeDictionaryBatch(t,e,r=!1){this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));let{byteLength:i,nodes:n,bufferRegions:s,buffers:u}=d.M.assemble(new o.O([t])),l=new a.Qh(t.length,n,s),c=new a.IM(l,e,r),h=a.v0.from(c,i);return this._writeMessage(h)._writeBodyBuffers(u)}_writeBodyBuffers(t){let e,r,i;for(let n=-1,s=t.length;++n0&&(this._write(e),(i=(r+7&-8)-r)>0&&this._writePadding(i));return this}_writeDictionaries(t){for(let[e,r]of t.dictionaries){let t=this._dictionaryDeltaOffsets.get(e)||0;if(0===t||(r=null==r?void 0:r.slice(t)).length>0)for(let i of r.data)this._writeDictionaryBatch(i,e,t>0),t+=i.length}return this}}class m extends v{static writeAll(t,e){let r=new m(e);return(0,b.tI)(t)?t.then(t=>r.writeAll(t)):(0,b.D0)(t)?w(r,t):_(r,t)}}class g extends v{static writeAll(t){let e=new g;return(0,b.tI)(t)?t.then(t=>e.writeAll(t)):(0,b.D0)(t)?w(e,t):_(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let e=u.$.encode(new u.$(t,l.Bo.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function _(t,e){let r=e;for(let i of(e instanceof n.iA&&(r=e.batches,t.reset(void 0,e.schema)),r))t.write(i);return t.finish()}function w(t,e){var r,n,s,o;return(0,i.mG)(this,void 0,void 0,function*(){try{for(r=(0,i.KL)(e);!(n=yield r.next()).done;){let e=n.value;t.write(e)}}catch(t){s={error:t}}finally{try{n&&!n.done&&(o=r.return)&&(yield o.call(r))}finally{if(s)throw s.error}}return t.finish()})}},814:function(t,e,r){"use strict";r.d(e,{Q:function(){return y},w:function(){return b}});var i,n=r(4035),s=r(6418),o=r(6927),a=r(693),u=r(8870),l=r(5108),c=r(4228),h=r(5478),d=r(362),f=r(5024);class y{constructor(...t){switch(t.length){case 2:if([this.schema]=t,!(this.schema instanceof a.V))throw TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=(0,n._l)({nullCount:0,type:new u.AU(this.schema.fields),children:this.schema.fields.map(t=>(0,n._l)({type:t.type,nullCount:0}))})]=t,!(this.data instanceof n.Vw))throw TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=p(this.schema,this.data.children);break;case 1:{let[e]=t,{fields:r,children:i,length:s}=Object.keys(e).reduce((t,r,i)=>(t.children[i]=e[r],t.length=Math.max(t.length,e[r].length),t.fields[i]=a.g.new({name:r,type:e[r].type,nullable:!0}),t),{length:0,fields:[],children:[]}),o=new a.V(r),l=(0,n._l)({type:new u.AU(r),length:s,children:i,nullCount:0});[this.schema,this.data]=p(o,l.children,s);break}default:throw TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=function t(e,r,i=new Map){for(let n=-1,s=e.length;++n0&&t(s.children,o.children,i)}return i}(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return l.e.visit(this.data,t)}set(t,e){return c.eE.visit(this.data,t,e)}indexOf(t,e){return h.e.visit(this.data,t,e)}getByteLength(t){return f.e.visit(this.data,t)}[Symbol.iterator](){return d.P.visit(new o.O([this.data]))}toArray(){return[...this]}concat(...t){return new s.iA(this.schema,[this,...t])}slice(t,e){let[r]=new o.O([this.data]).slice(t,e).data;return new y(this.schema,r)}getChild(t){var e;return this.getChildAt(null===(e=this.schema.fields)||void 0===e?void 0:e.findIndex(e=>e.name===t))}getChildAt(t){return t>-1&&te.name===t),e)}setChildAt(t,e){let r=this.schema,i=this.data;if(t>-1&&tt.name===e);~t&&(i[t]=this.data.children[t])}return new y(e,(0,n._l)({type:r,length:this.numRows,children:i}))}selectAt(t){let e=this.schema.selectAt(t),r=t.map(t=>this.data.children[t]).filter(Boolean),i=(0,n._l)({type:new u.AU(e.fields),length:this.numRows,children:r});return new y(e,i)}}function p(t,e,r=e.reduce((t,e)=>Math.max(t,e.length),0)){var i;let s=[...t.fields],o=[...e],a=(r+63&-64)>>3;for(let[u,l]of t.fields.entries()){let t=e[u];(!t||t.length!==r)&&(s[u]=l.clone({nullable:!0}),o[u]=null!==(i=null==t?void 0:t._changeLengthAndBackfillNullBitmap(r))&&void 0!==i?i:(0,n._l)({type:l.type,length:r,nullCount:r,nullBitmap:new Uint8Array(a)}))}return[t.assign(s),(0,n._l)({type:new u.AU(s),length:r,children:o})]}y[Symbol.toStringTag]=((i=y.prototype)._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,"RecordBatch");class b extends y{constructor(t){let e=t.fields.map(t=>(0,n._l)({type:t.type}));super(t,(0,n._l)({type:new u.AU(t.fields),nullCount:0,children:e}))}}},1360:function(t,e,r){"use strict";r.d(e,{if:function(){return l}});var i=r(6927),n=r(6810),s=r(5108),o=r(4228);let a=Symbol.for("keys"),u=Symbol.for("vals");class l{constructor(t){return this[a]=new i.O([t.children[0]]).memoize(),this[u]=t.children[1],new Proxy(this,new h)}[Symbol.iterator](){return new c(this[a],this[u])}get size(){return this[a].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[a],e=this[u],r={};for(let i=-1,n=t.length;++i`${(0,n.F)(t)}: ${(0,n.F)(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class c{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){let t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),s.e.visit(this.vals,t)]})}}class h{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[a].toArray().map(String)}has(t,e){return t[a].includes(e)}getOwnPropertyDescriptor(t,e){if(-1!==t[a].indexOf(e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let r=t[a].indexOf(e);if(-1!==r){let i=s.e.visit(Reflect.get(t,u),r);return Reflect.set(t,e,i),i}}set(t,e,r){let i=t[a].indexOf(e);return -1!==i?(o.eE.visit(Reflect.get(t,u),i,r),Reflect.set(t,e,r)):!!Reflect.has(t,e)&&Reflect.set(t,e,r)}}Object.defineProperties(l.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[a]:{writable:!0,enumerable:!1,configurable:!1,value:null},[u]:{writable:!0,enumerable:!1,configurable:!1,value:null}})},6534:function(t,e,r){"use strict";r.d(e,{W:function(){return u}});var i=r(6810),n=r(5108),s=r(4228);let o=Symbol.for("parent"),a=Symbol.for("rowIndex");class u{constructor(t,e){return this[o]=t,this[a]=e,new Proxy(this,new c)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[a],e=this[o],r=e.type.children,i={};for(let s=-1,o=r.length;++s`${(0,i.F)(t)}: ${(0,i.F)(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new l(this[o],this[a])}}class l{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let t=this.childIndex;return tt.name)}has(t,e){return -1!==t[o].type.children.findIndex(t=>t.name===e)}getOwnPropertyDescriptor(t,e){if(-1!==t[o].type.children.findIndex(t=>t.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let r=t[o].type.children.findIndex(t=>t.name===e);if(-1!==r){let i=n.e.visit(t[o].children[r],t[a]);return Reflect.set(t,e,i),i}}set(t,e,r){let i=t[o].type.children.findIndex(t=>t.name===e);return -1!==i?(s.eE.visit(t[o].children[i],t[a],r),Reflect.set(t,e,r)):(!!Reflect.has(t,e)||"symbol"==typeof e)&&Reflect.set(t,e,r)}}},693:function(t,e,r){"use strict";r.d(e,{V:function(){return n},g:function(){return s}});var i=r(8870);class n{constructor(t=[],e,r){this.fields=t||[],this.metadata=e||new Map,!r&&(r=a(t)),this.dictionaries=r}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){let e=new Set(t);return new n(this.fields.filter(t=>e.has(t.name)),this.metadata)}selectAt(t){return new n(t.map(t=>this.fields[t]).filter(Boolean),this.metadata)}assign(...t){let e=t[0]instanceof n?t[0]:new n(Array.isArray(t[0])?t[0]:t),r=[...this.fields],i=o(o(new Map,this.metadata),e.metadata),s=e.fields.filter(t=>{let e=r.findIndex(e=>e.name===t.name);return!~e||(r[e]=t.clone({metadata:o(o(new Map,r[e].metadata),t.metadata)}))&&!1}),u=a(s,new Map);return new n([...r,...s],i,new Map([...this.dictionaries,...u]))}}n.prototype.fields=null,n.prototype.metadata=null,n.prototype.dictionaries=null;class s{constructor(t,e,r=!1,i){this.name=t,this.type=e,this.nullable=r,this.metadata=i||new Map}static new(...t){let[e,r,i,n]=t;return t[0]&&"object"==typeof t[0]&&({name:e}=t[0],void 0===r&&(r=t[0].type),void 0===i&&(i=t[0].nullable),void 0===n&&(n=t[0].metadata)),new s(`${e}`,r,i,n)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,r,i,n]=t;return t[0]&&"object"==typeof t[0]?{name:e=this.name,type:r=this.type,nullable:i=this.nullable,metadata:n=this.metadata}=t[0]:[e=this.name,r=this.type,i=this.nullable,n=this.metadata]=t,s.new(e,r,i,n)}}function o(t,e){return new Map([...t||new Map,...e||new Map])}function a(t,e=new Map){for(let r=-1,n=t.length;++r0&&a(n.children,e)}return e}s.prototype.type=null,s.prototype.name=null,s.prototype.nullable=null,s.prototype.metadata=null},6418:function(t,e,r){"use strict";r.d(e,{iA:function(){return g}});var i,n=r(6306),s=r(4035),o=r(6927),a=r(693),u=r(8870),l=r(1269),c=r(4270),h=r(3668),d=r(5108),f=r(4228),y=r(5478),p=r(362),b=r(5024),v=r(1410),m=r(814);class g{constructor(...t){var e,r;let i,n;if(0===t.length)return this.batches=[],this.schema=new a.V([]),this._offsets=[0],this;t[0]instanceof a.V&&(i=t.shift()),t[t.length-1]instanceof Uint32Array&&(n=t.pop());let d=t=>{if(t){if(t instanceof m.Q)return[t];if(t instanceof g)return t.batches;else if(t instanceof s.Vw){if(t.type instanceof u.AU)return[new m.Q(new a.V(t.type.children),t)]}else if(Array.isArray(t))return t.flatMap(t=>d(t));else if("function"==typeof t[Symbol.iterator])return[...t].flatMap(t=>d(t));else if("object"==typeof t){let e=Object.keys(t),r=e.map(e=>new o.O([t[e]])),i=new a.V(e.map((t,e)=>new a.g(String(t),r[e].type))),[,n]=(0,c.$)(i,r);return 0===n.length?[new m.Q(t)]:n}}return[]},f=t.flatMap(t=>d(t));if(!((i=null!==(r=null!=i?i:null===(e=f[0])||void 0===e?void 0:e.schema)&&void 0!==r?r:new a.V([]))instanceof a.V))throw TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let t of f){if(!(t instanceof m.Q))throw TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!(0,l.$F)(i,t.schema))throw TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=f,this._offsets=null!=n?n:(0,h.mP)(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,e)=>t+e.length,0)}get nullCount(){return -1===this._nullCount&&(this._nullCount=(0,h.$k)(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return -1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?p.P.visit(new o.O(this.data)):[][Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ - ${this.toArray().join(",\n ")} -]`}concat(...t){let e=this.schema;return new g(e,this.data.concat(t.flatMap(({data:t})=>t)).map(t=>new m.Q(e,t)))}slice(t,e){let r=this.schema;return[t,e]=(0,v.l$)({length:this.numRows},t,e),new g(r,(0,h.pv)(this.data,this._offsets,t,e).map(t=>new m.Q(r,t)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&te.children[t]);if(0===e.length){let{type:r}=this.schema.fields[t],i=(0,s._l)({type:r,length:0,nullCount:0});e.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new o.O(e)}return null}setChild(t,e){var r;return this.setChildAt(null===(r=this.schema.fields)||void 0===r?void 0:r.findIndex(e=>e.name===t),e)}setChildAt(t,e){let r=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(e));[n[t],l[t]]=[a,e],[r,i]=(0,c.$)(r,l)}return new g(r,i)}select(t){let e=this.schema.fields.reduce((t,e,r)=>t.set(e.name,r),new Map);return this.selectAt(t.map(t=>e.get(t)).filter(t=>t>-1))}selectAt(t){let e=this.schema.selectAt(t);return new g(e,this.batches.map(e=>e.selectAt(t)))}assign(t){let e=this.schema.fields,[r,i]=t.schema.fields.reduce((t,r,i)=>{let[n,s]=t,o=e.findIndex(t=>t.name===r.name);return~o?s[o]=i:n.push(i),t},[[],[]]),n=this.schema.assign(t.schema),s=[...e.map((t,e)=>[e,i[e]]).map(([e,r])=>void 0===r?this.getChildAt(e):t.getChildAt(r)),...r.map(e=>t.getChildAt(e))].filter(Boolean);return new g(...(0,c.$)(n,s))}}g[Symbol.toStringTag]=((i=g.prototype).schema=null,i.batches=[],i._offsets=new Uint32Array([0]),i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,i.isValid=(0,h.uh)(h.Mk),i.get=(0,h.uh)(d.e.getVisitFn(n.Dy.Struct)),i.set=(0,h.ix)(f.eE.getVisitFn(n.Dy.Struct)),i.indexOf=(0,h.l4)(y.e.getVisitFn(n.Dy.Struct)),i.getByteLength=(0,h.uh)(b.e.getVisitFn(n.Dy.Struct)),"Table")},8870:function(t,e,r){"use strict";let i;r.d(e,{AU:function(){return j},DB:function(){return z},EJ:function(){return P},EK:function(){return U},J7:function(){return O},Kb:function(){return x},Vq:function(){return T},Xp:function(){return C},Xy:function(){return W},ZY:function(){return R},aV:function(){return k},bv:function(){return B},dN:function(){return N},di:function(){return M},g:function(){return D},oS:function(){return q},p2:function(){return A},qp:function(){return L},t7:function(){return V},tA:function(){return F},tW:function(){return E}});var n,s,o,a,u,l,c,h,d,f,y,p,b,v,m,g,_,w,S=r(886),I=r(6306);class D{static isNull(t){return(null==t?void 0:t.typeId)===I.Dy.Null}static isInt(t){return(null==t?void 0:t.typeId)===I.Dy.Int}static isFloat(t){return(null==t?void 0:t.typeId)===I.Dy.Float}static isBinary(t){return(null==t?void 0:t.typeId)===I.Dy.Binary}static isUtf8(t){return(null==t?void 0:t.typeId)===I.Dy.Utf8}static isBool(t){return(null==t?void 0:t.typeId)===I.Dy.Bool}static isDecimal(t){return(null==t?void 0:t.typeId)===I.Dy.Decimal}static isDate(t){return(null==t?void 0:t.typeId)===I.Dy.Date}static isTime(t){return(null==t?void 0:t.typeId)===I.Dy.Time}static isTimestamp(t){return(null==t?void 0:t.typeId)===I.Dy.Timestamp}static isInterval(t){return(null==t?void 0:t.typeId)===I.Dy.Interval}static isList(t){return(null==t?void 0:t.typeId)===I.Dy.List}static isStruct(t){return(null==t?void 0:t.typeId)===I.Dy.Struct}static isUnion(t){return(null==t?void 0:t.typeId)===I.Dy.Union}static isFixedSizeBinary(t){return(null==t?void 0:t.typeId)===I.Dy.FixedSizeBinary}static isFixedSizeList(t){return(null==t?void 0:t.typeId)===I.Dy.FixedSizeList}static isMap(t){return(null==t?void 0:t.typeId)===I.Dy.Map}static isDictionary(t){return(null==t?void 0:t.typeId)===I.Dy.Dictionary}static isDenseUnion(t){return D.isUnion(t)&&t.mode===I.yj.Dense}static isSparseUnion(t){return D.isUnion(t)&&t.mode===I.yj.Sparse}get typeId(){return I.Dy.NONE}}D[Symbol.toStringTag]=((n=D.prototype).children=null,n.ArrayType=Array,n[Symbol.toStringTag]="DataType");class A extends D{toString(){return"Null"}get typeId(){return I.Dy.Null}}A[Symbol.toStringTag]=A.prototype[Symbol.toStringTag]="Null";class O extends D{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return I.Dy.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?S.lb:S.yo}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}O[Symbol.toStringTag]=((s=O.prototype).isSigned=null,s.bitWidth=null,s[Symbol.toStringTag]="Int");class T extends O{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty((class t extends O{constructor(){super(!0,8)}get ArrayType(){return Int8Array}}).prototype,"ArrayType",{value:Int8Array}),Object.defineProperty((class t extends O{constructor(){super(!0,16)}get ArrayType(){return Int16Array}}).prototype,"ArrayType",{value:Int16Array}),Object.defineProperty(T.prototype,"ArrayType",{value:Int32Array}),Object.defineProperty((class t extends O{constructor(){super(!0,64)}get ArrayType(){return S.lb}}).prototype,"ArrayType",{value:S.lb}),Object.defineProperty((class t extends O{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}}).prototype,"ArrayType",{value:Uint8Array}),Object.defineProperty((class t extends O{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}}).prototype,"ArrayType",{value:Uint16Array}),Object.defineProperty((class t extends O{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}}).prototype,"ArrayType",{value:Uint32Array}),Object.defineProperty((class t extends O{constructor(){super(!1,64)}get ArrayType(){return S.yo}}).prototype,"ArrayType",{value:S.yo});class B extends D{constructor(t){super(),this.precision=t}get typeId(){return I.Dy.Float}get ArrayType(){switch(this.precision){case I.Gc.HALF:return Uint16Array;case I.Gc.SINGLE:return Float32Array;case I.Gc.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}B[Symbol.toStringTag]=((o=B.prototype).precision=null,o[Symbol.toStringTag]="Float");Object.defineProperty((class t extends B{constructor(){super(I.Gc.HALF)}}).prototype,"ArrayType",{value:Uint16Array}),Object.defineProperty((class t extends B{constructor(){super(I.Gc.SINGLE)}}).prototype,"ArrayType",{value:Float32Array}),Object.defineProperty((class t extends B{constructor(){super(I.Gc.DOUBLE)}}).prototype,"ArrayType",{value:Float64Array});class x extends D{constructor(){super()}get typeId(){return I.Dy.Binary}toString(){return"Binary"}}x[Symbol.toStringTag]=((a=x.prototype).ArrayType=Uint8Array,a[Symbol.toStringTag]="Binary");class M extends D{constructor(){super()}get typeId(){return I.Dy.Utf8}toString(){return"Utf8"}}M[Symbol.toStringTag]=((u=M.prototype).ArrayType=Uint8Array,u[Symbol.toStringTag]="Utf8");class E extends D{constructor(){super()}get typeId(){return I.Dy.Bool}toString(){return"Bool"}}E[Symbol.toStringTag]=((l=E.prototype).ArrayType=Uint8Array,l[Symbol.toStringTag]="Bool");class F extends D{constructor(t,e,r=128){super(),this.scale=t,this.precision=e,this.bitWidth=r}get typeId(){return I.Dy.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}F[Symbol.toStringTag]=((c=F.prototype).scale=null,c.precision=null,c.ArrayType=Uint32Array,c[Symbol.toStringTag]="Decimal");class N extends D{constructor(t){super(),this.unit=t}get typeId(){return I.Dy.Date}toString(){return`Date${(this.unit+1)*32}<${I.hQ[this.unit]}>`}}N[Symbol.toStringTag]=((h=N.prototype).unit=null,h.ArrayType=Int32Array,h[Symbol.toStringTag]="Date");class L extends D{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return I.Dy.Time}toString(){return`Time${this.bitWidth}<${I.j1[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return S.lb}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}L[Symbol.toStringTag]=((d=L.prototype).unit=null,d.bitWidth=null,d[Symbol.toStringTag]="Time");class U extends D{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return I.Dy.Timestamp}toString(){return`Timestamp<${I.j1[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}U[Symbol.toStringTag]=((f=U.prototype).unit=null,f.timezone=null,f.ArrayType=Int32Array,f[Symbol.toStringTag]="Timestamp");class C extends D{constructor(t){super(),this.unit=t}get typeId(){return I.Dy.Interval}toString(){return`Interval<${I.wK[this.unit]}>`}}C[Symbol.toStringTag]=((y=C.prototype).unit=null,y.ArrayType=Int32Array,y[Symbol.toStringTag]="Interval");class k extends D{constructor(t){super(),this.children=[t]}get typeId(){return I.Dy.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}k[Symbol.toStringTag]=((p=k.prototype).children=null,p[Symbol.toStringTag]="List");class j extends D{constructor(t){super(),this.children=t}get typeId(){return I.Dy.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}j[Symbol.toStringTag]=((b=j.prototype).children=null,b[Symbol.toStringTag]="Struct");class P extends D{constructor(t,e,r){super(),this.mode=t,this.children=r,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((t,e,r)=>(t[e]=r)&&t||t,Object.create(null))}get typeId(){return I.Dy.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}P[Symbol.toStringTag]=((v=P.prototype).mode=null,v.typeIds=null,v.children=null,v.typeIdToChildIndex=null,v.ArrayType=Int8Array,v[Symbol.toStringTag]="Union");class R extends D{constructor(t){super(),this.byteWidth=t}get typeId(){return I.Dy.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}R[Symbol.toStringTag]=((m=R.prototype).byteWidth=null,m.ArrayType=Uint8Array,m[Symbol.toStringTag]="FixedSizeBinary");class V extends D{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return I.Dy.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}V[Symbol.toStringTag]=((g=V.prototype).children=null,g.listSize=null,g[Symbol.toStringTag]="FixedSizeList");class z extends D{constructor(t,e=!1){super(),this.children=[t],this.keysSorted=e}get typeId(){return I.Dy.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}z[Symbol.toStringTag]=((_=z.prototype).children=null,_.keysSorted=null,_[Symbol.toStringTag]="Map_");let $=(i=-1,()=>++i);class W extends D{constructor(t,e,r,i){super(),this.indices=e,this.dictionary=t,this.isOrdered=i||!1,this.id=null==r?$():"number"==typeof r?r:r.low}get typeId(){return I.Dy.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}function q(t){switch(t.typeId){case I.Dy.Decimal:return t.bitWidth/32;case I.Dy.Timestamp:return 2;case I.Dy.Date:case I.Dy.Interval:return 1+t.unit;case I.Dy.FixedSizeList:return t.listSize;case I.Dy.FixedSizeBinary:return t.byteWidth;default:return 1}}W[Symbol.toStringTag]=((w=W.prototype).id=null,w.indices=null,w.isOrdered=null,w.dictionary=null,w[Symbol.toStringTag]="Dictionary")},4e3:function(t,e,r){"use strict";function i(t,e,r,i){return(r&1<>i}function s(t,e,r){let n=r.byteLength+7&-8;if(t>0||r.byteLength>3):o(new a(r,t,e,null,i)).subarray(0,n)),s}return r}function o(t){let e=[],r=0,i=0,n=0;for(let s of t)s&&(n|=1<0)&&(e[r++]=n);let s=new Uint8Array(e.length+7&-8);return s.set(e),s}r.d(e,{C9:function(){return o},SM:function(){return function t(e,r,i){if(i-r<=0)return 0;if(i-r<8){let t=0;for(let s of new a(e,r,i-r,e,n))t+=s;return t}let s=i>>3<<3,o=r+(r%8==0?0:8-r%8);return t(e,r,o)+t(e,s,i)+function(t,e,r){let i=0,n=Math.trunc(e),s=new DataView(t.buffer,t.byteOffset,t.byteLength),o=void 0===r?t.byteLength:n+r;for(;o-n>=4;)i+=u(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=u(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=u(s.getUint8(n)),n+=1;return i}(e,o>>3,s-o>>3)}},cB:function(){return s},o4:function(){return i},qD:function(){return n},t9:function(){return a}});class a{constructor(t,e,r,i,n){this.bytes=t,this.length=r,this.context=i,this.get=n,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>>1&1431655765,e=(858993459&e)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}},4755:function(t,e,r){"use strict";let i,n;r.d(e,{BN:function(){return y}});var s=r(7031),o=r(886);let a=Symbol.for("isArrowBigNum");function u(t,...e){return 0===e.length?Object.setPrototypeOf((0,s.AM)(this.TypedArray,t),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(t,...e),this.constructor.prototype)}function l(...t){return u.apply(this,t)}function c(...t){return u.apply(this,t)}function h(...t){return u.apply(this,t)}function d(t){let{buffer:e,byteOffset:r,length:i,signed:n}=t,s=new o.yo(e,r,i),a=n&&s[s.length-1]&BigInt(1)<8===t.byteLength?new t.BigIntArray(t.buffer,t.byteOffset,1)[0]:f(t),i=t=>8===t.byteLength?`${new t.BigIntArray(t.buffer,t.byteOffset,1)[0]}`:f(t)):n=i=f;class y{static new(t,e){switch(e){case!0:return new l(t);case!1:return new c(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case o.lb:return new l(t)}return 16===t.byteLength?new h(t):new c(t)}static signed(t){return new l(t)}static unsigned(t){return new c(t)}static decimal(t){return new h(t)}constructor(t,e){return y.new(t,e)}}},7031:function(t,e,r){"use strict";r.d(e,{$Q:function(){return u},AM:function(){return l},_f:function(){return h},iB:function(){return f},lJ:function(){return y},lf:function(){return p},vk:function(){return c},ys:function(){return b}});var i=r(8395),n=r(5098),s=r(886);let o="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;function a(t,e,r=0,i=e.byteLength){let n=t.byteLength,s=new Uint8Array(t.buffer,t.byteOffset,n),o=new Uint8Array(e.buffer,e.byteOffset,Math.min(i,n));return s.set(o,r),t}function u(t,e){let r,i,n;let s=function(t){let e,r,i,n;let s=t[0]?[t[0]]:[];for(let o,a,u=0,l=0,c=t.length;++ut+e.byteLength,0),u=0,l=-1,c=Math.min(e||Number.POSITIVE_INFINITY,o);for(let t=s.length;++ll(Int32Array,t),h=t=>l(Uint8Array,t),d=t=>(t.next(),t),f=t=>(function*(t,e){let r=function*(t){yield t},i="string"==typeof e?r(e):ArrayBuffer.isView(e)?r(e):e instanceof ArrayBuffer?r(e):e instanceof o?r(e):(0,s.TW)(e)?e:r(e);return yield*d(function*(e){let r=null;do r=e.next((yield l(t,r)));while(!r.done)}(i[Symbol.iterator]())),new t})(Uint8Array,t),y=t=>(function t(e,r){return(0,i.FC)(this,arguments,function*(){if((0,s.tI)(r))return yield(0,i.qq)((yield(0,i.qq)((yield*(0,i.V2)((0,i.KL)(t(e,(yield(0,i.qq)(r)))))))));let n=function(t){return(0,i.FC)(this,arguments,function*(){yield yield(0,i.qq)((yield(0,i.qq)(t)))})},a="string"==typeof r?n(r):ArrayBuffer.isView(r)?n(r):r instanceof ArrayBuffer?n(r):r instanceof o?n(r):(0,s.TW)(r)?function(t){return(0,i.FC)(this,arguments,function*(){yield(0,i.qq)((yield*(0,i.V2)((0,i.KL)(d(function*(t){let e=null;do e=t.next((yield null==e?void 0:e.value));while(!e.done)}(t[Symbol.iterator]()))))))})}(r):(0,s.D0)(r)?r:n(r);return yield(0,i.qq)((yield*(0,i.V2)((0,i.KL)(d(function(t){return(0,i.FC)(this,arguments,function*(){let r=null;do r=yield(0,i.qq)(t.next((yield yield(0,i.qq)(l(e,r)))));while(!r.done)})}(a[Symbol.asyncIterator]())))))),yield(0,i.qq)(new e)})})(Uint8Array,t);function p(t,e,r){if(0!==t){r=r.slice(0,e+1);for(let i=-1;++i<=e;)r[i]+=t}return r}function b(t,e){let r=0,i=t.length;if(i!==e.length)return!1;if(i>0)do if(t[r]!==e[r])return!1;while(++rt+e.nullCount,0)}function s(t){return t.reduce((t,e,r)=>(t[r+1]=t[r]+e.length,t),new Uint32Array(t.length+1))}function o(t,e,r,i){let n=[];for(let s=-1,o=t.length;++s=i)break;if(r>=a+u)continue;if(a>=r&&a+u<=i){n.push(o);continue}let l=Math.max(0,r-a),c=Math.min(i-a,u);n.push(o.slice(l,c-l))}return 0===n.length&&n.push(t[0].slice(0,0)),n}function a(t,e,r,i){let n=0,s=0,o=e.length-1;do{if(n>=o-1)return r{let t=()=>{throw Error("BigInt is not available in this environment")};function e(){throw t()}return e.asIntN=()=>{throw t()},e.asUintN=()=>{throw t()},"undefined"!=typeof BigInt?[BigInt,!0]:[e,!1]})(),[s,o]=(()=>{let t=()=>{throw Error("BigInt64Array is not available in this environment")};return"undefined"!=typeof BigInt64Array?[BigInt64Array,!0]:[class e{static get BYTES_PER_ELEMENT(){return 8}static of(){throw t()}static from(){throw t()}constructor(){throw t()}},!1]})(),[a,u]=(()=>{let t=()=>{throw Error("BigUint64Array is not available in this environment")};return"undefined"!=typeof BigUint64Array?[BigUint64Array,!0]:[class e{static get BYTES_PER_ELEMENT(){return 8}static of(){throw t()}static from(){throw t()}constructor(){throw t()}},!1]})(),l=t=>"number"==typeof t,c=t=>"boolean"==typeof t,h=t=>"function"==typeof t,d=t=>null!=t&&Object(t)===t,f=t=>d(t)&&h(t.then),y=t=>d(t)&&h(t[Symbol.iterator]),p=t=>d(t)&&h(t[Symbol.asyncIterator]),b=t=>d(t)&&d(t.schema),v=t=>d(t)&&"done"in t&&"value"in t,m=t=>d(t)&&h(t.stat)&&l(t.fd),g=t=>d(t)&&S(t.body),_=t=>"_getDOMStream"in t&&"_getNodeStream"in t,w=t=>d(t)&&h(t.abort)&&h(t.getWriter)&&!_(t),S=t=>d(t)&&h(t.cancel)&&h(t.getReader)&&!_(t),I=t=>d(t)&&h(t.end)&&h(t.write)&&c(t.writable)&&!_(t),D=t=>d(t)&&h(t.read)&&h(t.pipe)&&c(t.readable)&&!_(t),A=t=>d(t)&&h(t.clear)&&h(t.bytes)&&h(t.position)&&h(t.setPosition)&&h(t.capacity)&&h(t.getBufferIdentifier)&&h(t.createLong)},3858:function(t,e,r){"use strict";r.d(e,{Gm:function(){return u},ni:function(){return a}});function i(t){return t<0&&(t=4294967295+t+1),`0x${t.toString(16)}`}let n=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class s{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let e=new Uint32Array([this.buffer[1]>>>16,65535&this.buffer[1],this.buffer[0]>>>16,65535&this.buffer[0]]),r=new Uint32Array([t.buffer[1]>>>16,65535&t.buffer[1],t.buffer[0]>>>16,65535&t.buffer[0]]),i=e[3]*r[3];this.buffer[0]=65535&i;let n=i>>>16;return n+=i=e[2]*r[3],n+=i=e[3]*r[2]>>>0,this.buffer[0]+=n<<16,this.buffer[1]=n>>>0>>16,this.buffer[1]+=e[1]*r[3]+e[2]*r[2]+e[3]*r[1],this.buffer[1]+=e[0]*r[3]+e[1]*r[2]+e[2]*r[1]+e[3]*r[0]<<16,this}_plus(t){let e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${i(this.buffer[3])} ${i(this.buffer[2])} ${i(this.buffer[1])} ${i(this.buffer[0])}`}static multiply(t,e){return new u(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new u(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return u.fromString("string"==typeof t?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return u.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){let r=t.startsWith("-"),i=t.length,s=new u(e);for(let e=r?1:0;e>10,r=(1023&t)/1024,i=Math.pow(-1,(32768&t)>>15);switch(e){case 31:return i*(r?Number.NaN:1/0);case 0:return i*(r?6103515625e-14*r:0)}return i*Math.pow(2,e-15)*(1+r)}function o(t){if(t!=t)return 32256;i[0]=t;let e=(2147483648&n[1])>>16&65535,r=2146435072&n[1],s=0;return r>=1089470464?n[0]>0?r=31744:(r=(2080374784&r)>>16,s=(1048575&n[1])>>10):r<=1056964608?(s=1048576+((s=1048576+(1048575&n[1]))<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,s=(1048575&n[1])+512>>10),e|r|65535&s}},6810:function(t,e,r){"use strict";r.d(e,{F:function(){return function t(e){if(null===e)return"null";if(e===n)return"undefined";switch(typeof e){case"number":case"bigint":return`${e}`;case"string":return`"${e}"`}if("function"==typeof e[Symbol.toPrimitive])return e[Symbol.toPrimitive]("string");if(ArrayBuffer.isView(e))return e instanceof i.lb||e instanceof i.yo?`[${[...e].map(e=>t(e))}]`:`[${e}]`;return ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,e)=>"bigint"==typeof e?`${e}`:e)}}});var i=r(886);let n=void 0},4270:function(t,e,r){"use strict";r.d(e,{$:function(){return o}});var i=r(4035),n=r(8870),s=r(814);function o(t,e){return function(t,e){let r=[...t.fields],o=[],a={numBatches:e.reduce((t,e)=>Math.max(t,e.length),0)},u=0,l=0,c=-1,h=e.length,d,f=[];for(;a.numBatches-- >0;){for(l=Number.POSITIVE_INFINITY,c=-1;++c>3;for(let u=-1,l=n.length;++u=e)c===e?r[u]=l:(r[u]=l.slice(0,e),s.numBatches=Math.max(s.numBatches,n[u].unshift(l.slice(e,c-e))));else{let n=t[u];t[u]=n.clone({nullable:!0}),r[u]=null!==(o=null==l?void 0:l._changeLengthAndBackfillNullBitmap(e))&&void 0!==o?o:(0,i._l)({type:n.type,length:e,nullCount:e,nullBitmap:new Uint8Array(a)})}}return r}(r,l,f,e,a),l>0&&(o[u++]=(0,i._l)({type:new n.AU(r),length:l,nullCount:0,children:f.slice()})))}return[t=t.assign(r),o.map(e=>new s.Q(t,e))]}(t,e.map(t=>t.data.concat()))}},5098:function(t,e,r){"use strict";r.d(e,{F:function(){return n},l:function(){return o}});let i=new TextDecoder("utf-8"),n=t=>i.decode(t),s=new TextEncoder,o=t=>s.encode(t)},1410:function(t,e,r){"use strict";let i;r.d(e,{GZ:function(){return c},l$:function(){return u}});var n=r(6927),s=r(1360),o=r(6534),a=r(7031);function u(t,e,r,n){let{length:s=0}=t,o="number"!=typeof e?0:e,a="number"!=typeof r?s:r;return o<0&&(o=(o%s+s)%s),a<0&&(a=(a%s+s)%s),as&&(a=s),n?n(t,o,a):[o,a]}let l=t=>t!=t;function c(t){if("object"!=typeof t||null===t)return l(t)?l:e=>e===t;if(t instanceof Date){let e=t.valueOf();return t=>t instanceof Date&&t.valueOf()===e}return ArrayBuffer.isView(t)?e=>!!e&&(0,a.ys)(t,e):t instanceof Map?function(t){let e=-1,r=[];for(let i of t.values())r[++e]=c(i);return h(r)}(t):Array.isArray(t)?function(t){let e=[];for(let r=-1,i=t.length;++r!1;let i=[];for(let e=-1,n=r.length;++e{if(!r||"object"!=typeof r)return!1;switch(r.constructor){case Array:return function(t,e){let r=t.length;if(e.length!==r)return!1;for(let i=-1;++it.data):t;if(0===n.length||n.some(t=>!(t instanceof o.Vw)))throw TypeError("Vector constructor expects an Array of Data instances.");let u=null===(e=n[0])||void 0===e?void 0:e.type;switch(n.length){case 0:this._offsets=[0];break;case 1:{let{get:t,set:e,indexOf:r,byteLength:i}=f[u.typeId],s=n[0];this.isValid=t=>(0,a.Mk)(s,t),this.get=e=>t(s,e),this.set=(t,r)=>e(s,t,r),this.indexOf=t=>r(s,t),this.getByteLength=t=>i(s,t),this._offsets=[0,s.length];break}default:Object.setPrototypeOf(this,y[u.typeId]),this._offsets=(0,a.mP)(n)}this.data=n,this.type=u,this.stride=(0,s.oS)(u),this.numChildren=null!==(i=null===(r=u.children)||void 0===r?void 0:r.length)&&void 0!==i?i:0,this.length=this._offsets[this._offsets.length-1]}get byteLength(){return -1===this._byteLength&&(this._byteLength=this.data.reduce((t,e)=>t+e.byteLength,0)),this._byteLength}get nullCount(){return -1===this._nullCount&&(this._nullCount=(0,a.$k)(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${i.Dy[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return -1}includes(t,e){return this.indexOf(t,e)>0}getByteLength(t){return 0}[Symbol.iterator](){return h.P.visit(this)}concat(...t){return new p(this.data.concat(t.flatMap(t=>t.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new p((0,n.l$)(this,t,e,({data:t,_offsets:e},r,i)=>(0,a.pv)(t,e,r,i)))}toJSON(){return[...this]}toArray(){let{type:t,data:e,length:r,stride:n,ArrayType:s}=this;switch(t.typeId){case i.Dy.Int:case i.Dy.Float:case i.Dy.Decimal:case i.Dy.Time:case i.Dy.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,r*n);default:return e.reduce((t,{values:e,length:r})=>(t.array.set(e.subarray(0,r*n),t.offset),t.offset+=r*n,t),{array:new s(r*n),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt(null===(e=this.type.children)||void 0===e?void 0:e.findIndex(e=>e.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return!!s.g.isDictionary(this.type)&&this.data[0].dictionary.isMemoized}memoize(){if(s.g.isDictionary(this.type)){let t=new b(this.data[0].dictionary);return new p(this.data.map(e=>{let r=e.clone();return r.dictionary=t,r}))}return new b(this)}unmemoize(){if(s.g.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize();return new p(this.data.map(e=>{let r=e.clone();return r.dictionary=t,r}))}return this}}p[Symbol.toStringTag]=(t=>{for(let e of(t.type=s.g.prototype,t.data=[],t.length=0,t.stride=1,t.numChildren=0,t._nullCount=-1,t._byteLength=-1,t._offsets=new Uint32Array([0]),t[Symbol.isConcatSpreadable]=!0,Object.keys(i.Dy).map(t=>i.Dy[t]).filter(t=>"number"==typeof t&&t!==i.Dy.NONE))){let r=u.e.getVisitFnByTypeId(e),i=l.eE.getVisitFnByTypeId(e),n=c.e.getVisitFnByTypeId(e),s=d.e.getVisitFnByTypeId(e);f[e]={get:r,set:i,indexOf:n,byteLength:s},y[e]=Object.create(t,{isValid:{value:(0,a.uh)(a.Mk)},get:{value:(0,a.uh)(u.e.getVisitFnByTypeId(e))},set:{value:(0,a.ix)(l.eE.getVisitFnByTypeId(e))},indexOf:{value:(0,a.l4)(c.e.getVisitFnByTypeId(e))},getByteLength:{value:(0,a.uh)(d.e.getVisitFnByTypeId(e))}})}return"Vector"})(p.prototype);class b extends p{constructor(t){super(t.data);let e=this.get,r=this.set,i=this.slice,n=Array(this.length);Object.defineProperty(this,"get",{value(t){let r=n[t];if(void 0!==r)return r;let i=e.call(this,t);return n[t]=i,i}}),Object.defineProperty(this,"set",{value(t,e){r.call(this,t,e),n[t]=e}}),Object.defineProperty(this,"slice",{value:(t,e)=>new b(i.call(this,t,e))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new p(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}},593:function(t,e,r){"use strict";r.d(e,{a:function(){return s}});var i=r(6306),n=r(8870);class s{visitMany(t,...e){return t.map((t,r)=>this.visit(t,...e.map(t=>t[r])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return function(t,e,r=!0){return"number"==typeof e?o(t,e,r):"string"==typeof e&&e in i.Dy?o(t,i.Dy[e],r):e&&e instanceof n.g?o(t,a(e),r):(null==e?void 0:e.type)&&e.type instanceof n.g?o(t,a(e.type),r):o(t,i.Dy.NONE,r)}(this,t,e)}getVisitFnByTypeId(t,e=!0){return o(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function o(t,e,r=!0){let n=null;switch(e){case i.Dy.Null:n=t.visitNull;break;case i.Dy.Bool:n=t.visitBool;break;case i.Dy.Int:n=t.visitInt;break;case i.Dy.Int8:n=t.visitInt8||t.visitInt;break;case i.Dy.Int16:n=t.visitInt16||t.visitInt;break;case i.Dy.Int32:n=t.visitInt32||t.visitInt;break;case i.Dy.Int64:n=t.visitInt64||t.visitInt;break;case i.Dy.Uint8:n=t.visitUint8||t.visitInt;break;case i.Dy.Uint16:n=t.visitUint16||t.visitInt;break;case i.Dy.Uint32:n=t.visitUint32||t.visitInt;break;case i.Dy.Uint64:n=t.visitUint64||t.visitInt;break;case i.Dy.Float:n=t.visitFloat;break;case i.Dy.Float16:n=t.visitFloat16||t.visitFloat;break;case i.Dy.Float32:n=t.visitFloat32||t.visitFloat;break;case i.Dy.Float64:n=t.visitFloat64||t.visitFloat;break;case i.Dy.Utf8:n=t.visitUtf8;break;case i.Dy.Binary:n=t.visitBinary;break;case i.Dy.FixedSizeBinary:n=t.visitFixedSizeBinary;break;case i.Dy.Date:n=t.visitDate;break;case i.Dy.DateDay:n=t.visitDateDay||t.visitDate;break;case i.Dy.DateMillisecond:n=t.visitDateMillisecond||t.visitDate;break;case i.Dy.Timestamp:n=t.visitTimestamp;break;case i.Dy.TimestampSecond:n=t.visitTimestampSecond||t.visitTimestamp;break;case i.Dy.TimestampMillisecond:n=t.visitTimestampMillisecond||t.visitTimestamp;break;case i.Dy.TimestampMicrosecond:n=t.visitTimestampMicrosecond||t.visitTimestamp;break;case i.Dy.TimestampNanosecond:n=t.visitTimestampNanosecond||t.visitTimestamp;break;case i.Dy.Time:n=t.visitTime;break;case i.Dy.TimeSecond:n=t.visitTimeSecond||t.visitTime;break;case i.Dy.TimeMillisecond:n=t.visitTimeMillisecond||t.visitTime;break;case i.Dy.TimeMicrosecond:n=t.visitTimeMicrosecond||t.visitTime;break;case i.Dy.TimeNanosecond:n=t.visitTimeNanosecond||t.visitTime;break;case i.Dy.Decimal:n=t.visitDecimal;break;case i.Dy.List:n=t.visitList;break;case i.Dy.Struct:n=t.visitStruct;break;case i.Dy.Union:n=t.visitUnion;break;case i.Dy.DenseUnion:n=t.visitDenseUnion||t.visitUnion;break;case i.Dy.SparseUnion:n=t.visitSparseUnion||t.visitUnion;break;case i.Dy.Dictionary:n=t.visitDictionary;break;case i.Dy.Interval:n=t.visitInterval;break;case i.Dy.IntervalDayTime:n=t.visitIntervalDayTime||t.visitInterval;break;case i.Dy.IntervalYearMonth:n=t.visitIntervalYearMonth||t.visitInterval;break;case i.Dy.FixedSizeList:n=t.visitFixedSizeList;break;case i.Dy.Map:n=t.visitMap}if("function"==typeof n)return n;if(!r)return()=>null;throw Error(`Unrecognized type '${i.Dy[e]}'`)}function a(t){switch(t.typeId){case i.Dy.Null:return i.Dy.Null;case i.Dy.Int:{let{bitWidth:e,isSigned:r}=t;switch(e){case 8:return r?i.Dy.Int8:i.Dy.Uint8;case 16:return r?i.Dy.Int16:i.Dy.Uint16;case 32:return r?i.Dy.Int32:i.Dy.Uint32;case 64:return r?i.Dy.Int64:i.Dy.Uint64}return i.Dy.Int}case i.Dy.Float:switch(t.precision){case i.Gc.HALF:return i.Dy.Float16;case i.Gc.SINGLE:return i.Dy.Float32;case i.Gc.DOUBLE:return i.Dy.Float64}return i.Dy.Float;case i.Dy.Binary:return i.Dy.Binary;case i.Dy.Utf8:return i.Dy.Utf8;case i.Dy.Bool:return i.Dy.Bool;case i.Dy.Decimal:return i.Dy.Decimal;case i.Dy.Time:switch(t.unit){case i.j1.SECOND:return i.Dy.TimeSecond;case i.j1.MILLISECOND:return i.Dy.TimeMillisecond;case i.j1.MICROSECOND:return i.Dy.TimeMicrosecond;case i.j1.NANOSECOND:return i.Dy.TimeNanosecond}return i.Dy.Time;case i.Dy.Timestamp:switch(t.unit){case i.j1.SECOND:return i.Dy.TimestampSecond;case i.j1.MILLISECOND:return i.Dy.TimestampMillisecond;case i.j1.MICROSECOND:return i.Dy.TimestampMicrosecond;case i.j1.NANOSECOND:return i.Dy.TimestampNanosecond}return i.Dy.Timestamp;case i.Dy.Date:switch(t.unit){case i.hQ.DAY:return i.Dy.DateDay;case i.hQ.MILLISECOND:return i.Dy.DateMillisecond}return i.Dy.Date;case i.Dy.Interval:switch(t.unit){case i.wK.DAY_TIME:return i.Dy.IntervalDayTime;case i.wK.YEAR_MONTH:return i.Dy.IntervalYearMonth}return i.Dy.Interval;case i.Dy.Map:return i.Dy.Map;case i.Dy.List:return i.Dy.List;case i.Dy.Struct:return i.Dy.Struct;case i.Dy.Union:switch(t.mode){case i.yj.Dense:return i.Dy.DenseUnion;case i.yj.Sparse:return i.Dy.SparseUnion}return i.Dy.Union;case i.Dy.FixedSizeBinary:return i.Dy.FixedSizeBinary;case i.Dy.FixedSizeList:return i.Dy.FixedSizeList;case i.Dy.Dictionary:return i.Dy.Dictionary}throw Error(`Unrecognized type '${i.Dy[t.typeId]}'`)}s.prototype.visitInt8=null,s.prototype.visitInt16=null,s.prototype.visitInt32=null,s.prototype.visitInt64=null,s.prototype.visitUint8=null,s.prototype.visitUint16=null,s.prototype.visitUint32=null,s.prototype.visitUint64=null,s.prototype.visitFloat16=null,s.prototype.visitFloat32=null,s.prototype.visitFloat64=null,s.prototype.visitDateDay=null,s.prototype.visitDateMillisecond=null,s.prototype.visitTimestampSecond=null,s.prototype.visitTimestampMillisecond=null,s.prototype.visitTimestampMicrosecond=null,s.prototype.visitTimestampNanosecond=null,s.prototype.visitTimeSecond=null,s.prototype.visitTimeMillisecond=null,s.prototype.visitTimeMicrosecond=null,s.prototype.visitTimeNanosecond=null,s.prototype.visitDenseUnion=null,s.prototype.visitSparseUnion=null,s.prototype.visitIntervalDayTime=null,s.prototype.visitIntervalYearMonth=null},5024:function(t,e,r){"use strict";r.d(e,{e:function(){return l}});var i=r(593),n=r(6306);let s=(t,e)=>t+e;class o extends i.a{visitNull(t,e){return 0}visitInt(t,e){return t.type.bitWidth/8}visitFloat(t,e){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,e){return 1/8}visitDecimal(t,e){return t.type.bitWidth/8}visitDate(t,e){return(t.type.unit+1)*4}visitTime(t,e){return t.type.bitWidth/8}visitTimestamp(t,e){return t.type.unit===n.j1.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitStruct(t,e){return t.children.reduce((t,r)=>t+l.visit(r,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((t,r)=>t+l.visit(r,e),0)}visitDictionary(t,e){var r;return t.type.indices.bitWidth/8+((null===(r=t.dictionary)||void 0===r?void 0:r.getByteLength(t.values[e]))||0)}}let a=({type:t,children:e,typeIds:r,valueOffsets:i},n)=>{let s=t.typeIdToChildIndex[r[n]];return 8+l.visit(e[s],i[n])},u=({children:t},e)=>4+l.visitMany(t,t.map(()=>e)).reduce(s,0);o.prototype.visitUtf8=({valueOffsets:t},e)=>8+(t[e+1]-t[e]),o.prototype.visitBinary=({valueOffsets:t},e)=>8+(t[e+1]-t[e]),o.prototype.visitList=({valueOffsets:t,stride:e,children:r},i)=>{let n=r[0],{[i*e]:s}=t,{[i*e+1]:o}=t,a=l.getVisitFn(n.type),u=n.slice(s,o-s),c=8;for(let t=-1,e=o-s;++t{let i=e[0],n=i.slice(r*t,t),s=l.getVisitFn(i.type),o=0;for(let t=-1,e=n.length;++tt.type.mode===n.yj.Dense?a(t,e):u(t,e),o.prototype.visitDenseUnion=a,o.prototype.visitSparseUnion=u;let l=new o},5108:function(t,e,r){"use strict";r.d(e,{e:function(){return k}});var i=r(4755),n=r(6927),s=r(593),o=r(1360),a=r(6534),u=r(5098),l=r(472),c=r(6306);class h extends s.a{}function d(t){return(e,r)=>e.getValid(r)?t(e,r):null}let f=(t,e)=>864e5*t[e],y=(t,e)=>4294967296*t[e+1]+(t[e]>>>0),p=(t,e)=>4294967296*(t[e+1]/1e3)+(t[e]>>>0)/1e3,b=(t,e)=>4294967296*(t[e+1]/1e6)+(t[e]>>>0)/1e6,v=t=>new Date(t),m=(t,e)=>v(f(t,e)),g=(t,e)=>v(y(t,e)),_=(t,e,r)=>{if(r+1>=e.length)return null;let i=e[r],n=e[r+1];return t.subarray(i,n)},w=({values:t},e)=>m(t,e),S=({values:t},e)=>g(t,2*e),I=({stride:t,values:e},r)=>e[t*r],D=({values:t},e)=>t[e],A=({values:t},e)=>1e3*y(t,2*e),O=({values:t},e)=>y(t,2*e),T=({values:t},e)=>p(t,2*e),B=({values:t},e)=>b(t,2*e),x=({values:t},e)=>t[e],M=({values:t},e)=>t[e],E=({values:t},e)=>t[e],F=({values:t},e)=>t[e],N=(t,e)=>{let r=t.type.typeIdToChildIndex[t.typeIds[e]],i=t.children[r];return k.visit(i,t.valueOffsets[e])},L=(t,e)=>{let r=t.type.typeIdToChildIndex[t.typeIds[e]],i=t.children[r];return k.visit(i,e)},U=({values:t},e)=>t.subarray(2*e,2*(e+1)),C=({values:t},e)=>{let r=t[e],i=new Int32Array(2);return i[0]=Math.trunc(r/12),i[1]=Math.trunc(r%12),i};h.prototype.visitNull=d((t,e)=>null),h.prototype.visitBool=d(({offset:t,values:e},r)=>{let i=t+r;return(e[i>>3]&1<t[e]),h.prototype.visitInt8=d(I),h.prototype.visitInt16=d(I),h.prototype.visitInt32=d(I),h.prototype.visitInt64=d(D),h.prototype.visitUint8=d(I),h.prototype.visitUint16=d(I),h.prototype.visitUint32=d(I),h.prototype.visitUint64=d(D),h.prototype.visitFloat=d(({type:t,values:e},r)=>t.precision!==c.Gc.HALF?e[r]:(0,l.v)(e[r])),h.prototype.visitFloat16=d(({stride:t,values:e},r)=>(0,l.v)(e[t*r])),h.prototype.visitFloat32=d(I),h.prototype.visitFloat64=d(I),h.prototype.visitUtf8=d(({values:t,valueOffsets:e},r)=>{let i=_(t,e,r);return null!==i?(0,u.F)(i):null}),h.prototype.visitBinary=d(({values:t,valueOffsets:e},r)=>_(t,e,r)),h.prototype.visitFixedSizeBinary=d(({stride:t,values:e},r)=>e.subarray(t*r,t*(r+1))),h.prototype.visitDate=d((t,e)=>t.type.unit===c.hQ.DAY?w(t,e):S(t,e)),h.prototype.visitDateDay=d(w),h.prototype.visitDateMillisecond=d(S),h.prototype.visitTimestamp=d((t,e)=>{switch(t.type.unit){case c.j1.SECOND:return A(t,e);case c.j1.MILLISECOND:return O(t,e);case c.j1.MICROSECOND:return T(t,e);case c.j1.NANOSECOND:return B(t,e)}}),h.prototype.visitTimestampSecond=d(A),h.prototype.visitTimestampMillisecond=d(O),h.prototype.visitTimestampMicrosecond=d(T),h.prototype.visitTimestampNanosecond=d(B),h.prototype.visitTime=d((t,e)=>{switch(t.type.unit){case c.j1.SECOND:return x(t,e);case c.j1.MILLISECOND:return M(t,e);case c.j1.MICROSECOND:return E(t,e);case c.j1.NANOSECOND:return F(t,e)}}),h.prototype.visitTimeSecond=d(x),h.prototype.visitTimeMillisecond=d(M),h.prototype.visitTimeMicrosecond=d(E),h.prototype.visitTimeNanosecond=d(F),h.prototype.visitDecimal=d(({values:t,stride:e},r)=>i.BN.decimal(t.subarray(e*r,e*(r+1)))),h.prototype.visitList=d((t,e)=>{let{valueOffsets:r,stride:i,children:s}=t,{[e*i]:o,[e*i+1]:a}=r,u=s[0].slice(o,a-o);return new n.O([u])}),h.prototype.visitStruct=d((t,e)=>new a.W(t,e)),h.prototype.visitUnion=d((t,e)=>t.type.mode===c.yj.Dense?N(t,e):L(t,e)),h.prototype.visitDenseUnion=d(N),h.prototype.visitSparseUnion=d(L),h.prototype.visitDictionary=d((t,e)=>{var r;return null===(r=t.dictionary)||void 0===r?void 0:r.get(t.values[e])}),h.prototype.visitInterval=d((t,e)=>t.type.unit===c.wK.DAY_TIME?U(t,e):C(t,e)),h.prototype.visitIntervalDayTime=d(U),h.prototype.visitIntervalYearMonth=d(C),h.prototype.visitFixedSizeList=d((t,e)=>{let{stride:r,children:i}=t,s=i[0].slice(e*r,r);return new n.O([s])}),h.prototype.visitMap=d((t,e)=>{let{valueOffsets:r,children:i}=t,{[e]:n,[e+1]:s}=r,a=i[0];return new o.if(a.slice(n,s-n))});let k=new h},5478:function(t,e,r){"use strict";r.d(e,{e:function(){return c}});var i=r(593),n=r(5108),s=r(4e3),o=r(1410);class a extends i.a{}function u(t,e,r){if(void 0===e)return -1;if(null===e)return function(t,e){let{nullBitmap:r}=t;if(!r||t.nullCount<=0)return -1;let i=0;for(let n of new s.t9(r,t.offset+(e||0),t.length,r,s.o4)){if(!n)return i;++i}return -1}(t,r);let i=n.e.getVisitFn(t),a=(0,o.GZ)(e);for(let e=(r||0)-1,n=t.length;++e0?0:-1},a.prototype.visitBool=u,a.prototype.visitInt=u,a.prototype.visitInt8=u,a.prototype.visitInt16=u,a.prototype.visitInt32=u,a.prototype.visitInt64=u,a.prototype.visitUint8=u,a.prototype.visitUint16=u,a.prototype.visitUint32=u,a.prototype.visitUint64=u,a.prototype.visitFloat=u,a.prototype.visitFloat16=u,a.prototype.visitFloat32=u,a.prototype.visitFloat64=u,a.prototype.visitUtf8=u,a.prototype.visitBinary=u,a.prototype.visitFixedSizeBinary=u,a.prototype.visitDate=u,a.prototype.visitDateDay=u,a.prototype.visitDateMillisecond=u,a.prototype.visitTimestamp=u,a.prototype.visitTimestampSecond=u,a.prototype.visitTimestampMillisecond=u,a.prototype.visitTimestampMicrosecond=u,a.prototype.visitTimestampNanosecond=u,a.prototype.visitTime=u,a.prototype.visitTimeSecond=u,a.prototype.visitTimeMillisecond=u,a.prototype.visitTimeMicrosecond=u,a.prototype.visitTimeNanosecond=u,a.prototype.visitDecimal=u,a.prototype.visitList=u,a.prototype.visitStruct=u,a.prototype.visitUnion=u,a.prototype.visitDenseUnion=l,a.prototype.visitSparseUnion=l,a.prototype.visitDictionary=u,a.prototype.visitInterval=u,a.prototype.visitIntervalDayTime=u,a.prototype.visitIntervalYearMonth=u,a.prototype.visitFixedSizeList=u,a.prototype.visitMap=u;let c=new a},362:function(t,e,r){"use strict";r.d(e,{P:function(){return c}});var i=r(593),n=r(6306),s=r(8870),o=r(3668);class a extends i.a{}function u(t){let{type:e}=t;if(0===t.nullCount&&1===t.stride&&(e.typeId===n.Dy.Timestamp||e instanceof s.J7&&64!==e.bitWidth||e instanceof s.qp&&64!==e.bitWidth||e instanceof s.bv&&e.precision!==n.Gc.HALF))return new o.Xg(t.data.length,e=>{let r=t.data[e];return r.values.subarray(0,r.length)[Symbol.iterator]()});let r=0;return new o.Xg(t.data.length,e=>{let i=t.data[e].length,n=t.slice(r,r+i);return r+=i,new l(n)})}class l{constructor(t){this.vector=t,this.index=0}next(){return this.indexe.visitMany(t.fields,r.children))}visit({name:t},e){let{length:r}=e,{offset:i,nullCount:n,nullBitmap:s}=e,l=u.g.isDictionary(e.type)?e.type.indices:e.type,c=Object.assign([],e.buffers,{[o.w0.VALIDITY]:void 0});return Object.assign({name:t,count:r,VALIDITY:u.g.isNull(l)?void 0:n<=0?Array.from({length:r},()=>1):[...new a.t9(s,i,r,null,a.qD)]},super.visit(e.clone(l,i,r,0,c)))}visitNull(){return{}}visitBool({values:t,offset:e,length:r}){return{DATA:[...new a.t9(t,e,r,null,a.o4)]}}visitInt(t){return{DATA:t.type.bitWidth<64?[...t.values]:[...h(t.values,2)]}}visitFloat(t){return{DATA:[...t.values]}}visitUtf8(t){return{DATA:[...new n.O([t])],OFFSET:[...t.valueOffsets]}}visitBinary(t){return{DATA:[...c(new n.O([t]))],OFFSET:[...t.valueOffsets]}}visitFixedSizeBinary(t){return{DATA:[...c(new n.O([t]))]}}visitDate(t){return{DATA:t.type.unit===o.hQ.DAY?[...t.values]:[...h(t.values,2)]}}visitTimestamp(t){return{DATA:[...h(t.values,2)]}}visitTime(t){return{DATA:t.type.unit`${t}${("0"+(255&e).toString(16)).slice(-2)}`,"").toUpperCase()}function*h(t,e){let r=new Uint32Array(t.buffer);for(let t=-1,n=r.length/e;++t{if(e.setValid(r,null!=i))return t(e,r,i)}}let c=(t,e,r)=>{t[e]=Math.trunc(r/864e5)},h=(t,e,r)=>{t[e]=Math.trunc(r%4294967296),t[e+1]=Math.trunc(r/4294967296)},d=(t,e,r)=>{t[e]=Math.trunc(1e3*r%4294967296),t[e+1]=Math.trunc(1e3*r/4294967296)},f=(t,e,r)=>{t[e]=Math.trunc(1e6*r%4294967296),t[e+1]=Math.trunc(1e6*r/4294967296)},y=(t,e,r,i)=>{if(r+1{t[e]=r},b=({values:t},e,r)=>{t[e]=r},v=({values:t},e,r)=>{t[e]=(0,o.V)(r)},m=({values:t},e,r)=>{c(t,e,r.valueOf())},g=({values:t},e,r)=>{h(t,2*e,r.valueOf())},_=({values:t},e,r)=>h(t,2*e,r/1e3),w=({values:t},e,r)=>h(t,2*e,r),S=({values:t},e,r)=>d(t,2*e,r),I=({values:t},e,r)=>f(t,2*e,r),D=({values:t},e,r)=>{t[e]=r},A=({values:t},e,r)=>{t[e]=r},O=({values:t},e,r)=>{t[e]=r},T=({values:t},e,r)=>{t[e]=r},B=(t,e)=>(r,i,n,s)=>i&&r(i,t,e[s]),x=(t,e)=>(r,i,n,s)=>i&&r(i,t,e.get(s)),M=(t,e)=>(r,i,n,s)=>i&&r(i,t,e.get(n.name)),E=(t,e)=>(r,i,n,s)=>i&&r(i,t,e[n.name]),F=(t,e,r)=>{let i=t.type.typeIdToChildIndex[t.typeIds[e]],n=t.children[i];C.visit(n,t.valueOffsets[e],r)},N=(t,e,r)=>{let i=t.type.typeIdToChildIndex[t.typeIds[e]],n=t.children[i];C.visit(n,e,r)},L=({values:t},e,r)=>{t.set(r.subarray(0,2),2*e)},U=({values:t},e,r)=>{t[e]=12*r[0]+r[1]%12};u.prototype.visitBool=l(({offset:t,values:e},r,i)=>{let n=t+r;i?e[n>>3]|=1<>3]&=~(1<{switch(t.type.precision){case a.Gc.HALF:return v(t,e,r);case a.Gc.SINGLE:case a.Gc.DOUBLE:return b(t,e,r)}}),u.prototype.visitFloat16=l(v),u.prototype.visitFloat32=l(b),u.prototype.visitFloat64=l(b),u.prototype.visitUtf8=l(({values:t,valueOffsets:e},r,i)=>{y(t,e,r,(0,s.l)(i))}),u.prototype.visitBinary=l(({values:t,valueOffsets:e},r,i)=>y(t,e,r,i)),u.prototype.visitFixedSizeBinary=l(({stride:t,values:e},r,i)=>{e.set(i.subarray(0,t),t*r)}),u.prototype.visitDate=l((t,e,r)=>{t.type.unit===a.hQ.DAY?m(t,e,r):g(t,e,r)}),u.prototype.visitDateDay=l(m),u.prototype.visitDateMillisecond=l(g),u.prototype.visitTimestamp=l((t,e,r)=>{switch(t.type.unit){case a.j1.SECOND:return _(t,e,r);case a.j1.MILLISECOND:return w(t,e,r);case a.j1.MICROSECOND:return S(t,e,r);case a.j1.NANOSECOND:return I(t,e,r)}}),u.prototype.visitTimestampSecond=l(_),u.prototype.visitTimestampMillisecond=l(w),u.prototype.visitTimestampMicrosecond=l(S),u.prototype.visitTimestampNanosecond=l(I),u.prototype.visitTime=l((t,e,r)=>{switch(t.type.unit){case a.j1.SECOND:return D(t,e,r);case a.j1.MILLISECOND:return A(t,e,r);case a.j1.MICROSECOND:return O(t,e,r);case a.j1.NANOSECOND:return T(t,e,r)}}),u.prototype.visitTimeSecond=l(D),u.prototype.visitTimeMillisecond=l(A),u.prototype.visitTimeMicrosecond=l(O),u.prototype.visitTimeNanosecond=l(T),u.prototype.visitDecimal=l(({values:t,stride:e},r,i)=>{t.set(i.subarray(0,e),e*r)}),u.prototype.visitList=l((t,e,r)=>{let i=t.children[0],n=t.valueOffsets,s=C.getVisitFn(i);if(Array.isArray(r))for(let t=-1,o=n[e],a=n[e+1];o{let n=t.type.children.map(t=>C.getVisitFn(t.type)),s=r instanceof Map?M(e,r):r instanceof i.O?x(e,r):Array.isArray(r)?B(e,r):E(e,r);t.type.children.forEach((e,r)=>s(n[r],t.children[r],e,r))}),u.prototype.visitUnion=l((t,e,r)=>{t.type.mode===a.yj.Dense?F(t,e,r):N(t,e,r)}),u.prototype.visitDenseUnion=l(F),u.prototype.visitSparseUnion=l(N),u.prototype.visitDictionary=l((t,e,r)=>{var i;null===(i=t.dictionary)||void 0===i||i.set(t.values[e],r)}),u.prototype.visitInterval=l((t,e,r)=>{t.type.unit===a.wK.DAY_TIME?L(t,e,r):U(t,e,r)}),u.prototype.visitIntervalDayTime=l(L),u.prototype.visitIntervalYearMonth=l(U),u.prototype.visitFixedSizeList=l((t,e,r)=>{let{stride:i}=t,n=t.children[0],s=C.getVisitFn(n);if(Array.isArray(r))for(let t=-1,o=e*i;++t{let i=t.children[0],{valueOffsets:n}=t,s=C.getVisitFn(i),{[e]:o,[e+1]:a}=n;for(let t of r instanceof Map?r.entries():Object.entries(r))if(s(i,o,t),++o>=a)break});let C=new u},8750:function(t,e,r){"use strict";r.d(e,{e:function(){return A}});var i=r(6400),n=r(593),s=r(210),o=r(2039),a=r(345),u=r(3324),l=r(1209),c=r(1784),h=r(3603),d=r(3781),f=r(7124),y=r(8725),p=r(7029),b=r(5219),v=r(8888),m=r(6154),g=r(7748),_=r(9022),w=r(4596),S=r(7841),I=i.dK;class D extends n.a{visit(t,e){return null==t||null==e?void 0:super.visit(t,e)}visitNull(t,e){return s.p.startNull(e),s.p.endNull(e)}visitInt(t,e){return o.J.startInt(e),o.J.addBitWidth(e,t.bitWidth),o.J.addIsSigned(e,t.isSigned),o.J.endInt(e)}visitFloat(t,e){return a.j.startFloatingPoint(e),a.j.addPrecision(e,t.precision),a.j.endFloatingPoint(e)}visitBinary(t,e){return u.K.startBinary(e),u.K.endBinary(e)}visitBool(t,e){return l.t.startBool(e),l.t.endBool(e)}visitUtf8(t,e){return c.d.startUtf8(e),c.d.endUtf8(e)}visitDecimal(t,e){return h.t.startDecimal(e),h.t.addScale(e,t.scale),h.t.addPrecision(e,t.precision),h.t.addBitWidth(e,t.bitWidth),h.t.endDecimal(e)}visitDate(t,e){return d.E.startDate(e),d.E.addUnit(e,t.unit),d.E.endDate(e)}visitTime(t,e){return f.q.startTime(e),f.q.addUnit(e,t.unit),f.q.addBitWidth(e,t.bitWidth),f.q.endTime(e)}visitTimestamp(t,e){let r=t.timezone&&e.createString(t.timezone)||void 0;return y.E.startTimestamp(e),y.E.addUnit(e,t.unit),void 0!==r&&y.E.addTimezone(e,r),y.E.endTimestamp(e)}visitInterval(t,e){return p.X.startInterval(e),p.X.addUnit(e,t.unit),p.X.endInterval(e)}visitList(t,e){return b.a.startList(e),b.a.endList(e)}visitStruct(t,e){return v.q.startStruct_(e),v.q.endStruct_(e)}visitUnion(t,e){m.E.startTypeIdsVector(e,t.typeIds.length);let r=m.E.createTypeIdsVector(e,t.typeIds);return m.E.startUnion(e),m.E.addMode(e,t.mode),m.E.addTypeIds(e,r),m.E.endUnion(e)}visitDictionary(t,e){let r=this.visit(t.indices,e);return g.x.startDictionaryEncoding(e),g.x.addId(e,new I(t.id,0)),g.x.addIsOrdered(e,t.isOrdered),void 0!==r&&g.x.addIndexType(e,r),g.x.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return _.Z.startFixedSizeBinary(e),_.Z.addByteWidth(e,t.byteWidth),_.Z.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return w.t.startFixedSizeList(e),w.t.addListSize(e,t.listSize),w.t.endFixedSizeList(e)}visitMap(t,e){return S.D.startMap(e),S.D.addKeysSorted(e,t.keysSorted),S.D.endMap(e)}}let A=new D},1269:function(t,e,r){"use strict";r.d(e,{$F:function(){return p}});var i=r(593);class n extends i.a{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((t,r)=>this.compareFields(t,e[r]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function s(t,e){return e instanceof t.constructor}function o(t,e){return t===e||s(t,e)}function a(t,e){return t===e||s(t,e)&&t.bitWidth===e.bitWidth&&t.isSigned===e.isSigned}function u(t,e){return t===e||s(t,e)&&t.precision===e.precision}function l(t,e){return t===e||s(t,e)&&t.unit===e.unit}function c(t,e){return t===e||s(t,e)&&t.unit===e.unit&&t.timezone===e.timezone}function h(t,e){return t===e||s(t,e)&&t.unit===e.unit&&t.bitWidth===e.bitWidth}function d(t,e){return t===e||s(t,e)&&t.mode===e.mode&&t.typeIds.every((t,r)=>t===e.typeIds[r])&&y.compareManyFields(t.children,e.children)}function f(t,e){return t===e||s(t,e)&&t.unit===e.unit}n.prototype.visitNull=o,n.prototype.visitBool=o,n.prototype.visitInt=a,n.prototype.visitInt8=a,n.prototype.visitInt16=a,n.prototype.visitInt32=a,n.prototype.visitInt64=a,n.prototype.visitUint8=a,n.prototype.visitUint16=a,n.prototype.visitUint32=a,n.prototype.visitUint64=a,n.prototype.visitFloat=u,n.prototype.visitFloat16=u,n.prototype.visitFloat32=u,n.prototype.visitFloat64=u,n.prototype.visitUtf8=o,n.prototype.visitBinary=o,n.prototype.visitFixedSizeBinary=function(t,e){return t===e||s(t,e)&&t.byteWidth===e.byteWidth},n.prototype.visitDate=l,n.prototype.visitDateDay=l,n.prototype.visitDateMillisecond=l,n.prototype.visitTimestamp=c,n.prototype.visitTimestampSecond=c,n.prototype.visitTimestampMillisecond=c,n.prototype.visitTimestampMicrosecond=c,n.prototype.visitTimestampNanosecond=c,n.prototype.visitTime=h,n.prototype.visitTimeSecond=h,n.prototype.visitTimeMillisecond=h,n.prototype.visitTimeMicrosecond=h,n.prototype.visitTimeNanosecond=h,n.prototype.visitDecimal=o,n.prototype.visitList=function(t,e){return t===e||s(t,e)&&t.children.length===e.children.length&&y.compareManyFields(t.children,e.children)},n.prototype.visitStruct=function(t,e){return t===e||s(t,e)&&t.children.length===e.children.length&&y.compareManyFields(t.children,e.children)},n.prototype.visitUnion=d,n.prototype.visitDenseUnion=d,n.prototype.visitSparseUnion=d,n.prototype.visitDictionary=function(t,e){return t===e||s(t,e)&&t.id===e.id&&t.isOrdered===e.isOrdered&&y.visit(t.indices,e.indices)&&y.visit(t.dictionary,e.dictionary)},n.prototype.visitInterval=f,n.prototype.visitIntervalDayTime=f,n.prototype.visitIntervalYearMonth=f,n.prototype.visitFixedSizeList=function(t,e){return t===e||s(t,e)&&t.listSize===e.listSize&&t.children.length===e.children.length&&y.compareManyFields(t.children,e.children)},n.prototype.visitMap=function(t,e){return t===e||s(t,e)&&t.keysSorted===e.keysSorted&&t.children.length===e.children.length&&y.compareManyFields(t.children,e.children)};let y=new n;function p(t,e){return y.compareSchemas(t,e)}},9985:function(t,e,r){"use strict";r.d(e,{M:function(){return h}});var i=r(6927),n=r(593),s=r(6306),o=r(814),a=r(7031),u=r(4e3),l=r(1557),c=r(8870);class h extends n.a{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){let e=t=>t.flatMap(t=>Array.isArray(t)?e(t):t instanceof o.Q?t.data.children:t.data),r=new h;return r.visitMany(e(t)),r}visit(t){if(t instanceof i.O)return this.visitMany(t.data),this;let{type:e}=t;if(!c.g.isDictionary(e)){let{length:r,nullCount:i}=t;if(r>2147483647)throw RangeError("Cannot write arrays larger than 2^31 - 1 in length");!c.g.isNull(e)&&d.call(this,i<=0?new Uint8Array(0):(0,u.cB)(t.offset,r,t.nullBitmap)),this.nodes.push(new l.wm(r,i))}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function d(t){let e=t.byteLength+7&-8;return this.buffers.push(t),this.bufferRegions.push(new l.mg(this._byteLength,e)),this._byteLength+=e,this}function f(t){return d.call(this,t.values.subarray(0,t.length*t.stride))}function y(t){let{length:e,values:r,valueOffsets:i}=t,n=i[0],s=Math.min(i[e]-n,r.byteLength-n);return d.call(this,(0,a.lf)(-i[0],e,i)),d.call(this,r.subarray(n,n+s)),this}function p(t){let{length:e,valueOffsets:r}=t;return r&&d.call(this,(0,a.lf)(r[0],e,r)),this.visit(t.children[0])}function b(t){return this.visitMany(t.type.children.map((e,r)=>t.children[r]).filter(Boolean))[0]}h.prototype.visitBool=function(t){let e;return t.nullCount>=t.length?d.call(this,new Uint8Array(0)):(e=t.values)instanceof Uint8Array?d.call(this,(0,u.cB)(t.offset,t.length,e)):d.call(this,(0,u.C9)(t.values))},h.prototype.visitInt=f,h.prototype.visitFloat=f,h.prototype.visitUtf8=y,h.prototype.visitBinary=y,h.prototype.visitFixedSizeBinary=f,h.prototype.visitDate=f,h.prototype.visitTimestamp=f,h.prototype.visitTime=f,h.prototype.visitDecimal=f,h.prototype.visitList=p,h.prototype.visitStruct=b,h.prototype.visitUnion=function(t){let{type:e,length:r,typeIds:i,valueOffsets:n}=t;if(d.call(this,i),e.mode===s.yj.Sparse)return b.call(this,t);if(e.mode===s.yj.Dense){if(t.offset<=0)return d.call(this,n),b.call(this,t);{let s=i.reduce((t,e)=>Math.max(t,e),i[0]),o=new Int32Array(s+1),u=new Int32Array(s+1).fill(-1),l=new Int32Array(r),c=(0,a.lf)(-n[0],r,n);for(let t,e,n=-1;++n0&&this.readData(t,r)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class f extends d{constructor(t,e,r,i){super(new Uint8Array(0),e,r,i),this.sources=t}readNullBitmap(t,e,{offset:r}=this.nextBufferRange()){return e<=0?new Uint8Array(0):(0,a.C9)(this.sources[r])}readOffsets(t,{offset:e}=this.nextBufferRange()){return(0,h.AM)(Uint8Array,(0,h.AM)(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return(0,h.AM)(Uint8Array,(0,h.AM)(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){let{sources:r}=this;if(s.g.isTimestamp(t))return(0,h.AM)(Uint8Array,l.ni.convertArray(r[e]));if((s.g.isInt(t)||s.g.isTime(t))&&64===t.bitWidth)return(0,h.AM)(Uint8Array,l.ni.convertArray(r[e]));if(s.g.isDate(t)&&t.unit===c.hQ.MILLISECOND)return(0,h.AM)(Uint8Array,l.ni.convertArray(r[e]));else if(s.g.isDecimal(t))return(0,h.AM)(Uint8Array,l.Gm.convertArray(r[e]));else if(s.g.isBinary(t)||s.g.isFixedSizeBinary(t))return function(t){let e=t.join(""),r=new Uint8Array(e.length/2);for(let t=0;t>1]=Number.parseInt(e.slice(t,t+2),16);return r}(r[e]);else if(s.g.isBool(t))return(0,a.C9)(r[e]);else if(s.g.isUtf8(t))return(0,u.l)(r[e].join(""));return(0,h.AM)(Uint8Array,(0,h.AM)(t.ArrayType,r[e].map(t=>+t)))}}},8395:function(t,e,r){"use strict";r.d(e,{FC:function(){return o},KL:function(){return u},V2:function(){return a},mG:function(){return i},qq:function(){return s}});function i(t,e,r,i){return new(r||(r=Promise))(function(n,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?n(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(o,a)}u((i=i.apply(t,e||[])).next())})}function n(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(t){return this instanceof s?(this.v=t,this):new s(t)}function o(t,e,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,n=r.apply(t,e||[]),o=[];return i={},a("next"),a("throw"),a("return",function(t){return function(e){return Promise.resolve(e).then(t,c)}}),i[Symbol.asyncIterator]=function(){return this},i;function a(t,e){n[t]&&(i[t]=function(e){return new Promise(function(r,i){o.push([t,e,r,i])>1||u(t,e)})},e&&(i[t]=e(i[t])))}function u(t,e){try{(function(t){t.value instanceof s?Promise.resolve(t.value.v).then(l,c):h(o[0][2],t)})(n[t](e))}catch(t){h(o[0][3],t)}}function l(t){u("next",t)}function c(t){u("throw",t)}function h(t,e){t(e),o.shift(),o.length&&u(o[0][0],o[0][1])}}function a(t){var e,r;return e={},i("next"),i("throw",function(t){throw t}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(i,n){e[i]=t[i]?function(e){return(r=!r)?{value:s(t[i](e)),done:!1}:n?n(e):e}:n}}function u(t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=n(t),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(r){e[r]=t[r]&&function(e){return new Promise(function(i,n){(function(t,e,r,i){Promise.resolve(i).then(function(e){t({value:e,done:r})},e)})(i,n,(e=t[r](e)).done,e.value)})}}}},9471:function(t,e,r){"use strict";function i(t,e,r){let i=t.value,n=e+(r||""),s=document.activeElement,o=0,a=0;for(;o=0&&n.length-a-1>=0&&i[i.length-a-1]===n[n.length-a-1];)a++;o=Math.min(o,Math.min(i.length,n.length)-a),t.setSelectionRange(o,i.length-a);let u=n.substring(o,n.length-a);if(t.focus(),!document.execCommand("insertText",!1,u)){t.value=n;let e=document.createEvent("Event");e.initEvent("input",!0,!0),t.dispatchEvent(e)}return t.setSelectionRange(e.length,e.length),s.focus(),t}function n(t,e,r){let n=t.selectionEnd,s=t.value.substr(0,t.selectionStart)+e,o=t.value.substring(t.selectionStart,n)+(r||"")+t.value.substr(n);return i(t,s,o),t.selectionEnd=n+e.length,t}r.r(e),r.d(e,{update:function(){return i},wrapCursor:function(){return n}})}},e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var s=e[i]={exports:{}};return t[i].call(s.exports,s,s.exports,r),s.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};(()=>{"use strict";var t=r(4490),e=r(9973);var i=r(6946),n=r(847);function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r1&&void 0!==arguments[1]?arguments[1]:[],n=(e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r,i,n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var s=[],o=!0,a=!1;try{for(n=n.call(t);!(o=(r=n.next()).done)&&(s.push(r.value),!e||s.length!==e);o=!0);}catch(t){a=!0,i=t}finally{try{!o&&null!=n.return&&n.return()}finally{if(a)throw i}}return s}}(e,2)||function(t,e){if(t){if("string"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(t,e)}}(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=n[0],a=n[1],u=Function("return "+t.search)(),l=Function("return "+t.replace)(),c=t.template&&Function("return "+t.template)(),h=t.context&&Function("return "+t.context)();return Array.isArray(i)&&i.length&&o&&a&&(u=function(t,e,r){e(i.filter(function(e){return"".concat(e[o]).toLowerCase().includes(t.toLowerCase())}))},l=function(t){return"".concat(t[a])}),{id:t.id,index:t.index,cache:t.cache,match:new RegExp(t.match),search:u,replace:l,template:c,context:h}},a=function(t,e){if(!t.area_label)throw Error("Textcomplete: No label provided.");var r=t.area_label;if(!t.strategies||!Array.isArray(t.strategies))throw Error("Textcomplete: No strategies provided.");var i=t.strategies.map(function(t){return o(t,t.data,t.comparatorKeys)});!i.length&&console.warn("Textcomplete: No strategies provided. There will be no autocomplete.");var n={dropdown:Object.assign({parent:window.parent.document.querySelector("#root")},t.dropdown_option)},s="\n :root {\n --background-color: ".concat(e.backgroundColor,";\n --secondary-background-color: ").concat(e.secondaryBackgroundColor,";\n --text-color: ").concat(e.textColor,";\n --primary-color: ").concat(e.primaryColor,";\n };\n ");return{label:r,strategies:i,option:n,css:s}};t.ll.events.addEventListener(t.ll.RENDER_EVENT,function(r){var n=a(r.detail.args,r.detail.theme),s=n.label,o=n.strategies,u=n.option,l=n.css,c=window.parent.document.querySelector('textarea[aria-label="'.concat(s,'"]'));if(c.textcompleteInitialized){console.warn("Textcomplete already initialized for this textarea.");return}var h=document.createElement("style");h.innerHTML=document.querySelector("style").innerHTML+"\n"+l,window.parent.document.head.appendChild(h);var d=new i.TextareaEditor(c),f=new e.Textcomplete(d,o,u);c.textcompleteInitialized=!0,c.setAttribute("data-textcomplete",JSON.stringify(r.detail.args.dropdown_option)),f.on("selected",function(t){var e=t.detail.searchResult,r=c.value;delete e.strategy,console.log("Textcomplete selected",e),console.log("Text value",r)}),t.ll.setFrameHeight()}),t.ll.setComponentReady()})()})(); +(()=>{var e={344:function(e,t,n){"use strict";function r(e,t){for(var n=0;no&&(e.left=o-r),this.el.style.left="".concat(e.left,"px")}else e.right&&(e.right-r<0&&(e.right=0),this.el.style.right="".concat(e.right,"px"));var i=!1,a=this.option.placement||t.DEFAULT_DROPDOWN_PLACEMENT;if("auto"===a){var c=this.items.length*e.lineHeight;i=null!=e.clientTop&&e.clientTop+c>n.clientHeight}"top"===a||i?(this.el.style.bottom="".concat(n.clientHeight-e.top+e.lineHeight,"px"),this.el.style.top="auto"):(this.el.style.top="".concat(e.top,"px"),this.el.style.bottom="auto")}return this}},{key:"getNextActiveIndex",value:function(){if(null==this.activeIndex)throw Error();return this.activeIndex0)||void 0===arguments[0]||arguments[0];return this.completer.destroy(),this.dropdown.destroy(),e&&this.editor.destroy(),this.stopListening(),this}},{key:"isShown",value:function(){return this.dropdown.isShown()}},{key:"hide",value:function(){return this.dropdown.hide(),this}},{key:"trigger",value:function(e){return this.isQueryInFlight?this.nextPendingQuery=e:(this.isQueryInFlight=!0,this.nextPendingQuery=null,this.completer.run(e)),this}},{key:"startListening",value:function(){var e=this;this.editor.on("move",this.handleMove).on("enter",this.handleEnter).on("esc",this.handleEsc).on("change",this.handleChange),this.dropdown.on("select",this.handleSelect);var t=!0,n=!1,r=void 0;try{for(var o,i,a,c=u[Symbol.iterator]();!(t=(a=c.next()).done);t=!0)i=this,function(){var t=a.value;i.dropdown.on(t,function(n){return e.emit(t,n)})}()}catch(e){n=!0,r=e}finally{try{!t&&null!=c.return&&c.return()}finally{if(n)throw r}}this.completer.on("hit",this.handleHit),null===(o=this.dropdown.el.ownerDocument.defaultView)||void 0===o||o.addEventListener("resize",this.handleResize)}},{key:"stopListening",value:function(){var e;null===(e=this.dropdown.el.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",this.handleResize),this.completer.removeAllListeners(),this.dropdown.removeAllListeners(),this.editor.removeListener("move",this.handleMove).removeListener("enter",this.handleEnter).removeListener("esc",this.handleEsc).removeListener("change",this.handleChange)}}],r(a.prototype,l),h}(a.EventEmitter);t.Textcomplete=l},973:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(344),t),o(n(329),t),o(n(937),t),o(n(363),t),o(n(134),t),o(n(946),t),o(n(125),t)},125:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCustomEvent=void 0;var n="undefined"!=typeof window&&!!window.CustomEvent;t.createCustomEvent=function(e,t){if(n)return new CustomEvent(e,t);var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,!1,(null==t?void 0:t.cancelable)||!1,(null==t?void 0:t.detail)||void 0),r}},248:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,a){if("function"!=typeof r)throw TypeError("The listener must be a function");var c=new o(r,i||e,a),s=n?n+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],c]:e._events[s].push(c):(e._events[s]=c,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function c(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),!new r().__proto__&&(n=!1)),c.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},c.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=Array(i);oparseInt(l.height)&&(u.overflowY="scroll"):u.overflow="hidden",s.textContent=e.value.substring(0,o),f&&(s.textContent=s.textContent.replace(/\s/g,"\xa0"));var d=document.createElement("span");d.textContent=e.value.substring(o)||".",s.appendChild(d);var h={top:d.offsetTop+parseInt(l.borderTopWidth),left:d.offsetLeft+parseInt(l.borderLeftWidth),height:parseInt(l.lineHeight)};return a?d.style.backgroundColor="#aaa":document.body.removeChild(s),h}void 0!==e.exports?e.exports=o:n&&(window.getCaretCoordinates=o)}()},714:function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:[],i=(t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){c=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(c)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],c=i[1],s=Function("return "+e.search)(),u=Function("return "+e.replace)(),l=e.template&&Function("return "+e.template)(),f=e.context&&Function("return "+e.context)();return Array.isArray(o)&&o.length&&a&&c&&(s=function(e,t,n){t(o.filter(function(t){return"".concat(t[a]).toLowerCase().includes(e.toLowerCase())}))},u=function(e){return"".concat(e[c])}),{id:e.id,index:e.index,cache:e.cache,match:new RegExp(e.match),search:s,replace:u,template:l,context:f}},i=function(e,t){if(!e.area_label)throw Error("Textcomplete: No label provided.");var n=e.area_label,r=e.stop_enter_propagation||!1;if(!e.strategies||!Array.isArray(e.strategies))throw Error("Textcomplete: No strategies provided.");var i=e.strategies.map(function(e){return o(e,e.data,e.comparatorKeys)});!i.length&&console.warn("Textcomplete: No strategies provided. There will be no autocomplete.");var a={dropdown:Object.assign({},e.dropdown_option)},c="\n :root {\n --background-color: ".concat(t.backgroundColor,";\n --secondary-background-color: ").concat(t.secondaryBackgroundColor,";\n --text-color: ").concat(t.textColor,";\n --primary-color: ").concat(t.primaryColor,";\n };\n ");return{label:n,strategies:i,option:a,stopEnterPropagation:r,css:c}}},460:function(e,t,n){"use strict";function r(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}n.d(t,{l:function(){return c}});var o,i,a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?e.argsDataframeToObject(t.dfs):{};n=a(a({},n),r);var o=!!t.disabled,i=t.theme;i&&s(i);var c={disabled:o,args:n,theme:i},u=new CustomEvent(e.RENDER_EVENT,{detail:c});e.events.dispatchEvent(u)},e.argsDataframeToObject=function(e){return null},e.toArrowTable=function(e){return null},e.sendBackMsg=function(e,t){window.parent.postMessage(a({isStreamlitMessage:!0,type:e},t),"*")},e}(),s=function(e){var t=document.createElement("style");document.head.appendChild(t),t.innerHTML="\n :root {\n --primary-color: ".concat(e.primaryColor,";\n --background-color: ").concat(e.backgroundColor,";\n --secondary-background-color: ").concat(e.secondaryBackgroundColor,";\n --text-color: ").concat(e.textColor,";\n --font: ").concat(e.font,";\n }\n\n body {\n background-color: var(--background-color);\n color: var(--text-color);\n }\n ")}},471:function(e,t,n){"use strict";function r(e,t,n){let r=e.value,o=t+(n||""),i=document.activeElement,a=0,c=0;for(;a=0&&o.length-c-1>=0&&r[r.length-c-1]===o[o.length-c-1];)c++;a=Math.min(a,Math.min(r.length,o.length)-c),e.setSelectionRange(a,r.length-c);let s=o.substring(a,o.length-c);if(e.focus(),!document.execCommand("insertText",!1,s)){e.value=o;let t=document.createEvent("Event");t.initEvent("input",!0,!0),e.dispatchEvent(t)}return e.setSelectionRange(t.length,t.length),i.focus(),e}function o(e,t,n){let o=e.selectionEnd,i=e.value.substr(0,e.selectionStart)+t,a=e.value.substring(e.selectionStart,o)+(n||"")+e.value.substr(o);return r(e,i,a),e.selectionEnd=o+t.length,e}n.r(t),n.d(t,{update:function(){return r},wrapCursor:function(){return o}})}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};(()=>{"use strict";var e=n(460),t=n(973);var r=n(790),o=n(714);e.l.events.addEventListener(e.l.RENDER_EVENT,function(n){var i=(0,o.a)(n.detail.args,n.detail.theme),a=i.label,c=i.strategies,s=i.option,u=i.stopEnterPropagation,l=i.css,f=window.parent.document.querySelector("#root"),d=window.parent.document.querySelector('textarea[aria-label="'.concat(a,'"]'));if(d.textcompleteInitialized){console.warn("Textcomplete already initialized for this textarea.");return}var h=document.createElement("style");h.innerHTML=document.querySelector("style").innerHTML+"\n"+l,window.parent.document.head.appendChild(h),s.dropdown.parent=d.parentElement||f;var p=new r.TextareaEditor(d),v=new t.Textcomplete(p,c,s);d.textcompleteInitialized=!0,d.setAttribute("data-textcomplete",JSON.stringify(n.detail.args.dropdown_option)),u&&d.setAttribute("data-textcomplete-stopenterpropagation",!0),v.on("rendered",function(){d.parentElement.querySelector(".textcomplete-dropdown").style.top="4px"}),v.on("selected",function(e){var t=e.detail.searchResult,n=d.value;delete t.strategy,console.log("Textcomplete selected",t),console.log("Text value",n);var r=new InputEvent("textInput",{data:" ",bubbles:!0,cancelable:!1});Object.defineProperty(r,"target",{writable:!1,value:d}),Object.defineProperty(r,"srcElement",{writable:!1,value:d});var o=new Event("change",{bubbles:!0,cancelable:!1});Object.defineProperty(o,"target",{writable:!1,value:d}),o._reactName="onChange",o.nativeEvent=r,f.dispatchEvent(o),d.dispatchEvent(o)}),e.l.setFrameHeight()}),e.l.setComponentReady()})()})(); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/jest.config.ts b/textcomplete/frontend/jest.config.ts similarity index 100% rename from jest.config.ts rename to textcomplete/frontend/jest.config.ts diff --git a/textcomplete/frontend/package-lock.json b/textcomplete/frontend/package-lock.json index 6674744..b47d13a 100644 --- a/textcomplete/frontend/package-lock.json +++ b/textcomplete/frontend/package-lock.json @@ -27,6 +27,7 @@ "husky": "^8.0.3", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", + "patch-package": "^8.0.0", "prettier": "3.0.3" }, "engines": { @@ -2390,6 +2391,13 @@ "license": "Apache-2.0", "peer": true }, + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true, + "license": "BSD-2-Clause" + }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -2826,6 +2834,16 @@ "dev": true, "license": "MIT" }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -5225,6 +5243,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "micromatch": "^4.0.2" + } + }, "node_modules/flat-cache": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", @@ -5318,6 +5346,32 @@ "node": ">= 0.6" } }, + "node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fs-extra/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/fs-monkey": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.6.tgz", @@ -7433,6 +7487,25 @@ "dev": true, "license": "MIT" }, + "node_modules/json-stable-stringify": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.1.1.tgz", + "integrity": "sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -7440,6 +7513,13 @@ "dev": true, "license": "MIT" }, + "node_modules/json-stable-stringify/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -7453,6 +7533,39 @@ "node": ">=6" } }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonfile/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "dev": true, + "license": "Public Domain", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -7463,6 +7576,16 @@ "json-buffer": "3.0.1" } }, + "node_modules/klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.11" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -8075,6 +8198,16 @@ "node": ">= 0.8.0" } }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -8212,6 +8345,91 @@ "node": ">= 0.8" } }, + "node_modules/patch-package": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", + "integrity": "sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^9.0.0", + "json-stable-stringify": "^1.0.2", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "rimraf": "^2.6.3", + "semver": "^7.5.3", + "slash": "^2.0.0", + "tmp": "^0.0.33", + "yaml": "^2.2.2" + }, + "bin": { + "patch-package": "index.js" + }, + "engines": { + "node": ">=14", + "npm": ">5" + } + }, + "node_modules/patch-package/node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/patch-package/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/patch-package/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/patch-package/node_modules/slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -9865,6 +10083,19 @@ "dev": true, "license": "MIT" }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -10895,6 +11126,19 @@ "dev": true, "license": "ISC" }, + "node_modules/yaml": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", + "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/yargs": { "version": "17.6.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", diff --git a/textcomplete/frontend/package.json b/textcomplete/frontend/package.json index 002acb9..055a2fb 100644 --- a/textcomplete/frontend/package.json +++ b/textcomplete/frontend/package.json @@ -1,10 +1,11 @@ { "name": "streamlit-textcomplete", "version": "0.0.1", - "description": "Textcomplete editor for HTMLTextAreaElement", + "description": "Streamlit autocomplete Textcomplete editor for HTMLTextAreaElement", "main": "index.js", - "_type": "module", "scripts": { + "postinstall": "patch-package", + "rspack": "rspack", "build": "rspack build", "dev": "rspack dev", "test": "jest" @@ -35,6 +36,7 @@ "husky": "^8.0.3", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", + "patch-package": "^8.0.0", "prettier": "3.0.3" }, "overrides": { diff --git a/textcomplete/frontend/patches/@textcomplete+textarea+0.1.13.patch b/textcomplete/frontend/patches/@textcomplete+textarea+0.1.13.patch new file mode 100644 index 0000000..500d410 --- /dev/null +++ b/textcomplete/frontend/patches/@textcomplete+textarea+0.1.13.patch @@ -0,0 +1,14 @@ +diff --git a/node_modules/@textcomplete/textarea/dist/TextareaEditor.js b/node_modules/@textcomplete/textarea/dist/TextareaEditor.js +index c2ed775..461197e 100644 +--- a/node_modules/@textcomplete/textarea/dist/TextareaEditor.js ++++ b/node_modules/@textcomplete/textarea/dist/TextareaEditor.js +@@ -23,6 +23,9 @@ class TextareaEditor extends core_1.Editor { + } + else if (code === "ENTER") { + event = this.emitEnterEvent(); ++ if (el.dataset['textcompleteStopenterpropagation'] === 'true') { ++ e.stopImmediatePropagation() ++ } + } + else if (code === "ESC") { + event = this.emitEscEvent(); diff --git a/textcomplete/frontend/project.json b/textcomplete/frontend/project.json deleted file mode 100644 index 546ad88..0000000 --- a/textcomplete/frontend/project.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "streamlit-textcomplete-frontend", - "$schema": "../../../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "packages/streamlit-textcomplete/frontend", - "projectType": "application", - "targets": {}, - "tags": [] -} diff --git a/textcomplete/frontend/src/helpers.js b/textcomplete/frontend/src/helpers.js new file mode 100644 index 0000000..dce3ea3 --- /dev/null +++ b/textcomplete/frontend/src/helpers.js @@ -0,0 +1,76 @@ +/** + * Convert stringified functions back into functions + * @param {import('@textcomplete/core').StrategyProps} props + * @param {any[]} data + * @param {string} key + */ +export const convertStrategyProps = (props, data = [], [labelKey, valueKey] = []) => { + let searchFn = new Function('return ' + props.search)(); + let replaceFn = new Function('return ' + props.replace)(); + let templateFn = props.template && new Function('return ' + props.template)(); + let contextFn = props.context && new Function('return ' + props.context)(); + // If data is provided, create a default search function that filters the data by key + if (Array.isArray(data) && data.length && labelKey && valueKey) { + // (Required) When the current input matches the "match" regexp above, this + // function is called. The first argument is the captured substring. + // You can callback only once for each search. + searchFn = (term, callback, match) => { + const filteredData = data.filter(item => + `${item[labelKey]}`.toLowerCase().includes(term.toLowerCase()) + ); + callback(filteredData); + }; + // (Required) Specify how to update the editor value. The whole substring + // matched in the match phase will be replaced by the returned value. + // Note that it can return a string or an array of two strings. If it returns + // an array, the matched substring will be replaced by the concatenated string + // and the cursor will be set between first and second strings. + replaceFn = item => `${item[valueKey]}`; + } + return { + id: props.id, + index: props.index, + cache: props.cache, + match: new RegExp(props.match), + search: searchFn, + replace: replaceFn, + template: templateFn, + context: contextFn, + }; +}; + +/** + * Parse the Textcomplete args + * @param {any} args + * @param {any} theme + * */ +// @returns {import('@textcomplete/core').TextcompleteOption} +export const parseTextcompleteArgs = (args, theme) => { + if (!args.area_label) { + throw new Error('Textcomplete: No label provided.'); + } + const label = args.area_label; + const stopEnterPropagation = args.stop_enter_propagation || false; + if (!args.strategies || !Array.isArray(args.strategies)) { + throw new Error('Textcomplete: No strategies provided.'); + } + const strategies = args.strategies.map(s => + convertStrategyProps(s, s.data, s.comparatorKeys) + ); + if (!strategies.length) { + console.warn('Textcomplete: No strategies provided. There will be no autocomplete.'); + } + const option = { + dropdown: Object.assign({}, args.dropdown_option), + }; + const variables = ` + :root { + --background-color: ${theme.backgroundColor}; + --secondary-background-color: ${theme.secondaryBackgroundColor}; + --text-color: ${theme.textColor}; + --primary-color: ${theme.primaryColor}; + }; + `; + const css = variables; + return { label, strategies, option, stopEnterPropagation, css }; +}; diff --git a/textcomplete/frontend/src/index.js b/textcomplete/frontend/src/index.js index 4947668..99039ec 100644 --- a/textcomplete/frontend/src/index.js +++ b/textcomplete/frontend/src/index.js @@ -1,8 +1,8 @@ /* eslint-disable no-new-func */ -import { Streamlit } from 'streamlit-component-lib'; +import { Streamlit } from './streamlit'; import { Textcomplete } from '@textcomplete/core'; import { TextareaEditor } from '@textcomplete/textarea'; -import {} from '@textcomplete/utils'; +import { parseTextcompleteArgs } from './helpers'; /** * Event handler for textcomplete event @@ -11,88 +11,7 @@ import {} from '@textcomplete/utils'; * @param {Object} e.detail - The detail of the event. * @param {import('@textcomplete/core').SearchResult} e.detail.searchResult - The search result. */ - - -/** - * Convert stringified functions back into functions - * @param {import('@textcomplete/core').StrategyProps} props - * @param {any[]} data - * @param {string} key - */ -const convertStrategyProps = (props, data = [], [labelKey, valueKey] = []) => { - let searchFn = new Function('return ' + props.search)(); - let replaceFn = new Function('return ' + props.replace)(); - let templateFn = props.template && new Function('return ' + props.template)(); - let contextFn = props.context && new Function('return ' + props.context)(); - // If data is provided, create a default search function that filters the data by key - if (Array.isArray(data) && data.length && labelKey && valueKey) { - // (Required) When the current input matches the "match" regexp above, this - // function is called. The first argument is the captured substring. - // You can callback only once for each search. - searchFn = (term, callback, match) => { - const filteredData = data.filter(item => - `${item[labelKey]}`.toLowerCase().includes(term.toLowerCase()) - ); - callback(filteredData); - }; - // (Required) Specify how to update the editor value. The whole substring - // matched in the match phase will be replaced by the returned value. - // Note that it can return a string or an array of two strings. If it returns - // an array, the matched substring will be replaced by the concatenated string - // and the cursor will be set between first and second strings. - replaceFn = (item) => `${item[valueKey]}`; - } - return { - id: props.id, - index: props.index, - cache: props.cache, - match: new RegExp(props.match), - search: searchFn, - replace: replaceFn, - template: templateFn, - context: contextFn, - }; -}; - -/** - * Parse the Textcomplete args - * @param {any} args - * @param {any} theme - * */ -// @returns {import('@textcomplete/core').TextcompleteOption} -const parseTextcompleteArgs = (args, theme) => { - if (!args.area_label) { - throw new Error('Textcomplete: No label provided.'); - } - const label = args.area_label; - if (!args.strategies || !Array.isArray(args.strategies)) { - throw new Error('Textcomplete: No strategies provided.'); - } - const strategies = args.strategies.map(s => - convertStrategyProps(s, s.data, s.comparatorKeys) - ); - if (!strategies.length) { - console.warn('Textcomplete: No strategies provided. There will be no autocomplete.'); - } - const option = { - dropdown: Object.assign( - { - parent: window.parent.document.querySelector('#root'), - }, - args.dropdown_option - ), - }; - const variables = ` - :root { - --background-color: ${theme.backgroundColor}; - --secondary-background-color: ${theme.secondaryBackgroundColor}; - --text-color: ${theme.textColor}; - --primary-color: ${theme.primaryColor}; - }; - `; - const css = variables; - return { label, strategies, option, css }; -}; +// ----------------------------------------------------------------------------- /** * The component's render function. This will be called immediately after @@ -103,11 +22,11 @@ const parseTextcompleteArgs = (args, theme) => { */ function onRender(event) { // Get the RenderData from the event - const { label, strategies, option, css } = parseTextcompleteArgs( + const { label, strategies, option, stopEnterPropagation, css } = parseTextcompleteArgs( event.detail.args, event.detail.theme ); - + const rootElement = window.parent.document.querySelector('#root'); const textareaElement = window.parent.document.querySelector( `textarea[aria-label="${label}"]` ); @@ -123,6 +42,8 @@ function onRender(event) { style.innerHTML = document.querySelector('style').innerHTML + '\n' + css; window.parent.document.head.appendChild(style); + option.dropdown.parent = textareaElement.parentElement || rootElement; + const editor = new TextareaEditor(textareaElement); const textcomplete = new Textcomplete(editor, strategies, option); @@ -133,7 +54,18 @@ function onRender(event) { 'data-textcomplete', JSON.stringify(event.detail.args.dropdown_option) ); - + if (stopEnterPropagation) { + textareaElement.setAttribute('data-textcomplete-stopenterpropagation', true); + } + /** + * Adjust position of dropdown when rendered + */ + textcomplete.on('rendered', () => { + const dropdownElement = textareaElement.parentElement.querySelector( + '.textcomplete-dropdown' + ); + dropdownElement.style.top = '4px'; + }); /** * Event handler for 'selected' event * @param {string} ename @@ -142,9 +74,31 @@ function onRender(event) { textcomplete.on('selected', e => { const { searchResult } = e.detail; const text = textareaElement.value; + // textareaElement.value += ' '; delete searchResult.strategy; console.log('Textcomplete selected', searchResult); console.log('Text value', text); + + // Create a new InputEvent object with the same properties and methods as the native event object + const nativeEvent = new InputEvent('textInput', { + data: ' ', + bubbles: true, + cancelable: false, + }); + Object.defineProperty(nativeEvent, 'target', { writable: false, value: textareaElement }); + Object.defineProperty(nativeEvent, 'srcElement', { writable: false, value: textareaElement }); + // Create a new synthetic event object with the same properties and methods as the synthetic event object that is created by React + const changeEvent = new Event('change', { + bubbles: true, + cancelable: false, + }); + Object.defineProperty(changeEvent, 'target', { writable: false, value: textareaElement }); + // Attach the synthetic event object to the native event object using the _reactName property + changeEvent._reactName = 'onChange'; + changeEvent.nativeEvent = nativeEvent; + // Dispatch the native event object on the textarea element + rootElement.dispatchEvent(changeEvent); + textareaElement.dispatchEvent(changeEvent) // Streamlit.setComponentValue({ searchResult, text }); // FIXME: updating component causes re-render and resets textarea value by original react component state }); diff --git a/textcomplete/frontend/src/streamlit.d.ts b/textcomplete/frontend/src/streamlit.d.ts new file mode 100644 index 0000000..df0ede9 --- /dev/null +++ b/textcomplete/frontend/src/streamlit.d.ts @@ -0,0 +1,92 @@ +/** + * Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { ArrowTable } from "./ArrowTable"; +/** Object defining the currently set theme. */ +export interface Theme { + base: string; + primaryColor: string; + backgroundColor: string; + secondaryBackgroundColor: string; + textColor: string; + font: string; +} +/** Data sent in the custom Streamlit render event. */ +export interface RenderData { + args: ArgType; + disabled: boolean; + theme?: Theme; +} +type ComponentValue = ArrowTable | TypedArray | ArrayBuffer | any; +/** + * Streamlit communication API. + * + * Components can send data to Streamlit via the functions defined here, + * and receive data from Streamlit via the `events` property. + */ +export declare class Streamlit { + /** + * The Streamlit component API version we're targeting. + * There's currently only 1! + */ + static readonly API_VERSION = 1; + static readonly RENDER_EVENT = "streamlit:render"; + /** Dispatches events received from Streamlit. */ + static readonly events: EventTarget; + private static registeredMessageListener; + private static lastFrameHeight?; + /** + * Tell Streamlit that the component is ready to start receiving data. + * Streamlit will defer emitting RENDER events until it receives the + * COMPONENT_READY message. + */ + static setComponentReady: () => void; + /** + * Report the component's height to Streamlit. + * This should be called every time the component changes its DOM - that is, + * when it's first loaded, and any time it updates. + */ + static setFrameHeight: (height?: number) => void; + /** + * Set the component's value. This value will be returned to the Python + * script, and the script will be re-run. + * + * For example: + * + * JavaScript: + * Streamlit.setComponentValue("ahoy!") + * + * Python: + * value = st.my_component(...) + * st.write(value) # -> "ahoy!" + * + * The value must be an ArrowTable, a typed array, an ArrayBuffer, or be + * serializable to JSON. + */ + static setComponentValue: (value: ComponentValue) => void; + /** Receive a ForwardMsg from the Streamlit app */ + private static onMessageEvent; + /** + * Handle an untyped Streamlit render event and redispatch it as a + * StreamlitRenderEvent. + */ + private static onRenderMessage; + private static argsDataframeToObject; + private static toArrowTable; + /** Post a message to the Streamlit app. */ + private static sendBackMsg; +} +type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array; +export {}; diff --git a/textcomplete/frontend/src/streamlit.js b/textcomplete/frontend/src/streamlit.js new file mode 100644 index 0000000..d6c0696 --- /dev/null +++ b/textcomplete/frontend/src/streamlit.js @@ -0,0 +1,205 @@ +/** + * Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +// Safari doesn't support the EventTarget class, so we use a shim. +/** Messages from Component -> Streamlit */ +var ComponentMessageType; +(function (ComponentMessageType) { + // A component sends this message when it's ready to receive messages + // from Streamlit. Streamlit won't send any messages until it gets this. + // Data: { apiVersion: number } + ComponentMessageType["COMPONENT_READY"] = "streamlit:componentReady"; + // The component has a new widget value. Send it back to Streamlit, which + // will then re-run the app. + // Data: { value: any } + ComponentMessageType["SET_COMPONENT_VALUE"] = "streamlit:setComponentValue"; + // The component has a new height for its iframe. + // Data: { height: number } + ComponentMessageType["SET_FRAME_HEIGHT"] = "streamlit:setFrameHeight"; +})(ComponentMessageType || (ComponentMessageType = {})); +/** + * Streamlit communication API. + * + * Components can send data to Streamlit via the functions defined here, + * and receive data from Streamlit via the `events` property. + */ +export var Streamlit = /** @class */ (function () { + function Streamlit() { + } + /** + * The Streamlit component API version we're targeting. + * There's currently only 1! + */ + Streamlit.API_VERSION = 1; + Streamlit.RENDER_EVENT = "streamlit:render"; + /** Dispatches events received from Streamlit. */ + Streamlit.events = new EventTarget(); + Streamlit.registeredMessageListener = false; + /** + * Tell Streamlit that the component is ready to start receiving data. + * Streamlit will defer emitting RENDER events until it receives the + * COMPONENT_READY message. + */ + Streamlit.setComponentReady = function () { + if (!Streamlit.registeredMessageListener) { + // Register for message events if we haven't already + window.addEventListener("message", Streamlit.onMessageEvent); + Streamlit.registeredMessageListener = true; + } + Streamlit.sendBackMsg(ComponentMessageType.COMPONENT_READY, { + apiVersion: Streamlit.API_VERSION + }); + }; + /** + * Report the component's height to Streamlit. + * This should be called every time the component changes its DOM - that is, + * when it's first loaded, and any time it updates. + */ + Streamlit.setFrameHeight = function (height) { + if (height === undefined) { + // `height` is optional. If undefined, it defaults to scrollHeight, + // which is the entire height of the element minus its border, + // scrollbar, and margin. + height = document.body.scrollHeight; + } + if (height === Streamlit.lastFrameHeight) { + // Don't bother updating if our height hasn't changed. + return; + } + Streamlit.lastFrameHeight = height; + Streamlit.sendBackMsg(ComponentMessageType.SET_FRAME_HEIGHT, { height: height }); + }; + /** + * Set the component's value. This value will be returned to the Python + * script, and the script will be re-run. + * + * For example: + * + * JavaScript: + * Streamlit.setComponentValue("ahoy!") + * + * Python: + * value = st.my_component(...) + * st.write(value) # -> "ahoy!" + * + * The value must be a typed array, an ArrayBuffer, or be + * serializable to JSON. + */ + Streamlit.setComponentValue = function (value) { + var dataType; + if (isTypedArray(value)) { + // All typed arrays get sent as Uint8Array, because that's what our + // protobuf library uses for the "bytes" field type. + dataType = "bytes"; + value = new Uint8Array(value.buffer); + } + else if (value instanceof ArrayBuffer) { + dataType = "bytes"; + value = new Uint8Array(value); + } + else { + dataType = "json"; + } + Streamlit.sendBackMsg(ComponentMessageType.SET_COMPONENT_VALUE, { + value: value, + dataType: dataType + }); + }; + /** Receive a ForwardMsg from the Streamlit app */ + Streamlit.onMessageEvent = function (event) { + var type = event.data["type"]; + switch (type) { + case Streamlit.RENDER_EVENT: + Streamlit.onRenderMessage(event.data); + break; + } + }; + /** + * Handle an untyped Streamlit render event and redispatch it as a + * StreamlitRenderEvent. + */ + Streamlit.onRenderMessage = function (data) { + var args = data["args"]; + if (args == null) { + console.error("Got null args in onRenderMessage. This should never happen"); + args = {}; + } + // Parse our dataframe arguments with arrow, and merge them into our args dict + var dataframeArgs = data["dfs"] && data["dfs"].length > 0 + ? Streamlit.argsDataframeToObject(data["dfs"]) + : {}; + args = __assign(__assign({}, args), dataframeArgs); + var disabled = Boolean(data["disabled"]); + var theme = data["theme"]; + if (theme) { + _injectTheme(theme); + } + // Dispatch a render event! + var eventData = { disabled: disabled, args: args, theme: theme }; + var event = new CustomEvent(Streamlit.RENDER_EVENT, { + detail: eventData + }); + Streamlit.events.dispatchEvent(event); + }; + Streamlit.argsDataframeToObject = function (argsDataframe) { + return null; + }; + Streamlit.toArrowTable = function (df) { + return null; + }; + /** Post a message to the Streamlit app. */ + Streamlit.sendBackMsg = function (type, data) { + window.parent.postMessage(__assign({ isStreamlitMessage: true, type: type }, data), "*"); + }; + return Streamlit; +}()); +var _injectTheme = function (theme) { + var style = document.createElement("style"); + document.head.appendChild(style); + style.innerHTML = "\n :root {\n --primary-color: ".concat(theme.primaryColor, ";\n --background-color: ").concat(theme.backgroundColor, ";\n --secondary-background-color: ").concat(theme.secondaryBackgroundColor, ";\n --text-color: ").concat(theme.textColor, ";\n --font: ").concat(theme.font, ";\n }\n\n body {\n background-color: var(--background-color);\n color: var(--text-color);\n }\n "); +}; +/** True if the value is a TypedArray. */ +function isTypedArray(value) { + var isBigIntArray = false; + try { + isBigIntArray = + value instanceof BigInt64Array || value instanceof BigUint64Array; + } + catch (e) { + // Ignore cause Safari does not support this + // https://caniuse.com/mdn-javascript_builtins_bigint64array + } + return (value instanceof Int8Array || + value instanceof Uint8Array || + value instanceof Uint8ClampedArray || + value instanceof Int16Array || + value instanceof Uint16Array || + value instanceof Int32Array || + value instanceof Uint32Array || + value instanceof Float32Array || + value instanceof Float64Array || + isBigIntArray); +} diff --git a/textcomplete/test___init__.py b/textcomplete/test___init__.py index b1b60f2..743ccb3 100644 --- a/textcomplete/test___init__.py +++ b/textcomplete/test___init__.py @@ -1,73 +1,10 @@ -import pandas as pd import pytest -from textcomplete import get_dataframe_by_schema - - -def test_get_dataframe_by_schema(): - # Test case 1: Empty schema - schema = {} - expected_df = pd.DataFrame() - assert get_dataframe_by_schema(schema).equals(expected_df) - - # Test case 2: Schema with string properties - schema = { - "properties": { - "name": {"type": "string"}, - "age": {"type": "string"}, - "city": {"type": "string"}, - } - } - expected_df = pd.DataFrame( - { - "name": pd.Series(dtype="object"), - "age": pd.Series(dtype="object"), - "city": pd.Series(dtype="object"), - } - ) - assert get_dataframe_by_schema(schema).equals(expected_df) - - # Test case 3: Schema with boolean properties - schema = { - "properties": {"is_active": {"type": "boolean"}, "has_permission": {"type": "boolean"}} - } - expected_df = pd.DataFrame( - {"is_active": pd.Series(dtype="bool"), "has_permission": pd.Series(dtype="bool")} - ) - assert get_dataframe_by_schema(schema).equals(expected_df) - - -def test_get_dataframe_by_schema(): - # Test case 1: Empty schema - schema = {} - expected_df = pd.DataFrame() - assert get_dataframe_by_schema(schema).equals(expected_df) - - # Test case 2: Schema with string properties - schema = { - "properties": { - "name": {"type": "string"}, - "age": {"type": "string"}, - "city": {"type": "string"}, - } - } - expected_df = pd.DataFrame( - { - "name": pd.Series(dtype="object"), - "age": pd.Series(dtype="object"), - "city": pd.Series(dtype="object"), - } - ) - assert get_dataframe_by_schema(schema).equals(expected_df) - - # Test case 3: Schema with boolean properties - schema = { - "properties": {"is_active": {"type": "boolean"}, "has_permission": {"type": "boolean"}} - } - expected_df = pd.DataFrame( - {"is_active": pd.Series(dtype="bool"), "has_permission": pd.Series(dtype="bool")} - ) - assert get_dataframe_by_schema(schema).equals(expected_df) +from textcomplete import ( # noqa: F401 + TextcompleteResult, + StrategyProps, + textcomplete, +) if __name__ == "__main__":