From a96ed3f3fb7ad1fedfe180c55b3b130ffa1a6068 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 18 Jul 2026 11:50:25 +0000 Subject: [PATCH 1/3] Add cross-artifact scanners: text_layer_recall and numeric_provenance (v0.6.1) Gold answers can now be checked against extraction artifacts on disk. --files-root resolves // per record; every non-empty *.txt / *.md file there (except ground_truth.* and index.md) is treated as one extraction tool's text output. - text_layer_recall (consensus-aware): gold words found by no tool are high-severity typo/hallucination candidates; for full-page gold, words found by every tool but missing from the gold are medium-severity omissions. LaTeX math spans are excluded from the existence check (they render as glyphs) but still count as gold coverage; ligatures are NFKC-normalised and hyphenated linebreaks re-joined. - numeric_provenance: every number in the gold (comma/$-normalised) must appear in at least one tool output; misses are high-severity transcription-error candidates, anchored to their gold line. Validated against a real 14-sample benchmark corpus with a 4-tool extraction cache: zero findings on the clean corpus; seeded typos (one digit, one word) are caught by both scanners. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01LLg5cbBcfNyyrRGJVPfsA6 --- PLAN.md | 40 ++--- README.md | 28 ++- src/inspect_dataset/cli.py | 25 +++ src/inspect_dataset/scanners/__init__.py | 4 + src/inspect_dataset/scanners/_artifacts.py | 104 +++++++++++ .../scanners/numeric_provenance.py | 66 +++++++ .../scanners/text_layer_recall.py | 104 +++++++++++ tests/test_cross_artifact.py | 166 ++++++++++++++++++ 8 files changed, 508 insertions(+), 29 deletions(-) create mode 100644 src/inspect_dataset/scanners/_artifacts.py create mode 100644 src/inspect_dataset/scanners/numeric_provenance.py create mode 100644 src/inspect_dataset/scanners/text_layer_recall.py create mode 100644 tests/test_cross_artifact.py diff --git a/PLAN.md b/PLAN.md index 6a7d0f0..fdb1e4d 100644 --- a/PLAN.md +++ b/PLAN.md @@ -484,26 +484,26 @@ Design principles: - Benchmark-format-specific checks (frontmatter schema, financial checksums, JSON↔markdown cross-checks) live in the benchmark repo (e.g. `my_benchmark.audit.scanners`) and are loaded via `--scanner-module`. - The benchmark's extraction cache (per-sample page images, per-tool outputs) is the bridge for cross-artifact and viewer features — no bespoke extraction logic here. -#### v0.6.0 — Local loader, markdown scanners, plugin scanners - -- [ ] `Finding.line` — optional 1-based line number so markdown scanners can anchor findings to a location in the gold file (viewer highlighting later) -- [ ] `loader.py`: `load_local_samples(dir)` — loads a directory of JSON annotation files; resolves sidecar markdown via `*_path` convention (`ground_truth_markdown_path`), strips YAML frontmatter into `__frontmatter__`, records `__md_body_offset__` so findings can report real file line numbers; synthesises `question` from task/source fields; `answer` = gold markdown body (or embedded `ground_truth_table.markdown`) -- [ ] CLI: a dataset argument that is an existing directory routes to the local loader (`source_type="local"`, `split=None`) -- [ ] `markdown_integrity` scanner — gold markdown parses cleanly: pipe-table rows with inconsistent column counts, missing/malformed delimiter rows, fully-empty table rows, heading-level jumps, broken/empty image links -- [ ] `extraction_artifacts` scanner — characters that betray un-cleaned PDF extraction: ligatures (U+FB00–FB06), soft hyphens, zero-width chars, NBSP, BOM, U+FFFD replacement char -- [ ] `--scanner-module` CLI option (repeatable) — import a module, collect its `ScannerDef`s (module-level `SCANNERS` list, else attribute scan); plugin scanner names participate in `--scanners` filtering -- [ ] Benchmark-side plugin scanners (live in the benchmark repo): - - [ ] `frontmatter_consistency` — sidecar frontmatter agrees with the JSON annotation (page vs `page_number`, source vs `pdf_path` basename, tier) - - [ ] `json_md_agreement` — `ground_truth_table.rows` agrees cell-by-cell with the embedded `ground_truth_table.markdown` - - [ ] `numeric_checksum` — "Total …" rows in gold tables must equal a contiguous run of the numeric rows above them (catches transcription typos in financial tables) - - [ ] `sidecar_consistency` — orphan `.md` files no JSON references, missing sidecars, broken `![…](assets/…)` links - -#### v0.6.1 — Cross-artifact scanners (gold vs the PDF) - -- [ ] `--files-root` so scanners can resolve per-sample artifacts (source PDF, cached `page.png`, per-tool outputs) -- [ ] `text_layer_recall` — word-align gold markdown against the PDF text layer (from the pipeline cache); flag gold tokens absent from the PDF (typos/hallucinations) and PDF tokens absent from gold (omissions); skip `ocr_resistant` samples -- [ ] `numeric_provenance` — every number in gold must appear verbatim in the text layer -- [ ] `tool_consensus` — when top extraction tools agree with each other but all disagree with gold at the same spot, flag the gold (static sibling of the v0.5 `universal_failure` idea, seeded from cached per-tool scores) +#### v0.6.0 — Local loader, markdown scanners, plugin scanners ✓ + +- [x] `Finding.line` — optional 1-based line number so markdown scanners can anchor findings to a location in the gold file (viewer highlighting later) +- [x] `loader.py`: `load_local_samples(dir)` — loads a directory of JSON annotation files; resolves sidecar markdown via `*_path` convention (`ground_truth_markdown_path`), strips YAML frontmatter into `__frontmatter__`, records `__md_body_offset__` so findings can report real file line numbers; synthesises `question` from task/source fields; `answer` = gold markdown body (or embedded `ground_truth_table.markdown`) +- [x] CLI: a dataset argument that is an existing directory routes to the local loader (`source_type="local"`, `split=None`) +- [x] `markdown_integrity` scanner — gold markdown parses cleanly: pipe-table rows with inconsistent column counts, missing/malformed delimiter rows, fully-empty table rows, heading-level jumps, broken/empty image links +- [x] `extraction_artifacts` scanner — characters that betray un-cleaned PDF extraction: ligatures (U+FB00–FB06), soft hyphens, zero-width chars, NBSP, BOM, U+FFFD replacement char +- [x] `--scanner-module` CLI option (repeatable) — import a module, collect its `ScannerDef`s (module-level `SCANNERS` list, else attribute scan); plugin scanner names participate in `--scanners` filtering +- [x] Benchmark-side plugin scanners (live in the benchmark repo): + - [x] `frontmatter_consistency` — sidecar frontmatter agrees with the JSON annotation (page vs `page_number`, source vs `pdf_path` basename, tier) + - [x] `json_md_agreement` — `ground_truth_table.rows` agrees cell-by-cell with the embedded `ground_truth_table.markdown` + - [x] `numeric_checksum` — "Total …" rows in gold tables must equal a contiguous run of the numeric rows above them (catches transcription typos in financial tables) + - [x] `sidecar_consistency` — orphan `.md` files no JSON references, missing sidecars, broken `![…](assets/…)` links + +#### v0.6.1 — Cross-artifact scanners (gold vs the extraction cache) ✓ + +- [x] `--files-root` — resolves `//` per record; every non-empty `*.txt`/`*.md` there (except `ground_truth.*` and `index.md`) is one tool's text output +- [x] `text_layer_recall` — consensus-aware: gold words found by *no* tool are flagged high (typo/hallucination candidates); for full-page gold (`task_type` contains "page"), words found by *every* tool but absent from gold are flagged medium (omissions). LaTeX math spans are excluded from the existence check (they render as glyphs) but count as gold coverage. Skips `ocr_resistant` samples and hyphen-joins tool text linebreaks +- [x] `numeric_provenance` — every number in gold (comma/`$`-normalised) must appear in at least one tool output; misses are high-severity transcription-error candidates +- [x] `tool_consensus` — folded into `text_layer_recall`'s none-of-the-tools / all-of-the-tools semantics rather than shipping as a separate score-based scanner #### v0.6.2 — Vision LLM scanners diff --git a/README.md b/README.md index 343f479..98c81ef 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,12 @@ inspect-dataset scan flaviagiammarino/vqa-rad --max-answer-words 6 # Limit samples loaded inspect-dataset scan flaviagiammarino/vqa-rad --limit 500 +# Scan a local annotation directory (JSON samples + sidecar markdown gold), +# cross-checking gold against cached extraction-tool outputs +inspect-dataset scan path/to/samples/ \ + --files-root path/to/extraction-cache/ \ + --scanner-module my_benchmark.audit.scanners + # Run LLM-powered scanners (requires --model) inspect-dataset scan flaviagiammarino/vqa-rad \ --model openai/gpt-4o-mini --split test -o findings/ @@ -105,15 +111,19 @@ uv run inspect-dataset view results/vqa-rad/ results/medqa/ ## Scanners -| Scanner | Severity | What it flags | -| ----------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| `answer_length` | medium | Answers longer than N words (default: 4). Long answers are unlikely to be reproduced verbatim by exact-match scorers. | -| `duplicate_questions` | high | Questions that appear more than once. Duplicates inflate sample counts and bias metrics. | -| `inconsistent_format` | low/medium | Capitalisation, punctuation, or length deviations from the dataset majority (80%+ threshold). | -| `answer_distribution` | high | Datasets where a single answer accounts for ≥85% of samples — a model that always predicts that answer would score highly without any understanding. | -| `forced_choice_leakage` | medium | Questions offering explicit options via "or" where the answer is one of those options. | -| `encoding_issues` | low | Questions or answers containing non-printable or control characters. | -| `binary_question_ratio` | low | Datasets where a high proportion of questions are binary (yes/no). | +| Scanner | Severity | What it flags | +| ----------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `answer_length` | medium | Answers longer than N words (default: 4). Long answers are unlikely to be reproduced verbatim by exact-match scorers. | +| `duplicate_questions` | high | Questions that appear more than once. Duplicates inflate sample counts and bias metrics. | +| `inconsistent_format` | low/medium | Capitalisation, punctuation, or length deviations from the dataset majority (80%+ threshold). | +| `answer_distribution` | high | Datasets where a single answer accounts for ≥85% of samples — a model that always predicts that answer would score highly without any understanding. | +| `forced_choice_leakage` | medium | Questions offering explicit options via "or" where the answer is one of those options. | +| `encoding_issues` | low | Questions or answers containing non-printable or control characters. | +| `binary_question_ratio` | low | Datasets where a high proportion of questions are binary (yes/no). | +| `markdown_integrity` | low/medium | Structural problems in Markdown answers: table column-count mismatches, missing delimiter rows, heading jumps, empty image links. | +| `extraction_artifacts` | low/medium | Characters betraying un-cleaned PDF/OCR extraction: ligatures, soft hyphens, zero-width characters, U+FFFD. | +| `text_layer_recall` | medium/high | With `--files-root`: gold words no extraction tool found on the page (typo candidates); for full-page gold, words every tool found that gold omits. | +| `numeric_provenance` | high | With `--files-root`: numbers in the gold that no extraction tool extracted from the page — strong transcription-error candidates. | ### LLM Scanners (require `--model`) diff --git a/src/inspect_dataset/cli.py b/src/inspect_dataset/cli.py index cf5e6b8..2e495a1 100644 --- a/src/inspect_dataset/cli.py +++ b/src/inspect_dataset/cli.py @@ -135,6 +135,16 @@ def cli() -> None: show_default=True, help="Threshold for the answer_length scanner.", ) +@click.option( + "--files-root", + default=None, + type=click.Path(exists=True, file_okay=False), + help=( + "Directory of per-sample extraction artifacts (// " + "with tool text outputs). Enables the cross-artifact scanners " + "text_layer_recall and numeric_provenance." + ), +) @click.option("--limit", default=None, type=int, help="Cap number of samples loaded.") @click.option( "-o", @@ -158,6 +168,7 @@ def scan( scanner_modules: tuple[str, ...], model: str | None, max_answer_words: int, + files_root: str | None, limit: int | None, output_dir: str | None, ) -> None: @@ -253,6 +264,20 @@ def scan( records = load_hf_dataset(dataset, split=split, revision=revision, limit=limit) fields = resolve_fields(records, question_field, answer_field, id_field, image_field) + if files_root is not None: + from inspect_dataset.scanner import get_sample_id as _gsid + + root = Path(files_root) + attached = 0 + for idx, record in enumerate(records): + sample_dir = root / str(_gsid(record, fields, idx)) + if sample_dir.is_dir(): + record["__artifacts_dir__"] = str(sample_dir) + attached += 1 + console.print( + f" Artifacts: {attached}/{len(records)} samples have a directory under {root}" + ) + console.print(f" Loaded {len(records):,} samples.") console.print( f" Fields: question=[bold]{fields.question}[/bold] " diff --git a/src/inspect_dataset/scanners/__init__.py b/src/inspect_dataset/scanners/__init__.py index a4f3f38..ac30944 100644 --- a/src/inspect_dataset/scanners/__init__.py +++ b/src/inspect_dataset/scanners/__init__.py @@ -18,6 +18,8 @@ _make_scanner as _make_label_correctness, ) from inspect_dataset.scanners.markdown_integrity import markdown_integrity +from inspect_dataset.scanners.numeric_provenance import numeric_provenance +from inspect_dataset.scanners.text_layer_recall import text_layer_recall BUILTIN_SCANNERS: list[ScannerDef] = [ answer_length, @@ -30,6 +32,8 @@ image_mime_type, markdown_integrity, extraction_artifacts, + text_layer_recall, + numeric_provenance, ] BUILTIN_SCANNER_NAMES: dict[str, ScannerDef] = {s.name: s for s in BUILTIN_SCANNERS} diff --git a/src/inspect_dataset/scanners/_artifacts.py b/src/inspect_dataset/scanners/_artifacts.py new file mode 100644 index 0000000..646cb9e --- /dev/null +++ b/src/inspect_dataset/scanners/_artifacts.py @@ -0,0 +1,104 @@ +"""Shared helpers for cross-artifact scanners. + +Cross-artifact scanners compare gold answers against extraction artifacts on +disk (tool outputs from the benchmark's extraction cache). Records opt in by +carrying ``__artifacts_dir__`` — set by the CLI's ``--files-root`` option, +which resolves ``//`` per record. Within an artifacts +directory, every non-empty ``*.txt`` / ``*.md`` file except ``ground_truth.*`` +and ``index.md`` is treated as one extraction tool's text output. +""" + +from __future__ import annotations + +import re +import unicodedata +from pathlib import Path + +from inspect_dataset._types import Record + +_TABLE_DELIMITER = re.compile(r"^\|[\s:|-]+\|?\s*$") +_IMAGE_LINK = re.compile(r"!\[[^\]]*\]\([^)]*\)") +_LINK = re.compile(r"\[([^\]]*)\]\([^)]*\)") +_HEADING_PREFIX = re.compile(r"^#{1,6}\s+") +# LaTeX math renders as glyphs in the PDF (\tau -> τ), so math spans cannot be +# verified against a text layer and are excluded from token extraction. +_MATH_SPAN = re.compile(r"\$\$.*?\$\$|\$[^$\n]*\$", re.DOTALL) +_NUMBER = re.compile(r"\d[\d,]*(?:\.\d+)?") +_WORD = re.compile(r"[a-z]{2,}") + + +def tool_texts(record: Record) -> dict[str, str]: + """Read the non-empty tool text outputs for a record, keyed by file stem.""" + artifacts_dir = record.get("__artifacts_dir__") + if not artifacts_dir: + return {} + directory = Path(str(artifacts_dir)) + texts: dict[str, str] = {} + for path in sorted(directory.glob("*")): + if path.suffix not in (".txt", ".md"): + continue + if path.name == "index.md" or path.stem.startswith("ground_truth"): + continue + try: + text = path.read_text() + except OSError: + continue + if text.strip(): + # Re-join words hyphenated across line breaks before tokenising. + texts[path.stem] = text.replace("-\n", "") + return texts + + +def strip_markdown(text: str, strip_math: bool = True) -> str: + r"""Reduce markdown to comparable text. + + ``strip_math`` removes LaTeX math spans entirely — right for checking + whether gold content exists on the page (LaTeX commands never appear in a + text layer), wrong for checking what the gold covers (math spans can + contain literal words like ``\text{apply}`` that do render on the page). + """ + if strip_math: + text = _MATH_SPAN.sub(" ", text) + lines = [] + for line in text.splitlines(): + stripped = line.strip() + if _TABLE_DELIMITER.match(stripped): + continue + stripped = _IMAGE_LINK.sub(" ", stripped) + stripped = _LINK.sub(r"\1", stripped) + stripped = _HEADING_PREFIX.sub("", stripped) + stripped = stripped.replace("|", " ").replace("**", "").replace("`", "") + lines.append(stripped) + return "\n".join(lines) + + +def word_tokens(text: str) -> set[str]: + return set(_WORD.findall(unicodedata.normalize("NFKC", text).lower())) + + +def number_sources(text: str) -> dict[str, str]: + """Map each normalised number to its first original spelling in text.""" + numbers: dict[str, str] = {} + for match in _NUMBER.findall(unicodedata.normalize("NFKC", text)): + normalised = match.replace(",", "").rstrip(".") + if normalised and normalised not in numbers: + numbers[normalised] = match + return numbers + + +def number_tokens(text: str) -> set[str]: + return set(number_sources(text)) + + +def find_line(text: str, needle: str) -> int | None: + """1-based line of the first case-insensitive occurrence of needle.""" + lowered = needle.lower() + for line_no, line in enumerate(text.splitlines(), start=1): + if lowered in line.lower(): + return line_no + return None + + +def body_offset(record: Record) -> int: + offset = record.get("__md_body_offset__", 0) + return offset if isinstance(offset, int) else 0 diff --git a/src/inspect_dataset/scanners/numeric_provenance.py b/src/inspect_dataset/scanners/numeric_provenance.py new file mode 100644 index 0000000..5242555 --- /dev/null +++ b/src/inspect_dataset/scanners/numeric_provenance.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from inspect_dataset._types import FieldMap, Finding, Record +from inspect_dataset.scanner import ScannerDef, get_sample_id +from inspect_dataset.scanners._artifacts import ( + body_offset, + find_line, + number_sources, + number_tokens, + strip_markdown, + tool_texts, +) + +_MAX_LISTED = 10 + + +def _scan(records: list[Record], fields: FieldMap) -> list[Finding]: + findings: list[Finding] = [] + for i, record in enumerate(records): + if record.get("ocr_resistant"): + continue + texts = tool_texts(record) + if not texts: + continue + gold_raw = str(record.get(fields.answer, "") or "") + sources = number_sources(strip_markdown(gold_raw)) + gold_numbers = set(sources) + if not gold_numbers: + continue + seen = set().union(*(number_tokens(t) for t in texts.values())) + missing = sorted(gold_numbers - seen, key=lambda n: (len(n), n)) + if not missing: + continue + listed = ", ".join(missing[:_MAX_LISTED]) + extra = len(missing) - _MAX_LISTED + line = find_line(gold_raw, sources[missing[0]]) + findings.append( + Finding( + scanner="numeric_provenance", + severity="high", + category="label_quality", + explanation=( + f"{len(missing)} number(s) in the gold appear in none of the " + f"{len(texts)} extraction tool outputs for this page: {listed}" + + (f" (+{extra} more)" if extra > 0 else "") + + ". Numbers that no tool extracted are strong " + "transcription-error candidates." + ), + sample_index=i, + sample_id=get_sample_id(record, fields, i), + line=(line + body_offset(record)) if line is not None else None, + metadata={"missing_numbers": missing[:50], "tools": sorted(texts)}, + ) + ) + return findings + + +numeric_provenance = ScannerDef( + name="numeric_provenance", + fn=_scan, + description=( + "Cross-check every number in the gold against cached extraction tool " + "outputs (requires --files-root): a number no tool extracted from the " + "page is a strong transcription-error candidate." + ), +) diff --git a/src/inspect_dataset/scanners/text_layer_recall.py b/src/inspect_dataset/scanners/text_layer_recall.py new file mode 100644 index 0000000..0e13c62 --- /dev/null +++ b/src/inspect_dataset/scanners/text_layer_recall.py @@ -0,0 +1,104 @@ +from __future__ import annotations + +from inspect_dataset._types import FieldMap, Finding, Record +from inspect_dataset.scanner import ScannerDef, get_sample_id +from inspect_dataset.scanners._artifacts import ( + body_offset, + find_line, + strip_markdown, + tool_texts, + word_tokens, +) + +_MAX_LISTED = 12 + + +def _scan(records: list[Record], fields: FieldMap) -> list[Finding]: + findings: list[Finding] = [] + for i, record in enumerate(records): + if record.get("ocr_resistant"): + continue + texts = tool_texts(record) + if not texts: + continue + gold_raw = str(record.get(fields.answer, "") or "") + gold = word_tokens(strip_markdown(gold_raw)) + if not gold: + continue + gold_covering = word_tokens(strip_markdown(gold_raw, strip_math=False)) + per_tool = [word_tokens(t) for t in texts.values()] + union = set().union(*per_tool) + intersection = set.intersection(*per_tool) + sample_id = get_sample_id(record, fields, i) + + # Tokens no extraction tool saw anywhere on the page: the gold likely + # contains a typo or content from elsewhere. + unsupported = sorted(gold - union) + if unsupported: + listed = ", ".join(unsupported[:_MAX_LISTED]) + extra = len(unsupported) - _MAX_LISTED + line = find_line(gold_raw, unsupported[0]) + findings.append( + Finding( + scanner="text_layer_recall", + severity="high", + category="label_quality", + explanation=( + f"{len(unsupported)} gold word(s) appear in none of the " + f"{len(texts)} extraction tool outputs for this page: " + f"{listed}" + + (f" (+{extra} more)" if extra > 0 else "") + + ". Likely typos in the gold, or content that is not " + "on this page." + ), + sample_index=i, + sample_id=sample_id, + line=(line + body_offset(record)) if line is not None else None, + metadata={ + "unsupported_words": unsupported[:50], + "tools": sorted(texts), + }, + ) + ) + + # Omission check only makes sense when the gold covers the full page; + # element-scoped gold legitimately omits the rest of the page. + task_type = str(record.get("task_type", "") or "") + if "page" not in task_type: + continue + omitted = sorted(intersection - gold_covering) + if omitted: + listed = ", ".join(omitted[:_MAX_LISTED]) + extra = len(omitted) - _MAX_LISTED + findings.append( + Finding( + scanner="text_layer_recall", + severity="medium", + category="label_quality", + explanation=( + f"{len(omitted)} word(s) found by every extraction tool " + f"are missing from the gold: {listed}" + + (f" (+{extra} more)" if extra > 0 else "") + + ". The gold may be incomplete for this page." + ), + sample_index=i, + sample_id=sample_id, + metadata={ + "omitted_words": omitted[:50], + "tools": sorted(texts), + }, + ) + ) + return findings + + +text_layer_recall = ScannerDef( + name="text_layer_recall", + fn=_scan, + description=( + "Cross-check gold text against cached extraction tool outputs " + "(requires --files-root): flag gold words no tool found on the page " + "(typo/hallucination candidates) and, for full-page gold, words every " + "tool found that the gold omits." + ), +) diff --git a/tests/test_cross_artifact.py b/tests/test_cross_artifact.py new file mode 100644 index 0000000..1efa535 --- /dev/null +++ b/tests/test_cross_artifact.py @@ -0,0 +1,166 @@ +import pytest + +from inspect_dataset._types import FieldMap +from inspect_dataset.scanners.numeric_provenance import numeric_provenance +from inspect_dataset.scanners.text_layer_recall import text_layer_recall + +FIELDS = FieldMap(question="q", answer="a", id="id") + +PAGE_TEXT = ( + "CONSOLIDATED BALANCE SHEETS\nItem 2023\n" + "Cash and equivalents $ 48,304\nTotal assets 272,425\n" +) + +GOLD_MD = """\ +# CONSOLIDATED BALANCE SHEETS + +| Item | 2023 | +| --- | ---: | +| Cash and equivalents | $ 48,304 | +| Total assets | 272,425 | +""" + + +@pytest.fixture +def artifacts_dir(tmp_path): + sample = tmp_path / "s1" + sample.mkdir() + (sample / "pymupdf.txt").write_text(PAGE_TEXT) + (sample / "pdfplumber.txt").write_text(PAGE_TEXT) + (sample / "ground_truth.md").write_text(GOLD_MD) + (sample / "index.md").write_text("# index page, not a tool output\nsomething unrelated\n") + return sample + + +def record(artifacts_dir, answer=GOLD_MD, **extra): + rec = { + "id": "s1", + "q": "page_roundtrip x.pdf#page=1", + "a": answer, + "task_type": "page_roundtrip", + "__artifacts_dir__": str(artifacts_dir), + } + rec.update(extra) + return rec + + +# --------------------------------------------------------------------------- +# text_layer_recall +# --------------------------------------------------------------------------- + + +def test_faithful_gold_no_findings(artifacts_dir): + assert text_layer_recall([record(artifacts_dir)], FIELDS) == [] + + +def test_gold_word_no_tool_saw_flagged_high(artifacts_dir): + bad = GOLD_MD.replace("equivalents", "equivalentz") + findings = text_layer_recall([record(artifacts_dir, answer=bad)], FIELDS) + # A swapped word is both a hallucination ("equivalentz" nowhere on the + # page) and an omission ("equivalents" everywhere but the gold). + assert len(findings) == 2 + unsupported = next(f for f in findings if "unsupported_words" in f.metadata) + assert unsupported.severity == "high" + assert "equivalentz" in unsupported.metadata["unsupported_words"] + assert unsupported.line == 5 + omitted = next(f for f in findings if "omitted_words" in f.metadata) + assert "equivalents" in omitted.metadata["omitted_words"] + + +def test_word_all_tools_found_missing_from_page_gold_flagged(artifacts_dir): + partial = GOLD_MD.replace("| Total assets | 272,425 |\n", "") + findings = text_layer_recall([record(artifacts_dir, answer=partial)], FIELDS) + omissions = [f for f in findings if "missing from the gold" in f.explanation] + assert len(omissions) == 1 + assert omissions[0].severity == "medium" + assert "assets" in omissions[0].metadata["omitted_words"] + + +def test_element_gold_not_checked_for_omissions(artifacts_dir): + table_only = "| Item | 2023 |\n| --- | --- |\n| Cash and equivalents | $ 48,304 |" + rec = record(artifacts_dir, answer=table_only, task_type="element_reproduction") + assert text_layer_recall([rec], FIELDS) == [] + + +def test_word_found_by_one_tool_not_flagged(artifacts_dir): + (artifacts_dir / "pdfplumber.txt").write_text(PAGE_TEXT.replace("BALANCE", "")) + assert text_layer_recall([record(artifacts_dir)], FIELDS) == [] + + +def test_ocr_resistant_skipped(artifacts_dir): + bad = GOLD_MD.replace("equivalents", "equivalentz") + rec = record(artifacts_dir, answer=bad, ocr_resistant=True) + assert text_layer_recall([rec], FIELDS) == [] + + +def test_no_artifacts_dir_skipped(): + rec = {"id": "s1", "q": "?", "a": GOLD_MD, "task_type": "page_roundtrip"} + assert text_layer_recall([rec], FIELDS) == [] + + +def test_empty_tool_outputs_skipped(tmp_path): + sample = tmp_path / "s1" + sample.mkdir() + (sample / "pymupdf.txt").write_text(" \n") + rec = record(sample) + assert text_layer_recall([rec], FIELDS) == [] + + +def test_hyphenated_linebreaks_joined(tmp_path): + sample = tmp_path / "s1" + sample.mkdir() + (sample / "pymupdf.txt").write_text("Consolidated infor-\nmation follows\n") + rec = record(sample, answer="Consolidated information follows") + assert text_layer_recall([rec], FIELDS) == [] + + +def test_latex_math_spans_excluded(tmp_path): + sample = tmp_path / "s1" + sample.mkdir() + (sample / "pymupdf.txt").write_text("The quality gate Q(d, t) < θ applies\n") + gold = "The quality gate\n\n$$Q(d, t) < \\theta \\implies \\text{apply}$$\n\napplies\n" + rec = record(sample, answer=gold) + assert text_layer_recall([rec], FIELDS) == [] + + +def test_ligatures_normalised(tmp_path): + sample = tmp_path / "s1" + sample.mkdir() + (sample / "pymupdf.txt").write_text("profit and loss\n") + rec = record(sample, answer="profit and loss") + assert text_layer_recall([rec], FIELDS) == [] + + +# --------------------------------------------------------------------------- +# numeric_provenance +# --------------------------------------------------------------------------- + + +def test_all_numbers_present_no_findings(artifacts_dir): + assert numeric_provenance([record(artifacts_dir)], FIELDS) == [] + + +def test_number_no_tool_saw_flagged(artifacts_dir): + bad = GOLD_MD.replace("272,425", "272,426") + findings = numeric_provenance([record(artifacts_dir, answer=bad)], FIELDS) + assert len(findings) == 1 + f = findings[0] + assert f.severity == "high" + assert "272426" in f.metadata["missing_numbers"] + assert f.line == 6 + + +def test_comma_and_dollar_normalisation(artifacts_dir): + gold = "Cash 48304 and total 272425" + assert numeric_provenance([record(artifacts_dir, answer=gold)], FIELDS) == [] + + +def test_number_in_one_tool_suffices(artifacts_dir): + (artifacts_dir / "pdfplumber.txt").write_text("nothing numeric here") + assert numeric_provenance([record(artifacts_dir)], FIELDS) == [] + + +def test_numeric_ocr_resistant_skipped(artifacts_dir): + bad = GOLD_MD.replace("272,425", "999,999") + rec = record(artifacts_dir, answer=bad, ocr_resistant=True) + assert numeric_provenance([rec], FIELDS) == [] From 218123e4da029a895104b418657826b715275754 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 18 Jul 2026 11:56:43 +0000 Subject: [PATCH 2/3] Add side-by-side audit view to the explorer (v0.6.3 first slice) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Viewer support for auditing markdown ground truth against its source page: - Sample detail renders multi-line answers as real markdown (react-markdown + remark-gfm, Bootstrap-styled tables) with an "Audit view" button - AuditView: full-screen three-pane overlay — page image | rendered gold | raw source with line numbers; finding line anchors are highlighted in the raw pane (file lines mapped through the sample's frontmatter offset); a source selector switches between the gold markdown and each cached extraction tool's output - View server: local annotation datasets reload for sample detail; scan_summary.json now records --files-root so the server can resolve per-sample artifacts, serving page.png as a data URL plus tool text outputs and the markdown body line offset - API-level tests for the local-source flow; frontend bundle rebuilt Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01LLg5cbBcfNyyrRGJVPfsA6 --- PLAN.md | 9 +- src/inspect_dataset/_view/server.py | 33 + .../_view/www/dist/assets/index.js | 21740 +++++++++++++++- .../_view/www/dist/assets/index.js.map | 2 +- src/inspect_dataset/_view/www/dist/index.html | 24 +- .../_view/www/package-lock.json | 1634 +- src/inspect_dataset/_view/www/package.json | 2 + .../_view/www/src/components/AuditView.tsx | 154 + .../www/src/components/FindingDetail.tsx | 45 +- src/inspect_dataset/_view/www/src/types.ts | 8 + src/inspect_dataset/cli.py | 9 +- src/inspect_dataset/report.py | 2 + tests/test_cross_artifact.py | 7 +- tests/test_view_local_api.py | 92 + 14 files changed, 23546 insertions(+), 215 deletions(-) create mode 100644 src/inspect_dataset/_view/www/src/components/AuditView.tsx create mode 100644 tests/test_view_local_api.py diff --git a/PLAN.md b/PLAN.md index fdb1e4d..b1d0c4b 100644 --- a/PLAN.md +++ b/PLAN.md @@ -512,11 +512,12 @@ Design principles: - [ ] `gold_completeness` — page regions not represented in gold at all - [ ] `reading_order` — gold block order matches visual reading order -#### v0.6.3 — Viewer: side-by-side audit panel +#### v0.6.3 — Viewer: side-by-side audit panel (in progress) -- [ ] Rendered-markdown field type in sample detail (tables render as tables) -- [ ] Side-by-side layout: page image | rendered gold | raw source, findings highlighted at their `line` anchors in the raw view -- [ ] Tool-output comparison strip with word-level diff against gold +- [x] Rendered-markdown field type in sample detail (react-markdown + remark-gfm; multi-line answers render as real tables/headings) +- [x] Side-by-side audit view: full-screen overlay with page image | rendered gold | raw source; finding `line` anchors highlighted in the raw pane (file lines mapped through the sample's `line_offset`) +- [x] Tool-output source selector in the raw pane (cached per-tool outputs served by the view server; scan_summary records `files_root` so the server can resolve artifacts) +- [ ] Word-level diff of tool outputs against gold - [ ] Edit-in-place with write-back to the sidecar file + single-sample re-scan (turns triage into curation) - [ ] Audit provenance: record "verified against page image" per sample in `triage.json` with the md file's git hash, so staleness is detectable diff --git a/src/inspect_dataset/_view/server.py b/src/inspect_dataset/_view/server.py index da05042..c70abb8 100644 --- a/src/inspect_dataset/_view/server.py +++ b/src/inspect_dataset/_view/server.py @@ -166,6 +166,19 @@ async def _load_records_cached(ds: dict[str, Any]) -> list[dict[str, Any]] | Non from inspect_dataset.loader import load_task_from_spec records, _ = await asyncio.to_thread(load_task_from_spec, dataset_name) + elif source_type == "local": + from inspect_dataset.loader import load_local_samples + + records, fields = await asyncio.to_thread(load_local_samples, dataset_name) + files_root = summary.get("files_root") + if files_root: + from inspect_dataset.scanner import get_sample_id + + root = Path(files_root) + for idx, record in enumerate(records): + sample_dir = root / str(get_sample_id(record, fields, idx)) + if sample_dir.is_dir(): + record["__artifacts_dir__"] = str(sample_dir) else: return None @@ -371,6 +384,26 @@ async def handle_sample(request: web.Request) -> web.Response: } ) + # Extraction-cache artifacts (local annotation datasets): page image, + # per-tool text outputs, and the markdown body's line offset so the + # frontend can anchor file-based finding lines. + artifacts_dir = record.get("__artifacts_dir__") + if artifacts_dir: + adir = Path(str(artifacts_dir)) + page_png = adir / "page.png" + if page_png.exists(): + result["images"].append( + {"field": "page", "data_url": _to_data_url(page_png.read_bytes(), "page.png")} + ) + from inspect_dataset.scanners._artifacts import tool_texts + + result["tool_outputs"] = [ + {"name": name, "text": text} for name, text in tool_texts(record).items() + ] + offset = record.get("__md_body_offset__") + if isinstance(offset, int): + result["line_offset"] = offset + # inspect_ai Sample.files stored under __files__ files_map: dict[str, Any] = record.get("__files__") or {} for name, data in files_map.items(): diff --git a/src/inspect_dataset/_view/www/dist/assets/index.js b/src/inspect_dataset/_view/www/dist/assets/index.js index fd18e79..e2f0fec 100644 --- a/src/inspect_dataset/_view/www/dist/assets/index.js +++ b/src/inspect_dataset/_view/www/dist/assets/index.js @@ -6,6 +6,15 @@ var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports); +var __exportAll = (all, no_symbols) => { + let target = {}; + for (var name in all) __defProp(target, name, { + get: all[name], + enumerable: true + }); + if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" }); + return target; +}; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { key = keys[i]; @@ -11961,7 +11970,7 @@ var createImpl = (createState) => { Object.assign(useBoundStore, api); return useBoundStore; }; -var create = ((createState) => createState ? createImpl(createState) : createImpl); +var create$1 = ((createState) => createState ? createImpl(createState) : createImpl); //#endregion //#region src/api.ts var BASE = "/api"; @@ -12003,7 +12012,7 @@ async function fetchSampleDetail(slug, idx) { } //#endregion //#region src/store.ts -var useStore = create((set, get) => ({ +var useStore = create$1((set, get) => ({ datasets: [], currentSlug: null, summary: null, @@ -12443,118 +12452,21640 @@ function FindingRow({ finding, selected, onClick }) { }); } //#endregion -//#region src/components/FindingDetail.tsx -function FindingDetail() { - const finding = useStore((s) => s.selectedFinding); - const triageFinding = useStore((s) => s.triageFinding); - const findings = useStore((s) => s.findings); - const setSelectedFinding = useStore((s) => s.setSelectedFinding); - const [searchParams] = useSearchParams(); - const { slug } = useParams(); - const [sampleDetail, setSampleDetail] = (0, import_react.useState)(null); - const [sampleLoading, setSampleLoading] = (0, import_react.useState)(false); - (0, import_react.useEffect)(() => { - if (finding == null || !slug) return; - setSampleDetail(null); - setSampleLoading(true); - fetchSampleDetail(slug, finding.sample_index).then((d) => { - setSampleDetail(d); - setSampleLoading(false); +//#region node_modules/comma-separated-tokens/index.js +/** +* Serialize an array of strings or numbers to comma-separated tokens. +* +* @param {Array} values +* List of tokens. +* @param {Options} [options] +* Configuration for `stringify` (optional). +* @returns {string} +* Comma-separated tokens. +*/ +function stringify$1(values, options) { + const settings = options || {}; + return (values[values.length - 1] === "" ? [...values, ""] : values).join((settings.padRight ? " " : "") + "," + (settings.padLeft === false ? "" : " ")).trim(); +} +//#endregion +//#region node_modules/estree-util-is-identifier-name/lib/index.js +var nameRe = /^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u; +var nameReJsx = /^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u; +/** @type {Options} */ +var emptyOptions$3 = {}; +/** +* Checks if the given value is a valid identifier name. +* +* @param {string} name +* Identifier to check. +* @param {Options | null | undefined} [options] +* Configuration (optional). +* @returns {boolean} +* Whether `name` can be an identifier. +*/ +function name(name, options) { + return ((options || emptyOptions$3).jsx ? nameReJsx : nameRe).test(name); +} +//#endregion +//#region node_modules/hast-util-whitespace/lib/index.js +/** +* @typedef {import('hast').Nodes} Nodes +*/ +var re = /[ \t\n\f\r]/g; +/** +* Check if the given value is *inter-element whitespace*. +* +* @param {Nodes | string} thing +* Thing to check (`Node` or `string`). +* @returns {boolean} +* Whether the `value` is inter-element whitespace (`boolean`): consisting of +* zero or more of space, tab (`\t`), line feed (`\n`), carriage return +* (`\r`), or form feed (`\f`); if a node is passed it must be a `Text` node, +* whose `value` field is checked. +*/ +function whitespace(thing) { + return typeof thing === "object" ? thing.type === "text" ? empty$1(thing.value) : false : empty$1(thing); +} +/** +* @param {string} value +* @returns {boolean} +*/ +function empty$1(value) { + return value.replace(re, "") === ""; +} +//#endregion +//#region node_modules/property-information/lib/util/schema.js +/** +* @import {Schema as SchemaType, Space} from 'property-information' +*/ +/** @type {SchemaType} */ +var Schema = class { + /** + * @param {SchemaType['property']} property + * Property. + * @param {SchemaType['normal']} normal + * Normal. + * @param {Space | undefined} [space] + * Space. + * @returns + * Schema. + */ + constructor(property, normal, space) { + this.normal = normal; + this.property = property; + if (space) this.space = space; + } +}; +Schema.prototype.normal = {}; +Schema.prototype.property = {}; +Schema.prototype.space = void 0; +//#endregion +//#region node_modules/property-information/lib/util/merge.js +/** +* @import {Info, Space} from 'property-information' +*/ +/** +* @param {ReadonlyArray} definitions +* Definitions. +* @param {Space | undefined} [space] +* Space. +* @returns {Schema} +* Schema. +*/ +function merge(definitions, space) { + /** @type {Record} */ + const property = {}; + /** @type {Record} */ + const normal = {}; + for (const definition of definitions) { + Object.assign(property, definition.property); + Object.assign(normal, definition.normal); + } + return new Schema(property, normal, space); +} +//#endregion +//#region node_modules/property-information/lib/normalize.js +/** +* Get the cleaned case insensitive form of an attribute or property. +* +* @param {string} value +* An attribute-like or property-like name. +* @returns {string} +* Value that can be used to look up the properly cased property on a +* `Schema`. +*/ +function normalize$1(value) { + return value.toLowerCase(); +} +//#endregion +//#region node_modules/property-information/lib/util/info.js +/** +* @import {Info as InfoType} from 'property-information' +*/ +/** @type {InfoType} */ +var Info = class { + /** + * @param {string} property + * Property. + * @param {string} attribute + * Attribute. + * @returns + * Info. + */ + constructor(property, attribute) { + this.attribute = attribute; + this.property = property; + } +}; +Info.prototype.attribute = ""; +Info.prototype.booleanish = false; +Info.prototype.boolean = false; +Info.prototype.commaOrSpaceSeparated = false; +Info.prototype.commaSeparated = false; +Info.prototype.defined = false; +Info.prototype.mustUseProperty = false; +Info.prototype.number = false; +Info.prototype.overloadedBoolean = false; +Info.prototype.property = ""; +Info.prototype.spaceSeparated = false; +Info.prototype.space = void 0; +//#endregion +//#region node_modules/property-information/lib/util/types.js +var types_exports = /* @__PURE__ */ __exportAll({ + boolean: () => boolean, + booleanish: () => booleanish, + commaOrSpaceSeparated: () => commaOrSpaceSeparated, + commaSeparated: () => commaSeparated, + number: () => number, + overloadedBoolean: () => overloadedBoolean, + spaceSeparated: () => spaceSeparated +}); +var powers = 0; +var boolean = increment(); +var booleanish = increment(); +var overloadedBoolean = increment(); +var number = increment(); +var spaceSeparated = increment(); +var commaSeparated = increment(); +var commaOrSpaceSeparated = increment(); +function increment() { + return 2 ** ++powers; +} +//#endregion +//#region node_modules/property-information/lib/util/defined-info.js +/** +* @import {Space} from 'property-information' +*/ +var checks = Object.keys(types_exports); +var DefinedInfo = class extends Info { + /** + * @constructor + * @param {string} property + * Property. + * @param {string} attribute + * Attribute. + * @param {number | null | undefined} [mask] + * Mask. + * @param {Space | undefined} [space] + * Space. + * @returns + * Info. + */ + constructor(property, attribute, mask, space) { + let index = -1; + super(property, attribute); + mark(this, "space", space); + if (typeof mask === "number") while (++index < checks.length) { + const check = checks[index]; + mark(this, checks[index], (mask & types_exports[check]) === types_exports[check]); + } + } +}; +DefinedInfo.prototype.defined = true; +/** +* @template {keyof DefinedInfo} Key +* Key type. +* @param {DefinedInfo} values +* Info. +* @param {Key} key +* Key. +* @param {DefinedInfo[Key]} value +* Value. +* @returns {undefined} +* Nothing. +*/ +function mark(values, key, value) { + if (value) values[key] = value; +} +//#endregion +//#region node_modules/property-information/lib/util/create.js +/** +* @import {Info, Space} from 'property-information' +*/ +/** +* @typedef Definition +* Definition of a schema. +* @property {Record | undefined} [attributes] +* Normalzed names to special attribute case. +* @property {ReadonlyArray | undefined} [mustUseProperty] +* Normalized names that must be set as properties. +* @property {Record} properties +* Property names to their types. +* @property {Space | undefined} [space] +* Space. +* @property {Transform} transform +* Transform a property name. +*/ +/** +* @callback Transform +* Transform. +* @param {Record} attributes +* Attributes. +* @param {string} property +* Property. +* @returns {string} +* Attribute. +*/ +/** +* @param {Definition} definition +* Definition. +* @returns {Schema} +* Schema. +*/ +function create(definition) { + /** @type {Record} */ + const properties = {}; + /** @type {Record} */ + const normals = {}; + for (const [property, value] of Object.entries(definition.properties)) { + const info = new DefinedInfo(property, definition.transform(definition.attributes || {}, property), value, definition.space); + if (definition.mustUseProperty && definition.mustUseProperty.includes(property)) info.mustUseProperty = true; + properties[property] = info; + normals[normalize$1(property)] = property; + normals[normalize$1(info.attribute)] = property; + } + return new Schema(properties, normals, definition.space); +} +//#endregion +//#region node_modules/property-information/lib/aria.js +var aria = create({ + properties: { + ariaActiveDescendant: null, + ariaAtomic: booleanish, + ariaAutoComplete: null, + ariaBusy: booleanish, + ariaChecked: booleanish, + ariaColCount: number, + ariaColIndex: number, + ariaColSpan: number, + ariaControls: spaceSeparated, + ariaCurrent: null, + ariaDescribedBy: spaceSeparated, + ariaDetails: null, + ariaDisabled: booleanish, + ariaDropEffect: spaceSeparated, + ariaErrorMessage: null, + ariaExpanded: booleanish, + ariaFlowTo: spaceSeparated, + ariaGrabbed: booleanish, + ariaHasPopup: null, + ariaHidden: booleanish, + ariaInvalid: null, + ariaKeyShortcuts: null, + ariaLabel: null, + ariaLabelledBy: spaceSeparated, + ariaLevel: number, + ariaLive: null, + ariaModal: booleanish, + ariaMultiLine: booleanish, + ariaMultiSelectable: booleanish, + ariaOrientation: null, + ariaOwns: spaceSeparated, + ariaPlaceholder: null, + ariaPosInSet: number, + ariaPressed: booleanish, + ariaReadOnly: booleanish, + ariaRelevant: null, + ariaRequired: booleanish, + ariaRoleDescription: spaceSeparated, + ariaRowCount: number, + ariaRowIndex: number, + ariaRowSpan: number, + ariaSelected: booleanish, + ariaSetSize: number, + ariaSort: null, + ariaValueMax: number, + ariaValueMin: number, + ariaValueNow: number, + ariaValueText: null, + role: null + }, + transform(_, property) { + return property === "role" ? property : "aria-" + property.slice(4).toLowerCase(); + } +}); +//#endregion +//#region node_modules/property-information/lib/util/case-sensitive-transform.js +/** +* @param {Record} attributes +* Attributes. +* @param {string} attribute +* Attribute. +* @returns {string} +* Transformed attribute. +*/ +function caseSensitiveTransform(attributes, attribute) { + return attribute in attributes ? attributes[attribute] : attribute; +} +//#endregion +//#region node_modules/property-information/lib/util/case-insensitive-transform.js +/** +* @param {Record} attributes +* Attributes. +* @param {string} property +* Property. +* @returns {string} +* Transformed property. +*/ +function caseInsensitiveTransform(attributes, property) { + return caseSensitiveTransform(attributes, property.toLowerCase()); +} +//#endregion +//#region node_modules/property-information/lib/html.js +var html$3 = create({ + attributes: { + acceptcharset: "accept-charset", + classname: "class", + htmlfor: "for", + httpequiv: "http-equiv" + }, + mustUseProperty: [ + "checked", + "multiple", + "muted", + "selected" + ], + properties: { + abbr: null, + accept: commaSeparated, + acceptCharset: spaceSeparated, + accessKey: spaceSeparated, + action: null, + allow: null, + allowFullScreen: boolean, + allowPaymentRequest: boolean, + allowUserMedia: boolean, + alpha: boolean, + alt: null, + as: null, + async: boolean, + autoCapitalize: null, + autoComplete: spaceSeparated, + autoFocus: boolean, + autoPlay: boolean, + blocking: spaceSeparated, + capture: null, + charSet: null, + checked: boolean, + cite: null, + className: spaceSeparated, + closedBy: null, + colorSpace: null, + cols: number, + colSpan: number, + command: null, + commandFor: null, + content: null, + contentEditable: booleanish, + controls: boolean, + controlsList: spaceSeparated, + coords: number | commaSeparated, + crossOrigin: null, + data: null, + dateTime: null, + decoding: null, + default: boolean, + defer: boolean, + dir: null, + dirName: null, + disabled: boolean, + download: overloadedBoolean, + draggable: booleanish, + encType: null, + enterKeyHint: null, + fetchPriority: null, + form: null, + formAction: null, + formEncType: null, + formMethod: null, + formNoValidate: boolean, + formTarget: null, + headers: spaceSeparated, + height: number, + hidden: overloadedBoolean, + high: number, + href: null, + hrefLang: null, + htmlFor: spaceSeparated, + httpEquiv: spaceSeparated, + id: null, + imageSizes: null, + imageSrcSet: null, + inert: boolean, + inputMode: null, + integrity: null, + is: null, + isMap: boolean, + itemId: null, + itemProp: spaceSeparated, + itemRef: spaceSeparated, + itemScope: boolean, + itemType: spaceSeparated, + kind: null, + label: null, + lang: null, + language: null, + list: null, + loading: null, + loop: boolean, + low: number, + manifest: null, + max: null, + maxLength: number, + media: null, + method: null, + min: null, + minLength: number, + multiple: boolean, + muted: boolean, + name: null, + nonce: null, + noModule: boolean, + noValidate: boolean, + onAbort: null, + onAfterPrint: null, + onAuxClick: null, + onBeforeMatch: null, + onBeforePrint: null, + onBeforeToggle: null, + onBeforeUnload: null, + onBlur: null, + onCancel: null, + onCanPlay: null, + onCanPlayThrough: null, + onChange: null, + onClick: null, + onClose: null, + onContextLost: null, + onContextMenu: null, + onContextRestored: null, + onCopy: null, + onCueChange: null, + onCut: null, + onDblClick: null, + onDrag: null, + onDragEnd: null, + onDragEnter: null, + onDragExit: null, + onDragLeave: null, + onDragOver: null, + onDragStart: null, + onDrop: null, + onDurationChange: null, + onEmptied: null, + onEnded: null, + onError: null, + onFocus: null, + onFormData: null, + onHashChange: null, + onInput: null, + onInvalid: null, + onKeyDown: null, + onKeyPress: null, + onKeyUp: null, + onLanguageChange: null, + onLoad: null, + onLoadedData: null, + onLoadedMetadata: null, + onLoadEnd: null, + onLoadStart: null, + onMessage: null, + onMessageError: null, + onMouseDown: null, + onMouseEnter: null, + onMouseLeave: null, + onMouseMove: null, + onMouseOut: null, + onMouseOver: null, + onMouseUp: null, + onOffline: null, + onOnline: null, + onPageHide: null, + onPageShow: null, + onPaste: null, + onPause: null, + onPlay: null, + onPlaying: null, + onPopState: null, + onProgress: null, + onRateChange: null, + onRejectionHandled: null, + onReset: null, + onResize: null, + onScroll: null, + onScrollEnd: null, + onSecurityPolicyViolation: null, + onSeeked: null, + onSeeking: null, + onSelect: null, + onSlotChange: null, + onStalled: null, + onStorage: null, + onSubmit: null, + onSuspend: null, + onTimeUpdate: null, + onToggle: null, + onUnhandledRejection: null, + onUnload: null, + onVolumeChange: null, + onWaiting: null, + onWheel: null, + open: boolean, + optimum: number, + pattern: null, + ping: spaceSeparated, + placeholder: null, + playsInline: boolean, + popover: null, + popoverTarget: null, + popoverTargetAction: null, + poster: null, + preload: null, + readOnly: boolean, + referrerPolicy: null, + rel: spaceSeparated, + required: boolean, + reversed: boolean, + rows: number, + rowSpan: number, + sandbox: spaceSeparated, + scope: null, + scoped: boolean, + seamless: boolean, + selected: boolean, + shadowRootClonable: boolean, + shadowRootCustomElementRegistry: boolean, + shadowRootDelegatesFocus: boolean, + shadowRootMode: null, + shadowRootSerializable: boolean, + shape: null, + size: number, + sizes: null, + slot: null, + span: number, + spellCheck: booleanish, + src: null, + srcDoc: null, + srcLang: null, + srcSet: null, + start: number, + step: null, + style: null, + tabIndex: number, + target: null, + title: null, + translate: null, + type: null, + typeMustMatch: boolean, + useMap: null, + value: booleanish, + width: number, + wrap: null, + writingSuggestions: null, + align: null, + aLink: null, + archive: spaceSeparated, + axis: null, + background: null, + bgColor: null, + border: number, + borderColor: null, + bottomMargin: number, + cellPadding: null, + cellSpacing: null, + char: null, + charOff: null, + classId: null, + clear: null, + code: null, + codeBase: null, + codeType: null, + color: null, + compact: boolean, + declare: boolean, + event: null, + face: null, + frame: null, + frameBorder: null, + hSpace: number, + leftMargin: number, + link: null, + longDesc: null, + lowSrc: null, + marginHeight: number, + marginWidth: number, + noResize: boolean, + noHref: boolean, + noShade: boolean, + noWrap: boolean, + object: null, + profile: null, + prompt: null, + rev: null, + rightMargin: number, + rules: null, + scheme: null, + scrolling: booleanish, + standby: null, + summary: null, + text: null, + topMargin: number, + valueType: null, + version: null, + vAlign: null, + vLink: null, + vSpace: number, + allowTransparency: null, + autoCorrect: null, + autoSave: null, + credentialless: boolean, + disablePictureInPicture: boolean, + disableRemotePlayback: boolean, + exportParts: commaSeparated, + part: spaceSeparated, + prefix: null, + property: null, + results: number, + security: null, + unselectable: null + }, + space: "html", + transform: caseInsensitiveTransform +}); +//#endregion +//#region node_modules/property-information/lib/svg.js +var svg$1 = create({ + attributes: { + accentHeight: "accent-height", + alignmentBaseline: "alignment-baseline", + arabicForm: "arabic-form", + baselineShift: "baseline-shift", + capHeight: "cap-height", + className: "class", + clipPath: "clip-path", + clipRule: "clip-rule", + colorInterpolation: "color-interpolation", + colorInterpolationFilters: "color-interpolation-filters", + colorProfile: "color-profile", + colorRendering: "color-rendering", + crossOrigin: "crossorigin", + dataType: "datatype", + dominantBaseline: "dominant-baseline", + enableBackground: "enable-background", + fillOpacity: "fill-opacity", + fillRule: "fill-rule", + floodColor: "flood-color", + floodOpacity: "flood-opacity", + fontFamily: "font-family", + fontSize: "font-size", + fontSizeAdjust: "font-size-adjust", + fontStretch: "font-stretch", + fontStyle: "font-style", + fontVariant: "font-variant", + fontWeight: "font-weight", + glyphName: "glyph-name", + glyphOrientationHorizontal: "glyph-orientation-horizontal", + glyphOrientationVertical: "glyph-orientation-vertical", + hrefLang: "hreflang", + horizAdvX: "horiz-adv-x", + horizOriginX: "horiz-origin-x", + horizOriginY: "horiz-origin-y", + imageRendering: "image-rendering", + letterSpacing: "letter-spacing", + lightingColor: "lighting-color", + markerEnd: "marker-end", + markerMid: "marker-mid", + markerStart: "marker-start", + maskType: "mask-type", + navDown: "nav-down", + navDownLeft: "nav-down-left", + navDownRight: "nav-down-right", + navLeft: "nav-left", + navNext: "nav-next", + navPrev: "nav-prev", + navRight: "nav-right", + navUp: "nav-up", + navUpLeft: "nav-up-left", + navUpRight: "nav-up-right", + onAbort: "onabort", + onActivate: "onactivate", + onAfterPrint: "onafterprint", + onBeforePrint: "onbeforeprint", + onBegin: "onbegin", + onCancel: "oncancel", + onCanPlay: "oncanplay", + onCanPlayThrough: "oncanplaythrough", + onChange: "onchange", + onClick: "onclick", + onClose: "onclose", + onCopy: "oncopy", + onCueChange: "oncuechange", + onCut: "oncut", + onDblClick: "ondblclick", + onDrag: "ondrag", + onDragEnd: "ondragend", + onDragEnter: "ondragenter", + onDragExit: "ondragexit", + onDragLeave: "ondragleave", + onDragOver: "ondragover", + onDragStart: "ondragstart", + onDrop: "ondrop", + onDurationChange: "ondurationchange", + onEmptied: "onemptied", + onEnd: "onend", + onEnded: "onended", + onError: "onerror", + onFocus: "onfocus", + onFocusIn: "onfocusin", + onFocusOut: "onfocusout", + onHashChange: "onhashchange", + onInput: "oninput", + onInvalid: "oninvalid", + onKeyDown: "onkeydown", + onKeyPress: "onkeypress", + onKeyUp: "onkeyup", + onLoad: "onload", + onLoadedData: "onloadeddata", + onLoadedMetadata: "onloadedmetadata", + onLoadStart: "onloadstart", + onMessage: "onmessage", + onMouseDown: "onmousedown", + onMouseEnter: "onmouseenter", + onMouseLeave: "onmouseleave", + onMouseMove: "onmousemove", + onMouseOut: "onmouseout", + onMouseOver: "onmouseover", + onMouseUp: "onmouseup", + onMouseWheel: "onmousewheel", + onOffline: "onoffline", + onOnline: "ononline", + onPageHide: "onpagehide", + onPageShow: "onpageshow", + onPaste: "onpaste", + onPause: "onpause", + onPlay: "onplay", + onPlaying: "onplaying", + onPopState: "onpopstate", + onProgress: "onprogress", + onRateChange: "onratechange", + onRepeat: "onrepeat", + onReset: "onreset", + onResize: "onresize", + onScroll: "onscroll", + onSeeked: "onseeked", + onSeeking: "onseeking", + onSelect: "onselect", + onShow: "onshow", + onStalled: "onstalled", + onStorage: "onstorage", + onSubmit: "onsubmit", + onSuspend: "onsuspend", + onTimeUpdate: "ontimeupdate", + onToggle: "ontoggle", + onUnload: "onunload", + onVolumeChange: "onvolumechange", + onWaiting: "onwaiting", + onZoom: "onzoom", + overlinePosition: "overline-position", + overlineThickness: "overline-thickness", + paintOrder: "paint-order", + panose1: "panose-1", + pointerEvents: "pointer-events", + referrerPolicy: "referrerpolicy", + renderingIntent: "rendering-intent", + shapeRendering: "shape-rendering", + stopColor: "stop-color", + stopOpacity: "stop-opacity", + strikethroughPosition: "strikethrough-position", + strikethroughThickness: "strikethrough-thickness", + strokeDashArray: "stroke-dasharray", + strokeDashOffset: "stroke-dashoffset", + strokeLineCap: "stroke-linecap", + strokeLineJoin: "stroke-linejoin", + strokeMiterLimit: "stroke-miterlimit", + strokeOpacity: "stroke-opacity", + strokeWidth: "stroke-width", + tabIndex: "tabindex", + textAnchor: "text-anchor", + textDecoration: "text-decoration", + textRendering: "text-rendering", + transformOrigin: "transform-origin", + typeOf: "typeof", + underlinePosition: "underline-position", + underlineThickness: "underline-thickness", + unicodeBidi: "unicode-bidi", + unicodeRange: "unicode-range", + unitsPerEm: "units-per-em", + vAlphabetic: "v-alphabetic", + vHanging: "v-hanging", + vIdeographic: "v-ideographic", + vMathematical: "v-mathematical", + vectorEffect: "vector-effect", + vertAdvY: "vert-adv-y", + vertOriginX: "vert-origin-x", + vertOriginY: "vert-origin-y", + wordSpacing: "word-spacing", + writingMode: "writing-mode", + xHeight: "x-height", + playbackOrder: "playbackorder", + timelineBegin: "timelinebegin" + }, + properties: { + about: commaOrSpaceSeparated, + accentHeight: number, + accumulate: null, + additive: null, + alignmentBaseline: null, + alphabetic: number, + amplitude: number, + arabicForm: null, + ascent: number, + attributeName: null, + attributeType: null, + azimuth: number, + bandwidth: null, + baselineShift: null, + baseFrequency: null, + baseProfile: null, + bbox: null, + begin: null, + bias: number, + by: null, + calcMode: null, + capHeight: number, + className: spaceSeparated, + clip: null, + clipPath: null, + clipPathUnits: null, + clipRule: null, + color: null, + colorInterpolation: null, + colorInterpolationFilters: null, + colorProfile: null, + colorRendering: null, + content: null, + contentScriptType: null, + contentStyleType: null, + crossOrigin: null, + cursor: null, + cx: null, + cy: null, + d: null, + dataType: null, + defaultAction: null, + descent: number, + diffuseConstant: number, + direction: null, + display: null, + dur: null, + divisor: number, + dominantBaseline: null, + download: boolean, + dx: null, + dy: null, + edgeMode: null, + editable: null, + elevation: number, + enableBackground: null, + end: null, + event: null, + exponent: number, + externalResourcesRequired: null, + fill: null, + fillOpacity: number, + fillRule: null, + filter: null, + filterRes: null, + filterUnits: null, + floodColor: null, + floodOpacity: null, + focusable: null, + focusHighlight: null, + fontFamily: null, + fontSize: null, + fontSizeAdjust: null, + fontStretch: null, + fontStyle: null, + fontVariant: null, + fontWeight: null, + format: null, + fr: null, + from: null, + fx: null, + fy: null, + g1: commaSeparated, + g2: commaSeparated, + glyphName: commaSeparated, + glyphOrientationHorizontal: null, + glyphOrientationVertical: null, + glyphRef: null, + gradientTransform: null, + gradientUnits: null, + handler: null, + hanging: number, + hatchContentUnits: null, + hatchUnits: null, + height: null, + href: null, + hrefLang: null, + horizAdvX: number, + horizOriginX: number, + horizOriginY: number, + id: null, + ideographic: number, + imageRendering: null, + initialVisibility: null, + in: null, + in2: null, + intercept: number, + k: number, + k1: number, + k2: number, + k3: number, + k4: number, + kernelMatrix: commaOrSpaceSeparated, + kernelUnitLength: null, + keyPoints: null, + keySplines: null, + keyTimes: null, + kerning: null, + lang: null, + lengthAdjust: null, + letterSpacing: null, + lightingColor: null, + limitingConeAngle: number, + local: null, + markerEnd: null, + markerMid: null, + markerStart: null, + markerHeight: null, + markerUnits: null, + markerWidth: null, + mask: null, + maskContentUnits: null, + maskType: null, + maskUnits: null, + mathematical: null, + max: null, + media: null, + mediaCharacterEncoding: null, + mediaContentEncodings: null, + mediaSize: number, + mediaTime: null, + method: null, + min: null, + mode: null, + name: null, + navDown: null, + navDownLeft: null, + navDownRight: null, + navLeft: null, + navNext: null, + navPrev: null, + navRight: null, + navUp: null, + navUpLeft: null, + navUpRight: null, + numOctaves: null, + observer: null, + offset: null, + onAbort: null, + onActivate: null, + onAfterPrint: null, + onBeforePrint: null, + onBegin: null, + onCancel: null, + onCanPlay: null, + onCanPlayThrough: null, + onChange: null, + onClick: null, + onClose: null, + onCopy: null, + onCueChange: null, + onCut: null, + onDblClick: null, + onDrag: null, + onDragEnd: null, + onDragEnter: null, + onDragExit: null, + onDragLeave: null, + onDragOver: null, + onDragStart: null, + onDrop: null, + onDurationChange: null, + onEmptied: null, + onEnd: null, + onEnded: null, + onError: null, + onFocus: null, + onFocusIn: null, + onFocusOut: null, + onHashChange: null, + onInput: null, + onInvalid: null, + onKeyDown: null, + onKeyPress: null, + onKeyUp: null, + onLoad: null, + onLoadedData: null, + onLoadedMetadata: null, + onLoadStart: null, + onMessage: null, + onMouseDown: null, + onMouseEnter: null, + onMouseLeave: null, + onMouseMove: null, + onMouseOut: null, + onMouseOver: null, + onMouseUp: null, + onMouseWheel: null, + onOffline: null, + onOnline: null, + onPageHide: null, + onPageShow: null, + onPaste: null, + onPause: null, + onPlay: null, + onPlaying: null, + onPopState: null, + onProgress: null, + onRateChange: null, + onRepeat: null, + onReset: null, + onResize: null, + onScroll: null, + onSeeked: null, + onSeeking: null, + onSelect: null, + onShow: null, + onStalled: null, + onStorage: null, + onSubmit: null, + onSuspend: null, + onTimeUpdate: null, + onToggle: null, + onUnload: null, + onVolumeChange: null, + onWaiting: null, + onZoom: null, + opacity: null, + operator: null, + order: null, + orient: null, + orientation: null, + origin: null, + overflow: null, + overlay: null, + overlinePosition: number, + overlineThickness: number, + paintOrder: null, + panose1: null, + path: null, + pathLength: number, + patternContentUnits: null, + patternTransform: null, + patternUnits: null, + phase: null, + ping: spaceSeparated, + pitch: null, + playbackOrder: null, + pointerEvents: null, + points: null, + pointsAtX: number, + pointsAtY: number, + pointsAtZ: number, + preserveAlpha: null, + preserveAspectRatio: null, + primitiveUnits: null, + propagate: null, + property: commaOrSpaceSeparated, + r: null, + radius: null, + referrerPolicy: null, + refX: null, + refY: null, + rel: commaOrSpaceSeparated, + rev: commaOrSpaceSeparated, + renderingIntent: null, + repeatCount: null, + repeatDur: null, + requiredExtensions: commaOrSpaceSeparated, + requiredFeatures: commaOrSpaceSeparated, + requiredFonts: commaOrSpaceSeparated, + requiredFormats: commaOrSpaceSeparated, + resource: null, + restart: null, + result: null, + rotate: null, + rx: null, + ry: null, + scale: null, + seed: null, + shapeRendering: null, + side: null, + slope: null, + snapshotTime: null, + specularConstant: number, + specularExponent: number, + spreadMethod: null, + spacing: null, + startOffset: null, + stdDeviation: null, + stemh: null, + stemv: null, + stitchTiles: null, + stopColor: null, + stopOpacity: null, + strikethroughPosition: number, + strikethroughThickness: number, + string: null, + stroke: null, + strokeDashArray: commaOrSpaceSeparated, + strokeDashOffset: null, + strokeLineCap: null, + strokeLineJoin: null, + strokeMiterLimit: number, + strokeOpacity: number, + strokeWidth: null, + style: null, + surfaceScale: number, + syncBehavior: null, + syncBehaviorDefault: null, + syncMaster: null, + syncTolerance: null, + syncToleranceDefault: null, + systemLanguage: commaOrSpaceSeparated, + tabIndex: number, + tableValues: null, + target: null, + targetX: number, + targetY: number, + textAnchor: null, + textDecoration: null, + textRendering: null, + textLength: null, + timelineBegin: null, + title: null, + transformBehavior: null, + type: null, + typeOf: commaOrSpaceSeparated, + to: null, + transform: null, + transformOrigin: null, + u1: null, + u2: null, + underlinePosition: number, + underlineThickness: number, + unicode: null, + unicodeBidi: null, + unicodeRange: null, + unitsPerEm: number, + values: null, + vAlphabetic: number, + vMathematical: number, + vectorEffect: null, + vHanging: number, + vIdeographic: number, + version: null, + vertAdvY: number, + vertOriginX: number, + vertOriginY: number, + viewBox: null, + viewTarget: null, + visibility: null, + width: null, + widths: null, + wordSpacing: null, + writingMode: null, + x: null, + x1: null, + x2: null, + xChannelSelector: null, + xHeight: number, + y: null, + y1: null, + y2: null, + yChannelSelector: null, + z: null, + zoomAndPan: null + }, + space: "svg", + transform: caseSensitiveTransform +}); +//#endregion +//#region node_modules/property-information/lib/xlink.js +var xlink = create({ + properties: { + xLinkActuate: null, + xLinkArcRole: null, + xLinkHref: null, + xLinkRole: null, + xLinkShow: null, + xLinkTitle: null, + xLinkType: null + }, + space: "xlink", + transform(_, property) { + return "xlink:" + property.slice(5).toLowerCase(); + } +}); +//#endregion +//#region node_modules/property-information/lib/xmlns.js +var xmlns = create({ + attributes: { xmlnsxlink: "xmlns:xlink" }, + properties: { + xmlnsXLink: null, + xmlns: null + }, + space: "xmlns", + transform: caseInsensitiveTransform +}); +//#endregion +//#region node_modules/property-information/lib/xml.js +var xml = create({ + properties: { + xmlBase: null, + xmlLang: null, + xmlSpace: null + }, + space: "xml", + transform(_, property) { + return "xml:" + property.slice(3).toLowerCase(); + } +}); +//#endregion +//#region node_modules/property-information/lib/hast-to-react.js +/** +* Special cases for React (`Record`). +* +* `hast` is close to `React` but differs in a couple of cases. +* To get a React property from a hast property, +* check if it is in `hastToReact`. +* If it is, use the corresponding value; +* otherwise, use the hast property. +* +* @type {Record} +*/ +var hastToReact = { + classId: "classID", + dataType: "datatype", + itemId: "itemID", + strokeDashArray: "strokeDasharray", + strokeDashOffset: "strokeDashoffset", + strokeLineCap: "strokeLinecap", + strokeLineJoin: "strokeLinejoin", + strokeMiterLimit: "strokeMiterlimit", + typeOf: "typeof", + xLinkActuate: "xlinkActuate", + xLinkArcRole: "xlinkArcrole", + xLinkHref: "xlinkHref", + xLinkRole: "xlinkRole", + xLinkShow: "xlinkShow", + xLinkTitle: "xlinkTitle", + xLinkType: "xlinkType", + xmlnsXLink: "xmlnsXlink" +}; +//#endregion +//#region node_modules/property-information/lib/find.js +/** +* @import {Schema} from 'property-information' +*/ +var cap$1 = /[A-Z]/g; +var dash = /-[a-z]/g; +var valid = /^data[-\w.:]+$/i; +/** +* Look up info on a property. +* +* In most cases the given `schema` contains info on the property. +* All standard, +* most legacy, +* and some non-standard properties are supported. +* For these cases, +* the returned `Info` has hints about the value of the property. +* +* `name` can also be a valid data attribute or property, +* in which case an `Info` object with the correctly cased `attribute` and +* `property` is returned. +* +* `name` can be an unknown attribute, +* in which case an `Info` object with `attribute` and `property` set to the +* given name is returned. +* It is not recommended to provide unsupported legacy or recently specced +* properties. +* +* +* @param {Schema} schema +* Schema; +* either the `html` or `svg` export. +* @param {string} value +* An attribute-like or property-like name; +* it will be passed through `normalize` to hopefully find the correct info. +* @returns {Info} +* Info. +*/ +function find(schema, value) { + const normal = normalize$1(value); + let property = value; + let Type = Info; + if (normal in schema.normal) return schema.property[schema.normal[normal]]; + if (normal.length > 4 && normal.slice(0, 4) === "data" && valid.test(value)) { + if (value.charAt(4) === "-") { + const rest = value.slice(5).replace(dash, camelcase); + property = "data" + rest.charAt(0).toUpperCase() + rest.slice(1); + } else { + const rest = value.slice(4); + if (!dash.test(rest)) { + let dashes = rest.replace(cap$1, kebab); + if (dashes.charAt(0) !== "-") dashes = "-" + dashes; + value = "data" + dashes; + } + } + Type = DefinedInfo; + } + return new Type(property, value); +} +/** +* @param {string} $0 +* Value. +* @returns {string} +* Kebab. +*/ +function kebab($0) { + return "-" + $0.toLowerCase(); +} +/** +* @param {string} $0 +* Value. +* @returns {string} +* Camel. +*/ +function camelcase($0) { + return $0.charAt(1).toUpperCase(); +} +//#endregion +//#region node_modules/property-information/index.js +var html$2 = merge([ + aria, + html$3, + xlink, + xmlns, + xml +], "html"); +var svg = merge([ + aria, + svg$1, + xlink, + xmlns, + xml +], "svg"); +//#endregion +//#region node_modules/space-separated-tokens/index.js +/** +* Serialize an array of strings as space separated-tokens. +* +* @param {Array} values +* List of tokens. +* @returns {string} +* Space-separated tokens. +*/ +function stringify(values) { + return values.join(" ").trim(); +} +//#endregion +//#region node_modules/inline-style-parser/cjs/index.js +var require_cjs$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; + var NEWLINE_REGEX = /\n/g; + var WHITESPACE_REGEX = /^\s*/; + var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/; + var COLON_REGEX = /^:\s*/; + var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/; + var SEMICOLON_REGEX = /^[;\s]*/; + var TRIM_REGEX = /^\s+|\s+$/g; + var NEWLINE = "\n"; + var FORWARD_SLASH = "/"; + var ASTERISK = "*"; + var EMPTY_STRING = ""; + var TYPE_COMMENT = "comment"; + var TYPE_DECLARATION = "declaration"; + /** + * @param {String} style + * @param {Object} [options] + * @return {Object[]} + * @throws {TypeError} + * @throws {Error} + */ + function index(style, options) { + if (typeof style !== "string") throw new TypeError("First argument must be a string"); + if (!style) return []; + options = options || {}; + /** + * Positional. + */ + var lineno = 1; + var column = 1; + /** + * Update lineno and column based on `str`. + * + * @param {String} str + */ + function updatePosition(str) { + var lines = str.match(NEWLINE_REGEX); + if (lines) lineno += lines.length; + var i = str.lastIndexOf(NEWLINE); + column = ~i ? str.length - i : column + str.length; + } + /** + * Mark position and patch `node.position`. + * + * @return {Function} + */ + function position() { + var start = { + line: lineno, + column + }; + return function(node) { + node.position = new Position(start); + whitespace(); + return node; + }; + } + /** + * Store position information for a node. + * + * @constructor + * @property {Object} start + * @property {Object} end + * @property {undefined|String} source + */ + function Position(start) { + this.start = start; + this.end = { + line: lineno, + column + }; + this.source = options.source; + } + /** + * Non-enumerable source string. + */ + Position.prototype.content = style; + /** + * Error `msg`. + * + * @param {String} msg + * @throws {Error} + */ + function error(msg) { + var err = /* @__PURE__ */ new Error(options.source + ":" + lineno + ":" + column + ": " + msg); + err.reason = msg; + err.filename = options.source; + err.line = lineno; + err.column = column; + err.source = style; + if (options.silent); + else throw err; + } + /** + * Match `re` and return captures. + * + * @param {RegExp} re + * @return {undefined|Array} + */ + function match(re) { + var m = re.exec(style); + if (!m) return; + var str = m[0]; + updatePosition(str); + style = style.slice(str.length); + return m; + } + /** + * Parse whitespace. + */ + function whitespace() { + match(WHITESPACE_REGEX); + } + /** + * Parse comments. + * + * @param {Object[]} [rules] + * @return {Object[]} + */ + function comments(rules) { + var c; + rules = rules || []; + while (c = comment()) if (c !== false) rules.push(c); + return rules; + } + /** + * Parse comment. + * + * @return {Object} + * @throws {Error} + */ + function comment() { + var pos = position(); + if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return; + var i = 2; + while (EMPTY_STRING != style.charAt(i) && (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))) ++i; + i += 2; + if (EMPTY_STRING === style.charAt(i - 1)) return error("End of comment missing"); + var str = style.slice(2, i - 2); + column += 2; + updatePosition(str); + style = style.slice(i); + column += 2; + return pos({ + type: TYPE_COMMENT, + comment: str + }); + } + /** + * Parse declaration. + * + * @return {Object} + * @throws {Error} + */ + function declaration() { + var pos = position(); + var prop = match(PROPERTY_REGEX); + if (!prop) return; + comment(); + if (!match(COLON_REGEX)) return error("property missing ':'"); + var val = match(VALUE_REGEX); + var ret = pos({ + type: TYPE_DECLARATION, + property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)), + value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING + }); + match(SEMICOLON_REGEX); + return ret; + } + /** + * Parse declarations. + * + * @return {Object[]} + */ + function declarations() { + var decls = []; + comments(decls); + var decl; + while (decl = declaration()) if (decl !== false) { + decls.push(decl); + comments(decls); + } + return decls; + } + whitespace(); + return declarations(); + } + /** + * Trim `str`. + * + * @param {String} str + * @return {String} + */ + function trim(str) { + return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING; + } + module.exports = index; +})); +//#endregion +//#region node_modules/style-to-object/cjs/index.js +var require_cjs$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = StyleToObject; + var inline_style_parser_1 = __importDefault(require_cjs$2()); + /** + * Parses inline style to object. + * + * @param style - Inline style. + * @param iterator - Iterator. + * @returns - Style object or null. + * + * @example Parsing inline style to object: + * + * ```js + * import parse from 'style-to-object'; + * parse('line-height: 42;'); // { 'line-height': '42' } + * ``` + */ + function StyleToObject(style, iterator) { + let styleObject = null; + if (!style || typeof style !== "string") return styleObject; + const declarations = (0, inline_style_parser_1.default)(style); + const hasIterator = typeof iterator === "function"; + declarations.forEach((declaration) => { + if (declaration.type !== "declaration") return; + const { property, value } = declaration; + if (hasIterator) iterator(property, value, declaration); + else if (value) { + styleObject = styleObject || {}; + styleObject[property] = value; + } + }); + return styleObject; + } +})); +//#endregion +//#region node_modules/style-to-js/cjs/utilities.js +var require_utilities = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.camelCase = void 0; + var CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9_-]+$/; + var HYPHEN_REGEX = /-([a-z])/g; + var NO_HYPHEN_REGEX = /^[^-]+$/; + var VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/; + var MS_VENDOR_PREFIX_REGEX = /^-(ms)-/; + /** + * Checks whether to skip camelCase. + */ + var skipCamelCase = function(property) { + return !property || NO_HYPHEN_REGEX.test(property) || CUSTOM_PROPERTY_REGEX.test(property); + }; + /** + * Replacer that capitalizes first character. + */ + var capitalize = function(match, character) { + return character.toUpperCase(); + }; + /** + * Replacer that removes beginning hyphen of vendor prefix property. + */ + var trimHyphen = function(match, prefix) { + return "".concat(prefix, "-"); + }; + /** + * CamelCases a CSS property. + */ + var camelCase = function(property, options) { + if (options === void 0) options = {}; + if (skipCamelCase(property)) return property; + property = property.toLowerCase(); + if (options.reactCompat) property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen); + else property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen); + return property.replace(HYPHEN_REGEX, capitalize); + }; + exports.camelCase = camelCase; +})); +//#endregion +//#region node_modules/style-to-js/cjs/index.js +var require_cjs = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var style_to_object_1 = (exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + })(require_cjs$1()); + var utilities_1 = require_utilities(); + /** + * Parses CSS inline style to JavaScript object (camelCased). + */ + function StyleToJS(style, options) { + var output = {}; + if (!style || typeof style !== "string") return output; + (0, style_to_object_1.default)(style, function(property, value) { + if (property && value) output[(0, utilities_1.camelCase)(property, options)] = value; }); - }, [finding?.sample_index, slug]); - if (!finding) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { - className: "d-flex align-items-center justify-content-center text-body-secondary", - style: { - width: 380, - minWidth: 380 - }, - children: "Select a finding to view details." + return output; + } + StyleToJS.default = StyleToJS; + module.exports = StyleToJS; +})); +//#endregion +//#region node_modules/unist-util-position/lib/index.js +/** +* @typedef {import('unist').Node} Node +* @typedef {import('unist').Point} Point +* @typedef {import('unist').Position} Position +*/ +/** +* @typedef NodeLike +* @property {string} type +* @property {PositionLike | null | undefined} [position] +* +* @typedef PositionLike +* @property {PointLike | null | undefined} [start] +* @property {PointLike | null | undefined} [end] +* +* @typedef PointLike +* @property {number | null | undefined} [line] +* @property {number | null | undefined} [column] +* @property {number | null | undefined} [offset] +*/ +/** +* Get the ending point of `node`. +* +* @param node +* Node. +* @returns +* Point. +*/ +var pointEnd = point$2("end"); +/** +* Get the starting point of `node`. +* +* @param node +* Node. +* @returns +* Point. +*/ +var pointStart = point$2("start"); +/** +* Get the positional info of `node`. +* +* @param {'end' | 'start'} type +* Side. +* @returns +* Getter. +*/ +function point$2(type) { + return point; + /** + * Get the point info of `node` at a bound side. + * + * @param {Node | NodeLike | null | undefined} [node] + * @returns {Point | undefined} + */ + function point(node) { + const point = node && node.position && node.position[type] || {}; + if (typeof point.line === "number" && point.line > 0 && typeof point.column === "number" && point.column > 0) return { + line: point.line, + column: point.column, + offset: typeof point.offset === "number" && point.offset > -1 ? point.offset : void 0 + }; + } +} +/** +* Get the positional info of `node`. +* +* @param {Node | NodeLike | null | undefined} [node] +* Node. +* @returns {Position | undefined} +* Position. +*/ +function position$1(node) { + const start = pointStart(node); + const end = pointEnd(node); + if (start && end) return { + start, + end + }; +} +//#endregion +//#region node_modules/unist-util-stringify-position/lib/index.js +/** +* @typedef {import('unist').Node} Node +* @typedef {import('unist').Point} Point +* @typedef {import('unist').Position} Position +*/ +/** +* @typedef NodeLike +* @property {string} type +* @property {PositionLike | null | undefined} [position] +* +* @typedef PointLike +* @property {number | null | undefined} [line] +* @property {number | null | undefined} [column] +* @property {number | null | undefined} [offset] +* +* @typedef PositionLike +* @property {PointLike | null | undefined} [start] +* @property {PointLike | null | undefined} [end] +*/ +/** +* Serialize the positional info of a point, position (start and end points), +* or node. +* +* @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value] +* Node, position, or point. +* @returns {string} +* Pretty printed positional info of a node (`string`). +* +* In the format of a range `ls:cs-le:ce` (when given `node` or `position`) +* or a point `l:c` (when given `point`), where `l` stands for line, `c` for +* column, `s` for `start`, and `e` for end. +* An empty string (`''`) is returned if the given value is neither `node`, +* `position`, nor `point`. +*/ +function stringifyPosition(value) { + if (!value || typeof value !== "object") return ""; + if ("position" in value || "type" in value) return position(value.position); + if ("start" in value || "end" in value) return position(value); + if ("line" in value || "column" in value) return point$1(value); + return ""; +} +/** +* @param {Point | PointLike | null | undefined} point +* @returns {string} +*/ +function point$1(point) { + return index(point && point.line) + ":" + index(point && point.column); +} +/** +* @param {Position | PositionLike | null | undefined} pos +* @returns {string} +*/ +function position(pos) { + return point$1(pos && pos.start) + "-" + point$1(pos && pos.end); +} +/** +* @param {number | null | undefined} value +* @returns {number} +*/ +function index(value) { + return value && typeof value === "number" ? value : 1; +} +//#endregion +//#region node_modules/vfile-message/lib/index.js +/** +* @import {Node, Point, Position} from 'unist' +*/ +/** +* @typedef {object & {type: string, position?: Position | undefined}} NodeLike +* +* @typedef Options +* Configuration. +* @property {Array | null | undefined} [ancestors] +* Stack of (inclusive) ancestor nodes surrounding the message (optional). +* @property {Error | null | undefined} [cause] +* Original error cause of the message (optional). +* @property {Point | Position | null | undefined} [place] +* Place of message (optional). +* @property {string | null | undefined} [ruleId] +* Category of message (optional, example: `'my-rule'`). +* @property {string | null | undefined} [source] +* Namespace of who sent the message (optional, example: `'my-package'`). +*/ +/** +* Message. +*/ +var VFileMessage = class extends Error { + /** + * Create a message for `reason`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {Options | null | undefined} [options] + * @returns + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns + * Instance of `VFileMessage`. + */ + constructor(causeOrReason, optionsOrParentOrPlace, origin) { + super(); + if (typeof optionsOrParentOrPlace === "string") { + origin = optionsOrParentOrPlace; + optionsOrParentOrPlace = void 0; + } + /** @type {string} */ + let reason = ""; + /** @type {Options} */ + let options = {}; + let legacyCause = false; + if (optionsOrParentOrPlace) if ("line" in optionsOrParentOrPlace && "column" in optionsOrParentOrPlace) options = { place: optionsOrParentOrPlace }; + else if ("start" in optionsOrParentOrPlace && "end" in optionsOrParentOrPlace) options = { place: optionsOrParentOrPlace }; + else if ("type" in optionsOrParentOrPlace) options = { + ancestors: [optionsOrParentOrPlace], + place: optionsOrParentOrPlace.position + }; + else options = { ...optionsOrParentOrPlace }; + if (typeof causeOrReason === "string") reason = causeOrReason; + else if (!options.cause && causeOrReason) { + legacyCause = true; + reason = causeOrReason.message; + options.cause = causeOrReason; + } + if (!options.ruleId && !options.source && typeof origin === "string") { + const index = origin.indexOf(":"); + if (index === -1) options.ruleId = origin; + else { + options.source = origin.slice(0, index); + options.ruleId = origin.slice(index + 1); + } + } + if (!options.place && options.ancestors && options.ancestors) { + const parent = options.ancestors[options.ancestors.length - 1]; + if (parent) options.place = parent.position; + } + const start = options.place && "start" in options.place ? options.place.start : options.place; + /** + * Stack of ancestor nodes surrounding the message. + * + * @type {Array | undefined} + */ + this.ancestors = options.ancestors || void 0; + /** + * Original error cause of the message. + * + * @type {Error | undefined} + */ + this.cause = options.cause || void 0; + /** + * Starting column of message. + * + * @type {number | undefined} + */ + this.column = start ? start.column : void 0; + /** + * State of problem. + * + * * `true` — error, file not usable + * * `false` — warning, change may be needed + * * `undefined` — change likely not needed + * + * @type {boolean | null | undefined} + */ + this.fatal = void 0; + /** + * Path of a file (used throughout the `VFile` ecosystem). + * + * @type {string | undefined} + */ + this.file = ""; + /** + * Reason for message. + * + * @type {string} + */ + this.message = reason; + /** + * Starting line of error. + * + * @type {number | undefined} + */ + this.line = start ? start.line : void 0; + /** + * Serialized positional info of message. + * + * On normal errors, this would be something like `ParseError`, buit in + * `VFile` messages we use this space to show where an error happened. + */ + this.name = stringifyPosition(options.place) || "1:1"; + /** + * Place of message. + * + * @type {Point | Position | undefined} + */ + this.place = options.place || void 0; + /** + * Reason for message, should use markdown. + * + * @type {string} + */ + this.reason = this.message; + /** + * Category of message (example: `'my-rule'`). + * + * @type {string | undefined} + */ + this.ruleId = options.ruleId || void 0; + /** + * Namespace of message (example: `'my-package'`). + * + * @type {string | undefined} + */ + this.source = options.source || void 0; + /** + * Stack of message. + * + * This is used by normal errors to show where something happened in + * programming code, irrelevant for `VFile` messages, + * + * @type {string} + */ + this.stack = legacyCause && options.cause && typeof options.cause.stack === "string" ? options.cause.stack : ""; + /** + * Specify the source value that’s being reported, which is deemed + * incorrect. + * + * @type {string | undefined} + */ + this.actual = void 0; + /** + * Suggest acceptable values that can be used instead of `actual`. + * + * @type {Array | undefined} + */ + this.expected = void 0; + /** + * Long form description of the message (you should use markdown). + * + * @type {string | undefined} + */ + this.note = void 0; + /** + * Link to docs for the message. + * + * > 👉 **Note**: this must be an absolute URL that can be passed as `x` + * > to `new URL(x)`. + * + * @type {string | undefined} + */ + this.url = void 0; + } +}; +VFileMessage.prototype.file = ""; +VFileMessage.prototype.name = ""; +VFileMessage.prototype.reason = ""; +VFileMessage.prototype.message = ""; +VFileMessage.prototype.stack = ""; +VFileMessage.prototype.column = void 0; +VFileMessage.prototype.line = void 0; +VFileMessage.prototype.ancestors = void 0; +VFileMessage.prototype.cause = void 0; +VFileMessage.prototype.fatal = void 0; +VFileMessage.prototype.place = void 0; +VFileMessage.prototype.ruleId = void 0; +VFileMessage.prototype.source = void 0; +//#endregion +//#region node_modules/hast-util-to-jsx-runtime/lib/index.js +/** +* @import {Identifier, Literal, MemberExpression} from 'estree' +* @import {Jsx, JsxDev, Options, Props} from 'hast-util-to-jsx-runtime' +* @import {Element, Nodes, Parents, Root, Text} from 'hast' +* @import {MdxFlowExpressionHast, MdxTextExpressionHast} from 'mdast-util-mdx-expression' +* @import {MdxJsxFlowElementHast, MdxJsxTextElementHast} from 'mdast-util-mdx-jsx' +* @import {MdxjsEsmHast} from 'mdast-util-mdxjs-esm' +* @import {Position} from 'unist' +* @import {Child, Create, Field, JsxElement, State, Style} from './types.js' +*/ +var import_cjs = /* @__PURE__ */ __toESM(require_cjs(), 1); +var own$3 = {}.hasOwnProperty; +/** @type {Map} */ +var emptyMap = /* @__PURE__ */ new Map(); +var cap = /[A-Z]/g; +var tableElements = new Set([ + "table", + "tbody", + "thead", + "tfoot", + "tr" +]); +var tableCellElement = new Set(["td", "th"]); +var docs = "https://github.com/syntax-tree/hast-util-to-jsx-runtime"; +/** +* Transform a hast tree to preact, react, solid, svelte, vue, etc., +* with an automatic JSX runtime. +* +* @param {Nodes} tree +* Tree to transform. +* @param {Options} options +* Configuration (required). +* @returns {JsxElement} +* JSX element. +*/ +function toJsxRuntime(tree, options) { + if (!options || options.Fragment === void 0) throw new TypeError("Expected `Fragment` in options"); + const filePath = options.filePath || void 0; + /** @type {Create} */ + let create; + if (options.development) { + if (typeof options.jsxDEV !== "function") throw new TypeError("Expected `jsxDEV` in options when `development: true`"); + create = developmentCreate(filePath, options.jsxDEV); + } else { + if (typeof options.jsx !== "function") throw new TypeError("Expected `jsx` in production options"); + if (typeof options.jsxs !== "function") throw new TypeError("Expected `jsxs` in production options"); + create = productionCreate(filePath, options.jsx, options.jsxs); + } + /** @type {State} */ + const state = { + Fragment: options.Fragment, + ancestors: [], + components: options.components || {}, + create, + elementAttributeNameCase: options.elementAttributeNameCase || "react", + evaluater: options.createEvaluater ? options.createEvaluater() : void 0, + filePath, + ignoreInvalidStyle: options.ignoreInvalidStyle || false, + passKeys: options.passKeys !== false, + passNode: options.passNode || false, + schema: options.space === "svg" ? svg : html$2, + stylePropertyNameCase: options.stylePropertyNameCase || "dom", + tableCellAlignToStyle: options.tableCellAlignToStyle !== false + }; + const result = one$1(state, tree, void 0); + if (result && typeof result !== "string") return result; + return state.create(tree, state.Fragment, { children: result || void 0 }, void 0); +} +/** +* Transform a node. +* +* @param {State} state +* Info passed around. +* @param {Nodes} node +* Current node. +* @param {string | undefined} key +* Key. +* @returns {Child | undefined} +* Child, optional. +*/ +function one$1(state, node, key) { + if (node.type === "element") return element$1(state, node, key); + if (node.type === "mdxFlowExpression" || node.type === "mdxTextExpression") return mdxExpression(state, node); + if (node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement") return mdxJsxElement(state, node, key); + if (node.type === "mdxjsEsm") return mdxEsm(state, node); + if (node.type === "root") return root$2(state, node, key); + if (node.type === "text") return text$5(state, node); +} +/** +* Handle element. +* +* @param {State} state +* Info passed around. +* @param {Element} node +* Current node. +* @param {string | undefined} key +* Key. +* @returns {Child | undefined} +* Child, optional. +*/ +function element$1(state, node, key) { + const parentSchema = state.schema; + let schema = parentSchema; + if (node.tagName.toLowerCase() === "svg" && parentSchema.space === "html") { + schema = svg; + state.schema = schema; + } + state.ancestors.push(node); + const type = findComponentFromName(state, node.tagName, false); + const props = createElementProps(state, node); + let children = createChildren(state, node); + if (tableElements.has(node.tagName)) children = children.filter(function(child) { + return typeof child === "string" ? !whitespace(child) : true; }); - const handleTriage = (status) => { - triageFinding(finding.id, finding.triage_status === status ? "pending" : status); + addNode(state, props, type, node); + addChildren(props, children); + state.ancestors.pop(); + state.schema = parentSchema; + return state.create(node, type, props, key); +} +/** +* Handle MDX expression. +* +* @param {State} state +* Info passed around. +* @param {MdxFlowExpressionHast | MdxTextExpressionHast} node +* Current node. +* @returns {Child | undefined} +* Child, optional. +*/ +function mdxExpression(state, node) { + if (node.data && node.data.estree && state.evaluater) { + const expression = node.data.estree.body[0]; + expression.type; + return state.evaluater.evaluateExpression(expression.expression); + } + crashEstree(state, node.position); +} +/** +* Handle MDX ESM. +* +* @param {State} state +* Info passed around. +* @param {MdxjsEsmHast} node +* Current node. +* @returns {Child | undefined} +* Child, optional. +*/ +function mdxEsm(state, node) { + if (node.data && node.data.estree && state.evaluater) return state.evaluater.evaluateProgram(node.data.estree); + crashEstree(state, node.position); +} +/** +* Handle MDX JSX. +* +* @param {State} state +* Info passed around. +* @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node +* Current node. +* @param {string | undefined} key +* Key. +* @returns {Child | undefined} +* Child, optional. +*/ +function mdxJsxElement(state, node, key) { + const parentSchema = state.schema; + let schema = parentSchema; + if (node.name === "svg" && parentSchema.space === "html") { + schema = svg; + state.schema = schema; + } + state.ancestors.push(node); + const type = node.name === null ? state.Fragment : findComponentFromName(state, node.name, true); + const props = createJsxElementProps(state, node); + const children = createChildren(state, node); + addNode(state, props, type, node); + addChildren(props, children); + state.ancestors.pop(); + state.schema = parentSchema; + return state.create(node, type, props, key); +} +/** +* Handle root. +* +* @param {State} state +* Info passed around. +* @param {Root} node +* Current node. +* @param {string | undefined} key +* Key. +* @returns {Child | undefined} +* Child, optional. +*/ +function root$2(state, node, key) { + /** @type {Props} */ + const props = {}; + addChildren(props, createChildren(state, node)); + return state.create(node, state.Fragment, props, key); +} +/** +* Handle text. +* +* @param {State} _ +* Info passed around. +* @param {Text} node +* Current node. +* @returns {Child | undefined} +* Child, optional. +*/ +function text$5(_, node) { + return node.value; +} +/** +* Add `node` to props. +* +* @param {State} state +* Info passed around. +* @param {Props} props +* Props. +* @param {unknown} type +* Type. +* @param {Element | MdxJsxFlowElementHast | MdxJsxTextElementHast} node +* Node. +* @returns {undefined} +* Nothing. +*/ +function addNode(state, props, type, node) { + if (typeof type !== "string" && type !== state.Fragment && state.passNode) props.node = node; +} +/** +* Add children to props. +* +* @param {Props} props +* Props. +* @param {Array} children +* Children. +* @returns {undefined} +* Nothing. +*/ +function addChildren(props, children) { + if (children.length > 0) { + const value = children.length > 1 ? children : children[0]; + if (value) props.children = value; + } +} +/** +* @param {string | undefined} _ +* Path to file. +* @param {Jsx} jsx +* Dynamic. +* @param {Jsx} jsxs +* Static. +* @returns {Create} +* Create a production element. +*/ +function productionCreate(_, jsx, jsxs) { + return create; + /** @type {Create} */ + function create(_, type, props, key) { + const fn = Array.isArray(props.children) ? jsxs : jsx; + return key ? fn(type, props, key) : fn(type, props); + } +} +/** +* @param {string | undefined} filePath +* Path to file. +* @param {JsxDev} jsxDEV +* Development. +* @returns {Create} +* Create a development element. +*/ +function developmentCreate(filePath, jsxDEV) { + return create; + /** @type {Create} */ + function create(node, type, props, key) { + const isStaticChildren = Array.isArray(props.children); + const point = pointStart(node); + return jsxDEV(type, props, key, isStaticChildren, { + columnNumber: point ? point.column - 1 : void 0, + fileName: filePath, + lineNumber: point ? point.line : void 0 + }, void 0); + } +} +/** +* Create props from an element. +* +* @param {State} state +* Info passed around. +* @param {Element} node +* Current element. +* @returns {Props} +* Props. +*/ +function createElementProps(state, node) { + /** @type {Props} */ + const props = {}; + /** @type {string | undefined} */ + let alignValue; + /** @type {string} */ + let prop; + for (prop in node.properties) if (prop !== "children" && own$3.call(node.properties, prop)) { + const result = createProperty(state, prop, node.properties[prop]); + if (result) { + const [key, value] = result; + if (state.tableCellAlignToStyle && key === "align" && typeof value === "string" && tableCellElement.has(node.tagName)) alignValue = value; + else props[key] = value; + } + } + if (alignValue) { + const style = props.style || (props.style = {}); + style[state.stylePropertyNameCase === "css" ? "text-align" : "textAlign"] = alignValue; + } + return props; +} +/** +* Create props from a JSX element. +* +* @param {State} state +* Info passed around. +* @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node +* Current JSX element. +* @returns {Props} +* Props. +*/ +function createJsxElementProps(state, node) { + /** @type {Props} */ + const props = {}; + for (const attribute of node.attributes) if (attribute.type === "mdxJsxExpressionAttribute") if (attribute.data && attribute.data.estree && state.evaluater) { + const expression = attribute.data.estree.body[0]; + expression.type; + const objectExpression = expression.expression; + objectExpression.type; + const property = objectExpression.properties[0]; + property.type; + Object.assign(props, state.evaluater.evaluateExpression(property.argument)); + } else crashEstree(state, node.position); + else { + const name = attribute.name; + /** @type {unknown} */ + let value; + if (attribute.value && typeof attribute.value === "object") if (attribute.value.data && attribute.value.data.estree && state.evaluater) { + const expression = attribute.value.data.estree.body[0]; + expression.type; + value = state.evaluater.evaluateExpression(expression.expression); + } else crashEstree(state, node.position); + else value = attribute.value === null ? true : attribute.value; + props[name] = value; + } + return props; +} +/** +* Create children. +* +* @param {State} state +* Info passed around. +* @param {Parents} node +* Current element. +* @returns {Array} +* Children. +*/ +function createChildren(state, node) { + /** @type {Array} */ + const children = []; + let index = -1; + /** @type {Map} */ + /* c8 ignore next */ + const countsByName = state.passKeys ? /* @__PURE__ */ new Map() : emptyMap; + while (++index < node.children.length) { + const child = node.children[index]; + /** @type {string | undefined} */ + let key; + if (state.passKeys) { + const name = child.type === "element" ? child.tagName : child.type === "mdxJsxFlowElement" || child.type === "mdxJsxTextElement" ? child.name : void 0; + if (name) { + const count = countsByName.get(name) || 0; + key = name + "-" + count; + countsByName.set(name, count + 1); + } + } + const result = one$1(state, child, key); + if (result !== void 0) children.push(result); + } + return children; +} +/** +* Handle a property. +* +* @param {State} state +* Info passed around. +* @param {string} prop +* Key. +* @param {Array | boolean | number | string | null | undefined} value +* hast property value. +* @returns {Field | undefined} +* Field for runtime, optional. +*/ +function createProperty(state, prop, value) { + const info = find(state.schema, prop); + if (value === null || value === void 0 || typeof value === "number" && Number.isNaN(value)) return; + if (Array.isArray(value)) value = info.commaSeparated ? stringify$1(value) : stringify(value); + if (info.property === "style") { + let styleObject = typeof value === "object" ? value : parseStyle(state, String(value)); + if (state.stylePropertyNameCase === "css") styleObject = transformStylesToCssCasing(styleObject); + return ["style", styleObject]; + } + return [state.elementAttributeNameCase === "react" && info.space ? hastToReact[info.property] || info.property : info.attribute, value]; +} +/** +* Parse a CSS declaration to an object. +* +* @param {State} state +* Info passed around. +* @param {string} value +* CSS declarations. +* @returns {Style} +* Properties. +* @throws +* Throws `VFileMessage` when CSS cannot be parsed. +*/ +function parseStyle(state, value) { + try { + return (0, import_cjs.default)(value, { reactCompat: true }); + } catch (error) { + if (state.ignoreInvalidStyle) return {}; + const cause = error; + const message = new VFileMessage("Cannot parse `style` attribute", { + ancestors: state.ancestors, + cause, + ruleId: "style", + source: "hast-util-to-jsx-runtime" + }); + message.file = state.filePath || void 0; + message.url = docs + "#cannot-parse-style-attribute"; + throw message; + } +} +/** +* Create a JSX name from a string. +* +* @param {State} state +* To do. +* @param {string} name +* Name. +* @param {boolean} allowExpression +* Allow member expressions and identifiers. +* @returns {unknown} +* To do. +*/ +function findComponentFromName(state, name$1, allowExpression) { + /** @type {Identifier | Literal | MemberExpression} */ + let result; + if (!allowExpression) result = { + type: "Literal", + value: name$1 }; - const filtered = getFilteredFindings(findings, searchParams.get("scanner"), searchParams.get("severity"), searchParams.get("triage")); - const idx = filtered.findIndex((f) => f.id === finding.id); - const navigateFinding = (direction) => { - const next = direction === "next" ? Math.min(idx + 1, filtered.length - 1) : Math.max(idx - 1, 0); - if (next !== idx) setSelectedFinding(filtered[next]); + else if (name$1.includes(".")) { + const identifiers = name$1.split("."); + let index = -1; + /** @type {Identifier | Literal | MemberExpression | undefined} */ + let node; + while (++index < identifiers.length) { + /** @type {Identifier | Literal} */ + const prop = name(identifiers[index]) ? { + type: "Identifier", + name: identifiers[index] + } : { + type: "Literal", + value: identifiers[index] + }; + node = node ? { + type: "MemberExpression", + object: node, + property: prop, + computed: Boolean(index && prop.type === "Literal"), + optional: false + } : prop; + } + result = node; + } else result = name(name$1) && !/^[a-z]/.test(name$1) ? { + type: "Identifier", + name: name$1 + } : { + type: "Literal", + value: name$1 }; - const allImages = [...(sampleDetail?.images ?? []).map((img) => ({ - src: img.data_url, - label: img.field - })), ...(sampleDetail?.files ?? []).map((f) => ({ - src: f.data_url, - label: f.name - }))]; - return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { - className: "border-start d-flex flex-column", - style: { - width: 380, - minWidth: 380, - overflowY: "auto" - }, - children: [ - /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { - className: "p-3 border-bottom", - children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { - className: "d-flex justify-content-between align-items-start mb-2", - children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { - className: "badge bg-primary me-1", - children: finding.scanner - }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SeverityBadge, { severity: finding.severity })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { - className: "text-body-secondary small", - children: ["Sample #", finding.sample_index] - })] - }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { - className: "mb-0", - children: finding.explanation - })] - }), - finding.metadata && Object.keys(finding.metadata).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { - className: "p-3 border-bottom", - children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h6", { - className: "text-uppercase text-body-secondary small mb-2", - children: "Details" - }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dl", { - className: "mb-0 small", - children: Object.entries(finding.metadata).map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { - className: "mb-1", - children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dt", { - className: "d-inline text-body-secondary", - children: [key, ": "] - }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { - className: "d-inline", - children: typeof value === "object" ? JSON.stringify(value) : String(value) - })] - }, key)) - })] - }), - /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { - className: "p-3 border-bottom", - children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h6", { - className: "text-uppercase text-body-secondary small mb-2", - children: "Sample" - }), sampleLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { - className: "text-body-secondary small", - children: "Loading…" - }) : sampleDetail ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ - /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { - className: "mb-2 small", - children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { - className: "text-body-secondary fw-semibold", - children: "Q: " - }), sampleDetail.question] - }), - /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { - className: "mb-2 small", + if (result.type === "Literal") { + const name = result.value; + return own$3.call(state.components, name) ? state.components[name] : name; + } + if (state.evaluater) return state.evaluater.evaluateExpression(result); + crashEstree(state); +} +/** +* @param {State} state +* @param {Position | undefined} [place] +* @returns {never} +*/ +function crashEstree(state, place) { + const message = new VFileMessage("Cannot handle MDX estrees without `createEvaluater`", { + ancestors: state.ancestors, + place, + ruleId: "mdx-estree", + source: "hast-util-to-jsx-runtime" + }); + message.file = state.filePath || void 0; + message.url = docs + "#cannot-handle-mdx-estrees-without-createevaluater"; + throw message; +} +/** +* Transform a DOM casing style object to a CSS casing style object. +* +* @param {Style} domCasing +* @returns {Style} +*/ +function transformStylesToCssCasing(domCasing) { + /** @type {Style} */ + const cssCasing = {}; + /** @type {string} */ + let from; + for (from in domCasing) if (own$3.call(domCasing, from)) cssCasing[transformStyleToCssCasing(from)] = domCasing[from]; + return cssCasing; +} +/** +* Transform a DOM casing style field to a CSS casing style field. +* +* @param {string} from +* @returns {string} +*/ +function transformStyleToCssCasing(from) { + let to = from.replace(cap, toDash); + if (to.slice(0, 3) === "ms-") to = "-" + to; + return to; +} +/** +* Make `$0` dash cased. +* +* @param {string} $0 +* Capitalized ASCII leter. +* @returns {string} +* Dash and lower letter. +*/ +function toDash($0) { + return "-" + $0.toLowerCase(); +} +//#endregion +//#region node_modules/html-url-attributes/lib/index.js +/** +* HTML URL properties. +* +* Each key is a property name and each value is a list of tag names it applies +* to or `null` if it applies to all elements. +* +* @type {Record | null>} +*/ +var urlAttributes = { + action: ["form"], + cite: [ + "blockquote", + "del", + "ins", + "q" + ], + data: ["object"], + formAction: ["button", "input"], + href: [ + "a", + "area", + "base", + "link" + ], + icon: ["menuitem"], + itemId: null, + manifest: ["html"], + ping: ["a", "area"], + poster: ["video"], + src: [ + "audio", + "embed", + "iframe", + "img", + "input", + "script", + "source", + "track", + "video" + ] +}; +//#endregion +//#region node_modules/mdast-util-to-string/lib/index.js +/** +* @typedef {import('mdast').Nodes} Nodes +* +* @typedef Options +* Configuration (optional). +* @property {boolean | null | undefined} [includeImageAlt=true] +* Whether to use `alt` for `image`s (default: `true`). +* @property {boolean | null | undefined} [includeHtml=true] +* Whether to use `value` of HTML (default: `true`). +*/ +/** @type {Options} */ +var emptyOptions$2 = {}; +/** +* Get the text content of a node or list of nodes. +* +* Prefers the node’s plain-text fields, otherwise serializes its children, +* and if the given value is an array, serialize the nodes in it. +* +* @param {unknown} [value] +* Thing to serialize, typically `Node`. +* @param {Options | null | undefined} [options] +* Configuration (optional). +* @returns {string} +* Serialized `value`. +*/ +function toString$1(value, options) { + const settings = options || emptyOptions$2; + return one(value, typeof settings.includeImageAlt === "boolean" ? settings.includeImageAlt : true, typeof settings.includeHtml === "boolean" ? settings.includeHtml : true); +} +/** +* One node or several nodes. +* +* @param {unknown} value +* Thing to serialize. +* @param {boolean} includeImageAlt +* Include image `alt`s. +* @param {boolean} includeHtml +* Include HTML. +* @returns {string} +* Serialized node. +*/ +function one(value, includeImageAlt, includeHtml) { + if (node(value)) { + if ("value" in value) return value.type === "html" && !includeHtml ? "" : value.value; + if (includeImageAlt && "alt" in value && value.alt) return value.alt; + if ("children" in value) return all(value.children, includeImageAlt, includeHtml); + } + if (Array.isArray(value)) return all(value, includeImageAlt, includeHtml); + return ""; +} +/** +* Serialize a list of nodes. +* +* @param {Array} values +* Thing to serialize. +* @param {boolean} includeImageAlt +* Include image `alt`s. +* @param {boolean} includeHtml +* Include HTML. +* @returns {string} +* Serialized nodes. +*/ +function all(values, includeImageAlt, includeHtml) { + /** @type {Array} */ + const result = []; + let index = -1; + while (++index < values.length) result[index] = one(values[index], includeImageAlt, includeHtml); + return result.join(""); +} +/** +* Check if `value` looks like a node. +* +* @param {unknown} value +* Thing. +* @returns {value is Nodes} +* Whether `value` is a node. +*/ +function node(value) { + return Boolean(value && typeof value === "object"); +} +//#endregion +//#region node_modules/decode-named-character-reference/index.dom.js +var element = document.createElement("i"); +/** +* @param {string} value +* @returns {string | false} +*/ +function decodeNamedCharacterReference(value) { + const characterReference = "&" + value + ";"; + element.innerHTML = characterReference; + const character = element.textContent; + if (character.charCodeAt(character.length - 1) === 59 && value !== "semi") return false; + return character === characterReference ? false : character; +} +//#endregion +//#region node_modules/micromark-util-chunked/index.js +/** +* Like `Array#splice`, but smarter for giant arrays. +* +* `Array#splice` takes all items to be inserted as individual argument which +* causes a stack overflow in V8 when trying to insert 100k items for instance. +* +* Otherwise, this does not return the removed items, and takes `items` as an +* array instead of rest parameters. +* +* @template {unknown} T +* Item type. +* @param {Array} list +* List to operate on. +* @param {number} start +* Index to remove/insert at (can be negative). +* @param {number} remove +* Number of items to remove. +* @param {Array} items +* Items to inject into `list`. +* @returns {undefined} +* Nothing. +*/ +function splice(list, start, remove, items) { + const end = list.length; + let chunkStart = 0; + /** @type {Array} */ + let parameters; + if (start < 0) start = -start > end ? 0 : end + start; + else start = start > end ? end : start; + remove = remove > 0 ? remove : 0; + if (items.length < 1e4) { + parameters = Array.from(items); + parameters.unshift(start, remove); + list.splice(...parameters); + } else { + if (remove) list.splice(start, remove); + while (chunkStart < items.length) { + parameters = items.slice(chunkStart, chunkStart + 1e4); + parameters.unshift(start, 0); + list.splice(...parameters); + chunkStart += 1e4; + start += 1e4; + } + } +} +/** +* Append `items` (an array) at the end of `list` (another array). +* When `list` was empty, returns `items` instead. +* +* This prevents a potentially expensive operation when `list` is empty, +* and adds items in batches to prevent V8 from hanging. +* +* @template {unknown} T +* Item type. +* @param {Array} list +* List to operate on. +* @param {Array} items +* Items to add to `list`. +* @returns {Array} +* Either `list` or `items`. +*/ +function push(list, items) { + if (list.length > 0) { + splice(list, list.length, 0, items); + return list; + } + return items; +} +//#endregion +//#region node_modules/micromark-util-combine-extensions/index.js +/** +* @import { +* Extension, +* Handles, +* HtmlExtension, +* NormalizedExtension +* } from 'micromark-util-types' +*/ +var hasOwnProperty = {}.hasOwnProperty; +/** +* Combine multiple syntax extensions into one. +* +* @param {ReadonlyArray} extensions +* List of syntax extensions. +* @returns {NormalizedExtension} +* A single combined extension. +*/ +function combineExtensions(extensions) { + /** @type {NormalizedExtension} */ + const all = {}; + let index = -1; + while (++index < extensions.length) syntaxExtension(all, extensions[index]); + return all; +} +/** +* Merge `extension` into `all`. +* +* @param {NormalizedExtension} all +* Extension to merge into. +* @param {Extension} extension +* Extension to merge. +* @returns {undefined} +* Nothing. +*/ +function syntaxExtension(all, extension) { + /** @type {keyof Extension} */ + let hook; + for (hook in extension) { + /** @type {Record} */ + const left = (hasOwnProperty.call(all, hook) ? all[hook] : void 0) || (all[hook] = {}); + /** @type {Record | undefined} */ + const right = extension[hook]; + /** @type {string} */ + let code; + if (right) for (code in right) { + if (!hasOwnProperty.call(left, code)) left[code] = []; + const value = right[code]; + constructs(left[code], Array.isArray(value) ? value : value ? [value] : []); + } + } +} +/** +* Merge `list` into `existing` (both lists of constructs). +* Mutates `existing`. +* +* @param {Array} existing +* List of constructs to merge into. +* @param {Array} list +* List of constructs to merge. +* @returns {undefined} +* Nothing. +*/ +function constructs(existing, list) { + let index = -1; + /** @type {Array} */ + const before = []; + while (++index < list.length) (list[index].add === "after" ? existing : before).push(list[index]); + splice(existing, 0, 0, before); +} +//#endregion +//#region node_modules/micromark-util-decode-numeric-character-reference/index.js +/** +* Turn the number (in string form as either hexa- or plain decimal) coming from +* a numeric character reference into a character. +* +* Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes +* non-characters and control characters safe. +* +* @param {string} value +* Value to decode. +* @param {number} base +* Numeric base. +* @returns {string} +* Character. +*/ +function decodeNumericCharacterReference(value, base) { + const code = Number.parseInt(value, base); + if (code < 9 || code === 11 || code > 13 && code < 32 || code > 126 && code < 160 || code > 55295 && code < 57344 || code > 64975 && code < 65008 || (code & 65535) === 65535 || (code & 65535) === 65534 || code > 1114111) return "�"; + return String.fromCodePoint(code); +} +//#endregion +//#region node_modules/micromark-util-normalize-identifier/index.js +/** +* Normalize an identifier (as found in references, definitions). +* +* Collapses markdown whitespace, trim, and then lower- and uppercase. +* +* Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their +* lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different +* uppercase character (U+0398 (`Θ`)). +* So, to get a canonical form, we perform both lower- and uppercase. +* +* Using uppercase last makes sure keys will never interact with default +* prototypal values (such as `constructor`): nothing in the prototype of +* `Object` is uppercase. +* +* @param {string} value +* Identifier to normalize. +* @returns {string} +* Normalized identifier. +*/ +function normalizeIdentifier(value) { + return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase(); +} +//#endregion +//#region node_modules/micromark-util-character/index.js +/** +* @import {Code} from 'micromark-util-types' +*/ +/** +* Check whether the character code represents an ASCII alpha (`a` through `z`, +* case insensitive). +* +* An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha. +* +* An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`) +* to U+005A (`Z`). +* +* An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`) +* to U+007A (`z`). +* +* @param code +* Code. +* @returns {boolean} +* Whether it matches. +*/ +var asciiAlpha = regexCheck(/[A-Za-z]/); +/** +* Check whether the character code represents an ASCII alphanumeric (`a` +* through `z`, case insensitive, or `0` through `9`). +* +* An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha +* (see `asciiAlpha`). +* +* @param code +* Code. +* @returns {boolean} +* Whether it matches. +*/ +var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/); +/** +* Check whether the character code represents an ASCII atext. +* +* atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in +* the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`), +* U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F +* SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E +* CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE +* (`{`) to U+007E TILDE (`~`). +* +* See: +* **\[RFC5322]**: +* [Internet Message Format](https://tools.ietf.org/html/rfc5322). +* P. Resnick. +* IETF. +* +* @param code +* Code. +* @returns {boolean} +* Whether it matches. +*/ +var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/); +/** +* Check whether a character code is an ASCII control character. +* +* An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL) +* to U+001F (US), or U+007F (DEL). +* +* @param {Code} code +* Code. +* @returns {boolean} +* Whether it matches. +*/ +function asciiControl(code) { + return code !== null && (code < 32 || code === 127); +} +/** +* Check whether the character code represents an ASCII digit (`0` through `9`). +* +* An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to +* U+0039 (`9`). +* +* @param code +* Code. +* @returns {boolean} +* Whether it matches. +*/ +var asciiDigit = regexCheck(/\d/); +/** +* Check whether the character code represents an ASCII hex digit (`a` through +* `f`, case insensitive, or `0` through `9`). +* +* An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex +* digit, or an ASCII lower hex digit. +* +* An **ASCII upper hex digit** is a character in the inclusive range U+0041 +* (`A`) to U+0046 (`F`). +* +* An **ASCII lower hex digit** is a character in the inclusive range U+0061 +* (`a`) to U+0066 (`f`). +* +* @param code +* Code. +* @returns {boolean} +* Whether it matches. +*/ +var asciiHexDigit = regexCheck(/[\dA-Fa-f]/); +/** +* Check whether the character code represents ASCII punctuation. +* +* An **ASCII punctuation** is a character in the inclusive ranges U+0021 +* EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT +* SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT +* (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`). +* +* @param code +* Code. +* @returns {boolean} +* Whether it matches. +*/ +var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/); +/** +* Check whether a character code is a markdown line ending. +* +* A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN +* LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR). +* +* In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE +* RETURN (CR) are replaced by these virtual characters depending on whether +* they occurred together. +* +* @param {Code} code +* Code. +* @returns {boolean} +* Whether it matches. +*/ +function markdownLineEnding(code) { + return code !== null && code < -2; +} +/** +* Check whether a character code is a markdown line ending (see +* `markdownLineEnding`) or markdown space (see `markdownSpace`). +* +* @param {Code} code +* Code. +* @returns {boolean} +* Whether it matches. +*/ +function markdownLineEndingOrSpace(code) { + return code !== null && (code < 0 || code === 32); +} +/** +* Check whether a character code is a markdown space. +* +* A **markdown space** is the concrete character U+0020 SPACE (SP) and the +* virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT). +* +* In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is +* replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL +* SPACE (VS) characters, depending on the column at which the tab occurred. +* +* @param {Code} code +* Code. +* @returns {boolean} +* Whether it matches. +*/ +function markdownSpace(code) { + return code === -2 || code === -1 || code === 32; +} +/** +* Check whether the character code represents Unicode punctuation. +* +* A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation, +* Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf` +* (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po` +* (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII +* punctuation (see `asciiPunctuation`). +* +* See: +* **\[UNICODE]**: +* [The Unicode Standard](https://www.unicode.org/versions/). +* Unicode Consortium. +* +* @param code +* Code. +* @returns +* Whether it matches. +*/ +var unicodePunctuation = regexCheck(/\p{P}|\p{S}/u); +/** +* Check whether the character code represents Unicode whitespace. +* +* Note that this does handle micromark specific markdown whitespace characters. +* See `markdownLineEndingOrSpace` to check that. +* +* A **Unicode whitespace** is a character in the Unicode `Zs` (Separator, +* Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF), +* U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**). +* +* See: +* **\[UNICODE]**: +* [The Unicode Standard](https://www.unicode.org/versions/). +* Unicode Consortium. +* +* @param code +* Code. +* @returns +* Whether it matches. +*/ +var unicodeWhitespace = regexCheck(/\s/); +/** +* Create a code check from a regex. +* +* @param {RegExp} regex +* Expression. +* @returns {(code: Code) => boolean} +* Check. +*/ +function regexCheck(regex) { + return check; + /** + * Check whether a code matches the bound regex. + * + * @param {Code} code + * Character code. + * @returns {boolean} + * Whether the character code matches the bound regex. + */ + function check(code) { + return code !== null && code > -1 && regex.test(String.fromCharCode(code)); + } +} +//#endregion +//#region node_modules/micromark-util-sanitize-uri/index.js +/** +* Normalize a URL. +* +* Encode unsafe characters with percent-encoding, skipping already encoded +* sequences. +* +* @param {string} value +* URI to normalize. +* @returns {string} +* Normalized URI. +*/ +function normalizeUri(value) { + /** @type {Array} */ + const result = []; + let index = -1; + let start = 0; + let skip = 0; + while (++index < value.length) { + const code = value.charCodeAt(index); + /** @type {string} */ + let replace = ""; + if (code === 37 && asciiAlphanumeric(value.charCodeAt(index + 1)) && asciiAlphanumeric(value.charCodeAt(index + 2))) skip = 2; + else if (code < 128) { + if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) replace = String.fromCharCode(code); + } else if (code > 55295 && code < 57344) { + const next = value.charCodeAt(index + 1); + if (code < 56320 && next > 56319 && next < 57344) { + replace = String.fromCharCode(code, next); + skip = 1; + } else replace = "�"; + } else replace = String.fromCharCode(code); + if (replace) { + result.push(value.slice(start, index), encodeURIComponent(replace)); + start = index + skip + 1; + replace = ""; + } + if (skip) { + index += skip; + skip = 0; + } + } + return result.join("") + value.slice(start); +} +//#endregion +//#region node_modules/micromark-factory-space/index.js +/** +* @import {Effects, State, TokenType} from 'micromark-util-types' +*/ +/** +* Parse spaces and tabs. +* +* There is no `nok` parameter: +* +* * spaces in markdown are often optional, in which case this factory can be +* used and `ok` will be switched to whether spaces were found or not +* * one line ending or space can be detected with `markdownSpace(code)` right +* before using `factorySpace` +* +* ###### Examples +* +* Where `␉` represents a tab (plus how much it expands) and `␠` represents a +* single space. +* +* ```markdown +* ␉ +* ␠␠␠␠ +* ␉␠ +* ``` +* +* @param {Effects} effects +* Context. +* @param {State} ok +* State switched to when successful. +* @param {TokenType} type +* Type (`' \t'`). +* @param {number | undefined} [max=Infinity] +* Max (exclusive). +* @returns {State} +* Start state. +*/ +function factorySpace(effects, ok, type, max) { + const limit = max ? max - 1 : Number.POSITIVE_INFINITY; + let size = 0; + return start; + /** @type {State} */ + function start(code) { + if (markdownSpace(code)) { + effects.enter(type); + return prefix(code); + } + return ok(code); + } + /** @type {State} */ + function prefix(code) { + if (markdownSpace(code) && size++ < limit) { + effects.consume(code); + return prefix; + } + effects.exit(type); + return ok(code); + } +} +//#endregion +//#region node_modules/micromark/lib/initialize/content.js +/** +* @import { +* InitialConstruct, +* Initializer, +* State, +* TokenizeContext, +* Token +* } from 'micromark-util-types' +*/ +/** @type {InitialConstruct} */ +var content$1 = { tokenize: initializeContent }; +/** +* @this {TokenizeContext} +* Context. +* @type {Initializer} +* Content. +*/ +function initializeContent(effects) { + const contentStart = effects.attempt(this.parser.constructs.contentInitial, afterContentStartConstruct, paragraphInitial); + /** @type {Token} */ + let previous; + return contentStart; + /** @type {State} */ + function afterContentStartConstruct(code) { + if (code === null) { + effects.consume(code); + return; + } + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return factorySpace(effects, contentStart, "linePrefix"); + } + /** @type {State} */ + function paragraphInitial(code) { + effects.enter("paragraph"); + return lineStart(code); + } + /** @type {State} */ + function lineStart(code) { + const token = effects.enter("chunkText", { + contentType: "text", + previous + }); + if (previous) previous.next = token; + previous = token; + return data(code); + } + /** @type {State} */ + function data(code) { + if (code === null) { + effects.exit("chunkText"); + effects.exit("paragraph"); + effects.consume(code); + return; + } + if (markdownLineEnding(code)) { + effects.consume(code); + effects.exit("chunkText"); + return lineStart; + } + effects.consume(code); + return data; + } +} +//#endregion +//#region node_modules/micromark/lib/initialize/document.js +/** +* @import { +* Construct, +* ContainerState, +* InitialConstruct, +* Initializer, +* Point, +* State, +* TokenizeContext, +* Tokenizer, +* Token +* } from 'micromark-util-types' +*/ +/** +* @typedef {[Construct, ContainerState]} StackItem +* Construct and its state. +*/ +/** @type {InitialConstruct} */ +var document$2 = { tokenize: initializeDocument }; +/** @type {Construct} */ +var containerConstruct = { tokenize: tokenizeContainer }; +/** +* @this {TokenizeContext} +* Self. +* @type {Initializer} +* Initializer. +*/ +function initializeDocument(effects) { + const self = this; + /** @type {Array} */ + const stack = []; + let continued = 0; + /** @type {TokenizeContext | undefined} */ + let childFlow; + /** @type {Token | undefined} */ + let childToken; + /** @type {number} */ + let lineStartOffset; + return start; + /** @type {State} */ + function start(code) { + if (continued < stack.length) { + const item = stack[continued]; + self.containerState = item[1]; + return effects.attempt(item[0].continuation, documentContinue, checkNewContainers)(code); + } + return checkNewContainers(code); + } + /** @type {State} */ + function documentContinue(code) { + continued++; + if (self.containerState._closeFlow) { + self.containerState._closeFlow = void 0; + if (childFlow) closeFlow(); + const indexBeforeExits = self.events.length; + let indexBeforeFlow = indexBeforeExits; + /** @type {Point | undefined} */ + let point; + while (indexBeforeFlow--) if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") { + point = self.events[indexBeforeFlow][1].end; + break; + } + exitContainers(continued); + let index = indexBeforeExits; + while (index < self.events.length) { + self.events[index][1].end = { ...point }; + index++; + } + splice(self.events, indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits)); + self.events.length = index; + return checkNewContainers(code); + } + return start(code); + } + /** @type {State} */ + function checkNewContainers(code) { + if (continued === stack.length) { + if (!childFlow) return documentContinued(code); + if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) return flowStart(code); + self.interrupt = Boolean(childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack); + } + self.containerState = {}; + return effects.check(containerConstruct, thereIsANewContainer, thereIsNoNewContainer)(code); + } + /** @type {State} */ + function thereIsANewContainer(code) { + if (childFlow) closeFlow(); + exitContainers(continued); + return documentContinued(code); + } + /** @type {State} */ + function thereIsNoNewContainer(code) { + self.parser.lazy[self.now().line] = continued !== stack.length; + lineStartOffset = self.now().offset; + return flowStart(code); + } + /** @type {State} */ + function documentContinued(code) { + self.containerState = {}; + return effects.attempt(containerConstruct, containerContinue, flowStart)(code); + } + /** @type {State} */ + function containerContinue(code) { + continued++; + stack.push([self.currentConstruct, self.containerState]); + return documentContinued(code); + } + /** @type {State} */ + function flowStart(code) { + if (code === null) { + if (childFlow) closeFlow(); + exitContainers(0); + effects.consume(code); + return; + } + childFlow = childFlow || self.parser.flow(self.now()); + effects.enter("chunkFlow", { + _tokenizer: childFlow, + contentType: "flow", + previous: childToken + }); + return flowContinue(code); + } + /** @type {State} */ + function flowContinue(code) { + if (code === null) { + writeToChild(effects.exit("chunkFlow"), true); + exitContainers(0); + effects.consume(code); + return; + } + if (markdownLineEnding(code)) { + effects.consume(code); + writeToChild(effects.exit("chunkFlow")); + continued = 0; + self.interrupt = void 0; + return start; + } + effects.consume(code); + return flowContinue; + } + /** + * @param {Token} token + * Token. + * @param {boolean | undefined} [endOfFile] + * Whether the token is at the end of the file (default: `false`). + * @returns {undefined} + * Nothing. + */ + function writeToChild(token, endOfFile) { + const stream = self.sliceStream(token); + if (endOfFile) stream.push(null); + token.previous = childToken; + if (childToken) childToken.next = token; + childToken = token; + childFlow.defineSkip(token.start); + childFlow.write(stream); + if (self.parser.lazy[token.start.line]) { + let index = childFlow.events.length; + while (index--) if (childFlow.events[index][1].start.offset < lineStartOffset && (!childFlow.events[index][1].end || childFlow.events[index][1].end.offset > lineStartOffset)) return; + const indexBeforeExits = self.events.length; + let indexBeforeFlow = indexBeforeExits; + /** @type {boolean | undefined} */ + let seen; + /** @type {Point | undefined} */ + let point; + while (indexBeforeFlow--) if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") { + if (seen) { + point = self.events[indexBeforeFlow][1].end; + break; + } + seen = true; + } + exitContainers(continued); + index = indexBeforeExits; + while (index < self.events.length) { + self.events[index][1].end = { ...point }; + index++; + } + splice(self.events, indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits)); + self.events.length = index; + } + } + /** + * @param {number} size + * Size. + * @returns {undefined} + * Nothing. + */ + function exitContainers(size) { + let index = stack.length; + while (index-- > size) { + const entry = stack[index]; + self.containerState = entry[1]; + entry[0].exit.call(self, effects); + } + stack.length = size; + } + function closeFlow() { + childFlow.write([null]); + childToken = void 0; + childFlow = void 0; + self.containerState._closeFlow = void 0; + } +} +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +* Tokenizer. +*/ +function tokenizeContainer(effects, ok, nok) { + return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4); +} +//#endregion +//#region node_modules/micromark-util-classify-character/index.js +/** +* @import {Code} from 'micromark-util-types' +*/ +/** +* Classify whether a code represents whitespace, punctuation, or something +* else. +* +* Used for attention (emphasis, strong), whose sequences can open or close +* based on the class of surrounding characters. +* +* > 👉 **Note**: eof (`null`) is seen as whitespace. +* +* @param {Code} code +* Code. +* @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined} +* Group. +*/ +function classifyCharacter(code) { + if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) return 1; + if (unicodePunctuation(code)) return 2; +} +//#endregion +//#region node_modules/micromark-util-resolve-all/index.js +/** +* @import {Event, Resolver, TokenizeContext} from 'micromark-util-types' +*/ +/** +* Call all `resolveAll`s. +* +* @param {ReadonlyArray<{resolveAll?: Resolver | undefined}>} constructs +* List of constructs, optionally with `resolveAll`s. +* @param {Array} events +* List of events. +* @param {TokenizeContext} context +* Context used by `tokenize`. +* @returns {Array} +* Changed events. +*/ +function resolveAll(constructs, events, context) { + /** @type {Array} */ + const called = []; + let index = -1; + while (++index < constructs.length) { + const resolve = constructs[index].resolveAll; + if (resolve && !called.includes(resolve)) { + events = resolve(events, context); + called.push(resolve); + } + } + return events; +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/attention.js +/** +* @import { +* Code, +* Construct, +* Event, +* Point, +* Resolver, +* State, +* TokenizeContext, +* Tokenizer, +* Token +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var attention = { + name: "attention", + resolveAll: resolveAllAttention, + tokenize: tokenizeAttention +}; +/** +* Take all events and resolve attention to emphasis or strong. +* +* @type {Resolver} +*/ +function resolveAllAttention(events, context) { + let index = -1; + /** @type {number} */ + let open; + /** @type {Token} */ + let group; + /** @type {Token} */ + let text; + /** @type {Token} */ + let openingSequence; + /** @type {Token} */ + let closingSequence; + /** @type {number} */ + let use; + /** @type {Array} */ + let nextEvents; + /** @type {number} */ + let offset; + while (++index < events.length) if (events[index][0] === "enter" && events[index][1].type === "attentionSequence" && events[index][1]._close) { + open = index; + while (open--) if (events[open][0] === "exit" && events[open][1].type === "attentionSequence" && events[open][1]._open && context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) { + if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) continue; + use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1; + const start = { ...events[open][1].end }; + const end = { ...events[index][1].start }; + movePoint(start, -use); + movePoint(end, use); + openingSequence = { + type: use > 1 ? "strongSequence" : "emphasisSequence", + start, + end: { ...events[open][1].end } + }; + closingSequence = { + type: use > 1 ? "strongSequence" : "emphasisSequence", + start: { ...events[index][1].start }, + end + }; + text = { + type: use > 1 ? "strongText" : "emphasisText", + start: { ...events[open][1].end }, + end: { ...events[index][1].start } + }; + group = { + type: use > 1 ? "strong" : "emphasis", + start: { ...openingSequence.start }, + end: { ...closingSequence.end } + }; + events[open][1].end = { ...openingSequence.start }; + events[index][1].start = { ...closingSequence.end }; + nextEvents = []; + if (events[open][1].end.offset - events[open][1].start.offset) nextEvents = push(nextEvents, [[ + "enter", + events[open][1], + context + ], [ + "exit", + events[open][1], + context + ]]); + nextEvents = push(nextEvents, [ + [ + "enter", + group, + context + ], + [ + "enter", + openingSequence, + context + ], + [ + "exit", + openingSequence, + context + ], + [ + "enter", + text, + context + ] + ]); + nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context)); + nextEvents = push(nextEvents, [ + [ + "exit", + text, + context + ], + [ + "enter", + closingSequence, + context + ], + [ + "exit", + closingSequence, + context + ], + [ + "exit", + group, + context + ] + ]); + if (events[index][1].end.offset - events[index][1].start.offset) { + offset = 2; + nextEvents = push(nextEvents, [[ + "enter", + events[index][1], + context + ], [ + "exit", + events[index][1], + context + ]]); + } else offset = 0; + splice(events, open - 1, index - open + 3, nextEvents); + index = open + nextEvents.length - offset - 2; + break; + } + } + index = -1; + while (++index < events.length) if (events[index][1].type === "attentionSequence") events[index][1].type = "data"; + return events; +} +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeAttention(effects, ok) { + const attentionMarkers = this.parser.constructs.attentionMarkers.null; + const previous = this.previous; + const before = classifyCharacter(previous); + /** @type {NonNullable} */ + let marker; + return start; + /** + * Before a sequence. + * + * ```markdown + * > | ** + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + marker = code; + effects.enter("attentionSequence"); + return inside(code); + } + /** + * In a sequence. + * + * ```markdown + * > | ** + * ^^ + * ``` + * + * @type {State} + */ + function inside(code) { + if (code === marker) { + effects.consume(code); + return inside; + } + const token = effects.exit("attentionSequence"); + const after = classifyCharacter(code); + const open = !after || after === 2 && before || attentionMarkers.includes(code); + const close = !before || before === 2 && after || attentionMarkers.includes(previous); + token._open = Boolean(marker === 42 ? open : open && (before || !close)); + token._close = Boolean(marker === 42 ? close : close && (after || !open)); + return ok(code); + } +} +/** +* Move a point a bit. +* +* Note: `move` only works inside lines! It’s not possible to move past other +* chunks (replacement characters, tabs, or line endings). +* +* @param {Point} point +* Point. +* @param {number} offset +* Amount to move. +* @returns {undefined} +* Nothing. +*/ +function movePoint(point, offset) { + point.column += offset; + point.offset += offset; + point._bufferIndex += offset; +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/autolink.js +/** +* @import { +* Construct, +* State, +* TokenizeContext, +* Tokenizer +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var autolink = { + name: "autolink", + tokenize: tokenizeAutolink +}; +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeAutolink(effects, ok, nok) { + let size = 0; + return start; + /** + * Start of an autolink. + * + * ```markdown + * > | ab + * ^ + * > | ab + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + effects.enter("autolink"); + effects.enter("autolinkMarker"); + effects.consume(code); + effects.exit("autolinkMarker"); + effects.enter("autolinkProtocol"); + return open; + } + /** + * After `<`, at protocol or atext. + * + * ```markdown + * > | ab + * ^ + * > | ab + * ^ + * ``` + * + * @type {State} + */ + function open(code) { + if (asciiAlpha(code)) { + effects.consume(code); + return schemeOrEmailAtext; + } + if (code === 64) return nok(code); + return emailAtext(code); + } + /** + * At second byte of protocol or atext. + * + * ```markdown + * > | ab + * ^ + * > | ab + * ^ + * ``` + * + * @type {State} + */ + function schemeOrEmailAtext(code) { + if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) { + size = 1; + return schemeInsideOrEmailAtext(code); + } + return emailAtext(code); + } + /** + * In ambiguous protocol or atext. + * + * ```markdown + * > | ab + * ^ + * > | ab + * ^ + * ``` + * + * @type {State} + */ + function schemeInsideOrEmailAtext(code) { + if (code === 58) { + effects.consume(code); + size = 0; + return urlInside; + } + if ((code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && size++ < 32) { + effects.consume(code); + return schemeInsideOrEmailAtext; + } + size = 0; + return emailAtext(code); + } + /** + * After protocol, in URL. + * + * ```markdown + * > | ab + * ^ + * ``` + * + * @type {State} + */ + function urlInside(code) { + if (code === 62) { + effects.exit("autolinkProtocol"); + effects.enter("autolinkMarker"); + effects.consume(code); + effects.exit("autolinkMarker"); + effects.exit("autolink"); + return ok; + } + if (code === null || code === 32 || code === 60 || asciiControl(code)) return nok(code); + effects.consume(code); + return urlInside; + } + /** + * In email atext. + * + * ```markdown + * > | ab + * ^ + * ``` + * + * @type {State} + */ + function emailAtext(code) { + if (code === 64) { + effects.consume(code); + return emailAtSignOrDot; + } + if (asciiAtext(code)) { + effects.consume(code); + return emailAtext; + } + return nok(code); + } + /** + * In label, after at-sign or dot. + * + * ```markdown + * > | ab + * ^ ^ + * ``` + * + * @type {State} + */ + function emailAtSignOrDot(code) { + return asciiAlphanumeric(code) ? emailLabel(code) : nok(code); + } + /** + * In label, where `.` and `>` are allowed. + * + * ```markdown + * > | ab + * ^ + * ``` + * + * @type {State} + */ + function emailLabel(code) { + if (code === 46) { + effects.consume(code); + size = 0; + return emailAtSignOrDot; + } + if (code === 62) { + effects.exit("autolinkProtocol").type = "autolinkEmail"; + effects.enter("autolinkMarker"); + effects.consume(code); + effects.exit("autolinkMarker"); + effects.exit("autolink"); + return ok; + } + return emailValue(code); + } + /** + * In label, where `.` and `>` are *not* allowed. + * + * Though, this is also used in `emailLabel` to parse other values. + * + * ```markdown + * > | ab + * ^ + * ``` + * + * @type {State} + */ + function emailValue(code) { + if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) { + const next = code === 45 ? emailValue : emailLabel; + effects.consume(code); + return next; + } + return nok(code); + } +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/blank-line.js +/** +* @import { +* Construct, +* State, +* TokenizeContext, +* Tokenizer +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var blankLine = { + partial: true, + tokenize: tokenizeBlankLine +}; +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeBlankLine(effects, ok, nok) { + return start; + /** + * Start of blank line. + * + * > 👉 **Note**: `␠` represents a space character. + * + * ```markdown + * > | ␠␠␊ + * ^ + * > | ␊ + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + return markdownSpace(code) ? factorySpace(effects, after, "linePrefix")(code) : after(code); + } + /** + * At eof/eol, after optional whitespace. + * + * > 👉 **Note**: `␠` represents a space character. + * + * ```markdown + * > | ␠␠␊ + * ^ + * > | ␊ + * ^ + * ``` + * + * @type {State} + */ + function after(code) { + return code === null || markdownLineEnding(code) ? ok(code) : nok(code); + } +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/block-quote.js +/** +* @import { +* Construct, +* Exiter, +* State, +* TokenizeContext, +* Tokenizer +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var blockQuote = { + continuation: { tokenize: tokenizeBlockQuoteContinuation }, + exit: exit$1, + name: "blockQuote", + tokenize: tokenizeBlockQuoteStart +}; +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeBlockQuoteStart(effects, ok, nok) { + const self = this; + return start; + /** + * Start of block quote. + * + * ```markdown + * > | > a + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + if (code === 62) { + const state = self.containerState; + if (!state.open) { + effects.enter("blockQuote", { _container: true }); + state.open = true; + } + effects.enter("blockQuotePrefix"); + effects.enter("blockQuoteMarker"); + effects.consume(code); + effects.exit("blockQuoteMarker"); + return after; + } + return nok(code); + } + /** + * After `>`, before optional whitespace. + * + * ```markdown + * > | > a + * ^ + * ``` + * + * @type {State} + */ + function after(code) { + if (markdownSpace(code)) { + effects.enter("blockQuotePrefixWhitespace"); + effects.consume(code); + effects.exit("blockQuotePrefixWhitespace"); + effects.exit("blockQuotePrefix"); + return ok; + } + effects.exit("blockQuotePrefix"); + return ok(code); + } +} +/** +* Start of block quote continuation. +* +* ```markdown +* | > a +* > | > b +* ^ +* ``` +* +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeBlockQuoteContinuation(effects, ok, nok) { + const self = this; + return contStart; + /** + * Start of block quote continuation. + * + * Also used to parse the first block quote opening. + * + * ```markdown + * | > a + * > | > b + * ^ + * ``` + * + * @type {State} + */ + function contStart(code) { + if (markdownSpace(code)) return factorySpace(effects, contBefore, "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code); + return contBefore(code); + } + /** + * At `>`, after optional whitespace. + * + * Also used to parse the first block quote opening. + * + * ```markdown + * | > a + * > | > b + * ^ + * ``` + * + * @type {State} + */ + function contBefore(code) { + return effects.attempt(blockQuote, ok, nok)(code); + } +} +/** @type {Exiter} */ +function exit$1(effects) { + effects.exit("blockQuote"); +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/character-escape.js +/** +* @import { +* Construct, +* State, +* TokenizeContext, +* Tokenizer +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var characterEscape = { + name: "characterEscape", + tokenize: tokenizeCharacterEscape +}; +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeCharacterEscape(effects, ok, nok) { + return start; + /** + * Start of character escape. + * + * ```markdown + * > | a\*b + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + effects.enter("characterEscape"); + effects.enter("escapeMarker"); + effects.consume(code); + effects.exit("escapeMarker"); + return inside; + } + /** + * After `\`, at punctuation. + * + * ```markdown + * > | a\*b + * ^ + * ``` + * + * @type {State} + */ + function inside(code) { + if (asciiPunctuation(code)) { + effects.enter("characterEscapeValue"); + effects.consume(code); + effects.exit("characterEscapeValue"); + effects.exit("characterEscape"); + return ok; + } + return nok(code); + } +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/character-reference.js +/** +* @import { +* Code, +* Construct, +* State, +* TokenizeContext, +* Tokenizer +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var characterReference = { + name: "characterReference", + tokenize: tokenizeCharacterReference +}; +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeCharacterReference(effects, ok, nok) { + const self = this; + let size = 0; + /** @type {number} */ + let max; + /** @type {(code: Code) => boolean} */ + let test; + return start; + /** + * Start of character reference. + * + * ```markdown + * > | a&b + * ^ + * > | a{b + * ^ + * > | a b + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + effects.enter("characterReference"); + effects.enter("characterReferenceMarker"); + effects.consume(code); + effects.exit("characterReferenceMarker"); + return open; + } + /** + * After `&`, at `#` for numeric references or alphanumeric for named + * references. + * + * ```markdown + * > | a&b + * ^ + * > | a{b + * ^ + * > | a b + * ^ + * ``` + * + * @type {State} + */ + function open(code) { + if (code === 35) { + effects.enter("characterReferenceMarkerNumeric"); + effects.consume(code); + effects.exit("characterReferenceMarkerNumeric"); + return numeric; + } + effects.enter("characterReferenceValue"); + max = 31; + test = asciiAlphanumeric; + return value(code); + } + /** + * After `#`, at `x` for hexadecimals or digit for decimals. + * + * ```markdown + * > | a{b + * ^ + * > | a b + * ^ + * ``` + * + * @type {State} + */ + function numeric(code) { + if (code === 88 || code === 120) { + effects.enter("characterReferenceMarkerHexadecimal"); + effects.consume(code); + effects.exit("characterReferenceMarkerHexadecimal"); + effects.enter("characterReferenceValue"); + max = 6; + test = asciiHexDigit; + return value; + } + effects.enter("characterReferenceValue"); + max = 7; + test = asciiDigit; + return value(code); + } + /** + * After markers (`&#x`, `&#`, or `&`), in value, before `;`. + * + * The character reference kind defines what and how many characters are + * allowed. + * + * ```markdown + * > | a&b + * ^^^ + * > | a{b + * ^^^ + * > | a b + * ^ + * ``` + * + * @type {State} + */ + function value(code) { + if (code === 59 && size) { + const token = effects.exit("characterReferenceValue"); + if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self.sliceSerialize(token))) return nok(code); + effects.enter("characterReferenceMarker"); + effects.consume(code); + effects.exit("characterReferenceMarker"); + effects.exit("characterReference"); + return ok; + } + if (test(code) && size++ < max) { + effects.consume(code); + return value; + } + return nok(code); + } +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/code-fenced.js +/** +* @import { +* Code, +* Construct, +* State, +* TokenizeContext, +* Tokenizer +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var nonLazyContinuation = { + partial: true, + tokenize: tokenizeNonLazyContinuation +}; +/** @type {Construct} */ +var codeFenced = { + concrete: true, + name: "codeFenced", + tokenize: tokenizeCodeFenced +}; +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeCodeFenced(effects, ok, nok) { + const self = this; + /** @type {Construct} */ + const closeStart = { + partial: true, + tokenize: tokenizeCloseStart + }; + let initialPrefix = 0; + let sizeOpen = 0; + /** @type {NonNullable} */ + let marker; + return start; + /** + * Start of code. + * + * ```markdown + * > | ~~~js + * ^ + * | alert(1) + * | ~~~ + * ``` + * + * @type {State} + */ + function start(code) { + return beforeSequenceOpen(code); + } + /** + * In opening fence, after prefix, at sequence. + * + * ```markdown + * > | ~~~js + * ^ + * | alert(1) + * | ~~~ + * ``` + * + * @type {State} + */ + function beforeSequenceOpen(code) { + const tail = self.events[self.events.length - 1]; + initialPrefix = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; + marker = code; + effects.enter("codeFenced"); + effects.enter("codeFencedFence"); + effects.enter("codeFencedFenceSequence"); + return sequenceOpen(code); + } + /** + * In opening fence sequence. + * + * ```markdown + * > | ~~~js + * ^ + * | alert(1) + * | ~~~ + * ``` + * + * @type {State} + */ + function sequenceOpen(code) { + if (code === marker) { + sizeOpen++; + effects.consume(code); + return sequenceOpen; + } + if (sizeOpen < 3) return nok(code); + effects.exit("codeFencedFenceSequence"); + return markdownSpace(code) ? factorySpace(effects, infoBefore, "whitespace")(code) : infoBefore(code); + } + /** + * In opening fence, after the sequence (and optional whitespace), before info. + * + * ```markdown + * > | ~~~js + * ^ + * | alert(1) + * | ~~~ + * ``` + * + * @type {State} + */ + function infoBefore(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("codeFencedFence"); + return self.interrupt ? ok(code) : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code); + } + effects.enter("codeFencedFenceInfo"); + effects.enter("chunkString", { contentType: "string" }); + return info(code); + } + /** + * In info. + * + * ```markdown + * > | ~~~js + * ^ + * | alert(1) + * | ~~~ + * ``` + * + * @type {State} + */ + function info(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("chunkString"); + effects.exit("codeFencedFenceInfo"); + return infoBefore(code); + } + if (markdownSpace(code)) { + effects.exit("chunkString"); + effects.exit("codeFencedFenceInfo"); + return factorySpace(effects, metaBefore, "whitespace")(code); + } + if (code === 96 && code === marker) return nok(code); + effects.consume(code); + return info; + } + /** + * In opening fence, after info and whitespace, before meta. + * + * ```markdown + * > | ~~~js eval + * ^ + * | alert(1) + * | ~~~ + * ``` + * + * @type {State} + */ + function metaBefore(code) { + if (code === null || markdownLineEnding(code)) return infoBefore(code); + effects.enter("codeFencedFenceMeta"); + effects.enter("chunkString", { contentType: "string" }); + return meta(code); + } + /** + * In meta. + * + * ```markdown + * > | ~~~js eval + * ^ + * | alert(1) + * | ~~~ + * ``` + * + * @type {State} + */ + function meta(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("chunkString"); + effects.exit("codeFencedFenceMeta"); + return infoBefore(code); + } + if (code === 96 && code === marker) return nok(code); + effects.consume(code); + return meta; + } + /** + * At eol/eof in code, before a non-lazy closing fence or content. + * + * ```markdown + * > | ~~~js + * ^ + * > | alert(1) + * ^ + * | ~~~ + * ``` + * + * @type {State} + */ + function atNonLazyBreak(code) { + return effects.attempt(closeStart, after, contentBefore)(code); + } + /** + * Before code content, not a closing fence, at eol. + * + * ```markdown + * | ~~~js + * > | alert(1) + * ^ + * | ~~~ + * ``` + * + * @type {State} + */ + function contentBefore(code) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return contentStart; + } + /** + * Before code content, not a closing fence. + * + * ```markdown + * | ~~~js + * > | alert(1) + * ^ + * | ~~~ + * ``` + * + * @type {State} + */ + function contentStart(code) { + return initialPrefix > 0 && markdownSpace(code) ? factorySpace(effects, beforeContentChunk, "linePrefix", initialPrefix + 1)(code) : beforeContentChunk(code); + } + /** + * Before code content, after optional prefix. + * + * ```markdown + * | ~~~js + * > | alert(1) + * ^ + * | ~~~ + * ``` + * + * @type {State} + */ + function beforeContentChunk(code) { + if (code === null || markdownLineEnding(code)) return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code); + effects.enter("codeFlowValue"); + return contentChunk(code); + } + /** + * In code content. + * + * ```markdown + * | ~~~js + * > | alert(1) + * ^^^^^^^^ + * | ~~~ + * ``` + * + * @type {State} + */ + function contentChunk(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("codeFlowValue"); + return beforeContentChunk(code); + } + effects.consume(code); + return contentChunk; + } + /** + * After code. + * + * ```markdown + * | ~~~js + * | alert(1) + * > | ~~~ + * ^ + * ``` + * + * @type {State} + */ + function after(code) { + effects.exit("codeFenced"); + return ok(code); + } + /** + * @this {TokenizeContext} + * Context. + * @type {Tokenizer} + */ + function tokenizeCloseStart(effects, ok, nok) { + let size = 0; + return startBefore; + /** + * + * + * @type {State} + */ + function startBefore(code) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return start; + } + /** + * Before closing fence, at optional whitespace. + * + * ```markdown + * | ~~~js + * | alert(1) + * > | ~~~ + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + effects.enter("codeFencedFence"); + return markdownSpace(code) ? factorySpace(effects, beforeSequenceClose, "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code) : beforeSequenceClose(code); + } + /** + * In closing fence, after optional whitespace, at sequence. + * + * ```markdown + * | ~~~js + * | alert(1) + * > | ~~~ + * ^ + * ``` + * + * @type {State} + */ + function beforeSequenceClose(code) { + if (code === marker) { + effects.enter("codeFencedFenceSequence"); + return sequenceClose(code); + } + return nok(code); + } + /** + * In closing fence sequence. + * + * ```markdown + * | ~~~js + * | alert(1) + * > | ~~~ + * ^ + * ``` + * + * @type {State} + */ + function sequenceClose(code) { + if (code === marker) { + size++; + effects.consume(code); + return sequenceClose; + } + if (size >= sizeOpen) { + effects.exit("codeFencedFenceSequence"); + return markdownSpace(code) ? factorySpace(effects, sequenceCloseAfter, "whitespace")(code) : sequenceCloseAfter(code); + } + return nok(code); + } + /** + * After closing fence sequence, after optional whitespace. + * + * ```markdown + * | ~~~js + * | alert(1) + * > | ~~~ + * ^ + * ``` + * + * @type {State} + */ + function sequenceCloseAfter(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("codeFencedFence"); + return ok(code); + } + return nok(code); + } + } +} +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeNonLazyContinuation(effects, ok, nok) { + const self = this; + return start; + /** + * + * + * @type {State} + */ + function start(code) { + if (code === null) return nok(code); + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return lineStart; + } + /** + * + * + * @type {State} + */ + function lineStart(code) { + return self.parser.lazy[self.now().line] ? nok(code) : ok(code); + } +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/code-indented.js +/** +* @import { +* Construct, +* State, +* TokenizeContext, +* Tokenizer +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var codeIndented = { + name: "codeIndented", + tokenize: tokenizeCodeIndented +}; +/** @type {Construct} */ +var furtherStart = { + partial: true, + tokenize: tokenizeFurtherStart +}; +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeCodeIndented(effects, ok, nok) { + const self = this; + return start; + /** + * Start of code (indented). + * + * > **Parsing note**: it is not needed to check if this first line is a + * > filled line (that it has a non-whitespace character), because blank lines + * > are parsed already, so we never run into that. + * + * ```markdown + * > | aaa + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + effects.enter("codeIndented"); + return factorySpace(effects, afterPrefix, "linePrefix", 5)(code); + } + /** + * At start, after 1 or 4 spaces. + * + * ```markdown + * > | aaa + * ^ + * ``` + * + * @type {State} + */ + function afterPrefix(code) { + const tail = self.events[self.events.length - 1]; + return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? atBreak(code) : nok(code); + } + /** + * At a break. + * + * ```markdown + * > | aaa + * ^ ^ + * ``` + * + * @type {State} + */ + function atBreak(code) { + if (code === null) return after(code); + if (markdownLineEnding(code)) return effects.attempt(furtherStart, atBreak, after)(code); + effects.enter("codeFlowValue"); + return inside(code); + } + /** + * In code content. + * + * ```markdown + * > | aaa + * ^^^^ + * ``` + * + * @type {State} + */ + function inside(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("codeFlowValue"); + return atBreak(code); + } + effects.consume(code); + return inside; + } + /** @type {State} */ + function after(code) { + effects.exit("codeIndented"); + return ok(code); + } +} +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeFurtherStart(effects, ok, nok) { + const self = this; + return furtherStart; + /** + * At eol, trying to parse another indent. + * + * ```markdown + * > | aaa + * ^ + * | bbb + * ``` + * + * @type {State} + */ + function furtherStart(code) { + if (self.parser.lazy[self.now().line]) return nok(code); + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return furtherStart; + } + return factorySpace(effects, afterPrefix, "linePrefix", 5)(code); + } + /** + * At start, after 1 or 4 spaces. + * + * ```markdown + * > | aaa + * ^ + * ``` + * + * @type {State} + */ + function afterPrefix(code) { + const tail = self.events[self.events.length - 1]; + return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok(code) : markdownLineEnding(code) ? furtherStart(code) : nok(code); + } +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/code-text.js +/** +* @import { +* Construct, +* Previous, +* Resolver, +* State, +* TokenizeContext, +* Tokenizer, +* Token +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var codeText = { + name: "codeText", + previous: previous$1, + resolve: resolveCodeText, + tokenize: tokenizeCodeText +}; +/** @type {Resolver} */ +function resolveCodeText(events) { + let tailExitIndex = events.length - 4; + let headEnterIndex = 3; + /** @type {number} */ + let index; + /** @type {number | undefined} */ + let enter; + if ((events[headEnterIndex][1].type === "lineEnding" || events[headEnterIndex][1].type === "space") && (events[tailExitIndex][1].type === "lineEnding" || events[tailExitIndex][1].type === "space")) { + index = headEnterIndex; + while (++index < tailExitIndex) if (events[index][1].type === "codeTextData") { + events[headEnterIndex][1].type = "codeTextPadding"; + events[tailExitIndex][1].type = "codeTextPadding"; + headEnterIndex += 2; + tailExitIndex -= 2; + break; + } + } + index = headEnterIndex - 1; + tailExitIndex++; + while (++index <= tailExitIndex) if (enter === void 0) { + if (index !== tailExitIndex && events[index][1].type !== "lineEnding") enter = index; + } else if (index === tailExitIndex || events[index][1].type === "lineEnding") { + events[enter][1].type = "codeTextData"; + if (index !== enter + 2) { + events[enter][1].end = events[index - 1][1].end; + events.splice(enter + 2, index - enter - 2); + tailExitIndex -= index - enter - 2; + index = enter + 2; + } + enter = void 0; + } + return events; +} +/** +* @this {TokenizeContext} +* Context. +* @type {Previous} +*/ +function previous$1(code) { + return code !== 96 || this.events[this.events.length - 1][1].type === "characterEscape"; +} +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeCodeText(effects, ok, nok) { + let sizeOpen = 0; + /** @type {number} */ + let size; + /** @type {Token} */ + let token; + return start; + /** + * Start of code (text). + * + * ```markdown + * > | `a` + * ^ + * > | \`a` + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + effects.enter("codeText"); + effects.enter("codeTextSequence"); + return sequenceOpen(code); + } + /** + * In opening sequence. + * + * ```markdown + * > | `a` + * ^ + * ``` + * + * @type {State} + */ + function sequenceOpen(code) { + if (code === 96) { + effects.consume(code); + sizeOpen++; + return sequenceOpen; + } + effects.exit("codeTextSequence"); + return between(code); + } + /** + * Between something and something else. + * + * ```markdown + * > | `a` + * ^^ + * ``` + * + * @type {State} + */ + function between(code) { + if (code === null) return nok(code); + if (code === 32) { + effects.enter("space"); + effects.consume(code); + effects.exit("space"); + return between; + } + if (code === 96) { + token = effects.enter("codeTextSequence"); + size = 0; + return sequenceClose(code); + } + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return between; + } + effects.enter("codeTextData"); + return data(code); + } + /** + * In data. + * + * ```markdown + * > | `a` + * ^ + * ``` + * + * @type {State} + */ + function data(code) { + if (code === null || code === 32 || code === 96 || markdownLineEnding(code)) { + effects.exit("codeTextData"); + return between(code); + } + effects.consume(code); + return data; + } + /** + * In closing sequence. + * + * ```markdown + * > | `a` + * ^ + * ``` + * + * @type {State} + */ + function sequenceClose(code) { + if (code === 96) { + effects.consume(code); + size++; + return sequenceClose; + } + if (size === sizeOpen) { + effects.exit("codeTextSequence"); + effects.exit("codeText"); + return ok(code); + } + token.type = "codeTextData"; + return data(code); + } +} +//#endregion +//#region node_modules/micromark-util-subtokenize/lib/splice-buffer.js +/** +* Some of the internal operations of micromark do lots of editing +* operations on very large arrays. This runs into problems with two +* properties of most circa-2020 JavaScript interpreters: +* +* - Array-length modifications at the high end of an array (push/pop) are +* expected to be common and are implemented in (amortized) time +* proportional to the number of elements added or removed, whereas +* other operations (shift/unshift and splice) are much less efficient. +* - Function arguments are passed on the stack, so adding tens of thousands +* of elements to an array with `arr.push(...newElements)` will frequently +* cause stack overflows. (see ) +* +* SpliceBuffers are an implementation of gap buffers, which are a +* generalization of the "queue made of two stacks" idea. The splice buffer +* maintains a cursor, and moving the cursor has cost proportional to the +* distance the cursor moves, but inserting, deleting, or splicing in +* new information at the cursor is as efficient as the push/pop operation. +* This allows for an efficient sequence of splices (or pushes, pops, shifts, +* or unshifts) as long such edits happen at the same part of the array or +* generally sweep through the array from the beginning to the end. +* +* The interface for splice buffers also supports large numbers of inputs by +* passing a single array argument rather passing multiple arguments on the +* function call stack. +* +* @template T +* Item type. +*/ +var SpliceBuffer = class { + /** + * @param {ReadonlyArray | null | undefined} [initial] + * Initial items (optional). + * @returns + * Splice buffer. + */ + constructor(initial) { + /** @type {Array} */ + this.left = initial ? [...initial] : []; + /** @type {Array} */ + this.right = []; + } + /** + * Array access; + * does not move the cursor. + * + * @param {number} index + * Index. + * @return {T} + * Item. + */ + get(index) { + if (index < 0 || index >= this.left.length + this.right.length) throw new RangeError("Cannot access index `" + index + "` in a splice buffer of size `" + (this.left.length + this.right.length) + "`"); + if (index < this.left.length) return this.left[index]; + return this.right[this.right.length - index + this.left.length - 1]; + } + /** + * The length of the splice buffer, one greater than the largest index in the + * array. + */ + get length() { + return this.left.length + this.right.length; + } + /** + * Remove and return `list[0]`; + * moves the cursor to `0`. + * + * @returns {T | undefined} + * Item, optional. + */ + shift() { + this.setCursor(0); + return this.right.pop(); + } + /** + * Slice the buffer to get an array; + * does not move the cursor. + * + * @param {number} start + * Start. + * @param {number | null | undefined} [end] + * End (optional). + * @returns {Array} + * Array of items. + */ + slice(start, end) { + /** @type {number} */ + const stop = end === null || end === void 0 ? Number.POSITIVE_INFINITY : end; + if (stop < this.left.length) return this.left.slice(start, stop); + if (start > this.left.length) return this.right.slice(this.right.length - stop + this.left.length, this.right.length - start + this.left.length).reverse(); + return this.left.slice(start).concat(this.right.slice(this.right.length - stop + this.left.length).reverse()); + } + /** + * Mimics the behavior of Array.prototype.splice() except for the change of + * interface necessary to avoid segfaults when patching in very large arrays. + * + * This operation moves cursor is moved to `start` and results in the cursor + * placed after any inserted items. + * + * @param {number} start + * Start; + * zero-based index at which to start changing the array; + * negative numbers count backwards from the end of the array and values + * that are out-of bounds are clamped to the appropriate end of the array. + * @param {number | null | undefined} [deleteCount=0] + * Delete count (default: `0`); + * maximum number of elements to delete, starting from start. + * @param {Array | null | undefined} [items=[]] + * Items to include in place of the deleted items (default: `[]`). + * @return {Array} + * Any removed items. + */ + splice(start, deleteCount, items) { + /** @type {number} */ + const count = deleteCount || 0; + this.setCursor(Math.trunc(start)); + const removed = this.right.splice(this.right.length - count, Number.POSITIVE_INFINITY); + if (items) chunkedPush(this.left, items); + return removed.reverse(); + } + /** + * Remove and return the highest-numbered item in the array, so + * `list[list.length - 1]`; + * Moves the cursor to `length`. + * + * @returns {T | undefined} + * Item, optional. + */ + pop() { + this.setCursor(Number.POSITIVE_INFINITY); + return this.left.pop(); + } + /** + * Inserts a single item to the high-numbered side of the array; + * moves the cursor to `length`. + * + * @param {T} item + * Item. + * @returns {undefined} + * Nothing. + */ + push(item) { + this.setCursor(Number.POSITIVE_INFINITY); + this.left.push(item); + } + /** + * Inserts many items to the high-numbered side of the array. + * Moves the cursor to `length`. + * + * @param {Array} items + * Items. + * @returns {undefined} + * Nothing. + */ + pushMany(items) { + this.setCursor(Number.POSITIVE_INFINITY); + chunkedPush(this.left, items); + } + /** + * Inserts a single item to the low-numbered side of the array; + * Moves the cursor to `0`. + * + * @param {T} item + * Item. + * @returns {undefined} + * Nothing. + */ + unshift(item) { + this.setCursor(0); + this.right.push(item); + } + /** + * Inserts many items to the low-numbered side of the array; + * moves the cursor to `0`. + * + * @param {Array} items + * Items. + * @returns {undefined} + * Nothing. + */ + unshiftMany(items) { + this.setCursor(0); + chunkedPush(this.right, items.reverse()); + } + /** + * Move the cursor to a specific position in the array. Requires + * time proportional to the distance moved. + * + * If `n < 0`, the cursor will end up at the beginning. + * If `n > length`, the cursor will end up at the end. + * + * @param {number} n + * Position. + * @return {undefined} + * Nothing. + */ + setCursor(n) { + if (n === this.left.length || n > this.left.length && this.right.length === 0 || n < 0 && this.left.length === 0) return; + if (n < this.left.length) { + const removed = this.left.splice(n, Number.POSITIVE_INFINITY); + chunkedPush(this.right, removed.reverse()); + } else { + const removed = this.right.splice(this.left.length + this.right.length - n, Number.POSITIVE_INFINITY); + chunkedPush(this.left, removed.reverse()); + } + } +}; +/** +* Avoid stack overflow by pushing items onto the stack in segments +* +* @template T +* Item type. +* @param {Array} list +* List to inject into. +* @param {ReadonlyArray} right +* Items to inject. +* @return {undefined} +* Nothing. +*/ +function chunkedPush(list, right) { + /** @type {number} */ + let chunkStart = 0; + if (right.length < 1e4) list.push(...right); + else while (chunkStart < right.length) { + list.push(...right.slice(chunkStart, chunkStart + 1e4)); + chunkStart += 1e4; + } +} +//#endregion +//#region node_modules/micromark-util-subtokenize/index.js +/** +* @import {Chunk, Event, Token} from 'micromark-util-types' +*/ +/** +* Tokenize subcontent. +* +* @param {Array} eventsArray +* List of events. +* @returns {boolean} +* Whether subtokens were found. +*/ +function subtokenize(eventsArray) { + /** @type {Record} */ + const jumps = {}; + let index = -1; + /** @type {Event} */ + let event; + /** @type {number | undefined} */ + let lineIndex; + /** @type {number} */ + let otherIndex; + /** @type {Event} */ + let otherEvent; + /** @type {Array} */ + let parameters; + /** @type {Array} */ + let subevents; + /** @type {boolean | undefined} */ + let more; + const events = new SpliceBuffer(eventsArray); + while (++index < events.length) { + while (index in jumps) index = jumps[index]; + event = events.get(index); + if (index && event[1].type === "chunkFlow" && events.get(index - 1)[1].type === "listItemPrefix") { + subevents = event[1]._tokenizer.events; + otherIndex = 0; + if (otherIndex < subevents.length && subevents[otherIndex][1].type === "lineEndingBlank") otherIndex += 2; + if (otherIndex < subevents.length && subevents[otherIndex][1].type === "content") while (++otherIndex < subevents.length) { + if (subevents[otherIndex][1].type === "content") break; + if (subevents[otherIndex][1].type === "chunkText") { + subevents[otherIndex][1]._isInFirstContentOfListItem = true; + otherIndex++; + } + } + } + if (event[0] === "enter") { + if (event[1].contentType) { + Object.assign(jumps, subcontent(events, index)); + index = jumps[index]; + more = true; + } + } else if (event[1]._container) { + otherIndex = index; + lineIndex = void 0; + while (otherIndex--) { + otherEvent = events.get(otherIndex); + if (otherEvent[1].type === "lineEnding" || otherEvent[1].type === "lineEndingBlank") { + if (otherEvent[0] === "enter") { + if (lineIndex) events.get(lineIndex)[1].type = "lineEndingBlank"; + otherEvent[1].type = "lineEnding"; + lineIndex = otherIndex; + } + } else if (otherEvent[1].type === "linePrefix" || otherEvent[1].type === "listItemIndent") {} else break; + } + if (lineIndex) { + event[1].end = { ...events.get(lineIndex)[1].start }; + parameters = events.slice(lineIndex, index); + parameters.unshift(event); + events.splice(lineIndex, index - lineIndex + 1, parameters); + } + } + } + splice(eventsArray, 0, Number.POSITIVE_INFINITY, events.slice(0)); + return !more; +} +/** +* Tokenize embedded tokens. +* +* @param {SpliceBuffer} events +* Events. +* @param {number} eventIndex +* Index. +* @returns {Record} +* Gaps. +*/ +function subcontent(events, eventIndex) { + const token = events.get(eventIndex)[1]; + const context = events.get(eventIndex)[2]; + let startPosition = eventIndex - 1; + /** @type {Array} */ + const startPositions = []; + let tokenizer = token._tokenizer; + if (!tokenizer) { + tokenizer = context.parser[token.contentType](token.start); + if (token._contentTypeTextTrailing) tokenizer._contentTypeTextTrailing = true; + } + const childEvents = tokenizer.events; + /** @type {Array<[number, number]>} */ + const jumps = []; + /** @type {Record} */ + const gaps = {}; + /** @type {Array} */ + let stream; + /** @type {Token | undefined} */ + let previous; + let index = -1; + /** @type {Token | undefined} */ + let current = token; + let adjust = 0; + let start = 0; + const breaks = [start]; + while (current) { + while (events.get(++startPosition)[1] !== current); + startPositions.push(startPosition); + if (!current._tokenizer) { + stream = context.sliceStream(current); + if (!current.next) stream.push(null); + if (previous) tokenizer.defineSkip(current.start); + if (current._isInFirstContentOfListItem) tokenizer._gfmTasklistFirstContentOfListItem = true; + tokenizer.write(stream); + if (current._isInFirstContentOfListItem) tokenizer._gfmTasklistFirstContentOfListItem = void 0; + } + previous = current; + current = current.next; + } + current = token; + while (++index < childEvents.length) if (childEvents[index][0] === "exit" && childEvents[index - 1][0] === "enter" && childEvents[index][1].type === childEvents[index - 1][1].type && childEvents[index][1].start.line !== childEvents[index][1].end.line) { + start = index + 1; + breaks.push(start); + current._tokenizer = void 0; + current.previous = void 0; + current = current.next; + } + tokenizer.events = []; + if (current) { + current._tokenizer = void 0; + current.previous = void 0; + } else breaks.pop(); + index = breaks.length; + while (index--) { + const slice = childEvents.slice(breaks[index], breaks[index + 1]); + const start = startPositions.pop(); + jumps.push([start, start + slice.length - 1]); + events.splice(start, 2, slice); + } + jumps.reverse(); + index = -1; + while (++index < jumps.length) { + gaps[adjust + jumps[index][0]] = adjust + jumps[index][1]; + adjust += jumps[index][1] - jumps[index][0] - 1; + } + return gaps; +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/content.js +/** +* @import { +* Construct, +* Resolver, +* State, +* TokenizeContext, +* Tokenizer, +* Token +* } from 'micromark-util-types' +*/ +/** +* No name because it must not be turned off. +* @type {Construct} +*/ +var content = { + resolve: resolveContent, + tokenize: tokenizeContent +}; +/** @type {Construct} */ +var continuationConstruct = { + partial: true, + tokenize: tokenizeContinuation +}; +/** +* Content is transparent: it’s parsed right now. That way, definitions are also +* parsed right now: before text in paragraphs (specifically, media) are parsed. +* +* @type {Resolver} +*/ +function resolveContent(events) { + subtokenize(events); + return events; +} +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeContent(effects, ok) { + /** @type {Token | undefined} */ + let previous; + return chunkStart; + /** + * Before a content chunk. + * + * ```markdown + * > | abc + * ^ + * ``` + * + * @type {State} + */ + function chunkStart(code) { + effects.enter("content"); + previous = effects.enter("chunkContent", { contentType: "content" }); + return chunkInside(code); + } + /** + * In a content chunk. + * + * ```markdown + * > | abc + * ^^^ + * ``` + * + * @type {State} + */ + function chunkInside(code) { + if (code === null) return contentEnd(code); + if (markdownLineEnding(code)) return effects.check(continuationConstruct, contentContinue, contentEnd)(code); + effects.consume(code); + return chunkInside; + } + /** + * + * + * @type {State} + */ + function contentEnd(code) { + effects.exit("chunkContent"); + effects.exit("content"); + return ok(code); + } + /** + * + * + * @type {State} + */ + function contentContinue(code) { + effects.consume(code); + effects.exit("chunkContent"); + previous.next = effects.enter("chunkContent", { + contentType: "content", + previous + }); + previous = previous.next; + return chunkInside; + } +} +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeContinuation(effects, ok, nok) { + const self = this; + return startLookahead; + /** + * + * + * @type {State} + */ + function startLookahead(code) { + effects.exit("chunkContent"); + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return factorySpace(effects, prefixed, "linePrefix"); + } + /** + * + * + * @type {State} + */ + function prefixed(code) { + if (code === null || markdownLineEnding(code)) return nok(code); + const tail = self.events[self.events.length - 1]; + if (!self.parser.constructs.disable.null.includes("codeIndented") && tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4) return ok(code); + return effects.interrupt(self.parser.constructs.flow, nok, ok)(code); + } +} +//#endregion +//#region node_modules/micromark-factory-destination/index.js +/** +* @import {Effects, State, TokenType} from 'micromark-util-types' +*/ +/** +* Parse destinations. +* +* ###### Examples +* +* ```markdown +* +* b> +* +* +* a +* a\)b +* a(b)c +* a(b) +* ``` +* +* @param {Effects} effects +* Context. +* @param {State} ok +* State switched to when successful. +* @param {State} nok +* State switched to when unsuccessful. +* @param {TokenType} type +* Type for whole (`` or `b`). +* @param {TokenType} literalType +* Type when enclosed (``). +* @param {TokenType} literalMarkerType +* Type for enclosing (`<` and `>`). +* @param {TokenType} rawType +* Type when not enclosed (`b`). +* @param {TokenType} stringType +* Type for the value (`a` or `b`). +* @param {number | undefined} [max=Infinity] +* Depth of nested parens (inclusive). +* @returns {State} +* Start state. +*/ +function factoryDestination(effects, ok, nok, type, literalType, literalMarkerType, rawType, stringType, max) { + const limit = max || Number.POSITIVE_INFINITY; + let balance = 0; + return start; + /** + * Start of destination. + * + * ```markdown + * > | + * ^ + * > | aa + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + if (code === 60) { + effects.enter(type); + effects.enter(literalType); + effects.enter(literalMarkerType); + effects.consume(code); + effects.exit(literalMarkerType); + return enclosedBefore; + } + if (code === null || code === 32 || code === 41 || asciiControl(code)) return nok(code); + effects.enter(type); + effects.enter(rawType); + effects.enter(stringType); + effects.enter("chunkString", { contentType: "string" }); + return raw(code); + } + /** + * After `<`, at an enclosed destination. + * + * ```markdown + * > | + * ^ + * ``` + * + * @type {State} + */ + function enclosedBefore(code) { + if (code === 62) { + effects.enter(literalMarkerType); + effects.consume(code); + effects.exit(literalMarkerType); + effects.exit(literalType); + effects.exit(type); + return ok; + } + effects.enter(stringType); + effects.enter("chunkString", { contentType: "string" }); + return enclosed(code); + } + /** + * In enclosed destination. + * + * ```markdown + * > | + * ^ + * ``` + * + * @type {State} + */ + function enclosed(code) { + if (code === 62) { + effects.exit("chunkString"); + effects.exit(stringType); + return enclosedBefore(code); + } + if (code === null || code === 60 || markdownLineEnding(code)) return nok(code); + effects.consume(code); + return code === 92 ? enclosedEscape : enclosed; + } + /** + * After `\`, at a special character. + * + * ```markdown + * > | + * ^ + * ``` + * + * @type {State} + */ + function enclosedEscape(code) { + if (code === 60 || code === 62 || code === 92) { + effects.consume(code); + return enclosed; + } + return enclosed(code); + } + /** + * In raw destination. + * + * ```markdown + * > | aa + * ^ + * ``` + * + * @type {State} + */ + function raw(code) { + if (!balance && (code === null || code === 41 || markdownLineEndingOrSpace(code))) { + effects.exit("chunkString"); + effects.exit(stringType); + effects.exit(rawType); + effects.exit(type); + return ok(code); + } + if (balance < limit && code === 40) { + effects.consume(code); + balance++; + return raw; + } + if (code === 41) { + effects.consume(code); + balance--; + return raw; + } + if (code === null || code === 32 || code === 40 || asciiControl(code)) return nok(code); + effects.consume(code); + return code === 92 ? rawEscape : raw; + } + /** + * After `\`, at special character. + * + * ```markdown + * > | a\*a + * ^ + * ``` + * + * @type {State} + */ + function rawEscape(code) { + if (code === 40 || code === 41 || code === 92) { + effects.consume(code); + return raw; + } + return raw(code); + } +} +//#endregion +//#region node_modules/micromark-factory-label/index.js +/** +* @import { +* Effects, +* State, +* TokenizeContext, +* TokenType +* } from 'micromark-util-types' +*/ +/** +* Parse labels. +* +* > 👉 **Note**: labels in markdown are capped at 999 characters in the string. +* +* ###### Examples +* +* ```markdown +* [a] +* [a +* b] +* [a\]b] +* ``` +* +* @this {TokenizeContext} +* Tokenize context. +* @param {Effects} effects +* Context. +* @param {State} ok +* State switched to when successful. +* @param {State} nok +* State switched to when unsuccessful. +* @param {TokenType} type +* Type of the whole label (`[a]`). +* @param {TokenType} markerType +* Type for the markers (`[` and `]`). +* @param {TokenType} stringType +* Type for the identifier (`a`). +* @returns {State} +* Start state. +*/ +function factoryLabel(effects, ok, nok, type, markerType, stringType) { + const self = this; + let size = 0; + /** @type {boolean} */ + let seen; + return start; + /** + * Start of label. + * + * ```markdown + * > | [a] + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + effects.enter(type); + effects.enter(markerType); + effects.consume(code); + effects.exit(markerType); + effects.enter(stringType); + return atBreak; + } + /** + * In label, at something, before something else. + * + * ```markdown + * > | [a] + * ^ + * ``` + * + * @type {State} + */ + function atBreak(code) { + if (size > 999 || code === null || code === 91 || code === 93 && !seen || code === 94 && !size && "_hiddenFootnoteSupport" in self.parser.constructs) return nok(code); + if (code === 93) { + effects.exit(stringType); + effects.enter(markerType); + effects.consume(code); + effects.exit(markerType); + effects.exit(type); + return ok; + } + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return atBreak; + } + effects.enter("chunkString", { contentType: "string" }); + return labelInside(code); + } + /** + * In label, in text. + * + * ```markdown + * > | [a] + * ^ + * ``` + * + * @type {State} + */ + function labelInside(code) { + if (code === null || code === 91 || code === 93 || markdownLineEnding(code) || size++ > 999) { + effects.exit("chunkString"); + return atBreak(code); + } + effects.consume(code); + if (!seen) seen = !markdownSpace(code); + return code === 92 ? labelEscape : labelInside; + } + /** + * After `\`, at a special character. + * + * ```markdown + * > | [a\*a] + * ^ + * ``` + * + * @type {State} + */ + function labelEscape(code) { + if (code === 91 || code === 92 || code === 93) { + effects.consume(code); + size++; + return labelInside; + } + return labelInside(code); + } +} +//#endregion +//#region node_modules/micromark-factory-title/index.js +/** +* @import { +* Code, +* Effects, +* State, +* TokenType +* } from 'micromark-util-types' +*/ +/** +* Parse titles. +* +* ###### Examples +* +* ```markdown +* "a" +* 'b' +* (c) +* "a +* b" +* 'a +* b' +* (a\)b) +* ``` +* +* @param {Effects} effects +* Context. +* @param {State} ok +* State switched to when successful. +* @param {State} nok +* State switched to when unsuccessful. +* @param {TokenType} type +* Type of the whole title (`"a"`, `'b'`, `(c)`). +* @param {TokenType} markerType +* Type for the markers (`"`, `'`, `(`, and `)`). +* @param {TokenType} stringType +* Type for the value (`a`). +* @returns {State} +* Start state. +*/ +function factoryTitle(effects, ok, nok, type, markerType, stringType) { + /** @type {NonNullable} */ + let marker; + return start; + /** + * Start of title. + * + * ```markdown + * > | "a" + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + if (code === 34 || code === 39 || code === 40) { + effects.enter(type); + effects.enter(markerType); + effects.consume(code); + effects.exit(markerType); + marker = code === 40 ? 41 : code; + return begin; + } + return nok(code); + } + /** + * After opening marker. + * + * This is also used at the closing marker. + * + * ```markdown + * > | "a" + * ^ + * ``` + * + * @type {State} + */ + function begin(code) { + if (code === marker) { + effects.enter(markerType); + effects.consume(code); + effects.exit(markerType); + effects.exit(type); + return ok; + } + effects.enter(stringType); + return atBreak(code); + } + /** + * At something, before something else. + * + * ```markdown + * > | "a" + * ^ + * ``` + * + * @type {State} + */ + function atBreak(code) { + if (code === marker) { + effects.exit(stringType); + return begin(marker); + } + if (code === null) return nok(code); + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return factorySpace(effects, atBreak, "linePrefix"); + } + effects.enter("chunkString", { contentType: "string" }); + return inside(code); + } + /** + * + * + * @type {State} + */ + function inside(code) { + if (code === marker || code === null || markdownLineEnding(code)) { + effects.exit("chunkString"); + return atBreak(code); + } + effects.consume(code); + return code === 92 ? escape : inside; + } + /** + * After `\`, at a special character. + * + * ```markdown + * > | "a\*b" + * ^ + * ``` + * + * @type {State} + */ + function escape(code) { + if (code === marker || code === 92) { + effects.consume(code); + return inside; + } + return inside(code); + } +} +//#endregion +//#region node_modules/micromark-factory-whitespace/index.js +/** +* @import {Effects, State} from 'micromark-util-types' +*/ +/** +* Parse spaces and tabs. +* +* There is no `nok` parameter: +* +* * line endings or spaces in markdown are often optional, in which case this +* factory can be used and `ok` will be switched to whether spaces were found +* or not +* * one line ending or space can be detected with +* `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace` +* +* @param {Effects} effects +* Context. +* @param {State} ok +* State switched to when successful. +* @returns {State} +* Start state. +*/ +function factoryWhitespace(effects, ok) { + /** @type {boolean} */ + let seen; + return start; + /** @type {State} */ + function start(code) { + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + seen = true; + return start; + } + if (markdownSpace(code)) return factorySpace(effects, start, seen ? "linePrefix" : "lineSuffix")(code); + return ok(code); + } +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/definition.js +/** +* @import { +* Construct, +* State, +* TokenizeContext, +* Tokenizer +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var definition$1 = { + name: "definition", + tokenize: tokenizeDefinition +}; +/** @type {Construct} */ +var titleBefore = { + partial: true, + tokenize: tokenizeTitleBefore +}; +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeDefinition(effects, ok, nok) { + const self = this; + /** @type {string} */ + let identifier; + return start; + /** + * At start of a definition. + * + * ```markdown + * > | [a]: b "c" + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + effects.enter("definition"); + return before(code); + } + /** + * After optional whitespace, at `[`. + * + * ```markdown + * > | [a]: b "c" + * ^ + * ``` + * + * @type {State} + */ + function before(code) { + return factoryLabel.call(self, effects, labelAfter, nok, "definitionLabel", "definitionLabelMarker", "definitionLabelString")(code); + } + /** + * After label. + * + * ```markdown + * > | [a]: b "c" + * ^ + * ``` + * + * @type {State} + */ + function labelAfter(code) { + identifier = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)); + if (code === 58) { + effects.enter("definitionMarker"); + effects.consume(code); + effects.exit("definitionMarker"); + return markerAfter; + } + return nok(code); + } + /** + * After marker. + * + * ```markdown + * > | [a]: b "c" + * ^ + * ``` + * + * @type {State} + */ + function markerAfter(code) { + return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, destinationBefore)(code) : destinationBefore(code); + } + /** + * Before destination. + * + * ```markdown + * > | [a]: b "c" + * ^ + * ``` + * + * @type {State} + */ + function destinationBefore(code) { + return factoryDestination(effects, destinationAfter, nok, "definitionDestination", "definitionDestinationLiteral", "definitionDestinationLiteralMarker", "definitionDestinationRaw", "definitionDestinationString")(code); + } + /** + * After destination. + * + * ```markdown + * > | [a]: b "c" + * ^ + * ``` + * + * @type {State} + */ + function destinationAfter(code) { + return effects.attempt(titleBefore, after, after)(code); + } + /** + * After definition. + * + * ```markdown + * > | [a]: b + * ^ + * > | [a]: b "c" + * ^ + * ``` + * + * @type {State} + */ + function after(code) { + return markdownSpace(code) ? factorySpace(effects, afterWhitespace, "whitespace")(code) : afterWhitespace(code); + } + /** + * After definition, after optional whitespace. + * + * ```markdown + * > | [a]: b + * ^ + * > | [a]: b "c" + * ^ + * ``` + * + * @type {State} + */ + function afterWhitespace(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit("definition"); + self.parser.defined.push(identifier); + return ok(code); + } + return nok(code); + } +} +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeTitleBefore(effects, ok, nok) { + return titleBefore; + /** + * After destination, at whitespace. + * + * ```markdown + * > | [a]: b + * ^ + * > | [a]: b "c" + * ^ + * ``` + * + * @type {State} + */ + function titleBefore(code) { + return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, beforeMarker)(code) : nok(code); + } + /** + * At title. + * + * ```markdown + * | [a]: b + * > | "c" + * ^ + * ``` + * + * @type {State} + */ + function beforeMarker(code) { + return factoryTitle(effects, titleAfter, nok, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(code); + } + /** + * After title. + * + * ```markdown + * > | [a]: b "c" + * ^ + * ``` + * + * @type {State} + */ + function titleAfter(code) { + return markdownSpace(code) ? factorySpace(effects, titleAfterOptionalWhitespace, "whitespace")(code) : titleAfterOptionalWhitespace(code); + } + /** + * After title, after optional whitespace. + * + * ```markdown + * > | [a]: b "c" + * ^ + * ``` + * + * @type {State} + */ + function titleAfterOptionalWhitespace(code) { + return code === null || markdownLineEnding(code) ? ok(code) : nok(code); + } +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/hard-break-escape.js +/** +* @import { +* Construct, +* State, +* TokenizeContext, +* Tokenizer +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var hardBreakEscape = { + name: "hardBreakEscape", + tokenize: tokenizeHardBreakEscape +}; +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeHardBreakEscape(effects, ok, nok) { + return start; + /** + * Start of a hard break (escape). + * + * ```markdown + * > | a\ + * ^ + * | b + * ``` + * + * @type {State} + */ + function start(code) { + effects.enter("hardBreakEscape"); + effects.consume(code); + return after; + } + /** + * After `\`, at eol. + * + * ```markdown + * > | a\ + * ^ + * | b + * ``` + * + * @type {State} + */ + function after(code) { + if (markdownLineEnding(code)) { + effects.exit("hardBreakEscape"); + return ok(code); + } + return nok(code); + } +} +//#endregion +//#region node_modules/micromark-core-commonmark/lib/heading-atx.js +/** +* @import { +* Construct, +* Resolver, +* State, +* TokenizeContext, +* Tokenizer, +* Token +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var headingAtx = { + name: "headingAtx", + resolve: resolveHeadingAtx, + tokenize: tokenizeHeadingAtx +}; +/** @type {Resolver} */ +function resolveHeadingAtx(events, context) { + let contentEnd = events.length - 2; + let contentStart = 3; + /** @type {Token} */ + let content; + /** @type {Token} */ + let text; + if (events[contentStart][1].type === "whitespace") contentStart += 2; + if (contentEnd - 2 > contentStart && events[contentEnd][1].type === "whitespace") contentEnd -= 2; + if (events[contentEnd][1].type === "atxHeadingSequence" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === "whitespace")) contentEnd -= contentStart + 1 === contentEnd ? 2 : 4; + if (contentEnd > contentStart) { + content = { + type: "atxHeadingText", + start: events[contentStart][1].start, + end: events[contentEnd][1].end + }; + text = { + type: "chunkText", + start: events[contentStart][1].start, + end: events[contentEnd][1].end, + contentType: "text" + }; + splice(events, contentStart, contentEnd - contentStart + 1, [ + [ + "enter", + content, + context + ], + [ + "enter", + text, + context + ], + [ + "exit", + text, + context + ], + [ + "exit", + content, + context + ] + ]); + } + return events; +} +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeHeadingAtx(effects, ok, nok) { + let size = 0; + return start; + /** + * Start of a heading (atx). + * + * ```markdown + * > | ## aa + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + effects.enter("atxHeading"); + return before(code); + } + /** + * After optional whitespace, at `#`. + * + * ```markdown + * > | ## aa + * ^ + * ``` + * + * @type {State} + */ + function before(code) { + effects.enter("atxHeadingSequence"); + return sequenceOpen(code); + } + /** + * In opening sequence. + * + * ```markdown + * > | ## aa + * ^ + * ``` + * + * @type {State} + */ + function sequenceOpen(code) { + if (code === 35 && size++ < 6) { + effects.consume(code); + return sequenceOpen; + } + if (code === null || markdownLineEndingOrSpace(code)) { + effects.exit("atxHeadingSequence"); + return atBreak(code); + } + return nok(code); + } + /** + * After something, before something else. + * + * ```markdown + * > | ## aa + * ^ + * ``` + * + * @type {State} + */ + function atBreak(code) { + if (code === 35) { + effects.enter("atxHeadingSequence"); + return sequenceFurther(code); + } + if (code === null || markdownLineEnding(code)) { + effects.exit("atxHeading"); + return ok(code); + } + if (markdownSpace(code)) return factorySpace(effects, atBreak, "whitespace")(code); + effects.enter("atxHeadingText"); + return data(code); + } + /** + * In further sequence (after whitespace). + * + * Could be normal “visible” hashes in the heading or a final sequence. + * + * ```markdown + * > | ## aa ## + * ^ + * ``` + * + * @type {State} + */ + function sequenceFurther(code) { + if (code === 35) { + effects.consume(code); + return sequenceFurther; + } + effects.exit("atxHeadingSequence"); + return atBreak(code); + } + /** + * In text. + * + * ```markdown + * > | ## aa + * ^ + * ``` + * + * @type {State} + */ + function data(code) { + if (code === null || code === 35 || markdownLineEndingOrSpace(code)) { + effects.exit("atxHeadingText"); + return atBreak(code); + } + effects.consume(code); + return data; + } +} +//#endregion +//#region node_modules/micromark-util-html-tag-name/index.js +/** +* List of lowercase HTML “block” tag names. +* +* The list, when parsing HTML (flow), results in more relaxed rules (condition +* 6). +* Because they are known blocks, the HTML-like syntax doesn’t have to be +* strictly parsed. +* For tag names not in this list, a more strict algorithm (condition 7) is used +* to detect whether the HTML-like syntax is seen as HTML (flow) or not. +* +* This is copied from: +* . +* +* > 👉 **Note**: `search` was added in `CommonMark@0.31`. +*/ +var htmlBlockNames = [ + "address", + "article", + "aside", + "base", + "basefont", + "blockquote", + "body", + "caption", + "center", + "col", + "colgroup", + "dd", + "details", + "dialog", + "dir", + "div", + "dl", + "dt", + "fieldset", + "figcaption", + "figure", + "footer", + "form", + "frame", + "frameset", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hr", + "html", + "iframe", + "legend", + "li", + "link", + "main", + "menu", + "menuitem", + "nav", + "noframes", + "ol", + "optgroup", + "option", + "p", + "param", + "search", + "section", + "summary", + "table", + "tbody", + "td", + "tfoot", + "th", + "thead", + "title", + "tr", + "track", + "ul" +]; +/** +* List of lowercase HTML “raw” tag names. +* +* The list, when parsing HTML (flow), results in HTML that can include lines +* without exiting, until a closing tag also in this list is found (condition +* 1). +* +* This module is copied from: +* . +* +* > 👉 **Note**: `textarea` was added in `CommonMark@0.30`. +*/ +var htmlRawNames = [ + "pre", + "script", + "style", + "textarea" +]; +//#endregion +//#region node_modules/micromark-core-commonmark/lib/html-flow.js +/** +* @import { +* Code, +* Construct, +* Resolver, +* State, +* TokenizeContext, +* Tokenizer +* } from 'micromark-util-types' +*/ +/** @type {Construct} */ +var htmlFlow = { + concrete: true, + name: "htmlFlow", + resolveTo: resolveToHtmlFlow, + tokenize: tokenizeHtmlFlow +}; +/** @type {Construct} */ +var blankLineBefore = { + partial: true, + tokenize: tokenizeBlankLineBefore +}; +var nonLazyContinuationStart = { + partial: true, + tokenize: tokenizeNonLazyContinuationStart +}; +/** @type {Resolver} */ +function resolveToHtmlFlow(events) { + let index = events.length; + while (index--) if (events[index][0] === "enter" && events[index][1].type === "htmlFlow") break; + if (index > 1 && events[index - 2][1].type === "linePrefix") { + events[index][1].start = events[index - 2][1].start; + events[index + 1][1].start = events[index - 2][1].start; + events.splice(index - 2, 2); + } + return events; +} +/** +* @this {TokenizeContext} +* Context. +* @type {Tokenizer} +*/ +function tokenizeHtmlFlow(effects, ok, nok) { + const self = this; + /** @type {number} */ + let marker; + /** @type {boolean} */ + let closingTag; + /** @type {string} */ + let buffer; + /** @type {number} */ + let index; + /** @type {Code} */ + let markerB; + return start; + /** + * Start of HTML (flow). + * + * ```markdown + * > | + * ^ + * ``` + * + * @type {State} + */ + function start(code) { + return before(code); + } + /** + * At `<`, after optional whitespace. + * + * ```markdown + * > | + * ^ + * ``` + * + * @type {State} + */ + function before(code) { + effects.enter("htmlFlow"); + effects.enter("htmlFlowData"); + effects.consume(code); + return open; + } + /** + * After `<`, at tag name or other stuff. + * + * ```markdown + * > | + * ^ + * > | + * ^ + * > | + * ^ + * ``` + * + * @type {State} + */ + function open(code) { + if (code === 33) { + effects.consume(code); + return declarationOpen; + } + if (code === 47) { + effects.consume(code); + closingTag = true; + return tagCloseStart; + } + if (code === 63) { + effects.consume(code); + marker = 3; + return self.interrupt ? ok : continuationDeclarationInside; + } + if (asciiAlpha(code)) { + effects.consume(code); + buffer = String.fromCharCode(code); + return tagName; + } + return nok(code); + } + /** + * After ` | + * ^ + * > | + * ^ + * > | &<]]> + * ^ + * ``` + * + * @type {State} + */ + function declarationOpen(code) { + if (code === 45) { + effects.consume(code); + marker = 2; + return commentOpenInside; + } + if (code === 91) { + effects.consume(code); + marker = 5; + index = 0; + return cdataOpenInside; + } + if (asciiAlpha(code)) { + effects.consume(code); + marker = 4; + return self.interrupt ? ok : continuationDeclarationInside; + } + return nok(code); + } + /** + * After ` | + * ^ + * ``` + * + * @type {State} + */ + function commentOpenInside(code) { + if (code === 45) { + effects.consume(code); + return self.interrupt ? ok : continuationDeclarationInside; + } + return nok(code); + } + /** + * After ` | &<]]> + * ^^^^^^ + * ``` + * + * @type {State} + */ + function cdataOpenInside(code) { + if (code === "CDATA[".charCodeAt(index++)) { + effects.consume(code); + if (index === 6) return self.interrupt ? ok : continuation; + return cdataOpenInside; + } + return nok(code); + } + /** + * After ` | + * ^ + * ``` + * + * @type {State} + */ + function tagCloseStart(code) { + if (asciiAlpha(code)) { + effects.consume(code); + buffer = String.fromCharCode(code); + return tagName; + } + return nok(code); + } + /** + * In tag name. + * + * ```markdown + * > | + * ^^ + * > | + * ^^ + * ``` + * + * @type {State} + */ + function tagName(code) { + if (code === null || code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { + const slash = code === 47; + const name = buffer.toLowerCase(); + if (!slash && !closingTag && htmlRawNames.includes(name)) { + marker = 1; + return self.interrupt ? ok(code) : continuation(code); + } + if (htmlBlockNames.includes(buffer.toLowerCase())) { + marker = 6; + if (slash) { + effects.consume(code); + return basicSelfClosing; + } + return self.interrupt ? ok(code) : continuation(code); + } + marker = 7; + return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code) : closingTag ? completeClosingTagAfter(code) : completeAttributeNameBefore(code); + } + if (code === 45 || asciiAlphanumeric(code)) { + effects.consume(code); + buffer += String.fromCharCode(code); + return tagName; + } + return nok(code); + } + /** + * After closing slash of a basic tag name. + * + * ```markdown + * > |
+ * ^ + * ``` + * + * @type {State} + */ + function basicSelfClosing(code) { + if (code === 62) { + effects.consume(code); + return self.interrupt ? ok : continuation; + } + return nok(code); + } + /** + * After closing slash of a complete tag name. + * + * ```markdown + * > | + * ^ + * ``` + * + * @type {State} + */ + function completeClosingTagAfter(code) { + if (markdownSpace(code)) { + effects.consume(code); + return completeClosingTagAfter; + } + return completeEnd(code); + } + /** + * At an attribute name. + * + * At first, this state is used after a complete tag name, after whitespace, + * where it expects optional attributes or the end of the tag. + * It is also reused after attributes, when expecting more optional + * attributes. + * + * ```markdown + * > | + * ^ + * > | + * ^ + * > | + * ^ + * > | + * ^ + * > | + * ^ + * ``` + * + * @type {State} + */ + function completeAttributeNameBefore(code) { + if (code === 47) { + effects.consume(code); + return completeEnd; + } + if (code === 58 || code === 95 || asciiAlpha(code)) { + effects.consume(code); + return completeAttributeName; + } + if (markdownSpace(code)) { + effects.consume(code); + return completeAttributeNameBefore; + } + return completeEnd(code); + } + /** + * In attribute name. + * + * ```markdown + * > | + * ^ + * > | + * ^ + * > | + * ^ + * ``` + * + * @type {State} + */ + function completeAttributeName(code) { + if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) { + effects.consume(code); + return completeAttributeName; + } + return completeAttributeNameAfter(code); + } + /** + * After attribute name, at an optional initializer, the end of the tag, or + * whitespace. + * + * ```markdown + * > | + * ^ + * > | + * ^ + * ``` + * + * @type {State} + */ + function completeAttributeNameAfter(code) { + if (code === 61) { + effects.consume(code); + return completeAttributeValueBefore; + } + if (markdownSpace(code)) { + effects.consume(code); + return completeAttributeNameAfter; + } + return completeAttributeNameBefore(code); + } + /** + * Before unquoted, double quoted, or single quoted attribute value, allowing + * whitespace. + * + * ```markdown + * > | + * ^ + * > | + * ^ + * ``` + * + * @type {State} + */ + function completeAttributeValueBefore(code) { + if (code === null || code === 60 || code === 61 || code === 62 || code === 96) return nok(code); + if (code === 34 || code === 39) { + effects.consume(code); + markerB = code; + return completeAttributeValueQuoted; + } + if (markdownSpace(code)) { + effects.consume(code); + return completeAttributeValueBefore; + } + return completeAttributeValueUnquoted(code); + } + /** + * In double or single quoted attribute value. + * + * ```markdown + * > | + * ^ + * > | + * ^ + * ``` + * + * @type {State} + */ + function completeAttributeValueQuoted(code) { + if (code === markerB) { + effects.consume(code); + markerB = null; + return completeAttributeValueQuotedAfter; + } + if (code === null || markdownLineEnding(code)) return nok(code); + effects.consume(code); + return completeAttributeValueQuoted; + } + /** + * In unquoted attribute value. + * + * ```markdown + * > | + * ^ + * ``` + * + * @type {State} + */ + function completeAttributeValueUnquoted(code) { + if (code === null || code === 34 || code === 39 || code === 47 || code === 60 || code === 61 || code === 62 || code === 96 || markdownLineEndingOrSpace(code)) return completeAttributeNameAfter(code); + effects.consume(code); + return completeAttributeValueUnquoted; + } + /** + * After double or single quoted attribute value, before whitespace or the + * end of the tag. + * + * ```markdown + * > | + * ^ + * ``` + * + * @type {State} + */ + function completeAttributeValueQuotedAfter(code) { + if (code === 47 || code === 62 || markdownSpace(code)) return completeAttributeNameBefore(code); + return nok(code); + } + /** + * In certain circumstances of a complete tag where only an `>` is allowed. + * + * ```markdown + * > | + * ^ + * ``` + * + * @type {State} + */ + function completeEnd(code) { + if (code === 62) { + effects.consume(code); + return completeAfter; + } + return nok(code); + } + /** + * After `>` in a complete tag. + * + * ```markdown + * > | + * ^ + * ``` + * + * @type {State} + */ + function completeAfter(code) { + if (code === null || markdownLineEnding(code)) return continuation(code); + if (markdownSpace(code)) { + effects.consume(code); + return completeAfter; + } + return nok(code); + } + /** + * In continuation of any HTML kind. + * + * ```markdown + * > | + * ^ + * ``` + * + * @type {State} + */ + function continuation(code) { + if (code === 45 && marker === 2) { + effects.consume(code); + return continuationCommentInside; + } + if (code === 60 && marker === 1) { + effects.consume(code); + return continuationRawTagOpen; + } + if (code === 62 && marker === 4) { + effects.consume(code); + return continuationClose; + } + if (code === 63 && marker === 3) { + effects.consume(code); + return continuationDeclarationInside; + } + if (code === 93 && marker === 5) { + effects.consume(code); + return continuationCdataInside; + } + if (markdownLineEnding(code) && (marker === 6 || marker === 7)) { + effects.exit("htmlFlowData"); + return effects.check(blankLineBefore, continuationAfter, continuationStart)(code); + } + if (code === null || markdownLineEnding(code)) { + effects.exit("htmlFlowData"); + return continuationStart(code); + } + effects.consume(code); + return continuation; + } + /** + * In continuation, at eol. + * + * ```markdown + * > | + * ^ + * | asd + * ``` + * + * @type {State} + */ + function continuationStart(code) { + return effects.check(nonLazyContinuationStart, continuationStartNonLazy, continuationAfter)(code); + } + /** + * In continuation, at eol, before non-lazy content. + * + * ```markdown + * > | + * ^ + * | asd + * ``` + * + * @type {State} + */ + function continuationStartNonLazy(code) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return continuationBefore; + } + /** + * In continuation, before non-lazy content. + * + * ```markdown + * | + * > | asd + * ^ + * ``` + * + * @type {State} + */ + function continuationBefore(code) { + if (code === null || markdownLineEnding(code)) return continuationStart(code); + effects.enter("htmlFlowData"); + return continuation(code); + } + /** + * In comment continuation, after one `-`, expecting another. + * + * ```markdown + * > | + * ^ + * ``` + * + * @type {State} + */ + function continuationCommentInside(code) { + if (code === 45) { + effects.consume(code); + return continuationDeclarationInside; + } + return continuation(code); + } + /** + * In raw continuation, after `<`, at `/`. + * + * ```markdown + * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code);\n buffer = '';\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In raw continuation, after ` | \n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function continuationRawEndTag(code) {\n if (code === 62) {\n const name = buffer.toLowerCase();\n if (htmlRawNames.includes(name)) {\n effects.consume(code);\n return continuationClose;\n }\n return continuation(code);\n }\n if (asciiAlpha(code) && buffer.length < 8) {\n // Always the case.\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In cdata continuation, after `]`, expecting `]>`.\n *\n * ```markdown\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCdataInside(code) {\n if (code === 93) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In declaration or instruction continuation, at `>`.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code);\n return continuationClose;\n }\n\n // More dashes.\n if (code === 45 && marker === 2) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In closed continuation: everything we get until the eol/eof is part of it.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"htmlFlowData\");\n return continuationAfter(code);\n }\n effects.consume(code);\n return continuationClose;\n }\n\n /**\n * Done.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationAfter(code) {\n effects.exit(\"htmlFlow\");\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n // // No longer concrete.\n // tokenizer.concrete = false\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuationStart(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * At eol, before continuation.\n *\n * ```markdown\n * > | * ```js\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * A continuation.\n *\n * ```markdown\n * | * ```js\n * > | b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLineBefore(effects, ok, nok) {\n return start;\n\n /**\n * Before eol, expecting blank line.\n *\n * ```markdown\n * > |
\n * ^\n * |\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return effects.attempt(blankLine, ok, nok);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlText(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable | undefined} */\n let marker;\n /** @type {number} */\n let index;\n /** @type {State} */\n let returnState;\n return start;\n\n /**\n * Start of HTML (text).\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"htmlText\");\n effects.enter(\"htmlTextData\");\n effects.consume(code);\n return open;\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | a c\n * ^\n * > | a c\n * ^\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n if (code === 47) {\n effects.consume(code);\n return tagCloseStart;\n }\n if (code === 63) {\n effects.consume(code);\n return instruction;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagOpen;\n }\n return nok(code);\n }\n\n /**\n * After ` | a c\n * ^\n * > | a c\n * ^\n * > | a &<]]> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n return commentOpenInside;\n }\n if (code === 91) {\n effects.consume(code);\n index = 0;\n return cdataOpenInside;\n }\n if (asciiAlpha(code)) {\n effects.consume(code);\n return declaration;\n }\n return nok(code);\n }\n\n /**\n * In a comment, after ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return nok(code);\n }\n\n /**\n * In comment.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function comment(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 45) {\n effects.consume(code);\n return commentClose;\n }\n if (markdownLineEnding(code)) {\n returnState = comment;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return comment;\n }\n\n /**\n * In comment, after `-`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return comment(code);\n }\n\n /**\n * In comment, after `--`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentEnd(code) {\n return code === 62 ? end(code) : code === 45 ? commentClose(code) : comment(code);\n }\n\n /**\n * After ` | a &<]]> b\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = \"CDATA[\";\n if (code === value.charCodeAt(index++)) {\n effects.consume(code);\n return index === value.length ? cdata : cdataOpenInside;\n }\n return nok(code);\n }\n\n /**\n * In CDATA.\n *\n * ```markdown\n * > | a &<]]> b\n * ^^^\n * ```\n *\n * @type {State}\n */\n function cdata(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataClose;\n }\n if (markdownLineEnding(code)) {\n returnState = cdata;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return cdata;\n }\n\n /**\n * In CDATA, after `]`, at another `]`.\n *\n * ```markdown\n * > | a &<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In CDATA, after `]]`, at `>`.\n *\n * ```markdown\n * > | a &<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataEnd(code) {\n if (code === 62) {\n return end(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In declaration.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code);\n }\n if (markdownLineEnding(code)) {\n returnState = declaration;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return declaration;\n }\n\n /**\n * In instruction.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function instruction(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 63) {\n effects.consume(code);\n return instructionClose;\n }\n if (markdownLineEnding(code)) {\n returnState = instruction;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return instruction;\n }\n\n /**\n * In instruction, after `?`, at `>`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code);\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagClose;\n }\n return nok(code);\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagClose(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagClose;\n }\n return tagCloseBetween(code);\n }\n\n /**\n * In closing tag, after tag name.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagCloseBetween;\n }\n return end(code);\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpen(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpen;\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In opening tag, after tag name.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code);\n return end;\n }\n\n // ASCII alphabetical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenBetween;\n }\n return end(code);\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | a d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeName(code) {\n // ASCII alphabetical and `-`, `.`, `:`, and `_`.\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n return tagOpenAttributeNameAfter(code);\n }\n\n /**\n * After attribute name, before initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | a d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeNameAfter;\n }\n return tagOpenBetween(code);\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n if (code === 34 || code === 39) {\n effects.consume(code);\n marker = code;\n return tagOpenAttributeValueQuoted;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code);\n marker = undefined;\n return tagOpenAttributeValueQuotedAfter;\n }\n if (code === null) {\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueQuoted;\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 96) {\n return nok(code);\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the end\n * of the tag.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In certain circumstances of a tag where only an `>` is allowed.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function end(code) {\n if (code === 62) {\n effects.consume(code);\n effects.exit(\"htmlTextData\");\n effects.exit(\"htmlText\");\n return ok;\n }\n return nok(code);\n }\n\n /**\n * At eol.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * > | a \n * ```\n *\n * @type {State}\n */\n function lineEndingBefore(code) {\n effects.exit(\"htmlTextData\");\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return lineEndingAfter;\n }\n\n /**\n * After eol, at optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a \n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfter(code) {\n // Always populated by defaults.\n\n return markdownSpace(code) ? factorySpace(effects, lineEndingAfterPrefix, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : lineEndingAfterPrefix(code);\n }\n\n /**\n * After eol, after optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a \n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfterPrefix(code) {\n effects.enter(\"htmlTextData\");\n return returnState(code);\n }\n}","/**\n * @import {\n * Construct,\n * Event,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const labelEnd = {\n name: 'labelEnd',\n resolveAll: resolveAllLabelEnd,\n resolveTo: resolveToLabelEnd,\n tokenize: tokenizeLabelEnd\n};\n\n/** @type {Construct} */\nconst resourceConstruct = {\n tokenize: tokenizeResource\n};\n/** @type {Construct} */\nconst referenceFullConstruct = {\n tokenize: tokenizeReferenceFull\n};\n/** @type {Construct} */\nconst referenceCollapsedConstruct = {\n tokenize: tokenizeReferenceCollapsed\n};\n\n/** @type {Resolver} */\nfunction resolveAllLabelEnd(events) {\n let index = -1;\n /** @type {Array} */\n const newEvents = [];\n while (++index < events.length) {\n const token = events[index][1];\n newEvents.push(events[index]);\n if (token.type === \"labelImage\" || token.type === \"labelLink\" || token.type === \"labelEnd\") {\n // Remove the marker.\n const offset = token.type === \"labelImage\" ? 4 : 2;\n token.type = \"data\";\n index += offset;\n }\n }\n\n // If the events are equal, we don't have to copy newEvents to events\n if (events.length !== newEvents.length) {\n splice(events, 0, events.length, newEvents);\n }\n return events;\n}\n\n/** @type {Resolver} */\nfunction resolveToLabelEnd(events, context) {\n let index = events.length;\n let offset = 0;\n /** @type {Token} */\n let token;\n /** @type {number | undefined} */\n let open;\n /** @type {number | undefined} */\n let close;\n /** @type {Array} */\n let media;\n\n // Find an opening.\n while (index--) {\n token = events[index][1];\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (token.type === \"link\" || token.type === \"labelLink\" && token._inactive) {\n break;\n }\n\n // Mark other link openings as inactive, as we can’t have links in\n // links.\n if (events[index][0] === 'enter' && token.type === \"labelLink\") {\n token._inactive = true;\n }\n } else if (close) {\n if (events[index][0] === 'enter' && (token.type === \"labelImage\" || token.type === \"labelLink\") && !token._balanced) {\n open = index;\n if (token.type !== \"labelLink\") {\n offset = 2;\n break;\n }\n }\n } else if (token.type === \"labelEnd\") {\n close = index;\n }\n }\n const group = {\n type: events[open][1].type === \"labelLink\" ? \"link\" : \"image\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n const label = {\n type: \"label\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[close][1].end\n }\n };\n const text = {\n type: \"labelText\",\n start: {\n ...events[open + offset + 2][1].end\n },\n end: {\n ...events[close - 2][1].start\n }\n };\n media = [['enter', group, context], ['enter', label, context]];\n\n // Opening marker.\n media = push(media, events.slice(open + 1, open + offset + 3));\n\n // Text open.\n media = push(media, [['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n media = push(media, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + offset + 4, close - 3), context));\n\n // Text close, marker close, label close.\n media = push(media, [['exit', text, context], events[close - 2], events[close - 1], ['exit', label, context]]);\n\n // Reference, resource, or so.\n media = push(media, events.slice(close + 1));\n\n // Media close.\n media = push(media, [['exit', group, context]]);\n splice(events, open, events.length, media);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelEnd(effects, ok, nok) {\n const self = this;\n let index = self.events.length;\n /** @type {Token} */\n let labelStart;\n /** @type {boolean} */\n let defined;\n\n // Find an opening.\n while (index--) {\n if ((self.events[index][1].type === \"labelImage\" || self.events[index][1].type === \"labelLink\") && !self.events[index][1]._balanced) {\n labelStart = self.events[index][1];\n break;\n }\n }\n return start;\n\n /**\n * Start of label end.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // If there is not an okay opening.\n if (!labelStart) {\n return nok(code);\n }\n\n // If the corresponding label (link) start is marked as inactive,\n // it means we’d be wrapping a link, like this:\n //\n // ```markdown\n // > | a [b [c](d) e](f) g.\n // ^\n // ```\n //\n // We can’t have that, so it’s just balanced brackets.\n if (labelStart._inactive) {\n return labelEndNok(code);\n }\n defined = self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })));\n effects.enter(\"labelEnd\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelEnd\");\n return after;\n }\n\n /**\n * After `]`.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Note: `markdown-rs` also parses GFM footnotes here, which for us is in\n // an extension.\n\n // Resource (`[asd](fgh)`)?\n if (code === 40) {\n return effects.attempt(resourceConstruct, labelEndOk, defined ? labelEndOk : labelEndNok)(code);\n }\n\n // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference?\n if (code === 91) {\n return effects.attempt(referenceFullConstruct, labelEndOk, defined ? referenceNotFull : labelEndNok)(code);\n }\n\n // Shortcut (`[asd]`) reference?\n return defined ? labelEndOk(code) : labelEndNok(code);\n }\n\n /**\n * After `]`, at `[`, but not at a full reference.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceNotFull(code) {\n return effects.attempt(referenceCollapsedConstruct, labelEndOk, labelEndNok)(code);\n }\n\n /**\n * Done, we found something.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndOk(code) {\n // Note: `markdown-rs` does a bunch of stuff here.\n return ok(code);\n }\n\n /**\n * Done, it’s nothing.\n *\n * There was an okay opening, but we didn’t match anything.\n *\n * ```markdown\n * > | [a](b c\n * ^\n * > | [a][b c\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndNok(code) {\n labelStart._balanced = true;\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeResource(effects, ok, nok) {\n return resourceStart;\n\n /**\n * At a resource.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceStart(code) {\n effects.enter(\"resource\");\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n return resourceBefore;\n }\n\n /**\n * In resource, after `(`, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBefore(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceOpen)(code) : resourceOpen(code);\n }\n\n /**\n * In resource, after optional whitespace, at `)` or a destination.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceOpen(code) {\n if (code === 41) {\n return resourceEnd(code);\n }\n return factoryDestination(effects, resourceDestinationAfter, resourceDestinationMissing, \"resourceDestination\", \"resourceDestinationLiteral\", \"resourceDestinationLiteralMarker\", \"resourceDestinationRaw\", \"resourceDestinationString\", 32)(code);\n }\n\n /**\n * In resource, after destination, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceBetween)(code) : resourceEnd(code);\n }\n\n /**\n * At invalid destination.\n *\n * ```markdown\n * > | [a](<<) b\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationMissing(code) {\n return nok(code);\n }\n\n /**\n * In resource, after destination and whitespace, at `(` or title.\n *\n * ```markdown\n * > | [a](b ) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBetween(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(effects, resourceTitleAfter, nok, \"resourceTitle\", \"resourceTitleMarker\", \"resourceTitleString\")(code);\n }\n return resourceEnd(code);\n }\n\n /**\n * In resource, after title, at optional whitespace.\n *\n * ```markdown\n * > | [a](b \"c\") d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceTitleAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceEnd)(code) : resourceEnd(code);\n }\n\n /**\n * In resource, at `)`.\n *\n * ```markdown\n * > | [a](b) d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceEnd(code) {\n if (code === 41) {\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n effects.exit(\"resource\");\n return ok;\n }\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceFull(effects, ok, nok) {\n const self = this;\n return referenceFull;\n\n /**\n * In a reference (full), at the `[`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFull(code) {\n return factoryLabel.call(self, effects, referenceFullAfter, referenceFullMissing, \"reference\", \"referenceMarker\", \"referenceString\")(code);\n }\n\n /**\n * In a reference (full), after `]`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullAfter(code) {\n return self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1))) ? ok(code) : nok(code);\n }\n\n /**\n * In reference (full) that was missing.\n *\n * ```markdown\n * > | [a][b d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullMissing(code) {\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceCollapsed(effects, ok, nok) {\n return referenceCollapsedStart;\n\n /**\n * In reference (collapsed), at `[`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedStart(code) {\n // We only attempt a collapsed label if there’s a `[`.\n\n effects.enter(\"reference\");\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n return referenceCollapsedOpen;\n }\n\n /**\n * In reference (collapsed), at `]`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedOpen(code) {\n if (code === 93) {\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n effects.exit(\"reference\");\n return ok;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartImage = {\n name: 'labelStartImage',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartImage\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * Start of label (image) start.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelImage\");\n effects.enter(\"labelImageMarker\");\n effects.consume(code);\n effects.exit(\"labelImageMarker\");\n return open;\n }\n\n /**\n * After `!`, at `[`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 91) {\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelImage\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * After `![`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * This is needed in because, when GFM footnotes are enabled, images never\n * form when started with a `^`.\n * Instead, links form:\n *\n * ```markdown\n * ![^a](b)\n *\n * ![^a][b]\n *\n * [b]: c\n * ```\n *\n * ```html\n *

!^a

\n *

!^a

\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // To do: use a new field to do this, this is still needed for\n // `micromark-extension-gfm-footnote`, but the `label-start-link`\n // behavior isn’t.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartLink = {\n name: 'labelStartLink',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartLink\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * Start of label (link) start.\n *\n * ```markdown\n * > | a [b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelLink\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelLink\");\n return after;\n }\n\n /** @type {State} */\n function after(code) {\n // To do: this isn’t needed in `micromark-extension-gfm-footnote`,\n // remove.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLineEnding(effects, ok) {\n return start;\n\n /** @type {State} */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, ok, \"linePrefix\");\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const thematicBreak = {\n name: 'thematicBreak',\n tokenize: tokenizeThematicBreak\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeThematicBreak(effects, ok, nok) {\n let size = 0;\n /** @type {NonNullable} */\n let marker;\n return start;\n\n /**\n * Start of thematic break.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"thematicBreak\");\n // To do: parse indent like `markdown-rs`.\n return before(code);\n }\n\n /**\n * After optional whitespace, at marker.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n marker = code;\n return atBreak(code);\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.enter(\"thematicBreakSequence\");\n return sequence(code);\n }\n if (size >= 3 && (code === null || markdownLineEnding(code))) {\n effects.exit(\"thematicBreak\");\n return ok(code);\n }\n return nok(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function sequence(code) {\n if (code === marker) {\n effects.consume(code);\n size++;\n return sequence;\n }\n effects.exit(\"thematicBreakSequence\");\n return markdownSpace(code) ? factorySpace(effects, atBreak, \"whitespace\")(code) : atBreak(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * Exiter,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiDigit, markdownSpace } from 'micromark-util-character';\nimport { blankLine } from './blank-line.js';\nimport { thematicBreak } from './thematic-break.js';\n\n/** @type {Construct} */\nexport const list = {\n continuation: {\n tokenize: tokenizeListContinuation\n },\n exit: tokenizeListEnd,\n name: 'list',\n tokenize: tokenizeListStart\n};\n\n/** @type {Construct} */\nconst listItemPrefixWhitespaceConstruct = {\n partial: true,\n tokenize: tokenizeListItemPrefixWhitespace\n};\n\n/** @type {Construct} */\nconst indentConstruct = {\n partial: true,\n tokenize: tokenizeIndent\n};\n\n// To do: `markdown-rs` parses list items on their own and later stitches them\n// together.\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListStart(effects, ok, nok) {\n const self = this;\n const tail = self.events[self.events.length - 1];\n let initialSize = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n const kind = self.containerState.type || (code === 42 || code === 43 || code === 45 ? \"listUnordered\" : \"listOrdered\");\n if (kind === \"listUnordered\" ? !self.containerState.marker || code === self.containerState.marker : asciiDigit(code)) {\n if (!self.containerState.type) {\n self.containerState.type = kind;\n effects.enter(kind, {\n _container: true\n });\n }\n if (kind === \"listUnordered\") {\n effects.enter(\"listItemPrefix\");\n return code === 42 || code === 45 ? effects.check(thematicBreak, nok, atMarker)(code) : atMarker(code);\n }\n if (!self.interrupt || code === 49) {\n effects.enter(\"listItemPrefix\");\n effects.enter(\"listItemValue\");\n return inside(code);\n }\n }\n return nok(code);\n }\n\n /** @type {State} */\n function inside(code) {\n if (asciiDigit(code) && ++size < 10) {\n effects.consume(code);\n return inside;\n }\n if ((!self.interrupt || size < 2) && (self.containerState.marker ? code === self.containerState.marker : code === 41 || code === 46)) {\n effects.exit(\"listItemValue\");\n return atMarker(code);\n }\n return nok(code);\n }\n\n /**\n * @type {State}\n **/\n function atMarker(code) {\n effects.enter(\"listItemMarker\");\n effects.consume(code);\n effects.exit(\"listItemMarker\");\n self.containerState.marker = self.containerState.marker || code;\n return effects.check(blankLine,\n // Can’t be empty when interrupting.\n self.interrupt ? nok : onBlank, effects.attempt(listItemPrefixWhitespaceConstruct, endOfPrefix, otherPrefix));\n }\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.initialBlankLine = true;\n initialSize++;\n return endOfPrefix(code);\n }\n\n /** @type {State} */\n function otherPrefix(code) {\n if (markdownSpace(code)) {\n effects.enter(\"listItemPrefixWhitespace\");\n effects.consume(code);\n effects.exit(\"listItemPrefixWhitespace\");\n return endOfPrefix;\n }\n return nok(code);\n }\n\n /** @type {State} */\n function endOfPrefix(code) {\n self.containerState.size = initialSize + self.sliceSerialize(effects.exit(\"listItemPrefix\"), true).length;\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListContinuation(effects, ok, nok) {\n const self = this;\n self.containerState._closeFlow = undefined;\n return effects.check(blankLine, onBlank, notBlank);\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine;\n\n // We have a blank line.\n // Still, try to consume at most the items size.\n return factorySpace(effects, ok, \"listItemIndent\", self.containerState.size + 1)(code);\n }\n\n /** @type {State} */\n function notBlank(code) {\n if (self.containerState.furtherBlankLines || !markdownSpace(code)) {\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return notInCurrentItem(code);\n }\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return effects.attempt(indentConstruct, ok, notInCurrentItem)(code);\n }\n\n /** @type {State} */\n function notInCurrentItem(code) {\n // While we do continue, we signal that the flow should be closed.\n self.containerState._closeFlow = true;\n // As we’re closing flow, we’re no longer interrupting.\n self.interrupt = undefined;\n // Always populated by defaults.\n\n return factorySpace(effects, effects.attempt(list, ok, nok), \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, \"listItemIndent\", self.containerState.size + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === \"listItemIndent\" && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok(code) : nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Exiter}\n */\nfunction tokenizeListEnd(effects) {\n effects.exit(this.containerState.type);\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListItemPrefixWhitespace(effects, ok, nok) {\n const self = this;\n\n // Always populated by defaults.\n\n return factorySpace(effects, afterPrefix, \"listItemPrefixWhitespace\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4 + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return !markdownSpace(code) && tail && tail[1].type === \"listItemPrefixWhitespace\" ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const setextUnderline = {\n name: 'setextUnderline',\n resolveTo: resolveToSetextUnderline,\n tokenize: tokenizeSetextUnderline\n};\n\n/** @type {Resolver} */\nfunction resolveToSetextUnderline(events, context) {\n // To do: resolve like `markdown-rs`.\n let index = events.length;\n /** @type {number | undefined} */\n let content;\n /** @type {number | undefined} */\n let text;\n /** @type {number | undefined} */\n let definition;\n\n // Find the opening of the content.\n // It’ll always exist: we don’t tokenize if it isn’t there.\n while (index--) {\n if (events[index][0] === 'enter') {\n if (events[index][1].type === \"content\") {\n content = index;\n break;\n }\n if (events[index][1].type === \"paragraph\") {\n text = index;\n }\n }\n // Exit\n else {\n if (events[index][1].type === \"content\") {\n // Remove the content end (if needed we’ll add it later)\n events.splice(index, 1);\n }\n if (!definition && events[index][1].type === \"definition\") {\n definition = index;\n }\n }\n }\n const heading = {\n type: \"setextHeading\",\n start: {\n ...events[content][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n\n // Change the paragraph to setext heading text.\n events[text][1].type = \"setextHeadingText\";\n\n // If we have definitions in the content, we’ll keep on having content,\n // but we need move it.\n if (definition) {\n events.splice(text, 0, ['enter', heading, context]);\n events.splice(definition + 1, 0, ['exit', events[content][1], context]);\n events[content][1].end = {\n ...events[definition][1].end\n };\n } else {\n events[content][1] = heading;\n }\n\n // Add the heading exit at the end.\n events.push(['exit', heading, context]);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeSetextUnderline(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable} */\n let marker;\n return start;\n\n /**\n * At start of heading (setext) underline.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n let index = self.events.length;\n /** @type {boolean | undefined} */\n let paragraph;\n // Find an opening.\n while (index--) {\n // Skip enter/exit of line ending, line prefix, and content.\n // We can now either have a definition or a paragraph.\n if (self.events[index][1].type !== \"lineEnding\" && self.events[index][1].type !== \"linePrefix\" && self.events[index][1].type !== \"content\") {\n paragraph = self.events[index][1].type === \"paragraph\";\n break;\n }\n }\n\n // To do: handle lazy/pierce like `markdown-rs`.\n // To do: parse indent like `markdown-rs`.\n if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {\n effects.enter(\"setextHeadingLine\");\n marker = code;\n return before(code);\n }\n return nok(code);\n }\n\n /**\n * After optional whitespace, at `-` or `=`.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"setextHeadingLineSequence\");\n return inside(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n effects.exit(\"setextHeadingLineSequence\");\n return markdownSpace(code) ? factorySpace(effects, after, \"lineSuffix\")(code) : after(code);\n }\n\n /**\n * After sequence, after optional whitespace.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"setextHeadingLine\");\n return ok(code);\n }\n return nok(code);\n }\n}","/**\n * @import {\n * InitialConstruct,\n * Initializer,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nimport { blankLine, content } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\nexport const flow = {\n tokenize: initializeFlow\n};\n\n/**\n * @this {TokenizeContext}\n * Self.\n * @type {Initializer}\n * Initializer.\n */\nfunction initializeFlow(effects) {\n const self = this;\n const initial = effects.attempt(\n // Try to parse a blank line.\n blankLine, atBlankEnding,\n // Try to parse initial flow (essentially, only code).\n effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content, afterConstruct)), \"linePrefix\")));\n return initial;\n\n /** @type {State} */\n function atBlankEnding(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEndingBlank\");\n effects.consume(code);\n effects.exit(\"lineEndingBlank\");\n self.currentConstruct = undefined;\n return initial;\n }\n\n /** @type {State} */\n function afterConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n self.currentConstruct = undefined;\n return initial;\n }\n}","/**\n * @import {\n * Code,\n * InitialConstruct,\n * Initializer,\n * Resolver,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nexport const resolver = {\n resolveAll: createResolver()\n};\nexport const string = initializeFactory('string');\nexport const text = initializeFactory('text');\n\n/**\n * @param {'string' | 'text'} field\n * Field.\n * @returns {InitialConstruct}\n * Construct.\n */\nfunction initializeFactory(field) {\n return {\n resolveAll: createResolver(field === 'text' ? resolveAllLineSuffixes : undefined),\n tokenize: initializeText\n };\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Initializer}\n */\n function initializeText(effects) {\n const self = this;\n const constructs = this.parser.constructs[field];\n const text = effects.attempt(constructs, start, notText);\n return start;\n\n /** @type {State} */\n function start(code) {\n return atBreak(code) ? text(code) : notText(code);\n }\n\n /** @type {State} */\n function notText(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"data\");\n effects.consume(code);\n return data;\n }\n\n /** @type {State} */\n function data(code) {\n if (atBreak(code)) {\n effects.exit(\"data\");\n return text(code);\n }\n\n // Data.\n effects.consume(code);\n return data;\n }\n\n /**\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether the code is a break.\n */\n function atBreak(code) {\n if (code === null) {\n return true;\n }\n const list = constructs[code];\n let index = -1;\n if (list) {\n // Always populated by defaults.\n\n while (++index < list.length) {\n const item = list[index];\n if (!item.previous || item.previous.call(self, self.previous)) {\n return true;\n }\n }\n }\n return false;\n }\n }\n}\n\n/**\n * @param {Resolver | undefined} [extraResolver]\n * Resolver.\n * @returns {Resolver}\n * Resolver.\n */\nfunction createResolver(extraResolver) {\n return resolveAllText;\n\n /** @type {Resolver} */\n function resolveAllText(events, context) {\n let index = -1;\n /** @type {number | undefined} */\n let enter;\n\n // A rather boring computation (to merge adjacent `data` events) which\n // improves mm performance by 29%.\n while (++index <= events.length) {\n if (enter === undefined) {\n if (events[index] && events[index][1].type === \"data\") {\n enter = index;\n index++;\n }\n } else if (!events[index] || events[index][1].type !== \"data\") {\n // Don’t do anything if there is one data token.\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return extraResolver ? extraResolver(events, context) : events;\n }\n}\n\n/**\n * A rather ugly set of instructions which again looks at chunks in the input\n * stream.\n * The reason to do this here is that it is *much* faster to parse in reverse.\n * And that we can’t hook into `null` to split the line suffix before an EOF.\n * To do: figure out if we can make this into a clean utility, or even in core.\n * As it will be useful for GFMs literal autolink extension (and maybe even\n * tables?)\n *\n * @type {Resolver}\n */\nfunction resolveAllLineSuffixes(events, context) {\n let eventIndex = 0; // Skip first.\n\n while (++eventIndex <= events.length) {\n if ((eventIndex === events.length || events[eventIndex][1].type === \"lineEnding\") && events[eventIndex - 1][1].type === \"data\") {\n const data = events[eventIndex - 1][1];\n const chunks = context.sliceStream(data);\n let index = chunks.length;\n let bufferIndex = -1;\n let size = 0;\n /** @type {boolean | undefined} */\n let tabs;\n while (index--) {\n const chunk = chunks[index];\n if (typeof chunk === 'string') {\n bufferIndex = chunk.length;\n while (chunk.charCodeAt(bufferIndex - 1) === 32) {\n size++;\n bufferIndex--;\n }\n if (bufferIndex) break;\n bufferIndex = -1;\n }\n // Number\n else if (chunk === -2) {\n tabs = true;\n size++;\n } else if (chunk === -1) {\n // Empty\n } else {\n // Replacement character, exit.\n index++;\n break;\n }\n }\n\n // Allow final trailing whitespace.\n if (context._contentTypeTextTrailing && eventIndex === events.length) {\n size = 0;\n }\n if (size) {\n const token = {\n type: eventIndex === events.length || tabs || size < 2 ? \"lineSuffix\" : \"hardBreakTrailing\",\n start: {\n _bufferIndex: index ? bufferIndex : data.start._bufferIndex + bufferIndex,\n _index: data.start._index + index,\n line: data.end.line,\n column: data.end.column - size,\n offset: data.end.offset - size\n },\n end: {\n ...data.end\n }\n };\n data.end = {\n ...token.start\n };\n if (data.start.offset === data.end.offset) {\n Object.assign(data, token);\n } else {\n events.splice(eventIndex, 0, ['enter', token, context], ['exit', token, context]);\n eventIndex += 2;\n }\n }\n eventIndex++;\n }\n }\n return events;\n}","/**\n * @import {Extension} from 'micromark-util-types'\n */\n\nimport { attention, autolink, blockQuote, characterEscape, characterReference, codeFenced, codeIndented, codeText, definition, hardBreakEscape, headingAtx, htmlFlow, htmlText, labelEnd, labelStartImage, labelStartLink, lineEnding, list, setextUnderline, thematicBreak } from 'micromark-core-commonmark';\nimport { resolver as resolveText } from './initialize/text.js';\n\n/** @satisfies {Extension['document']} */\nexport const document = {\n [42]: list,\n [43]: list,\n [45]: list,\n [48]: list,\n [49]: list,\n [50]: list,\n [51]: list,\n [52]: list,\n [53]: list,\n [54]: list,\n [55]: list,\n [56]: list,\n [57]: list,\n [62]: blockQuote\n};\n\n/** @satisfies {Extension['contentInitial']} */\nexport const contentInitial = {\n [91]: definition\n};\n\n/** @satisfies {Extension['flowInitial']} */\nexport const flowInitial = {\n [-2]: codeIndented,\n [-1]: codeIndented,\n [32]: codeIndented\n};\n\n/** @satisfies {Extension['flow']} */\nexport const flow = {\n [35]: headingAtx,\n [42]: thematicBreak,\n [45]: [setextUnderline, thematicBreak],\n [60]: htmlFlow,\n [61]: setextUnderline,\n [95]: thematicBreak,\n [96]: codeFenced,\n [126]: codeFenced\n};\n\n/** @satisfies {Extension['string']} */\nexport const string = {\n [38]: characterReference,\n [92]: characterEscape\n};\n\n/** @satisfies {Extension['text']} */\nexport const text = {\n [-5]: lineEnding,\n [-4]: lineEnding,\n [-3]: lineEnding,\n [33]: labelStartImage,\n [38]: characterReference,\n [42]: attention,\n [60]: [autolink, htmlText],\n [91]: labelStartLink,\n [92]: [hardBreakEscape, characterEscape],\n [93]: labelEnd,\n [95]: attention,\n [96]: codeText\n};\n\n/** @satisfies {Extension['insideSpan']} */\nexport const insideSpan = {\n null: [attention, resolveText]\n};\n\n/** @satisfies {Extension['attentionMarkers']} */\nexport const attentionMarkers = {\n null: [42, 95]\n};\n\n/** @satisfies {Extension['disable']} */\nexport const disable = {\n null: []\n};","/**\n * @import {\n * Chunk,\n * Code,\n * ConstructRecord,\n * Construct,\n * Effects,\n * InitialConstruct,\n * ParseContext,\n * Point,\n * State,\n * TokenizeContext,\n * Token\n * } from 'micromark-util-types'\n */\n\n/**\n * @callback Restore\n * Restore the state.\n * @returns {undefined}\n * Nothing.\n *\n * @typedef Info\n * Info.\n * @property {Restore} restore\n * Restore.\n * @property {number} from\n * From.\n *\n * @callback ReturnHandle\n * Handle a successful run.\n * @param {Construct} construct\n * Construct.\n * @param {Info} info\n * Info.\n * @returns {undefined}\n * Nothing.\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/**\n * Create a tokenizer.\n * Tokenizers deal with one type of data (e.g., containers, flow, text).\n * The parser is the object dealing with it all.\n * `initialize` works like other constructs, except that only its `tokenize`\n * function is used, in which case it doesn’t receive an `ok` or `nok`.\n * `from` can be given to set the point before the first character, although\n * when further lines are indented, they must be set with `defineSkip`.\n *\n * @param {ParseContext} parser\n * Parser.\n * @param {InitialConstruct} initialize\n * Construct.\n * @param {Omit | undefined} [from]\n * Point (optional).\n * @returns {TokenizeContext}\n * Context.\n */\nexport function createTokenizer(parser, initialize, from) {\n /** @type {Point} */\n let point = {\n _bufferIndex: -1,\n _index: 0,\n line: from && from.line || 1,\n column: from && from.column || 1,\n offset: from && from.offset || 0\n };\n /** @type {Record} */\n const columnStart = {};\n /** @type {Array} */\n const resolveAllConstructs = [];\n /** @type {Array} */\n let chunks = [];\n /** @type {Array} */\n let stack = [];\n /** @type {boolean | undefined} */\n let consumed = true;\n\n /**\n * Tools used for tokenizing.\n *\n * @type {Effects}\n */\n const effects = {\n attempt: constructFactory(onsuccessfulconstruct),\n check: constructFactory(onsuccessfulcheck),\n consume,\n enter,\n exit,\n interrupt: constructFactory(onsuccessfulcheck, {\n interrupt: true\n })\n };\n\n /**\n * State and tools for resolving and serializing.\n *\n * @type {TokenizeContext}\n */\n const context = {\n code: null,\n containerState: {},\n defineSkip,\n events: [],\n now,\n parser,\n previous: null,\n sliceSerialize,\n sliceStream,\n write\n };\n\n /**\n * The state function.\n *\n * @type {State | undefined}\n */\n let state = initialize.tokenize.call(context, effects);\n\n /**\n * Track which character we expect to be consumed, to catch bugs.\n *\n * @type {Code}\n */\n let expectedCode;\n if (initialize.resolveAll) {\n resolveAllConstructs.push(initialize);\n }\n return context;\n\n /** @type {TokenizeContext['write']} */\n function write(slice) {\n chunks = push(chunks, slice);\n main();\n\n // Exit if we’re not done, resolve might change stuff.\n if (chunks[chunks.length - 1] !== null) {\n return [];\n }\n addResult(initialize, 0);\n\n // Otherwise, resolve, and exit.\n context.events = resolveAll(resolveAllConstructs, context.events, context);\n return context.events;\n }\n\n //\n // Tools.\n //\n\n /** @type {TokenizeContext['sliceSerialize']} */\n function sliceSerialize(token, expandTabs) {\n return serializeChunks(sliceStream(token), expandTabs);\n }\n\n /** @type {TokenizeContext['sliceStream']} */\n function sliceStream(token) {\n return sliceChunks(chunks, token);\n }\n\n /** @type {TokenizeContext['now']} */\n function now() {\n // This is a hot path, so we clone manually instead of `Object.assign({}, point)`\n const {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n } = point;\n return {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n };\n }\n\n /** @type {TokenizeContext['defineSkip']} */\n function defineSkip(value) {\n columnStart[value.line] = value.column;\n accountForPotentialSkip();\n }\n\n //\n // State management.\n //\n\n /**\n * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by\n * `consume`).\n * Here is where we walk through the chunks, which either include strings of\n * several characters, or numerical character codes.\n * The reason to do this in a loop instead of a call is so the stack can\n * drain.\n *\n * @returns {undefined}\n * Nothing.\n */\n function main() {\n /** @type {number} */\n let chunkIndex;\n while (point._index < chunks.length) {\n const chunk = chunks[point._index];\n\n // If we’re in a buffer chunk, loop through it.\n if (typeof chunk === 'string') {\n chunkIndex = point._index;\n if (point._bufferIndex < 0) {\n point._bufferIndex = 0;\n }\n while (point._index === chunkIndex && point._bufferIndex < chunk.length) {\n go(chunk.charCodeAt(point._bufferIndex));\n }\n } else {\n go(chunk);\n }\n }\n }\n\n /**\n * Deal with one code.\n *\n * @param {Code} code\n * Code.\n * @returns {undefined}\n * Nothing.\n */\n function go(code) {\n consumed = undefined;\n expectedCode = code;\n state = state(code);\n }\n\n /** @type {Effects['consume']} */\n function consume(code) {\n if (markdownLineEnding(code)) {\n point.line++;\n point.column = 1;\n point.offset += code === -3 ? 2 : 1;\n accountForPotentialSkip();\n } else if (code !== -1) {\n point.column++;\n point.offset++;\n }\n\n // Not in a string chunk.\n if (point._bufferIndex < 0) {\n point._index++;\n } else {\n point._bufferIndex++;\n\n // At end of string chunk.\n if (point._bufferIndex ===\n // Points w/ non-negative `_bufferIndex` reference\n // strings.\n /** @type {string} */\n chunks[point._index].length) {\n point._bufferIndex = -1;\n point._index++;\n }\n }\n\n // Expose the previous character.\n context.previous = code;\n\n // Mark as consumed.\n consumed = true;\n }\n\n /** @type {Effects['enter']} */\n function enter(type, fields) {\n /** @type {Token} */\n // @ts-expect-error Patch instead of assign required fields to help GC.\n const token = fields || {};\n token.type = type;\n token.start = now();\n context.events.push(['enter', token, context]);\n stack.push(token);\n return token;\n }\n\n /** @type {Effects['exit']} */\n function exit(type) {\n const token = stack.pop();\n token.end = now();\n context.events.push(['exit', token, context]);\n return token;\n }\n\n /**\n * Use results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulconstruct(construct, info) {\n addResult(construct, info.from);\n }\n\n /**\n * Discard results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulcheck(_, info) {\n info.restore();\n }\n\n /**\n * Factory to attempt/check/interrupt.\n *\n * @param {ReturnHandle} onreturn\n * Callback.\n * @param {{interrupt?: boolean | undefined} | undefined} [fields]\n * Fields.\n */\n function constructFactory(onreturn, fields) {\n return hook;\n\n /**\n * Handle either an object mapping codes to constructs, a list of\n * constructs, or a single construct.\n *\n * @param {Array | ConstructRecord | Construct} constructs\n * Constructs.\n * @param {State} returnState\n * State.\n * @param {State | undefined} [bogusState]\n * State.\n * @returns {State}\n * State.\n */\n function hook(constructs, returnState, bogusState) {\n /** @type {ReadonlyArray} */\n let listOfConstructs;\n /** @type {number} */\n let constructIndex;\n /** @type {Construct} */\n let currentConstruct;\n /** @type {Info} */\n let info;\n return Array.isArray(constructs) ? /* c8 ignore next 1 */\n handleListOfConstructs(constructs) : 'tokenize' in constructs ?\n // Looks like a construct.\n handleListOfConstructs([(/** @type {Construct} */constructs)]) : handleMapOfConstructs(constructs);\n\n /**\n * Handle a list of construct.\n *\n * @param {ConstructRecord} map\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleMapOfConstructs(map) {\n return start;\n\n /** @type {State} */\n function start(code) {\n const left = code !== null && map[code];\n const all = code !== null && map.null;\n const list = [\n // To do: add more extension tests.\n /* c8 ignore next 2 */\n ...(Array.isArray(left) ? left : left ? [left] : []), ...(Array.isArray(all) ? all : all ? [all] : [])];\n return handleListOfConstructs(list)(code);\n }\n }\n\n /**\n * Handle a list of construct.\n *\n * @param {ReadonlyArray} list\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleListOfConstructs(list) {\n listOfConstructs = list;\n constructIndex = 0;\n if (list.length === 0) {\n return bogusState;\n }\n return handleConstruct(list[constructIndex]);\n }\n\n /**\n * Handle a single construct.\n *\n * @param {Construct} construct\n * Construct.\n * @returns {State}\n * State.\n */\n function handleConstruct(construct) {\n return start;\n\n /** @type {State} */\n function start(code) {\n // To do: not needed to store if there is no bogus state, probably?\n // Currently doesn’t work because `inspect` in document does a check\n // w/o a bogus, which doesn’t make sense. But it does seem to help perf\n // by not storing.\n info = store();\n currentConstruct = construct;\n if (!construct.partial) {\n context.currentConstruct = construct;\n }\n\n // Always populated by defaults.\n\n if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) {\n return nok(code);\n }\n return construct.tokenize.call(\n // If we do have fields, create an object w/ `context` as its\n // prototype.\n // This allows a “live binding”, which is needed for `interrupt`.\n fields ? Object.assign(Object.create(context), fields) : context, effects, ok, nok)(code);\n }\n }\n\n /** @type {State} */\n function ok(code) {\n consumed = true;\n onreturn(currentConstruct, info);\n return returnState;\n }\n\n /** @type {State} */\n function nok(code) {\n consumed = true;\n info.restore();\n if (++constructIndex < listOfConstructs.length) {\n return handleConstruct(listOfConstructs[constructIndex]);\n }\n return bogusState;\n }\n }\n }\n\n /**\n * @param {Construct} construct\n * Construct.\n * @param {number} from\n * From.\n * @returns {undefined}\n * Nothing.\n */\n function addResult(construct, from) {\n if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {\n resolveAllConstructs.push(construct);\n }\n if (construct.resolve) {\n splice(context.events, from, context.events.length - from, construct.resolve(context.events.slice(from), context));\n }\n if (construct.resolveTo) {\n context.events = construct.resolveTo(context.events, context);\n }\n }\n\n /**\n * Store state.\n *\n * @returns {Info}\n * Info.\n */\n function store() {\n const startPoint = now();\n const startPrevious = context.previous;\n const startCurrentConstruct = context.currentConstruct;\n const startEventsIndex = context.events.length;\n const startStack = Array.from(stack);\n return {\n from: startEventsIndex,\n restore\n };\n\n /**\n * Restore state.\n *\n * @returns {undefined}\n * Nothing.\n */\n function restore() {\n point = startPoint;\n context.previous = startPrevious;\n context.currentConstruct = startCurrentConstruct;\n context.events.length = startEventsIndex;\n stack = startStack;\n accountForPotentialSkip();\n }\n }\n\n /**\n * Move the current point a bit forward in the line when it’s on a column\n * skip.\n *\n * @returns {undefined}\n * Nothing.\n */\n function accountForPotentialSkip() {\n if (point.line in columnStart && point.column < 2) {\n point.column = columnStart[point.line];\n point.offset += columnStart[point.line] - 1;\n }\n }\n}\n\n/**\n * Get the chunks from a slice of chunks in the range of a token.\n *\n * @param {ReadonlyArray} chunks\n * Chunks.\n * @param {Pick} token\n * Token.\n * @returns {Array}\n * Chunks.\n */\nfunction sliceChunks(chunks, token) {\n const startIndex = token.start._index;\n const startBufferIndex = token.start._bufferIndex;\n const endIndex = token.end._index;\n const endBufferIndex = token.end._bufferIndex;\n /** @type {Array} */\n let view;\n if (startIndex === endIndex) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)];\n } else {\n view = chunks.slice(startIndex, endIndex);\n if (startBufferIndex > -1) {\n const head = view[0];\n if (typeof head === 'string') {\n view[0] = head.slice(startBufferIndex);\n /* c8 ignore next 4 -- used to be used, no longer */\n } else {\n view.shift();\n }\n }\n if (endBufferIndex > 0) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view.push(chunks[endIndex].slice(0, endBufferIndex));\n }\n }\n return view;\n}\n\n/**\n * Get the string value of a slice of chunks.\n *\n * @param {ReadonlyArray} chunks\n * Chunks.\n * @param {boolean | undefined} [expandTabs=false]\n * Whether to expand tabs (default: `false`).\n * @returns {string}\n * Result.\n */\nfunction serializeChunks(chunks, expandTabs) {\n let index = -1;\n /** @type {Array} */\n const result = [];\n /** @type {boolean | undefined} */\n let atTab;\n while (++index < chunks.length) {\n const chunk = chunks[index];\n /** @type {string} */\n let value;\n if (typeof chunk === 'string') {\n value = chunk;\n } else switch (chunk) {\n case -5:\n {\n value = \"\\r\";\n break;\n }\n case -4:\n {\n value = \"\\n\";\n break;\n }\n case -3:\n {\n value = \"\\r\" + \"\\n\";\n break;\n }\n case -2:\n {\n value = expandTabs ? \" \" : \"\\t\";\n break;\n }\n case -1:\n {\n if (!expandTabs && atTab) continue;\n value = \" \";\n break;\n }\n default:\n {\n // Currently only replacement character.\n value = String.fromCharCode(chunk);\n }\n }\n atTab = chunk === -2;\n result.push(value);\n }\n return result.join('');\n}","/**\n * @import {\n * Create,\n * FullNormalizedExtension,\n * InitialConstruct,\n * ParseContext,\n * ParseOptions\n * } from 'micromark-util-types'\n */\n\nimport { combineExtensions } from 'micromark-util-combine-extensions';\nimport { content } from './initialize/content.js';\nimport { document } from './initialize/document.js';\nimport { flow } from './initialize/flow.js';\nimport { string, text } from './initialize/text.js';\nimport * as defaultConstructs from './constructs.js';\nimport { createTokenizer } from './create-tokenizer.js';\n\n/**\n * @param {ParseOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ParseContext}\n * Parser.\n */\nexport function parse(options) {\n const settings = options || {};\n const constructs = /** @type {FullNormalizedExtension} */\n combineExtensions([defaultConstructs, ...(settings.extensions || [])]);\n\n /** @type {ParseContext} */\n const parser = {\n constructs,\n content: create(content),\n defined: [],\n document: create(document),\n flow: create(flow),\n lazy: {},\n string: create(string),\n text: create(text)\n };\n return parser;\n\n /**\n * @param {InitialConstruct} initial\n * Construct to start with.\n * @returns {Create}\n * Create a tokenizer.\n */\n function create(initial) {\n return creator;\n /** @type {Create} */\n function creator(from) {\n return createTokenizer(parser, initial, from);\n }\n }\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\nimport { subtokenize } from 'micromark-util-subtokenize';\n\n/**\n * @param {Array} events\n * Events.\n * @returns {Array}\n * Events.\n */\nexport function postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n return events;\n}","/**\n * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'\n */\n\n/**\n * @callback Preprocessor\n * Preprocess a value.\n * @param {Value} value\n * Value.\n * @param {Encoding | null | undefined} [encoding]\n * Encoding when `value` is a typed array (optional).\n * @param {boolean | null | undefined} [end=false]\n * Whether this is the last chunk (default: `false`).\n * @returns {Array}\n * Chunks.\n */\n\nconst search = /[\\0\\t\\n\\r]/g;\n\n/**\n * @returns {Preprocessor}\n * Preprocess a value.\n */\nexport function preprocess() {\n let column = 1;\n let buffer = '';\n /** @type {boolean | undefined} */\n let start = true;\n /** @type {boolean | undefined} */\n let atCarriageReturn;\n return preprocessor;\n\n /** @type {Preprocessor} */\n // eslint-disable-next-line complexity\n function preprocessor(value, encoding, end) {\n /** @type {Array} */\n const chunks = [];\n /** @type {RegExpMatchArray | null} */\n let match;\n /** @type {number} */\n let next;\n /** @type {number} */\n let startPosition;\n /** @type {number} */\n let endPosition;\n /** @type {Code} */\n let code;\n value = buffer + (typeof value === 'string' ? value.toString() : new TextDecoder(encoding || undefined).decode(value));\n startPosition = 0;\n buffer = '';\n if (start) {\n // To do: `markdown-rs` actually parses BOMs (byte order mark).\n if (value.charCodeAt(0) === 65279) {\n startPosition++;\n }\n start = undefined;\n }\n while (startPosition < value.length) {\n search.lastIndex = startPosition;\n match = search.exec(value);\n endPosition = match && match.index !== undefined ? match.index : value.length;\n code = value.charCodeAt(endPosition);\n if (!match) {\n buffer = value.slice(startPosition);\n break;\n }\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3);\n atCarriageReturn = undefined;\n } else {\n if (atCarriageReturn) {\n chunks.push(-5);\n atCarriageReturn = undefined;\n }\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition));\n column += endPosition - startPosition;\n }\n switch (code) {\n case 0:\n {\n chunks.push(65533);\n column++;\n break;\n }\n case 9:\n {\n next = Math.ceil(column / 4) * 4;\n chunks.push(-2);\n while (column++ < next) chunks.push(-1);\n break;\n }\n case 10:\n {\n chunks.push(-4);\n column = 1;\n break;\n }\n default:\n {\n atCarriageReturn = true;\n column = 1;\n }\n }\n }\n startPosition = endPosition + 1;\n }\n if (end) {\n if (atCarriageReturn) chunks.push(-5);\n if (buffer) chunks.push(buffer);\n chunks.push(null);\n }\n return chunks;\n }\n}","import { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nconst characterEscapeOrReference = /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi;\n\n/**\n * Decode markdown strings (which occur in places such as fenced code info\n * strings, destinations, labels, and titles).\n *\n * The “string” content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * Value to decode.\n * @returns {string}\n * Decoded value.\n */\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode);\n}\n\n/**\n * @param {string} $0\n * Match.\n * @param {string} $1\n * Character escape.\n * @param {string} $2\n * Character reference.\n * @returns {string}\n * Decoded value\n */\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1;\n }\n\n // Reference.\n const head = $2.charCodeAt(0);\n if (head === 35) {\n const head = $2.charCodeAt(1);\n const hex = head === 120 || head === 88;\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);\n }\n return decodeNamedCharacterReference($2) || $0;\n}","/**\n * @import {\n * Break,\n * Blockquote,\n * Code,\n * Definition,\n * Emphasis,\n * Heading,\n * Html,\n * Image,\n * InlineCode,\n * Link,\n * ListItem,\n * List,\n * Nodes,\n * Paragraph,\n * PhrasingContent,\n * ReferenceType,\n * Root,\n * Strong,\n * Text,\n * ThematicBreak\n * } from 'mdast'\n * @import {\n * Encoding,\n * Event,\n * Token,\n * Value\n * } from 'micromark-util-types'\n * @import {Point} from 'unist'\n * @import {\n * CompileContext,\n * CompileData,\n * Config,\n * Extension,\n * Handle,\n * OnEnterError,\n * Options\n * } from './types.js'\n */\n\nimport { toString } from 'mdast-util-to-string';\nimport { parse, postprocess, preprocess } from 'micromark';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nimport { decodeString } from 'micromark-util-decode-string';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { stringifyPosition } from 'unist-util-stringify-position';\nconst own = {}.hasOwnProperty;\n\n/**\n * Turn markdown into a syntax tree.\n *\n * @overload\n * @param {Value} value\n * @param {Encoding | null | undefined} [encoding]\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @overload\n * @param {Value} value\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @param {Value} value\n * Markdown to parse.\n * @param {Encoding | Options | null | undefined} [encoding]\n * Character encoding for when `value` is `Buffer`.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {Root}\n * mdast tree.\n */\nexport function fromMarkdown(value, encoding, options) {\n if (encoding && typeof encoding === 'object') {\n options = encoding;\n encoding = undefined;\n }\n return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));\n}\n\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options | null | undefined} [options]\n */\nfunction compiler(options) {\n /** @type {Config} */\n const config = {\n transforms: [],\n canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n characterReference: onexitcharacterreference,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n };\n configure(config, (options || {}).mdastExtensions || []);\n\n /** @type {CompileData} */\n const data = {};\n return compile;\n\n /**\n * Turn micromark events into an mdast tree.\n *\n * @param {Array} events\n * Events.\n * @returns {Root}\n * mdast tree.\n */\n function compile(events) {\n /** @type {Root} */\n let tree = {\n type: 'root',\n children: []\n };\n /** @type {Omit} */\n const context = {\n stack: [tree],\n tokenStack: [],\n config,\n enter,\n exit,\n buffer,\n resume,\n data\n };\n /** @type {Array} */\n const listStack = [];\n let index = -1;\n while (++index < events.length) {\n // We preprocess lists to add `listItem` tokens, and to infer whether\n // items the list itself are spread out.\n if (events[index][1].type === \"listOrdered\" || events[index][1].type === \"listUnordered\") {\n if (events[index][0] === 'enter') {\n listStack.push(index);\n } else {\n const tail = listStack.pop();\n index = prepareList(events, tail, index);\n }\n }\n }\n index = -1;\n while (++index < events.length) {\n const handler = config[events[index][0]];\n if (own.call(handler, events[index][1].type)) {\n handler[events[index][1].type].call(Object.assign({\n sliceSerialize: events[index][2].sliceSerialize\n }, context), events[index][1]);\n }\n }\n\n // Handle tokens still being open.\n if (context.tokenStack.length > 0) {\n const tail = context.tokenStack[context.tokenStack.length - 1];\n const handler = tail[1] || defaultOnError;\n handler.call(context, undefined, tail[0]);\n }\n\n // Figure out `root` position.\n tree.position = {\n start: point(events.length > 0 ? events[0][1].start : {\n line: 1,\n column: 1,\n offset: 0\n }),\n end: point(events.length > 0 ? events[events.length - 2][1].end : {\n line: 1,\n column: 1,\n offset: 0\n })\n };\n\n // Call transforms.\n index = -1;\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree;\n }\n return tree;\n }\n\n /**\n * @param {Array} events\n * @param {number} start\n * @param {number} length\n * @returns {number}\n */\n function prepareList(events, start, length) {\n let index = start - 1;\n let containerBalance = -1;\n let listSpread = false;\n /** @type {Token | undefined} */\n let listItem;\n /** @type {number | undefined} */\n let lineIndex;\n /** @type {number | undefined} */\n let firstBlankLineIndex;\n /** @type {boolean | undefined} */\n let atMarker;\n while (++index <= length) {\n const event = events[index];\n switch (event[1].type) {\n case \"listUnordered\":\n case \"listOrdered\":\n case \"blockQuote\":\n {\n if (event[0] === 'enter') {\n containerBalance++;\n } else {\n containerBalance--;\n }\n atMarker = undefined;\n break;\n }\n case \"lineEndingBlank\":\n {\n if (event[0] === 'enter') {\n if (listItem && !atMarker && !containerBalance && !firstBlankLineIndex) {\n firstBlankLineIndex = index;\n }\n atMarker = undefined;\n }\n break;\n }\n case \"linePrefix\":\n case \"listItemValue\":\n case \"listItemMarker\":\n case \"listItemPrefix\":\n case \"listItemPrefixWhitespace\":\n {\n // Empty.\n\n break;\n }\n default:\n {\n atMarker = undefined;\n }\n }\n if (!containerBalance && event[0] === 'enter' && event[1].type === \"listItemPrefix\" || containerBalance === -1 && event[0] === 'exit' && (event[1].type === \"listUnordered\" || event[1].type === \"listOrdered\")) {\n if (listItem) {\n let tailIndex = index;\n lineIndex = undefined;\n while (tailIndex--) {\n const tailEvent = events[tailIndex];\n if (tailEvent[1].type === \"lineEnding\" || tailEvent[1].type === \"lineEndingBlank\") {\n if (tailEvent[0] === 'exit') continue;\n if (lineIndex) {\n events[lineIndex][1].type = \"lineEndingBlank\";\n listSpread = true;\n }\n tailEvent[1].type = \"lineEnding\";\n lineIndex = tailIndex;\n } else if (tailEvent[1].type === \"linePrefix\" || tailEvent[1].type === \"blockQuotePrefix\" || tailEvent[1].type === \"blockQuotePrefixWhitespace\" || tailEvent[1].type === \"blockQuoteMarker\" || tailEvent[1].type === \"listItemIndent\") {\n // Empty\n } else {\n break;\n }\n }\n if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {\n listItem._spread = true;\n }\n\n // Fix position.\n listItem.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end);\n events.splice(lineIndex || index, 0, ['exit', listItem, event[2]]);\n index++;\n length++;\n }\n\n // Create a new list item.\n if (event[1].type === \"listItemPrefix\") {\n /** @type {Token} */\n const item = {\n type: 'listItem',\n _spread: false,\n start: Object.assign({}, event[1].start),\n // @ts-expect-error: we’ll add `end` in a second.\n end: undefined\n };\n listItem = item;\n events.splice(index, 0, ['enter', item, event[2]]);\n index++;\n length++;\n firstBlankLineIndex = undefined;\n atMarker = true;\n }\n }\n }\n events[start][1]._spread = listSpread;\n return length;\n }\n\n /**\n * Create an opener handle.\n *\n * @param {(token: Token) => Nodes} create\n * Create a node.\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function opener(create, and) {\n return open;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function open(token) {\n enter.call(this, create(token), token);\n if (and) and.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['buffer']}\n */\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n });\n }\n\n /**\n * @type {CompileContext['enter']}\n */\n function enter(node, token, errorHandler) {\n const parent = this.stack[this.stack.length - 1];\n /** @type {Array} */\n const siblings = parent.children;\n siblings.push(node);\n this.stack.push(node);\n this.tokenStack.push([token, errorHandler || undefined]);\n node.position = {\n start: point(token.start),\n // @ts-expect-error: `end` will be patched later.\n end: undefined\n };\n }\n\n /**\n * Create a closer handle.\n *\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function closer(and) {\n return close;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function close(token) {\n if (and) and.call(this, token);\n exit.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['exit']}\n */\n function exit(token, onExitError) {\n const node = this.stack.pop();\n const open = this.tokenStack.pop();\n if (!open) {\n throw new Error('Cannot close `' + token.type + '` (' + stringifyPosition({\n start: token.start,\n end: token.end\n }) + '): it’s not open');\n } else if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0]);\n } else {\n const handler = open[1] || defaultOnError;\n handler.call(this, token, open[0]);\n }\n }\n node.position.end = point(token.end);\n }\n\n /**\n * @type {CompileContext['resume']}\n */\n function resume() {\n return toString(this.stack.pop());\n }\n\n //\n // Handlers.\n //\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistordered() {\n this.data.expectingFirstListItemValue = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistitemvalue(token) {\n if (this.data.expectingFirstListItemValue) {\n const ancestor = this.stack[this.stack.length - 2];\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);\n this.data.expectingFirstListItemValue = undefined;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfenceinfo() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.lang = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfencemeta() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.meta = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (this.data.flowCodeInside) return;\n this.buffer();\n this.data.flowCodeInside = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefenced() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '');\n this.data.flowCodeInside = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodeindented() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '');\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitionlabelstring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.label = label;\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiontitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiondestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitatxheadingsequence(token) {\n const node = this.stack[this.stack.length - 1];\n if (!node.depth) {\n const depth = this.sliceSerialize(token).length;\n node.depth = depth;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadingtext() {\n this.data.setextHeadingSlurpLineEnding = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadinglinesequence(token) {\n const node = this.stack[this.stack.length - 1];\n node.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheading() {\n this.data.setextHeadingSlurpLineEnding = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterdata(token) {\n const node = this.stack[this.stack.length - 1];\n /** @type {Array} */\n const siblings = node.children;\n let tail = siblings[siblings.length - 1];\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text();\n tail.position = {\n start: point(token.start),\n // @ts-expect-error: we’ll add `end` later.\n end: undefined\n };\n siblings.push(tail);\n }\n this.stack.push(tail);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitdata(token) {\n const tail = this.stack.pop();\n tail.value += this.sliceSerialize(token);\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlineending(token) {\n const context = this.stack[this.stack.length - 1];\n // If we’re at a hard break, include the line ending in there.\n if (this.data.atHardBreak) {\n const tail = context.children[context.children.length - 1];\n tail.position.end = point(token.end);\n this.data.atHardBreak = undefined;\n return;\n }\n if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context.type)) {\n onenterdata.call(this, token);\n onexitdata.call(this, token);\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithardbreak() {\n this.data.atHardBreak = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmlflow() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmltext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcodetext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlink() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitimage() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabeltext(token) {\n const string = this.sliceSerialize(token);\n const ancestor = this.stack[this.stack.length - 2];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n ancestor.label = decodeString(string);\n // @ts-expect-error: same as above.\n ancestor.identifier = normalizeIdentifier(string).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabel() {\n const fragment = this.stack[this.stack.length - 1];\n const value = this.resume();\n const node = this.stack[this.stack.length - 1];\n // Assume a reference.\n this.data.inReference = true;\n if (node.type === 'link') {\n /** @type {Array} */\n const children = fragment.children;\n node.children = children;\n } else {\n node.alt = value;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcedestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcetitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresource() {\n this.data.inReference = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterreference() {\n this.data.referenceType = 'collapsed';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitreferencestring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n node.label = label;\n // @ts-expect-error: same as above.\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n this.data.referenceType = 'full';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcharacterreferencemarker(token) {\n this.data.characterReferenceType = token.type;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreferencevalue(token) {\n const data = this.sliceSerialize(token);\n const type = this.data.characterReferenceType;\n /** @type {string} */\n let value;\n if (type) {\n value = decodeNumericCharacterReference(data, type === \"characterReferenceMarkerNumeric\" ? 10 : 16);\n this.data.characterReferenceType = undefined;\n } else {\n const result = decodeNamedCharacterReference(data);\n value = result;\n }\n const tail = this.stack[this.stack.length - 1];\n tail.value += value;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreference(token) {\n const tail = this.stack.pop();\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = this.sliceSerialize(token);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkemail(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = 'mailto:' + this.sliceSerialize(token);\n }\n\n //\n // Creaters.\n //\n\n /** @returns {Blockquote} */\n function blockQuote() {\n return {\n type: 'blockquote',\n children: []\n };\n }\n\n /** @returns {Code} */\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: ''\n };\n }\n\n /** @returns {InlineCode} */\n function codeText() {\n return {\n type: 'inlineCode',\n value: ''\n };\n }\n\n /** @returns {Definition} */\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: ''\n };\n }\n\n /** @returns {Emphasis} */\n function emphasis() {\n return {\n type: 'emphasis',\n children: []\n };\n }\n\n /** @returns {Heading} */\n function heading() {\n return {\n type: 'heading',\n // @ts-expect-error `depth` will be set later.\n depth: 0,\n children: []\n };\n }\n\n /** @returns {Break} */\n function hardBreak() {\n return {\n type: 'break'\n };\n }\n\n /** @returns {Html} */\n function html() {\n return {\n type: 'html',\n value: ''\n };\n }\n\n /** @returns {Image} */\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null\n };\n }\n\n /** @returns {Link} */\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: []\n };\n }\n\n /**\n * @param {Token} token\n * @returns {List}\n */\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n spread: token._spread,\n children: []\n };\n }\n\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n function listItem(token) {\n return {\n type: 'listItem',\n spread: token._spread,\n checked: null,\n children: []\n };\n }\n\n /** @returns {Paragraph} */\n function paragraph() {\n return {\n type: 'paragraph',\n children: []\n };\n }\n\n /** @returns {Strong} */\n function strong() {\n return {\n type: 'strong',\n children: []\n };\n }\n\n /** @returns {Text} */\n function text() {\n return {\n type: 'text',\n value: ''\n };\n }\n\n /** @returns {ThematicBreak} */\n function thematicBreak() {\n return {\n type: 'thematicBreak'\n };\n }\n}\n\n/**\n * Copy a point-like value.\n *\n * @param {Point} d\n * Point-like value.\n * @returns {Point}\n * unist point.\n */\nfunction point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n };\n}\n\n/**\n * @param {Config} combined\n * @param {Array | Extension>} extensions\n * @returns {undefined}\n */\nfunction configure(combined, extensions) {\n let index = -1;\n while (++index < extensions.length) {\n const value = extensions[index];\n if (Array.isArray(value)) {\n configure(combined, value);\n } else {\n extension(combined, value);\n }\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Extension} extension\n * @returns {undefined}\n */\nfunction extension(combined, extension) {\n /** @type {keyof Extension} */\n let key;\n for (key in extension) {\n if (own.call(extension, key)) {\n switch (key) {\n case 'canContainEols':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'transforms':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'enter':\n case 'exit':\n {\n const right = extension[key];\n if (right) {\n Object.assign(combined[key], right);\n }\n break;\n }\n // No default\n }\n }\n }\n}\n\n/** @type {OnEnterError} */\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error('Cannot close `' + left.type + '` (' + stringifyPosition({\n start: left.start,\n end: left.end\n }) + '): a different token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is open');\n } else {\n throw new Error('Cannot close document, a token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is still open');\n }\n}","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-from-markdown').Options} FromMarkdownOptions\n * @typedef {import('unified').Parser} Parser\n * @typedef {import('unified').Processor} Processor\n */\n\n/**\n * @typedef {Omit} Options\n */\n\nimport {fromMarkdown} from 'mdast-util-from-markdown'\n\n/**\n * Aadd support for parsing from markdown.\n *\n * @param {Readonly | null | undefined} [options]\n * Configuration (optional).\n * @returns {undefined}\n * Nothing.\n */\nexport default function remarkParse(options) {\n /** @type {Processor} */\n // @ts-expect-error: TS in JSDoc generates wrong types if `this` is typed regularly.\n const self = this\n\n self.parser = parser\n\n /**\n * @type {Parser}\n */\n function parser(doc) {\n return fromMarkdown(doc, {\n ...self.data('settings'),\n ...options,\n // Note: these options are not in the readme.\n // The goal is for them to be set by plugins on `data` instead of being\n // passed by users.\n extensions: self.data('micromarkExtensions') || [],\n mdastExtensions: self.data('fromMarkdownExtensions') || []\n })\n }\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Blockquote} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `blockquote` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Blockquote} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function blockquote(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'blockquote',\n properties: {},\n children: state.wrap(state.all(node), true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element, Text} from 'hast'\n * @import {Break} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `break` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Break} node\n * mdast node.\n * @returns {Array}\n * hast element content.\n */\nexport function hardBreak(state, node) {\n /** @type {Element} */\n const result = {type: 'element', tagName: 'br', properties: {}, children: []}\n state.patch(node, result)\n return [state.applyData(node, result), {type: 'text', value: '\\n'}]\n}\n","/**\n * @import {Element, Properties} from 'hast'\n * @import {Code} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `code` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Code} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function code(state, node) {\n const value = node.value ? node.value + '\\n' : ''\n /** @type {Properties} */\n const properties = {}\n // Someone can write `js python ruby`.\n const language = node.lang ? node.lang.split(/\\s+/) : []\n\n // GH/CM still drop the non-first languages.\n if (language.length > 0) {\n properties.className = ['language-' + language[0]]\n }\n\n // Create ``.\n /** @type {Element} */\n let result = {\n type: 'element',\n tagName: 'code',\n properties,\n children: [{type: 'text', value}]\n }\n\n if (node.meta) {\n result.data = {meta: node.meta}\n }\n\n state.patch(node, result)\n result = state.applyData(node, result)\n\n // Create `
`.\n  result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}\n  state.patch(node, result)\n  return result\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Delete} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `delete` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Delete} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strikethrough(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'del',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Emphasis} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `emphasis` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Emphasis} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function emphasis(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'em',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {FootnoteReference} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `footnoteReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {FootnoteReference} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function footnoteReference(state, node) {\n  const clobberPrefix =\n    typeof state.options.clobberPrefix === 'string'\n      ? state.options.clobberPrefix\n      : 'user-content-'\n  const id = String(node.identifier).toUpperCase()\n  const safeId = normalizeUri(id.toLowerCase())\n  const index = state.footnoteOrder.indexOf(id)\n  /** @type {number} */\n  let counter\n\n  let reuseCounter = state.footnoteCounts.get(id)\n\n  if (reuseCounter === undefined) {\n    reuseCounter = 0\n    state.footnoteOrder.push(id)\n    counter = state.footnoteOrder.length\n  } else {\n    counter = index + 1\n  }\n\n  reuseCounter += 1\n  state.footnoteCounts.set(id, reuseCounter)\n\n  /** @type {Element} */\n  const link = {\n    type: 'element',\n    tagName: 'a',\n    properties: {\n      href: '#' + clobberPrefix + 'fn-' + safeId,\n      id:\n        clobberPrefix +\n        'fnref-' +\n        safeId +\n        (reuseCounter > 1 ? '-' + reuseCounter : ''),\n      dataFootnoteRef: true,\n      ariaDescribedBy: ['footnote-label']\n    },\n    children: [{type: 'text', value: String(counter)}]\n  }\n  state.patch(node, link)\n\n  /** @type {Element} */\n  const sup = {\n    type: 'element',\n    tagName: 'sup',\n    properties: {},\n    children: [link]\n  }\n  state.patch(node, sup)\n  return state.applyData(node, sup)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Heading} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `heading` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Heading} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function heading(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'h' + node.depth,\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Html} from 'mdast'\n * @import {State} from '../state.js'\n * @import {Raw} from '../../index.js'\n */\n\n/**\n * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise\n * nothing).\n *\n * @param {State} state\n *   Info passed around.\n * @param {Html} node\n *   mdast node.\n * @returns {Element | Raw | undefined}\n *   hast node.\n */\nexport function html(state, node) {\n  if (state.options.allowDangerousHtml) {\n    /** @type {Raw} */\n    const result = {type: 'raw', value: node.value}\n    state.patch(node, result)\n    return state.applyData(node, result)\n  }\n\n  return undefined\n}\n","/**\n * @import {ElementContent} from 'hast'\n * @import {Reference, Nodes} from 'mdast'\n * @import {State} from './state.js'\n */\n\n/**\n * Return the content of a reference without definition as plain text.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Extract} node\n *   Reference node (image, link).\n * @returns {Array}\n *   hast content.\n */\nexport function revert(state, node) {\n  const subtype = node.referenceType\n  let suffix = ']'\n\n  if (subtype === 'collapsed') {\n    suffix += '[]'\n  } else if (subtype === 'full') {\n    suffix += '[' + (node.label || node.identifier) + ']'\n  }\n\n  if (node.type === 'imageReference') {\n    return [{type: 'text', value: '![' + node.alt + suffix}]\n  }\n\n  const contents = state.all(node)\n  const head = contents[0]\n\n  if (head && head.type === 'text') {\n    head.value = '[' + head.value\n  } else {\n    contents.unshift({type: 'text', value: '['})\n  }\n\n  const tail = contents[contents.length - 1]\n\n  if (tail && tail.type === 'text') {\n    tail.value += suffix\n  } else {\n    contents.push({type: 'text', value: suffix})\n  }\n\n  return contents\n}\n","/**\n * @import {ElementContent, Element, Properties} from 'hast'\n * @import {ImageReference} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `imageReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ImageReference} node\n *   mdast node.\n * @returns {Array | ElementContent}\n *   hast node.\n */\nexport function imageReference(state, node) {\n  const id = String(node.identifier).toUpperCase()\n  const definition = state.definitionById.get(id)\n\n  if (!definition) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(definition.url || ''), alt: node.alt}\n\n  if (definition.title !== null && definition.title !== undefined) {\n    properties.title = definition.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Element, Properties} from 'hast'\n * @import {Image} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `image` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Image} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function image(state, node) {\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(node.url)}\n\n  if (node.alt !== null && node.alt !== undefined) {\n    properties.alt = node.alt\n  }\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Element, Text} from 'hast'\n * @import {InlineCode} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `inlineCode` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {InlineCode} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function inlineCode(state, node) {\n  /** @type {Text} */\n  const text = {type: 'text', value: node.value.replace(/\\r?\\n|\\r/g, ' ')}\n  state.patch(node, text)\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'code',\n    properties: {},\n    children: [text]\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {ElementContent, Element, Properties} from 'hast'\n * @import {LinkReference} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `linkReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {LinkReference} node\n *   mdast node.\n * @returns {Array | ElementContent}\n *   hast node.\n */\nexport function linkReference(state, node) {\n  const id = String(node.identifier).toUpperCase()\n  const definition = state.definitionById.get(id)\n\n  if (!definition) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(definition.url || '')}\n\n  if (definition.title !== null && definition.title !== undefined) {\n    properties.title = definition.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Element, Properties} from 'hast'\n * @import {Link} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `link` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Link} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function link(state, node) {\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(node.url)}\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {ElementContent, Element, Properties} from 'hast'\n * @import {ListItem, Parents} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `listItem` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ListItem} node\n *   mdast node.\n * @param {Parents | undefined} parent\n *   Parent of `node`.\n * @returns {Element}\n *   hast node.\n */\nexport function listItem(state, node, parent) {\n  const results = state.all(node)\n  const loose = parent ? listLoose(parent) : listItemLoose(node)\n  /** @type {Properties} */\n  const properties = {}\n  /** @type {Array} */\n  const children = []\n\n  if (typeof node.checked === 'boolean') {\n    const head = results[0]\n    /** @type {Element} */\n    let paragraph\n\n    if (head && head.type === 'element' && head.tagName === 'p') {\n      paragraph = head\n    } else {\n      paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}\n      results.unshift(paragraph)\n    }\n\n    if (paragraph.children.length > 0) {\n      paragraph.children.unshift({type: 'text', value: ' '})\n    }\n\n    paragraph.children.unshift({\n      type: 'element',\n      tagName: 'input',\n      properties: {type: 'checkbox', checked: node.checked, disabled: true},\n      children: []\n    })\n\n    // According to github-markdown-css, this class hides bullet.\n    // See: .\n    properties.className = ['task-list-item']\n  }\n\n  let index = -1\n\n  while (++index < results.length) {\n    const child = results[index]\n\n    // Add eols before nodes, except if this is a loose, first paragraph.\n    if (\n      loose ||\n      index !== 0 ||\n      child.type !== 'element' ||\n      child.tagName !== 'p'\n    ) {\n      children.push({type: 'text', value: '\\n'})\n    }\n\n    if (child.type === 'element' && child.tagName === 'p' && !loose) {\n      children.push(...child.children)\n    } else {\n      children.push(child)\n    }\n  }\n\n  const tail = results[results.length - 1]\n\n  // Add a final eol.\n  if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {\n    children.push({type: 'text', value: '\\n'})\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'li', properties, children}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n\n/**\n * @param {Parents} node\n * @return {Boolean}\n */\nfunction listLoose(node) {\n  let loose = false\n  if (node.type === 'list') {\n    loose = node.spread || false\n    const children = node.children\n    let index = -1\n\n    while (!loose && ++index < children.length) {\n      loose = listItemLoose(children[index])\n    }\n  }\n\n  return loose\n}\n\n/**\n * @param {ListItem} node\n * @return {Boolean}\n */\nfunction listItemLoose(node) {\n  const spread = node.spread\n\n  return spread === null || spread === undefined\n    ? node.children.length > 1\n    : spread\n}\n","/**\n * @import {Element, Properties} from 'hast'\n * @import {List} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `list` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {List} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function list(state, node) {\n  /** @type {Properties} */\n  const properties = {}\n  const results = state.all(node)\n  let index = -1\n\n  if (typeof node.start === 'number' && node.start !== 1) {\n    properties.start = node.start\n  }\n\n  // Like GitHub, add a class for custom styling.\n  while (++index < results.length) {\n    const child = results[index]\n\n    if (\n      child.type === 'element' &&\n      child.tagName === 'li' &&\n      child.properties &&\n      Array.isArray(child.properties.className) &&\n      child.properties.className.includes('task-list-item')\n    ) {\n      properties.className = ['contains-task-list']\n      break\n    }\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: node.ordered ? 'ol' : 'ul',\n    properties,\n    children: state.wrap(results, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Paragraph} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `paragraph` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Paragraph} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function paragraph(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'p',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Parents as HastParents, Root as HastRoot} from 'hast'\n * @import {Root as MdastRoot} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `root` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastRoot} node\n *   mdast node.\n * @returns {HastParents}\n *   hast node.\n */\nexport function root(state, node) {\n  /** @type {HastRoot} */\n  const result = {type: 'root', children: state.wrap(state.all(node))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Strong} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `strong` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Strong} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strong(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'strong',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Table} from 'mdast'\n * @import {Element} from 'hast'\n * @import {State} from '../state.js'\n */\n\nimport {pointEnd, pointStart} from 'unist-util-position'\n\n/**\n * Turn an mdast `table` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Table} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function table(state, node) {\n  const rows = state.all(node)\n  const firstRow = rows.shift()\n  /** @type {Array} */\n  const tableContent = []\n\n  if (firstRow) {\n    /** @type {Element} */\n    const head = {\n      type: 'element',\n      tagName: 'thead',\n      properties: {},\n      children: state.wrap([firstRow], true)\n    }\n    state.patch(node.children[0], head)\n    tableContent.push(head)\n  }\n\n  if (rows.length > 0) {\n    /** @type {Element} */\n    const body = {\n      type: 'element',\n      tagName: 'tbody',\n      properties: {},\n      children: state.wrap(rows, true)\n    }\n\n    const start = pointStart(node.children[1])\n    const end = pointEnd(node.children[node.children.length - 1])\n    if (start && end) body.position = {start, end}\n    tableContent.push(body)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'table',\n    properties: {},\n    children: state.wrap(tableContent, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Element, ElementContent, Properties} from 'hast'\n * @import {Parents, TableRow} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `tableRow` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableRow} node\n *   mdast node.\n * @param {Parents | undefined} parent\n *   Parent of `node`.\n * @returns {Element}\n *   hast node.\n */\nexport function tableRow(state, node, parent) {\n  const siblings = parent ? parent.children : undefined\n  // Generate a body row when without parent.\n  const rowIndex = siblings ? siblings.indexOf(node) : 1\n  const tagName = rowIndex === 0 ? 'th' : 'td'\n  // To do: option to use `style`?\n  const align = parent && parent.type === 'table' ? parent.align : undefined\n  const length = align ? align.length : node.children.length\n  let cellIndex = -1\n  /** @type {Array} */\n  const cells = []\n\n  while (++cellIndex < length) {\n    // Note: can also be undefined.\n    const cell = node.children[cellIndex]\n    /** @type {Properties} */\n    const properties = {}\n    const alignValue = align ? align[cellIndex] : undefined\n\n    if (alignValue) {\n      properties.align = alignValue\n    }\n\n    /** @type {Element} */\n    let result = {type: 'element', tagName, properties, children: []}\n\n    if (cell) {\n      result.children = state.all(cell)\n      state.patch(cell, result)\n      result = state.applyData(cell, result)\n    }\n\n    cells.push(result)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'tr',\n    properties: {},\n    children: state.wrap(cells, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {TableCell} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `tableCell` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableCell} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function tableCell(state, node) {\n  // Note: this function is normally not called: see `table-row` for how rows\n  // and their cells are compiled.\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'td', // Assume body cell.\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","const tab = 9 /* `\\t` */\nconst space = 32 /* ` ` */\n\n/**\n * Remove initial and final spaces and tabs at the line breaks in `value`.\n * Does not trim initial and final spaces and tabs of the value itself.\n *\n * @param {string} value\n *   Value to trim.\n * @returns {string}\n *   Trimmed value.\n */\nexport function trimLines(value) {\n  const source = String(value)\n  const search = /\\r?\\n|\\r/g\n  let match = search.exec(source)\n  let last = 0\n  /** @type {Array} */\n  const lines = []\n\n  while (match) {\n    lines.push(\n      trimLine(source.slice(last, match.index), last > 0, true),\n      match[0]\n    )\n\n    last = match.index + match[0].length\n    match = search.exec(source)\n  }\n\n  lines.push(trimLine(source.slice(last), last > 0, false))\n\n  return lines.join('')\n}\n\n/**\n * @param {string} value\n *   Line to trim.\n * @param {boolean} start\n *   Whether to trim the start of the line.\n * @param {boolean} end\n *   Whether to trim the end of the line.\n * @returns {string}\n *   Trimmed line.\n */\nfunction trimLine(value, start, end) {\n  let startIndex = 0\n  let endIndex = value.length\n\n  if (start) {\n    let code = value.codePointAt(startIndex)\n\n    while (code === tab || code === space) {\n      startIndex++\n      code = value.codePointAt(startIndex)\n    }\n  }\n\n  if (end) {\n    let code = value.codePointAt(endIndex - 1)\n\n    while (code === tab || code === space) {\n      endIndex--\n      code = value.codePointAt(endIndex - 1)\n    }\n  }\n\n  return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''\n}\n","/**\n * @import {Element as HastElement, Text as HastText} from 'hast'\n * @import {Text as MdastText} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {trimLines} from 'trim-lines'\n\n/**\n * Turn an mdast `text` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastText} node\n *   mdast node.\n * @returns {HastElement | HastText}\n *   hast node.\n */\nexport function text(state, node) {\n  /** @type {HastText} */\n  const result = {type: 'text', value: trimLines(String(node.value))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {ThematicBreak} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `thematicBreak` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ThematicBreak} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function thematicBreak(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'hr',\n    properties: {},\n    children: []\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @import {Handlers} from '../state.js'\n */\n\nimport {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {strikethrough} from './delete.js'\nimport {emphasis} from './emphasis.js'\nimport {footnoteReference} from './footnote-reference.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {imageReference} from './image-reference.js'\nimport {image} from './image.js'\nimport {inlineCode} from './inline-code.js'\nimport {linkReference} from './link-reference.js'\nimport {link} from './link.js'\nimport {listItem} from './list-item.js'\nimport {list} from './list.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {table} from './table.js'\nimport {tableRow} from './table-row.js'\nimport {tableCell} from './table-cell.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default handlers for nodes.\n *\n * @satisfies {Handlers}\n */\nexport const handlers = {\n  blockquote,\n  break: hardBreak,\n  code,\n  delete: strikethrough,\n  emphasis,\n  footnoteReference,\n  heading,\n  html,\n  imageReference,\n  image,\n  inlineCode,\n  linkReference,\n  link,\n  listItem,\n  list,\n  paragraph,\n  // @ts-expect-error: root is different, but hard to type.\n  root,\n  strong,\n  table,\n  tableCell,\n  tableRow,\n  text,\n  thematicBreak,\n  toml: ignore,\n  yaml: ignore,\n  definition: ignore,\n  footnoteDefinition: ignore\n}\n\n// Return nothing for nodes that are ignored.\nfunction ignore() {\n  return undefined\n}\n","import {\n  VOID, PRIMITIVE,\n  ARRAY, OBJECT,\n  DATE, REGEXP, MAP, SET,\n  ERROR, BIGINT\n} from './types.js';\n\nconst env = typeof self === 'object' ? self : globalThis;\n\nconst guard = (name, init) => {\n  switch (name) {\n    case 'Function':\n    case 'SharedWorker':\n    case 'Worker':\n    case 'eval':\n    case 'setInterval':\n    case 'setTimeout':\n      throw new TypeError('unable to deserialize ' + name);\n  }\n  return new env[name](init);\n};\n\nconst deserializer = ($, _) => {\n  const as = (out, index) => {\n    $.set(index, out);\n    return out;\n  };\n\n  const unpair = index => {\n    if ($.has(index))\n      return $.get(index);\n\n    const [type, value] = _[index];\n    switch (type) {\n      case PRIMITIVE:\n      case VOID:\n        return as(value, index);\n      case ARRAY: {\n        const arr = as([], index);\n        for (const index of value)\n          arr.push(unpair(index));\n        return arr;\n      }\n      case OBJECT: {\n        const object = as({}, index);\n        for (const [key, index] of value)\n          object[unpair(key)] = unpair(index);\n        return object;\n      }\n      case DATE:\n        return as(new Date(value), index);\n      case REGEXP: {\n        const {source, flags} = value;\n        return as(new RegExp(source, flags), index);\n      }\n      case MAP: {\n        const map = as(new Map, index);\n        for (const [key, index] of value)\n          map.set(unpair(key), unpair(index));\n        return map;\n      }\n      case SET: {\n        const set = as(new Set, index);\n        for (const index of value)\n          set.add(unpair(index));\n        return set;\n      }\n      case ERROR: {\n        const {name, message} = value;\n        return as(\n          typeof env[name] === 'function' ?\n            guard(name, message) :\n            new Error(message),\n          index\n        );\n      }\n      case BIGINT:\n        return as(BigInt(value), index);\n      case 'BigInt':\n        return as(Object(BigInt(value)), index);\n      case 'ArrayBuffer':\n        return as(new Uint8Array(value).buffer, value);\n      case 'DataView': {\n        const { buffer } = new Uint8Array(value);\n        return as(new DataView(buffer), value);\n      }\n    }\n    return as(guard(type, value), index);\n  };\n\n  return unpair;\n};\n\n/**\n * @typedef {Array} Record a type representation\n */\n\n/**\n * Returns a deserialized value from a serialized array of Records.\n * @param {Record[]} serialized a previously serialized value.\n * @returns {any}\n */\nexport const deserialize = serialized => deserializer(new Map, serialized)(0);\n","import {\n  VOID, PRIMITIVE,\n  ARRAY, OBJECT,\n  DATE, REGEXP, MAP, SET,\n  ERROR, BIGINT\n} from './types.js';\n\nconst EMPTY = '';\n\nconst {toString} = {};\nconst {keys} = Object;\n\nconst typeOf = value => {\n  const type = typeof value;\n  if (type !== 'object' || !value)\n    return [PRIMITIVE, type];\n\n  const asString = toString.call(value).slice(8, -1);\n  switch (asString) {\n    case 'Array':\n      return [ARRAY, EMPTY];\n    case 'Object':\n      return [OBJECT, EMPTY];\n    case 'Date':\n      return [DATE, EMPTY];\n    case 'RegExp':\n      return [REGEXP, EMPTY];\n    case 'Map':\n      return [MAP, EMPTY];\n    case 'Set':\n      return [SET, EMPTY];\n    case 'DataView':\n      return [ARRAY, asString];\n  }\n\n  if (asString.includes('Array'))\n    return [ARRAY, asString];\n\n  if (value instanceof Error)\n    return [ERROR, value.name || 'Error'];\n\n  return [OBJECT, asString];\n};\n\nconst shouldSkip = ([TYPE, type]) => (\n  TYPE === PRIMITIVE &&\n  (type === 'function' || type === 'symbol')\n);\n\nconst serializer = (strict, json, $, _) => {\n\n  const as = (out, value) => {\n    const index = _.push(out) - 1;\n    $.set(value, index);\n    return index;\n  };\n\n  const pair = value => {\n    if ($.has(value))\n      return $.get(value);\n\n    let [TYPE, type] = typeOf(value);\n    switch (TYPE) {\n      case PRIMITIVE: {\n        let entry = value;\n        switch (type) {\n          case 'bigint':\n            TYPE = BIGINT;\n            entry = value.toString();\n            break;\n          case 'function':\n          case 'symbol':\n            if (strict)\n              throw new TypeError('unable to serialize ' + type);\n            entry = null;\n            break;\n          case 'undefined':\n            return as([VOID], value);\n        }\n        return as([TYPE, entry], value);\n      }\n      case ARRAY: {\n        if (type) {\n          let spread = value;\n          if (type === 'DataView') {\n            spread = new Uint8Array(value.buffer);\n          }\n          else if (type === 'ArrayBuffer') {\n            spread = new Uint8Array(value);\n          }\n          return as([type, [...spread]], value);\n        }\n\n        const arr = [];\n        const index = as([TYPE, arr], value);\n        for (const entry of value)\n          arr.push(pair(entry));\n        return index;\n      }\n      case OBJECT: {\n        if (type) {\n          switch (type) {\n            case 'BigInt':\n              return as([type, value.toString()], value);\n            case 'Boolean':\n            case 'Number':\n            case 'String':\n              return as([type, value.valueOf()], value);\n          }\n        }\n\n        if (json && ('toJSON' in value))\n          return pair(value.toJSON());\n\n        const entries = [];\n        const index = as([TYPE, entries], value);\n        for (const key of keys(value)) {\n          if (strict || !shouldSkip(typeOf(value[key])))\n            entries.push([pair(key), pair(value[key])]);\n        }\n        return index;\n      }\n      case DATE:\n        return as([TYPE, isNaN(value.getTime()) ? EMPTY : value.toISOString()], value);\n      case REGEXP: {\n        const {source, flags} = value;\n        return as([TYPE, {source, flags}], value);\n      }\n      case MAP: {\n        const entries = [];\n        const index = as([TYPE, entries], value);\n        for (const [key, entry] of value) {\n          if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry))))\n            entries.push([pair(key), pair(entry)]);\n        }\n        return index;\n      }\n      case SET: {\n        const entries = [];\n        const index = as([TYPE, entries], value);\n        for (const entry of value) {\n          if (strict || !shouldSkip(typeOf(entry)))\n            entries.push(pair(entry));\n        }\n        return index;\n      }\n    }\n\n    const {message} = value;\n    return as([TYPE, {name: type, message}], value);\n  };\n\n  return pair;\n};\n\n/**\n * @typedef {Array} Record a type representation\n */\n\n/**\n * Returns an array of serialized Records.\n * @param {any} value a serializable value.\n * @param {{json?: boolean, lossy?: boolean}?} options an object with a `lossy` or `json` property that,\n *  if `true`, will not throw errors on incompatible types, and behave more\n *  like JSON stringify would behave. Symbol and Function will be discarded.\n * @returns {Record[]}\n */\n export const serialize = (value, {json, lossy} = {}) => {\n  const _ = [];\n  return serializer(!(json || lossy), !!json, new Map, _)(value), _;\n};\n","import {deserialize} from './deserialize.js';\nimport {serialize} from './serialize.js';\n\n/**\n * @typedef {Array} Record a type representation\n */\n\n/**\n * Returns an array of serialized Records.\n * @param {any} any a serializable value.\n * @param {{transfer?: any[], json?: boolean, lossy?: boolean}?} options an object with\n * a transfer option (ignored when polyfilled) and/or non standard fields that\n * fallback to the polyfill if present.\n * @returns {Record[]}\n */\nexport default typeof structuredClone === \"function\" ?\n  /* c8 ignore start */\n  (any, options) => (\n    options && ('json' in options || 'lossy' in options) ?\n      deserialize(serialize(any, options)) : structuredClone(any)\n  ) :\n  (any, options) => deserialize(serialize(any, options));\n  /* c8 ignore stop */\n\nexport {deserialize, serialize};\n","/**\n * @import {ElementContent, Element} from 'hast'\n * @import {State} from './state.js'\n */\n\n/**\n * @callback FootnoteBackContentTemplate\n *   Generate content for the backreference dynamically.\n *\n *   For the following markdown:\n *\n *   ```markdown\n *   Alpha[^micromark], bravo[^micromark], and charlie[^remark].\n *\n *   [^remark]: things about remark\n *   [^micromark]: things about micromark\n *   ```\n *\n *   This function will be called with:\n *\n *   *  `0` and `0` for the backreference from `things about micromark` to\n *      `alpha`, as it is the first used definition, and the first call to it\n *   *  `0` and `1` for the backreference from `things about micromark` to\n *      `bravo`, as it is the first used definition, and the second call to it\n *   *  `1` and `0` for the backreference from `things about remark` to\n *      `charlie`, as it is the second used definition\n * @param {number} referenceIndex\n *   Index of the definition in the order that they are first referenced,\n *   0-indexed.\n * @param {number} rereferenceIndex\n *   Index of calls to the same definition, 0-indexed.\n * @returns {Array | ElementContent | string}\n *   Content for the backreference when linking back from definitions to their\n *   reference.\n *\n * @callback FootnoteBackLabelTemplate\n *   Generate a back label dynamically.\n *\n *   For the following markdown:\n *\n *   ```markdown\n *   Alpha[^micromark], bravo[^micromark], and charlie[^remark].\n *\n *   [^remark]: things about remark\n *   [^micromark]: things about micromark\n *   ```\n *\n *   This function will be called with:\n *\n *   *  `0` and `0` for the backreference from `things about micromark` to\n *      `alpha`, as it is the first used definition, and the first call to it\n *   *  `0` and `1` for the backreference from `things about micromark` to\n *      `bravo`, as it is the first used definition, and the second call to it\n *   *  `1` and `0` for the backreference from `things about remark` to\n *      `charlie`, as it is the second used definition\n * @param {number} referenceIndex\n *   Index of the definition in the order that they are first referenced,\n *   0-indexed.\n * @param {number} rereferenceIndex\n *   Index of calls to the same definition, 0-indexed.\n * @returns {string}\n *   Back label to use when linking back from definitions to their reference.\n */\n\nimport structuredClone from '@ungap/structured-clone'\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Generate the default content that GitHub uses on backreferences.\n *\n * @param {number} _\n *   Index of the definition in the order that they are first referenced,\n *   0-indexed.\n * @param {number} rereferenceIndex\n *   Index of calls to the same definition, 0-indexed.\n * @returns {Array}\n *   Content.\n */\nexport function defaultFootnoteBackContent(_, rereferenceIndex) {\n  /** @type {Array} */\n  const result = [{type: 'text', value: '↩'}]\n\n  if (rereferenceIndex > 1) {\n    result.push({\n      type: 'element',\n      tagName: 'sup',\n      properties: {},\n      children: [{type: 'text', value: String(rereferenceIndex)}]\n    })\n  }\n\n  return result\n}\n\n/**\n * Generate the default label that GitHub uses on backreferences.\n *\n * @param {number} referenceIndex\n *   Index of the definition in the order that they are first referenced,\n *   0-indexed.\n * @param {number} rereferenceIndex\n *   Index of calls to the same definition, 0-indexed.\n * @returns {string}\n *   Label.\n */\nexport function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {\n  return (\n    'Back to reference ' +\n    (referenceIndex + 1) +\n    (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')\n  )\n}\n\n/**\n * Generate a hast footer for called footnote definitions.\n *\n * @param {State} state\n *   Info passed around.\n * @returns {Element | undefined}\n *   `section` element or `undefined`.\n */\n// eslint-disable-next-line complexity\nexport function footer(state) {\n  const clobberPrefix =\n    typeof state.options.clobberPrefix === 'string'\n      ? state.options.clobberPrefix\n      : 'user-content-'\n  const footnoteBackContent =\n    state.options.footnoteBackContent || defaultFootnoteBackContent\n  const footnoteBackLabel =\n    state.options.footnoteBackLabel || defaultFootnoteBackLabel\n  const footnoteLabel = state.options.footnoteLabel || 'Footnotes'\n  const footnoteLabelTagName = state.options.footnoteLabelTagName || 'h2'\n  const footnoteLabelProperties = state.options.footnoteLabelProperties || {\n    className: ['sr-only']\n  }\n  /** @type {Array} */\n  const listItems = []\n  let referenceIndex = -1\n\n  while (++referenceIndex < state.footnoteOrder.length) {\n    const definition = state.footnoteById.get(\n      state.footnoteOrder[referenceIndex]\n    )\n\n    if (!definition) {\n      continue\n    }\n\n    const content = state.all(definition)\n    const id = String(definition.identifier).toUpperCase()\n    const safeId = normalizeUri(id.toLowerCase())\n    let rereferenceIndex = 0\n    /** @type {Array} */\n    const backReferences = []\n    const counts = state.footnoteCounts.get(id)\n\n    // eslint-disable-next-line no-unmodified-loop-condition\n    while (counts !== undefined && ++rereferenceIndex <= counts) {\n      if (backReferences.length > 0) {\n        backReferences.push({type: 'text', value: ' '})\n      }\n\n      let children =\n        typeof footnoteBackContent === 'string'\n          ? footnoteBackContent\n          : footnoteBackContent(referenceIndex, rereferenceIndex)\n\n      if (typeof children === 'string') {\n        children = {type: 'text', value: children}\n      }\n\n      backReferences.push({\n        type: 'element',\n        tagName: 'a',\n        properties: {\n          href:\n            '#' +\n            clobberPrefix +\n            'fnref-' +\n            safeId +\n            (rereferenceIndex > 1 ? '-' + rereferenceIndex : ''),\n          dataFootnoteBackref: '',\n          ariaLabel:\n            typeof footnoteBackLabel === 'string'\n              ? footnoteBackLabel\n              : footnoteBackLabel(referenceIndex, rereferenceIndex),\n          className: ['data-footnote-backref']\n        },\n        children: Array.isArray(children) ? children : [children]\n      })\n    }\n\n    const tail = content[content.length - 1]\n\n    if (tail && tail.type === 'element' && tail.tagName === 'p') {\n      const tailTail = tail.children[tail.children.length - 1]\n      if (tailTail && tailTail.type === 'text') {\n        tailTail.value += ' '\n      } else {\n        tail.children.push({type: 'text', value: ' '})\n      }\n\n      tail.children.push(...backReferences)\n    } else {\n      content.push(...backReferences)\n    }\n\n    /** @type {Element} */\n    const listItem = {\n      type: 'element',\n      tagName: 'li',\n      properties: {id: clobberPrefix + 'fn-' + safeId},\n      children: state.wrap(content, true)\n    }\n\n    state.patch(definition, listItem)\n\n    listItems.push(listItem)\n  }\n\n  if (listItems.length === 0) {\n    return\n  }\n\n  return {\n    type: 'element',\n    tagName: 'section',\n    properties: {dataFootnotes: true, className: ['footnotes']},\n    children: [\n      {\n        type: 'element',\n        tagName: footnoteLabelTagName,\n        properties: {\n          ...structuredClone(footnoteLabelProperties),\n          id: 'footnote-label'\n        },\n        children: [{type: 'text', value: footnoteLabel}]\n      },\n      {type: 'text', value: '\\n'},\n      {\n        type: 'element',\n        tagName: 'ol',\n        properties: {},\n        children: state.wrap(listItems, true)\n      },\n      {type: 'text', value: '\\n'}\n    ]\n  }\n}\n","/**\n * @import {Node, Parent} from 'unist'\n */\n\n/**\n * @template Fn\n * @template Fallback\n * @typedef {Fn extends (value: any) => value is infer Thing ? Thing : Fallback} Predicate\n */\n\n/**\n * @callback Check\n *   Check that an arbitrary value is a node.\n * @param {unknown} this\n *   The given context.\n * @param {unknown} [node]\n *   Anything (typically a node).\n * @param {number | null | undefined} [index]\n *   The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n *   The node’s parent.\n * @returns {boolean}\n *   Whether this is a node and passes a test.\n *\n * @typedef {Record | Node} Props\n *   Object to check for equivalence.\n *\n *   Note: `Node` is included as it is common but is not indexable.\n *\n * @typedef {Array | ReadonlyArray | Props | TestFunction | string | null | undefined} Test\n *   Check for an arbitrary node.\n *\n * @callback TestFunction\n *   Check if a node passes a test.\n * @param {unknown} this\n *   The given context.\n * @param {Node} node\n *   A node.\n * @param {number | undefined} [index]\n *   The node’s position in its parent.\n * @param {Parent | undefined} [parent]\n *   The node’s parent.\n * @returns {boolean | undefined | void}\n *   Whether this node passes the test.\n *\n *   Note: `void` is included until TS sees no return as `undefined`.\n */\n\n/**\n * Check if `node` is a `Node` and whether it passes the given test.\n *\n * @param {unknown} node\n *   Thing to check, typically `Node`.\n * @param {Test} test\n *   A check for a specific node.\n * @param {number | null | undefined} index\n *   The node’s position in its parent.\n * @param {Parent | null | undefined} parent\n *   The node’s parent.\n * @param {unknown} context\n *   Context object (`this`) to pass to `test` functions.\n * @returns {boolean}\n *   Whether `node` is a node and passes a test.\n */\nexport const is =\n  // Note: overloads in JSDoc can’t yet use different `@template`s.\n  /**\n   * @type {(\n   *   (>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition[number]}) &\n   *   (>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition[number]}) &\n   *   ((node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &\n   *   ((node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &\n   *   ((node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate) &\n   *   ((node?: null | undefined) => false) &\n   *   ((node: unknown, test?: null | undefined, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &\n   *   ((node: unknown, test?: Test, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => boolean)\n   * )}\n   */\n  (\n    /**\n     * @param {unknown} [node]\n     * @param {Test} [test]\n     * @param {number | null | undefined} [index]\n     * @param {Parent | null | undefined} [parent]\n     * @param {unknown} [context]\n     * @returns {boolean}\n     */\n    // eslint-disable-next-line max-params\n    function (node, test, index, parent, context) {\n      const check = convert(test)\n\n      if (\n        index !== undefined &&\n        index !== null &&\n        (typeof index !== 'number' ||\n          index < 0 ||\n          index === Number.POSITIVE_INFINITY)\n      ) {\n        throw new Error('Expected positive finite index')\n      }\n\n      if (\n        parent !== undefined &&\n        parent !== null &&\n        (!is(parent) || !parent.children)\n      ) {\n        throw new Error('Expected parent node')\n      }\n\n      if (\n        (parent === undefined || parent === null) !==\n        (index === undefined || index === null)\n      ) {\n        throw new Error('Expected both parent and index')\n      }\n\n      return looksLikeANode(node)\n        ? check.call(context, node, index, parent)\n        : false\n    }\n  )\n\n/**\n * Generate an assertion from a test.\n *\n * Useful if you’re going to test many nodes, for example when creating a\n * utility where something else passes a compatible test.\n *\n * The created function is a bit faster because it expects valid input only:\n * a `node`, `index`, and `parent`.\n *\n * @param {Test} test\n *   *   when nullish, checks if `node` is a `Node`.\n *   *   when `string`, works like passing `(node) => node.type === test`.\n *   *   when `function` checks if function passed the node is true.\n *   *   when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.\n *   *   when `array`, checks if any one of the subtests pass.\n * @returns {Check}\n *   An assertion.\n */\nexport const convert =\n  // Note: overloads in JSDoc can’t yet use different `@template`s.\n  /**\n   * @type {(\n   *   ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &\n   *   ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &\n   *   ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate) &\n   *   ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &\n   *   ((test?: Test) => Check)\n   * )}\n   */\n  (\n    /**\n     * @param {Test} [test]\n     * @returns {Check}\n     */\n    function (test) {\n      if (test === null || test === undefined) {\n        return ok\n      }\n\n      if (typeof test === 'function') {\n        return castFactory(test)\n      }\n\n      if (typeof test === 'object') {\n        return Array.isArray(test)\n          ? anyFactory(test)\n          : // Cast because `ReadonlyArray` goes into the above but `isArray`\n            // narrows to `Array`.\n            propertiesFactory(/** @type {Props} */ (test))\n      }\n\n      if (typeof test === 'string') {\n        return typeFactory(test)\n      }\n\n      throw new Error('Expected function, string, or object as test')\n    }\n  )\n\n/**\n * @param {Array} tests\n * @returns {Check}\n */\nfunction anyFactory(tests) {\n  /** @type {Array} */\n  const checks = []\n  let index = -1\n\n  while (++index < tests.length) {\n    checks[index] = convert(tests[index])\n  }\n\n  return castFactory(any)\n\n  /**\n   * @this {unknown}\n   * @type {TestFunction}\n   */\n  function any(...parameters) {\n    let index = -1\n\n    while (++index < checks.length) {\n      if (checks[index].apply(this, parameters)) return true\n    }\n\n    return false\n  }\n}\n\n/**\n * Turn an object into a test for a node with a certain fields.\n *\n * @param {Props} check\n * @returns {Check}\n */\nfunction propertiesFactory(check) {\n  const checkAsRecord = /** @type {Record} */ (check)\n\n  return castFactory(all)\n\n  /**\n   * @param {Node} node\n   * @returns {boolean}\n   */\n  function all(node) {\n    const nodeAsRecord = /** @type {Record} */ (\n      /** @type {unknown} */ (node)\n    )\n\n    /** @type {string} */\n    let key\n\n    for (key in check) {\n      if (nodeAsRecord[key] !== checkAsRecord[key]) return false\n    }\n\n    return true\n  }\n}\n\n/**\n * Turn a string into a test for a node with a certain type.\n *\n * @param {string} check\n * @returns {Check}\n */\nfunction typeFactory(check) {\n  return castFactory(type)\n\n  /**\n   * @param {Node} node\n   */\n  function type(node) {\n    return node && node.type === check\n  }\n}\n\n/**\n * Turn a custom test into a test for a node that passes that test.\n *\n * @param {TestFunction} testFunction\n * @returns {Check}\n */\nfunction castFactory(testFunction) {\n  return check\n\n  /**\n   * @this {unknown}\n   * @type {Check}\n   */\n  function check(value, index, parent) {\n    return Boolean(\n      looksLikeANode(value) &&\n        testFunction.call(\n          this,\n          value,\n          typeof index === 'number' ? index : undefined,\n          parent || undefined\n        )\n    )\n  }\n}\n\nfunction ok() {\n  return true\n}\n\n/**\n * @param {unknown} value\n * @returns {value is Node}\n */\nfunction looksLikeANode(value) {\n  return value !== null && typeof value === 'object' && 'type' in value\n}\n","/**\n * @param {string} d\n * @returns {string}\n */\nexport function color(d) {\n  return d\n}\n","/**\n * @import {Node as UnistNode, Parent as UnistParent} from 'unist'\n */\n\n/**\n * @typedef {Exclude | undefined} Test\n *   Test from `unist-util-is`.\n *\n *   Note: we have remove and add `undefined`, because otherwise when generating\n *   automatic `.d.ts` files, TS tries to flatten paths from a local perspective,\n *   which doesn’t work when publishing on npm.\n */\n\n/**\n * @typedef {(\n *   Fn extends (value: any) => value is infer Thing\n *   ? Thing\n *   : Fallback\n * )} Predicate\n *   Get the value of a type guard `Fn`.\n * @template Fn\n *   Value; typically function that is a type guard (such as `(x): x is Y`).\n * @template Fallback\n *   Value to yield if `Fn` is not a type guard.\n */\n\n/**\n * @typedef {(\n *   Check extends null | undefined // No test.\n *   ? Value\n *   : Value extends {type: Check} // String (type) test.\n *   ? Value\n *   : Value extends Check // Partial test.\n *   ? Value\n *   : Check extends Function // Function test.\n *   ? Predicate extends Value\n *     ? Predicate\n *     : never\n *   : never // Some other test?\n * )} MatchesOne\n *   Check whether a node matches a primitive check in the type system.\n * @template Value\n *   Value; typically unist `Node`.\n * @template Check\n *   Value; typically `unist-util-is`-compatible test, but not arrays.\n */\n\n/**\n * @typedef {(\n *   Check extends ReadonlyArray\n *   ? MatchesOne\n *   : Check extends Array\n *   ? MatchesOne\n *   : MatchesOne\n * )} Matches\n *   Check whether a node matches a check in the type system.\n * @template Value\n *   Value; typically unist `Node`.\n * @template Check\n *   Value; typically `unist-util-is`-compatible test.\n */\n\n/**\n * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint\n *   Number; capped reasonably.\n */\n\n/**\n * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment\n *   Increment a number in the type system.\n * @template {Uint} [I=0]\n *   Index.\n */\n\n/**\n * @typedef {(\n *   Node extends UnistParent\n *   ? Node extends {children: Array}\n *     ? Child extends Children ? Node : never\n *     : never\n *   : never\n * )} InternalParent\n *   Collect nodes that can be parents of `Child`.\n * @template {UnistNode} Node\n *   All node types in a tree.\n * @template {UnistNode} Child\n *   Node to search for.\n */\n\n/**\n * @typedef {InternalParent, Child>} Parent\n *   Collect nodes in `Tree` that can be parents of `Child`.\n * @template {UnistNode} Tree\n *   All node types in a tree.\n * @template {UnistNode} Child\n *   Node to search for.\n */\n\n/**\n * @typedef {(\n *   Depth extends Max\n *   ? never\n *   :\n *     | InternalParent\n *     | InternalAncestor, Max, Increment>\n * )} InternalAncestor\n *   Collect nodes in `Tree` that can be ancestors of `Child`.\n * @template {UnistNode} Node\n *   All node types in a tree.\n * @template {UnistNode} Child\n *   Node to search for.\n * @template {Uint} [Max=10]\n *   Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n *   Current depth.\n */\n\n/**\n * @typedef {InternalAncestor, Child>} Ancestor\n *   Collect nodes in `Tree` that can be ancestors of `Child`.\n * @template {UnistNode} Tree\n *   All node types in a tree.\n * @template {UnistNode} Child\n *   Node to search for.\n */\n\n/**\n * @typedef {(\n *   Tree extends UnistParent\n *     ? Depth extends Max\n *       ? Tree\n *       : Tree | InclusiveDescendant>\n *     : Tree\n * )} InclusiveDescendant\n *   Collect all (inclusive) descendants of `Tree`.\n *\n *   > 👉 **Note**: for performance reasons, this seems to be the fastest way to\n *   > recurse without actually running into an infinite loop, which the\n *   > previous version did.\n *   >\n *   > Practically, a max of `2` is typically enough assuming a `Root` is\n *   > passed, but it doesn’t improve performance.\n *   > It gets higher with `List > ListItem > Table > TableRow > TableCell`.\n *   > Using up to `10` doesn’t hurt or help either.\n * @template {UnistNode} Tree\n *   Tree type.\n * @template {Uint} [Max=10]\n *   Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n *   Current depth.\n */\n\n/**\n * @typedef {'skip' | boolean} Action\n *   Union of the action types.\n *\n * @typedef {number} Index\n *   Move to the sibling at `index` next (after node itself is completely\n *   traversed).\n *\n *   Useful if mutating the tree, such as removing the node the visitor is\n *   currently on, or any of its previous siblings.\n *   Results less than 0 or greater than or equal to `children.length` stop\n *   traversing the parent.\n *\n * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple\n *   List with one or two values, the first an action, the second an index.\n *\n * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult\n *   Any value that can be returned from a visitor.\n */\n\n/**\n * @callback Visitor\n *   Handle a node (matching `test`, if given).\n *\n *   Visitors are free to transform `node`.\n *   They can also transform the parent of node (the last of `ancestors`).\n *\n *   Replacing `node` itself, if `SKIP` is not returned, still causes its\n *   descendants to be walked (which is a bug).\n *\n *   When adding or removing previous siblings of `node` (or next siblings, in\n *   case of reverse), the `Visitor` should return a new `Index` to specify the\n *   sibling to traverse after `node` is traversed.\n *   Adding or removing next siblings of `node` (or previous siblings, in case\n *   of reverse) is handled as expected without needing to return a new `Index`.\n *\n *   Removing the children property of an ancestor still results in them being\n *   traversed.\n * @param {Visited} node\n *   Found node.\n * @param {Array} ancestors\n *   Ancestors of `node`.\n * @returns {VisitorResult}\n *   What to do next.\n *\n *   An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n *   An `Action` is treated as a tuple of `[Action]`.\n *\n *   Passing a tuple back only makes sense if the `Action` is `SKIP`.\n *   When the `Action` is `EXIT`, that action can be returned.\n *   When the `Action` is `CONTINUE`, `Index` can be returned.\n * @template {UnistNode} [Visited=UnistNode]\n *   Visited node type.\n * @template {UnistParent} [VisitedParents=UnistParent]\n *   Ancestor type.\n */\n\n/**\n * @typedef {Visitor, Check>, Ancestor, Check>>>} BuildVisitor\n *   Build a typed `Visitor` function from a tree and a test.\n *\n *   It will infer which values are passed as `node` and which as `parents`.\n * @template {UnistNode} [Tree=UnistNode]\n *   Tree type.\n * @template {Test} [Check=Test]\n *   Test type.\n */\n\nimport {convert} from 'unist-util-is'\nimport {color} from 'unist-util-visit-parents/do-not-use-color'\n\n/** @type {Readonly} */\nconst empty = []\n\n/**\n * Continue traversing as normal.\n */\nexport const CONTINUE = true\n\n/**\n * Stop traversing immediately.\n */\nexport const EXIT = false\n\n/**\n * Do not traverse this node’s children.\n */\nexport const SKIP = 'skip'\n\n/**\n * Visit nodes, with ancestral information.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @overload\n * @param {Tree} tree\n * @param {Check} check\n * @param {BuildVisitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @overload\n * @param {Tree} tree\n * @param {BuildVisitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @param {UnistNode} tree\n *   Tree to traverse.\n * @param {Visitor | Test} test\n *   `unist-util-is`-compatible test\n * @param {Visitor | boolean | null | undefined} [visitor]\n *   Handle each node.\n * @param {boolean | null | undefined} [reverse]\n *   Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns {undefined}\n *   Nothing.\n *\n * @template {UnistNode} Tree\n *   Node type.\n * @template {Test} Check\n *   `unist-util-is`-compatible test.\n */\nexport function visitParents(tree, test, visitor, reverse) {\n  /** @type {Test} */\n  let check\n\n  if (typeof test === 'function' && typeof visitor !== 'function') {\n    reverse = visitor\n    // @ts-expect-error no visitor given, so `visitor` is test.\n    visitor = test\n  } else {\n    // @ts-expect-error visitor given, so `test` isn’t a visitor.\n    check = test\n  }\n\n  const is = convert(check)\n  const step = reverse ? -1 : 1\n\n  factory(tree, undefined, [])()\n\n  /**\n   * @param {UnistNode} node\n   * @param {number | undefined} index\n   * @param {Array} parents\n   */\n  function factory(node, index, parents) {\n    const value = /** @type {Record} */ (\n      node && typeof node === 'object' ? node : {}\n    )\n\n    if (typeof value.type === 'string') {\n      const name =\n        // `hast`\n        typeof value.tagName === 'string'\n          ? value.tagName\n          : // `xast`\n            typeof value.name === 'string'\n            ? value.name\n            : undefined\n\n      Object.defineProperty(visit, 'name', {\n        value:\n          'node (' + color(node.type + (name ? '<' + name + '>' : '')) + ')'\n      })\n    }\n\n    return visit\n\n    function visit() {\n      /** @type {Readonly} */\n      let result = empty\n      /** @type {Readonly} */\n      let subresult\n      /** @type {number} */\n      let offset\n      /** @type {Array} */\n      let grandparents\n\n      if (!test || is(node, index, parents[parents.length - 1] || undefined)) {\n        // @ts-expect-error: `visitor` is now a visitor.\n        result = toResult(visitor(node, parents))\n\n        if (result[0] === EXIT) {\n          return result\n        }\n      }\n\n      if ('children' in node && node.children) {\n        const nodeAsParent = /** @type {UnistParent} */ (node)\n\n        if (nodeAsParent.children && result[0] !== SKIP) {\n          offset = (reverse ? nodeAsParent.children.length : -1) + step\n          grandparents = parents.concat(nodeAsParent)\n\n          while (offset > -1 && offset < nodeAsParent.children.length) {\n            const child = nodeAsParent.children[offset]\n\n            subresult = factory(child, offset, grandparents)()\n\n            if (subresult[0] === EXIT) {\n              return subresult\n            }\n\n            offset =\n              typeof subresult[1] === 'number' ? subresult[1] : offset + step\n          }\n        }\n      }\n\n      return result\n    }\n  }\n}\n\n/**\n * Turn a return value into a clean result.\n *\n * @param {VisitorResult} value\n *   Valid return values from visitors.\n * @returns {Readonly}\n *   Clean result.\n */\nfunction toResult(value) {\n  if (Array.isArray(value)) {\n    return value\n  }\n\n  if (typeof value === 'number') {\n    return [CONTINUE, value]\n  }\n\n  return value === null || value === undefined ? empty : [value]\n}\n","/**\n * @import {Node as UnistNode, Parent as UnistParent} from 'unist'\n * @import {VisitorResult} from 'unist-util-visit-parents'\n */\n\n/**\n * @typedef {Exclude | undefined} Test\n *   Test from `unist-util-is`.\n *\n *   Note: we have remove and add `undefined`, because otherwise when generating\n *   automatic `.d.ts` files, TS tries to flatten paths from a local perspective,\n *   which doesn’t work when publishing on npm.\n */\n\n// To do: use types from `unist-util-visit-parents` when it’s released.\n\n/**\n * @typedef {(\n *   Fn extends (value: any) => value is infer Thing\n *   ? Thing\n *   : Fallback\n * )} Predicate\n *   Get the value of a type guard `Fn`.\n * @template Fn\n *   Value; typically function that is a type guard (such as `(x): x is Y`).\n * @template Fallback\n *   Value to yield if `Fn` is not a type guard.\n */\n\n/**\n * @typedef {(\n *   Check extends null | undefined // No test.\n *   ? Value\n *   : Value extends {type: Check} // String (type) test.\n *   ? Value\n *   : Value extends Check // Partial test.\n *   ? Value\n *   : Check extends Function // Function test.\n *   ? Predicate extends Value\n *     ? Predicate\n *     : never\n *   : never // Some other test?\n * )} MatchesOne\n *   Check whether a node matches a primitive check in the type system.\n * @template Value\n *   Value; typically unist `Node`.\n * @template Check\n *   Value; typically `unist-util-is`-compatible test, but not arrays.\n */\n\n/**\n * @typedef {(\n *   Check extends ReadonlyArray\n *   ? MatchesOne\n *   : MatchesOne\n * )} Matches\n *   Check whether a node matches a check in the type system.\n * @template Value\n *   Value; typically unist `Node`.\n * @template Check\n *   Value; typically `unist-util-is`-compatible test.\n */\n\n/**\n * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint\n *   Number; capped reasonably.\n */\n\n/**\n * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment\n *   Increment a number in the type system.\n * @template {Uint} [I=0]\n *   Index.\n */\n\n/**\n * @typedef {(\n *   Node extends UnistParent\n *   ? Node extends {children: Array}\n *     ? Child extends Children ? Node : never\n *     : never\n *   : never\n * )} InternalParent\n *   Collect nodes that can be parents of `Child`.\n * @template {UnistNode} Node\n *   All node types in a tree.\n * @template {UnistNode} Child\n *   Node to search for.\n */\n\n/**\n * @typedef {InternalParent, Child>} Parent\n *   Collect nodes in `Tree` that can be parents of `Child`.\n * @template {UnistNode} Tree\n *   All node types in a tree.\n * @template {UnistNode} Child\n *   Node to search for.\n */\n\n/**\n * @typedef {(\n *   Depth extends Max\n *   ? never\n *   :\n *     | InternalParent\n *     | InternalAncestor, Max, Increment>\n * )} InternalAncestor\n *   Collect nodes in `Tree` that can be ancestors of `Child`.\n * @template {UnistNode} Node\n *   All node types in a tree.\n * @template {UnistNode} Child\n *   Node to search for.\n * @template {Uint} [Max=10]\n *   Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n *   Current depth.\n */\n\n/**\n * @typedef {(\n *   Tree extends UnistParent\n *     ? Depth extends Max\n *       ? Tree\n *       : Tree | InclusiveDescendant>\n *     : Tree\n * )} InclusiveDescendant\n *   Collect all (inclusive) descendants of `Tree`.\n *\n *   > 👉 **Note**: for performance reasons, this seems to be the fastest way to\n *   > recurse without actually running into an infinite loop, which the\n *   > previous version did.\n *   >\n *   > Practically, a max of `2` is typically enough assuming a `Root` is\n *   > passed, but it doesn’t improve performance.\n *   > It gets higher with `List > ListItem > Table > TableRow > TableCell`.\n *   > Using up to `10` doesn’t hurt or help either.\n * @template {UnistNode} Tree\n *   Tree type.\n * @template {Uint} [Max=10]\n *   Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n *   Current depth.\n */\n\n/**\n * @callback Visitor\n *   Handle a node (matching `test`, if given).\n *\n *   Visitors are free to transform `node`.\n *   They can also transform `parent`.\n *\n *   Replacing `node` itself, if `SKIP` is not returned, still causes its\n *   descendants to be walked (which is a bug).\n *\n *   When adding or removing previous siblings of `node` (or next siblings, in\n *   case of reverse), the `Visitor` should return a new `Index` to specify the\n *   sibling to traverse after `node` is traversed.\n *   Adding or removing next siblings of `node` (or previous siblings, in case\n *   of reverse) is handled as expected without needing to return a new `Index`.\n *\n *   Removing the children property of `parent` still results in them being\n *   traversed.\n * @param {Visited} node\n *   Found node.\n * @param {Visited extends UnistNode ? number | undefined : never} index\n *   Index of `node` in `parent`.\n * @param {Ancestor extends UnistParent ? Ancestor | undefined : never} parent\n *   Parent of `node`.\n * @returns {VisitorResult}\n *   What to do next.\n *\n *   An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n *   An `Action` is treated as a tuple of `[Action]`.\n *\n *   Passing a tuple back only makes sense if the `Action` is `SKIP`.\n *   When the `Action` is `EXIT`, that action can be returned.\n *   When the `Action` is `CONTINUE`, `Index` can be returned.\n * @template {UnistNode} [Visited=UnistNode]\n *   Visited node type.\n * @template {UnistParent} [Ancestor=UnistParent]\n *   Ancestor type.\n */\n\n/**\n * @typedef {Visitor>} BuildVisitorFromMatch\n *   Build a typed `Visitor` function from a node and all possible parents.\n *\n *   It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} Visited\n *   Node type.\n * @template {UnistParent} Ancestor\n *   Parent type.\n */\n\n/**\n * @typedef {(\n *   BuildVisitorFromMatch<\n *     Matches,\n *     Extract\n *   >\n * )} BuildVisitorFromDescendants\n *   Build a typed `Visitor` function from a list of descendants and a test.\n *\n *   It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} Descendant\n *   Node type.\n * @template {Test} Check\n *   Test type.\n */\n\n/**\n * @typedef {(\n *   BuildVisitorFromDescendants<\n *     InclusiveDescendant,\n *     Check\n *   >\n * )} BuildVisitor\n *   Build a typed `Visitor` function from a tree and a test.\n *\n *   It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} [Tree=UnistNode]\n *   Node type.\n * @template {Test} [Check=Test]\n *   Test type.\n */\n\nimport {visitParents} from 'unist-util-visit-parents'\n\nexport {CONTINUE, EXIT, SKIP} from 'unist-util-visit-parents'\n\n/**\n * Visit nodes.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @overload\n * @param {Tree} tree\n * @param {Check} check\n * @param {BuildVisitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @overload\n * @param {Tree} tree\n * @param {BuildVisitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @param {UnistNode} tree\n *   Tree to traverse.\n * @param {Visitor | Test} testOrVisitor\n *   `unist-util-is`-compatible test (optional, omit to pass a visitor).\n * @param {Visitor | boolean | null | undefined} [visitorOrReverse]\n *   Handle each node (when test is omitted, pass `reverse`).\n * @param {boolean | null | undefined} [maybeReverse=false]\n *   Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns {undefined}\n *   Nothing.\n *\n * @template {UnistNode} Tree\n *   Node type.\n * @template {Test} Check\n *   `unist-util-is`-compatible test.\n */\nexport function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {\n  /** @type {boolean | null | undefined} */\n  let reverse\n  /** @type {Test} */\n  let test\n  /** @type {Visitor} */\n  let visitor\n\n  if (\n    typeof testOrVisitor === 'function' &&\n    typeof visitorOrReverse !== 'function'\n  ) {\n    test = undefined\n    visitor = testOrVisitor\n    reverse = visitorOrReverse\n  } else {\n    // @ts-expect-error: assume the overload with test was given.\n    test = testOrVisitor\n    // @ts-expect-error: assume the overload with test was given.\n    visitor = visitorOrReverse\n    reverse = maybeReverse\n  }\n\n  visitParents(tree, test, overload, reverse)\n\n  /**\n   * @param {UnistNode} node\n   * @param {Array} parents\n   */\n  function overload(node, parents) {\n    const parent = parents[parents.length - 1]\n    const index = parent ? parent.children.indexOf(node) : undefined\n    return visitor(node, index, parent)\n  }\n}\n","/**\n * @import {\n *   ElementContent as HastElementContent,\n *   Element as HastElement,\n *   Nodes as HastNodes,\n *   Properties as HastProperties,\n *   RootContent as HastRootContent,\n *   Text as HastText\n * } from 'hast'\n * @import {\n *   Definition as MdastDefinition,\n *   FootnoteDefinition as MdastFootnoteDefinition,\n *   Nodes as MdastNodes,\n *   Parents as MdastParents\n * } from 'mdast'\n * @import {VFile} from 'vfile'\n * @import {\n *   FootnoteBackContentTemplate,\n *   FootnoteBackLabelTemplate\n * } from './footer.js'\n */\n\n/**\n * @callback Handler\n *   Handle a node.\n * @param {State} state\n *   Info passed around.\n * @param {any} node\n *   mdast node to handle.\n * @param {MdastParents | undefined} parent\n *   Parent of `node`.\n * @returns {Array | HastElementContent | undefined}\n *   hast node.\n *\n * @typedef {Partial>} Handlers\n *   Handle nodes.\n *\n * @typedef Options\n *   Configuration (optional).\n * @property {boolean | null | undefined} [allowDangerousHtml=false]\n *   Whether to persist raw HTML in markdown in the hast tree (default:\n *   `false`).\n * @property {string | null | undefined} [clobberPrefix='user-content-']\n *   Prefix to use before the `id` property on footnotes to prevent them from\n *   *clobbering* (default: `'user-content-'`).\n *\n *   Pass `''` for trusted markdown and when you are careful with\n *   polyfilling.\n *   You could pass a different prefix.\n *\n *   DOM clobbering is this:\n *\n *   ```html\n *   

\n * \n * ```\n *\n * The above example shows that elements are made available by browsers, by\n * their ID, on the `window` object.\n * This is a security risk because you might be expecting some other variable\n * at that place.\n * It can also break polyfills.\n * Using a prefix solves these problems.\n * @property {VFile | null | undefined} [file]\n * Corresponding virtual file representing the input document (optional).\n * @property {FootnoteBackContentTemplate | string | null | undefined} [footnoteBackContent]\n * Content of the backreference back to references (default: `defaultFootnoteBackContent`).\n *\n * The default value is:\n *\n * ```js\n * function defaultFootnoteBackContent(_, rereferenceIndex) {\n * const result = [{type: 'text', value: '↩'}]\n *\n * if (rereferenceIndex > 1) {\n * result.push({\n * type: 'element',\n * tagName: 'sup',\n * properties: {},\n * children: [{type: 'text', value: String(rereferenceIndex)}]\n * })\n * }\n *\n * return result\n * }\n * ```\n *\n * This content is used in the `a` element of each backreference (the `↩`\n * links).\n * @property {FootnoteBackLabelTemplate | string | null | undefined} [footnoteBackLabel]\n * Label to describe the backreference back to references (default:\n * `defaultFootnoteBackLabel`).\n *\n * The default value is:\n *\n * ```js\n * function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {\n * return (\n * 'Back to reference ' +\n * (referenceIndex + 1) +\n * (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')\n * )\n * }\n * ```\n *\n * Change it when the markdown is not in English.\n *\n * This label is used in the `ariaLabel` property on each backreference\n * (the `↩` links).\n * It affects users of assistive technology.\n * @property {string | null | undefined} [footnoteLabel='Footnotes']\n * Textual label to use for the footnotes section (default: `'Footnotes'`).\n *\n * Change it when the markdown is not in English.\n *\n * This label is typically hidden visually (assuming a `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass different properties with the `footnoteLabelProperties` option.\n * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}]\n * Properties to use on the footnote label (default: `{className:\n * ['sr-only']}`).\n *\n * Change it to show the label and add other properties.\n *\n * This label is typically hidden visually (assuming an `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass an empty string.\n * You can also add different properties.\n *\n * > **Note**: `id: 'footnote-label'` is always added, because footnote\n * > calls use it with `aria-describedby` to provide an accessible label.\n * @property {string | null | undefined} [footnoteLabelTagName='h2']\n * HTML tag name to use for the footnote label element (default: `'h2'`).\n *\n * Change it to match your document structure.\n *\n * This label is typically hidden visually (assuming a `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass different properties with the `footnoteLabelProperties` option.\n * @property {Handlers | null | undefined} [handlers]\n * Extra handlers for nodes (optional).\n * @property {Array | null | undefined} [passThrough]\n * List of custom mdast node types to pass through (keep) in hast (note that\n * the node itself is passed, but eventual children are transformed)\n * (optional).\n * @property {Handler | null | undefined} [unknownHandler]\n * Handler for all unknown nodes (optional).\n *\n * @typedef State\n * Info passed around.\n * @property {(node: MdastNodes) => Array} all\n * Transform the children of an mdast parent to hast.\n * @property {(from: MdastNodes, to: Type) => HastElement | Type} applyData\n * Honor the `data` of `from`, and generate an element instead of `node`.\n * @property {Map} definitionById\n * Definitions by their identifier.\n * @property {Map} footnoteById\n * Footnote definitions by their identifier.\n * @property {Map} footnoteCounts\n * Counts for how often the same footnote was called.\n * @property {Array} footnoteOrder\n * Identifiers of order when footnote calls first appear in tree order.\n * @property {Handlers} handlers\n * Applied handlers.\n * @property {(node: MdastNodes, parent: MdastParents | undefined) => Array | HastElementContent | undefined} one\n * Transform an mdast node to hast.\n * @property {Options} options\n * Configuration.\n * @property {(from: MdastNodes, node: HastNodes) => undefined} patch\n * Copy a node’s positional info.\n * @property {(nodes: Array, loose?: boolean | undefined) => Array} wrap\n * Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.\n */\n\nimport structuredClone from '@ungap/structured-clone'\nimport {visit} from 'unist-util-visit'\nimport {position} from 'unist-util-position'\nimport {handlers as defaultHandlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Create `state` from an mdast tree.\n *\n * @param {MdastNodes} tree\n * mdast node to transform.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {State}\n * `state` function.\n */\nexport function createState(tree, options) {\n const settings = options || emptyOptions\n /** @type {Map} */\n const definitionById = new Map()\n /** @type {Map} */\n const footnoteById = new Map()\n /** @type {Map} */\n const footnoteCounts = new Map()\n /** @type {Handlers} */\n // @ts-expect-error: the root handler returns a root.\n // Hard to type.\n const handlers = {...defaultHandlers, ...settings.handlers}\n\n /** @type {State} */\n const state = {\n all,\n applyData,\n definitionById,\n footnoteById,\n footnoteCounts,\n footnoteOrder: [],\n handlers,\n one,\n options: settings,\n patch,\n wrap\n }\n\n visit(tree, function (node) {\n if (node.type === 'definition' || node.type === 'footnoteDefinition') {\n const map = node.type === 'definition' ? definitionById : footnoteById\n const id = String(node.identifier).toUpperCase()\n\n // Mimick CM behavior of link definitions.\n // See: .\n if (!map.has(id)) {\n // @ts-expect-error: node type matches map.\n map.set(id, node)\n }\n }\n })\n\n return state\n\n /**\n * Transform an mdast node into a hast node.\n *\n * @param {MdastNodes} node\n * mdast node.\n * @param {MdastParents | undefined} [parent]\n * Parent of `node`.\n * @returns {Array | HastElementContent | undefined}\n * Resulting hast node.\n */\n function one(node, parent) {\n const type = node.type\n const handle = state.handlers[type]\n\n if (own.call(state.handlers, type) && handle) {\n return handle(state, node, parent)\n }\n\n if (state.options.passThrough && state.options.passThrough.includes(type)) {\n if ('children' in node) {\n const {children, ...shallow} = node\n const result = structuredClone(shallow)\n // @ts-expect-error: TS doesn’t understand…\n result.children = state.all(node)\n // @ts-expect-error: TS doesn’t understand…\n return result\n }\n\n // @ts-expect-error: it’s custom.\n return structuredClone(node)\n }\n\n const unknown = state.options.unknownHandler || defaultUnknownHandler\n\n return unknown(state, node, parent)\n }\n\n /**\n * Transform the children of an mdast node into hast nodes.\n *\n * @param {MdastNodes} parent\n * mdast node to compile\n * @returns {Array}\n * Resulting hast nodes.\n */\n function all(parent) {\n /** @type {Array} */\n const values = []\n\n if ('children' in parent) {\n const nodes = parent.children\n let index = -1\n while (++index < nodes.length) {\n const result = state.one(nodes[index], parent)\n\n // To do: see if we van clean this? Can we merge texts?\n if (result) {\n if (index && nodes[index - 1].type === 'break') {\n if (!Array.isArray(result) && result.type === 'text') {\n result.value = trimMarkdownSpaceStart(result.value)\n }\n\n if (!Array.isArray(result) && result.type === 'element') {\n const head = result.children[0]\n\n if (head && head.type === 'text') {\n head.value = trimMarkdownSpaceStart(head.value)\n }\n }\n }\n\n if (Array.isArray(result)) {\n values.push(...result)\n } else {\n values.push(result)\n }\n }\n }\n }\n\n return values\n }\n}\n\n/**\n * Copy a node’s positional info.\n *\n * @param {MdastNodes} from\n * mdast node to copy from.\n * @param {HastNodes} to\n * hast node to copy into.\n * @returns {undefined}\n * Nothing.\n */\nfunction patch(from, to) {\n if (from.position) to.position = position(from)\n}\n\n/**\n * Honor the `data` of `from` and maybe generate an element instead of `to`.\n *\n * @template {HastNodes} Type\n * Node type.\n * @param {MdastNodes} from\n * mdast node to use data from.\n * @param {Type} to\n * hast node to change.\n * @returns {HastElement | Type}\n * Nothing.\n */\nfunction applyData(from, to) {\n /** @type {HastElement | Type} */\n let result = to\n\n // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n if (from && from.data) {\n const hName = from.data.hName\n const hChildren = from.data.hChildren\n const hProperties = from.data.hProperties\n\n if (typeof hName === 'string') {\n // Transforming the node resulted in an element with a different name\n // than wanted:\n if (result.type === 'element') {\n result.tagName = hName\n }\n // Transforming the node resulted in a non-element, which happens for\n // raw, text, and root nodes (unless custom handlers are passed).\n // The intent of `hName` is to create an element, but likely also to keep\n // the content around (otherwise: pass `hChildren`).\n else {\n /** @type {Array} */\n // @ts-expect-error: assume no doctypes in `root`.\n const children = 'children' in result ? result.children : [result]\n result = {type: 'element', tagName: hName, properties: {}, children}\n }\n }\n\n if (result.type === 'element' && hProperties) {\n Object.assign(result.properties, structuredClone(hProperties))\n }\n\n if (\n 'children' in result &&\n result.children &&\n hChildren !== null &&\n hChildren !== undefined\n ) {\n result.children = hChildren\n }\n }\n\n return result\n}\n\n/**\n * Transform an unknown node.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdastNodes} node\n * Unknown mdast node.\n * @returns {HastElement | HastText}\n * Resulting hast node.\n */\nfunction defaultUnknownHandler(state, node) {\n const data = node.data || {}\n /** @type {HastElement | HastText} */\n const result =\n 'value' in node &&\n !(own.call(data, 'hProperties') || own.call(data, 'hChildren'))\n ? {type: 'text', value: node.value}\n : {\n type: 'element',\n tagName: 'div',\n properties: {},\n children: state.all(node)\n }\n\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * Wrap `nodes` with line endings between each node.\n *\n * @template {HastRootContent} Type\n * Node type.\n * @param {Array} nodes\n * List of nodes to wrap.\n * @param {boolean | undefined} [loose=false]\n * Whether to add line endings at start and end (default: `false`).\n * @returns {Array}\n * Wrapped nodes.\n */\nexport function wrap(nodes, loose) {\n /** @type {Array} */\n const result = []\n let index = -1\n\n if (loose) {\n result.push({type: 'text', value: '\\n'})\n }\n\n while (++index < nodes.length) {\n if (index) result.push({type: 'text', value: '\\n'})\n result.push(nodes[index])\n }\n\n if (loose && nodes.length > 0) {\n result.push({type: 'text', value: '\\n'})\n }\n\n return result\n}\n\n/**\n * Trim spaces and tabs at the start of `value`.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Result.\n */\nfunction trimMarkdownSpaceStart(value) {\n let index = 0\n let code = value.charCodeAt(index)\n\n while (code === 9 || code === 32) {\n index++\n code = value.charCodeAt(index)\n }\n\n return value.slice(index)\n}\n","/**\n * @import {Nodes as HastNodes} from 'hast'\n * @import {Nodes as MdastNodes} from 'mdast'\n * @import {Options} from './state.js'\n */\n\nimport {ok as assert} from 'devlop'\nimport {footer} from './footer.js'\nimport {createState} from './state.js'\n\n/**\n * Transform mdast to hast.\n *\n * ##### Notes\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most utilities ignore `raw` nodes but two notable ones don’t:\n *\n * * `hast-util-to-html` also has an option `allowDangerousHtml` which will\n * output the raw HTML.\n * This is typically discouraged as noted by the option name but is useful\n * if you completely trust authors\n * * `hast-util-raw` can handle the raw embedded HTML strings by parsing them\n * into standard hast nodes (`element`, `text`, etc).\n * This is a heavy task as it needs a full HTML parser, but it is the only\n * way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark, which we follow by default.\n * They are supported by GitHub, so footnotes can be enabled in markdown with\n * `mdast-util-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes, which is hidden for sighted users but shown to\n * assistive technology.\n * When your page is not in English, you must define translated values.\n *\n * Back references use ARIA attributes, but the section label itself uses a\n * heading that is hidden with an `sr-only` class.\n * To show it to sighted users, define different attributes in\n * `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem, as it links footnote calls to footnote\n * definitions on the page through `id` attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n *

\n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * Example: headings (DOM clobbering) in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value` (and doesn’t have `data.hName`,\n * `data.hProperties`, or `data.hChildren`, see later), create a hast `text`\n * node\n * * otherwise, create a `
` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @param {MdastNodes} tree\n * mdast tree.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {HastNodes}\n * hast tree.\n */\nexport function toHast(tree, options) {\n const state = createState(tree, options)\n const node = state.one(tree, undefined)\n const foot = footer(state)\n /** @type {HastNodes} */\n const result = Array.isArray(node)\n ? {type: 'root', children: node}\n : node || {type: 'root', children: []}\n\n if (foot) {\n // If there’s a footer, there were definitions, meaning block\n // content.\n // So `result` is a parent node.\n assert('children' in result)\n result.children.push({type: 'text', value: '\\n'}, foot)\n }\n\n return result\n}\n","/**\n * @import {Root as HastRoot} from 'hast'\n * @import {Root as MdastRoot} from 'mdast'\n * @import {Options as ToHastOptions} from 'mdast-util-to-hast'\n * @import {Processor} from 'unified'\n * @import {VFile} from 'vfile'\n */\n\n/**\n * @typedef {Omit} Options\n *\n * @callback TransformBridge\n * Bridge-mode.\n *\n * Runs the destination with the new hast tree.\n * Discards result.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {Promise}\n * Nothing.\n *\n * @callback TransformMutate\n * Mutate-mode.\n *\n * Further transformers run on the hast tree.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {HastRoot}\n * Tree (hast).\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n/**\n * Turn markdown into HTML.\n *\n * ##### Notes\n *\n * ###### Signature\n *\n * * if a processor is given,\n * runs the (rehype) plugins used on it with a hast tree,\n * then discards the result (*bridge mode*)\n * * otherwise,\n * returns a hast tree,\n * the plugins used after `remarkRehype` are rehype plugins (*mutate mode*)\n *\n * > 👉 **Note**:\n * > It’s highly unlikely that you want to pass a `processor`.\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most plugins ignore `raw` nodes but two notable ones don’t:\n *\n * * `rehype-stringify` also has an option `allowDangerousHtml` which will\n * output the raw HTML.\n * This is typically discouraged as noted by the option name but is useful if\n * you completely trust authors\n * * `rehype-raw` can handle the raw embedded HTML strings by parsing them\n * into standard hast nodes (`element`, `text`, etc);\n * this is a heavy task as it needs a full HTML parser,\n * but it is the only way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark,\n * which we follow by default.\n * They are supported by GitHub,\n * so footnotes can be enabled in markdown with `remark-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes,\n * which is hidden for sighted users but shown to assistive technology.\n * When your page is not in English,\n * you must define translated values.\n *\n * Back references use ARIA attributes,\n * but the section label itself uses a heading that is hidden with an\n * `sr-only` class.\n * To show it to sighted users,\n * define different attributes in `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem,\n * as it links footnote calls to footnote definitions on the page through `id`\n * attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n *

\n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * *Example: headings (DOM clobbering)* in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value`\n * (and doesn’t have `data.hName`, `data.hProperties`, or `data.hChildren`,\n * see later),\n * create a hast `text` node\n * * otherwise,\n * create a `
` element (which could be changed with `data.hName`),\n * with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @overload\n * @param {Processor} processor\n * @param {Readonly | null | undefined} [options]\n * @returns {TransformBridge}\n *\n * @overload\n * @param {Readonly | null | undefined} [options]\n * @returns {TransformMutate}\n *\n * @overload\n * @param {Readonly | Processor | null | undefined} [destination]\n * @param {Readonly | null | undefined} [options]\n * @returns {TransformBridge | TransformMutate}\n *\n * @param {Readonly | Processor | null | undefined} [destination]\n * Processor or configuration (optional).\n * @param {Readonly | null | undefined} [options]\n * When a processor was given,\n * configuration (optional).\n * @returns {TransformBridge | TransformMutate}\n * Transform.\n */\nexport default function remarkRehype(destination, options) {\n if (destination && 'run' in destination) {\n /**\n * @type {TransformBridge}\n */\n return async function (tree, file) {\n // Cast because root in -> root out.\n const hastTree = /** @type {HastRoot} */ (\n toHast(tree, {file, ...options})\n )\n await destination.run(hastTree, file)\n }\n }\n\n /**\n * @type {TransformMutate}\n */\n return function (tree, file) {\n // Cast because root in -> root out.\n // To do: in the future, disallow ` || options` fallback.\n // With `unified-engine`, `destination` can be `undefined` but\n // `options` will be the file set.\n // We should not pass that as `options`.\n return /** @type {HastRoot} */ (\n toHast(tree, {file, ...(destination || options)})\n )\n }\n}\n","/**\n * Throw a given error.\n *\n * @param {Error|null|undefined} [error]\n * Maybe error.\n * @returns {asserts error is null|undefined}\n */\nexport function bail(error) {\n if (error) {\n throw error\n }\n}\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","export default function isPlainObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);\n}\n","// To do: remove `void`s\n// To do: remove `null` from output of our APIs, allow it as user APIs.\n\n/**\n * @typedef {(error?: Error | null | undefined, ...output: Array) => void} Callback\n * Callback.\n *\n * @typedef {(...input: Array) => any} Middleware\n * Ware.\n *\n * @typedef Pipeline\n * Pipeline.\n * @property {Run} run\n * Run the pipeline.\n * @property {Use} use\n * Add middleware.\n *\n * @typedef {(...input: Array) => void} Run\n * Call all middleware.\n *\n * Calls `done` on completion with either an error or the output of the\n * last middleware.\n *\n * > 👉 **Note**: as the length of input defines whether async functions get a\n * > `next` function,\n * > it’s recommended to keep `input` at one value normally.\n\n *\n * @typedef {(fn: Middleware) => Pipeline} Use\n * Add middleware.\n */\n\n/**\n * Create new middleware.\n *\n * @returns {Pipeline}\n * Pipeline.\n */\nexport function trough() {\n /** @type {Array} */\n const fns = []\n /** @type {Pipeline} */\n const pipeline = {run, use}\n\n return pipeline\n\n /** @type {Run} */\n function run(...values) {\n let middlewareIndex = -1\n /** @type {Callback} */\n const callback = values.pop()\n\n if (typeof callback !== 'function') {\n throw new TypeError('Expected function as last argument, not ' + callback)\n }\n\n next(null, ...values)\n\n /**\n * Run the next `fn`, or we’re done.\n *\n * @param {Error | null | undefined} error\n * @param {Array} output\n */\n function next(error, ...output) {\n const fn = fns[++middlewareIndex]\n let index = -1\n\n if (error) {\n callback(error)\n return\n }\n\n // Copy non-nullish input into values.\n while (++index < values.length) {\n if (output[index] === null || output[index] === undefined) {\n output[index] = values[index]\n }\n }\n\n // Save the newly created `output` for the next call.\n values = output\n\n // Next or done.\n if (fn) {\n wrap(fn, next)(...output)\n } else {\n callback(null, ...output)\n }\n }\n }\n\n /** @type {Use} */\n function use(middelware) {\n if (typeof middelware !== 'function') {\n throw new TypeError(\n 'Expected `middelware` to be a function, not ' + middelware\n )\n }\n\n fns.push(middelware)\n return pipeline\n }\n}\n\n/**\n * Wrap `middleware` into a uniform interface.\n *\n * You can pass all input to the resulting function.\n * `callback` is then called with the output of `middleware`.\n *\n * If `middleware` accepts more arguments than the later given in input,\n * an extra `done` function is passed to it after that input,\n * which must be called by `middleware`.\n *\n * The first value in `input` is the main input value.\n * All other input values are the rest input values.\n * The values given to `callback` are the input values,\n * merged with every non-nullish output value.\n *\n * * if `middleware` throws an error,\n * returns a promise that is rejected,\n * or calls the given `done` function with an error,\n * `callback` is called with that error\n * * if `middleware` returns a value or returns a promise that is resolved,\n * that value is the main output value\n * * if `middleware` calls `done`,\n * all non-nullish values except for the first one (the error) overwrite the\n * output values\n *\n * @param {Middleware} middleware\n * Function to wrap.\n * @param {Callback} callback\n * Callback called with the output of `middleware`.\n * @returns {Run}\n * Wrapped middleware.\n */\nexport function wrap(middleware, callback) {\n /** @type {boolean} */\n let called\n\n return wrapped\n\n /**\n * Call `middleware`.\n * @this {any}\n * @param {Array} parameters\n * @returns {void}\n */\n function wrapped(...parameters) {\n const fnExpectsCallback = middleware.length > parameters.length\n /** @type {any} */\n let result\n\n if (fnExpectsCallback) {\n parameters.push(done)\n }\n\n try {\n result = middleware.apply(this, parameters)\n } catch (error) {\n const exception = /** @type {Error} */ (error)\n\n // Well, this is quite the pickle.\n // `middleware` received a callback and called it synchronously, but that\n // threw an error.\n // The only thing left to do is to throw the thing instead.\n if (fnExpectsCallback && called) {\n throw exception\n }\n\n return done(exception)\n }\n\n if (!fnExpectsCallback) {\n if (result && result.then && typeof result.then === 'function') {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n /**\n * Call `callback`, only once.\n *\n * @type {Callback}\n */\n function done(error, ...output) {\n if (!called) {\n called = true\n callback(error, ...output)\n }\n }\n\n /**\n * Call `done` with one value.\n *\n * @param {any} [value]\n */\n function then(value) {\n done(null, value)\n }\n}\n","// A derivative work based on:\n// .\n// Which is licensed:\n//\n// MIT License\n//\n// Copyright (c) 2013 James Halliday\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n// the Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n// A derivative work based on:\n//\n// Parts of that are extracted from Node’s internal `path` module:\n// .\n// Which is licensed:\n//\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nexport const minpath = {basename, dirname, extname, join, sep: '/'}\n\n/* eslint-disable max-depth, complexity */\n\n/**\n * Get the basename from a path.\n *\n * @param {string} path\n * File path.\n * @param {string | null | undefined} [extname]\n * Extension to strip.\n * @returns {string}\n * Stem or basename.\n */\nfunction basename(path, extname) {\n if (extname !== undefined && typeof extname !== 'string') {\n throw new TypeError('\"ext\" argument must be a string')\n }\n\n assertPath(path)\n let start = 0\n let end = -1\n let index = path.length\n /** @type {boolean | undefined} */\n let seenNonSlash\n\n if (\n extname === undefined ||\n extname.length === 0 ||\n extname.length > path.length\n ) {\n while (index--) {\n if (path.codePointAt(index) === 47 /* `/` */) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now.\n if (seenNonSlash) {\n start = index + 1\n break\n }\n } else if (end < 0) {\n // We saw the first non-path separator, mark this as the end of our\n // path component.\n seenNonSlash = true\n end = index + 1\n }\n }\n\n return end < 0 ? '' : path.slice(start, end)\n }\n\n if (extname === path) {\n return ''\n }\n\n let firstNonSlashEnd = -1\n let extnameIndex = extname.length - 1\n\n while (index--) {\n if (path.codePointAt(index) === 47 /* `/` */) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now.\n if (seenNonSlash) {\n start = index + 1\n break\n }\n } else {\n if (firstNonSlashEnd < 0) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching.\n seenNonSlash = true\n firstNonSlashEnd = index + 1\n }\n\n if (extnameIndex > -1) {\n // Try to match the explicit extension.\n if (path.codePointAt(index) === extname.codePointAt(extnameIndex--)) {\n if (extnameIndex < 0) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = index\n }\n } else {\n // Extension does not match, so our result is the entire path\n // component\n extnameIndex = -1\n end = firstNonSlashEnd\n }\n }\n }\n }\n\n if (start === end) {\n end = firstNonSlashEnd\n } else if (end < 0) {\n end = path.length\n }\n\n return path.slice(start, end)\n}\n\n/**\n * Get the dirname from a path.\n *\n * @param {string} path\n * File path.\n * @returns {string}\n * File path.\n */\nfunction dirname(path) {\n assertPath(path)\n\n if (path.length === 0) {\n return '.'\n }\n\n let end = -1\n let index = path.length\n /** @type {boolean | undefined} */\n let unmatchedSlash\n\n // Prefix `--` is important to not run on `0`.\n while (--index) {\n if (path.codePointAt(index) === 47 /* `/` */) {\n if (unmatchedSlash) {\n end = index\n break\n }\n } else if (!unmatchedSlash) {\n // We saw the first non-path separator\n unmatchedSlash = true\n }\n }\n\n return end < 0\n ? path.codePointAt(0) === 47 /* `/` */\n ? '/'\n : '.'\n : end === 1 && path.codePointAt(0) === 47 /* `/` */\n ? '//'\n : path.slice(0, end)\n}\n\n/**\n * Get an extname from a path.\n *\n * @param {string} path\n * File path.\n * @returns {string}\n * Extname.\n */\nfunction extname(path) {\n assertPath(path)\n\n let index = path.length\n\n let end = -1\n let startPart = 0\n let startDot = -1\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find.\n let preDotState = 0\n /** @type {boolean | undefined} */\n let unmatchedSlash\n\n while (index--) {\n const code = path.codePointAt(index)\n\n if (code === 47 /* `/` */) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now.\n if (unmatchedSlash) {\n startPart = index + 1\n break\n }\n\n continue\n }\n\n if (end < 0) {\n // We saw the first non-path separator, mark this as the end of our\n // extension.\n unmatchedSlash = true\n end = index + 1\n }\n\n if (code === 46 /* `.` */) {\n // If this is our first dot, mark it as the start of our extension.\n if (startDot < 0) {\n startDot = index\n } else if (preDotState !== 1) {\n preDotState = 1\n }\n } else if (startDot > -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension.\n preDotState = -1\n }\n }\n\n if (\n startDot < 0 ||\n end < 0 ||\n // We saw a non-dot character immediately before the dot.\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly `..`.\n (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)\n ) {\n return ''\n }\n\n return path.slice(startDot, end)\n}\n\n/**\n * Join segments from a path.\n *\n * @param {Array} segments\n * Path segments.\n * @returns {string}\n * File path.\n */\nfunction join(...segments) {\n let index = -1\n /** @type {string | undefined} */\n let joined\n\n while (++index < segments.length) {\n assertPath(segments[index])\n\n if (segments[index]) {\n joined =\n joined === undefined ? segments[index] : joined + '/' + segments[index]\n }\n }\n\n return joined === undefined ? '.' : normalize(joined)\n}\n\n/**\n * Normalize a basic file path.\n *\n * @param {string} path\n * File path.\n * @returns {string}\n * File path.\n */\n// Note: `normalize` is not exposed as `path.normalize`, so some code is\n// manually removed from it.\nfunction normalize(path) {\n assertPath(path)\n\n const absolute = path.codePointAt(0) === 47 /* `/` */\n\n // Normalize the path according to POSIX rules.\n let value = normalizeString(path, !absolute)\n\n if (value.length === 0 && !absolute) {\n value = '.'\n }\n\n if (value.length > 0 && path.codePointAt(path.length - 1) === 47 /* / */) {\n value += '/'\n }\n\n return absolute ? '/' + value : value\n}\n\n/**\n * Resolve `.` and `..` elements in a path with directory names.\n *\n * @param {string} path\n * File path.\n * @param {boolean} allowAboveRoot\n * Whether `..` can move above root.\n * @returns {string}\n * File path.\n */\nfunction normalizeString(path, allowAboveRoot) {\n let result = ''\n let lastSegmentLength = 0\n let lastSlash = -1\n let dots = 0\n let index = -1\n /** @type {number | undefined} */\n let code\n /** @type {number} */\n let lastSlashIndex\n\n while (++index <= path.length) {\n if (index < path.length) {\n code = path.codePointAt(index)\n } else if (code === 47 /* `/` */) {\n break\n } else {\n code = 47 /* `/` */\n }\n\n if (code === 47 /* `/` */) {\n if (lastSlash === index - 1 || dots === 1) {\n // Empty.\n } else if (lastSlash !== index - 1 && dots === 2) {\n if (\n result.length < 2 ||\n lastSegmentLength !== 2 ||\n result.codePointAt(result.length - 1) !== 46 /* `.` */ ||\n result.codePointAt(result.length - 2) !== 46 /* `.` */\n ) {\n if (result.length > 2) {\n lastSlashIndex = result.lastIndexOf('/')\n\n if (lastSlashIndex !== result.length - 1) {\n if (lastSlashIndex < 0) {\n result = ''\n lastSegmentLength = 0\n } else {\n result = result.slice(0, lastSlashIndex)\n lastSegmentLength = result.length - 1 - result.lastIndexOf('/')\n }\n\n lastSlash = index\n dots = 0\n continue\n }\n } else if (result.length > 0) {\n result = ''\n lastSegmentLength = 0\n lastSlash = index\n dots = 0\n continue\n }\n }\n\n if (allowAboveRoot) {\n result = result.length > 0 ? result + '/..' : '..'\n lastSegmentLength = 2\n }\n } else {\n if (result.length > 0) {\n result += '/' + path.slice(lastSlash + 1, index)\n } else {\n result = path.slice(lastSlash + 1, index)\n }\n\n lastSegmentLength = index - lastSlash - 1\n }\n\n lastSlash = index\n dots = 0\n } else if (code === 46 /* `.` */ && dots > -1) {\n dots++\n } else {\n dots = -1\n }\n }\n\n return result\n}\n\n/**\n * Make sure `path` is a string.\n *\n * @param {string} path\n * File path.\n * @returns {asserts path is string}\n * Nothing.\n */\nfunction assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError(\n 'Path must be a string. Received ' + JSON.stringify(path)\n )\n }\n}\n\n/* eslint-enable max-depth, complexity */\n","// Somewhat based on:\n// .\n// But I don’t think one tiny line of code can be copyrighted. 😅\nexport const minproc = {cwd}\n\nfunction cwd() {\n return '/'\n}\n","/**\n * Checks if a value has the shape of a WHATWG URL object.\n *\n * Using a symbol or instanceof would not be able to recognize URL objects\n * coming from other implementations (e.g. in Electron), so instead we are\n * checking some well known properties for a lack of a better test.\n *\n * We use `href` and `protocol` as they are the only properties that are\n * easy to retrieve and calculate due to the lazy nature of the getters.\n *\n * We check for auth attribute to distinguish legacy url instance with\n * WHATWG URL instance.\n *\n * @param {unknown} fileUrlOrPath\n * File path or URL.\n * @returns {fileUrlOrPath is URL}\n * Whether it’s a URL.\n */\n// From: \nexport function isUrl(fileUrlOrPath) {\n return Boolean(\n fileUrlOrPath !== null &&\n typeof fileUrlOrPath === 'object' &&\n 'href' in fileUrlOrPath &&\n fileUrlOrPath.href &&\n 'protocol' in fileUrlOrPath &&\n fileUrlOrPath.protocol &&\n // @ts-expect-error: indexing is fine.\n fileUrlOrPath.auth === undefined\n )\n}\n","import {isUrl} from './minurl.shared.js'\n\nexport {isUrl} from './minurl.shared.js'\n\n// See: \n\n/**\n * @param {URL | string} path\n * File URL.\n * @returns {string}\n * File URL.\n */\nexport function urlToPath(path) {\n if (typeof path === 'string') {\n path = new URL(path)\n } else if (!isUrl(path)) {\n /** @type {NodeJS.ErrnoException} */\n const error = new TypeError(\n 'The \"path\" argument must be of type string or an instance of URL. Received `' +\n path +\n '`'\n )\n error.code = 'ERR_INVALID_ARG_TYPE'\n throw error\n }\n\n if (path.protocol !== 'file:') {\n /** @type {NodeJS.ErrnoException} */\n const error = new TypeError('The URL must be of scheme file')\n error.code = 'ERR_INVALID_URL_SCHEME'\n throw error\n }\n\n return getPathFromURLPosix(path)\n}\n\n/**\n * Get a path from a POSIX URL.\n *\n * @param {URL} url\n * URL.\n * @returns {string}\n * File path.\n */\nfunction getPathFromURLPosix(url) {\n if (url.hostname !== '') {\n /** @type {NodeJS.ErrnoException} */\n const error = new TypeError(\n 'File URL host must be \"localhost\" or empty on darwin'\n )\n error.code = 'ERR_INVALID_FILE_URL_HOST'\n throw error\n }\n\n const pathname = url.pathname\n let index = -1\n\n while (++index < pathname.length) {\n if (\n pathname.codePointAt(index) === 37 /* `%` */ &&\n pathname.codePointAt(index + 1) === 50 /* `2` */\n ) {\n const third = pathname.codePointAt(index + 2)\n if (third === 70 /* `F` */ || third === 102 /* `f` */) {\n /** @type {NodeJS.ErrnoException} */\n const error = new TypeError(\n 'File URL path must not include encoded / characters'\n )\n error.code = 'ERR_INVALID_FILE_URL_PATH'\n throw error\n }\n }\n }\n\n return decodeURIComponent(pathname)\n}\n","/**\n * @import {Node, Point, Position} from 'unist'\n * @import {Options as MessageOptions} from 'vfile-message'\n * @import {Compatible, Data, Map, Options, Value} from 'vfile'\n */\n\n/**\n * @typedef {object & {type: string, position?: Position | undefined}} NodeLike\n */\n\nimport {VFileMessage} from 'vfile-message'\nimport {minpath} from '#minpath'\nimport {minproc} from '#minproc'\nimport {urlToPath, isUrl} from '#minurl'\n\n/**\n * Order of setting (least specific to most), we need this because otherwise\n * `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a\n * stem can be set.\n */\nconst order = /** @type {const} */ ([\n 'history',\n 'path',\n 'basename',\n 'stem',\n 'extname',\n 'dirname'\n])\n\nexport class VFile {\n /**\n * Create a new virtual file.\n *\n * `options` is treated as:\n *\n * * `string` or `Uint8Array` — `{value: options}`\n * * `URL` — `{path: options}`\n * * `VFile` — shallow copies its data over to the new file\n * * `object` — all fields are shallow copied over to the new file\n *\n * Path related fields are set in the following order (least specific to\n * most specific): `history`, `path`, `basename`, `stem`, `extname`,\n * `dirname`.\n *\n * You cannot set `dirname` or `extname` without setting either `history`,\n * `path`, `basename`, or `stem` too.\n *\n * @param {Compatible | null | undefined} [value]\n * File value.\n * @returns\n * New instance.\n */\n constructor(value) {\n /** @type {Options | VFile} */\n let options\n\n if (!value) {\n options = {}\n } else if (isUrl(value)) {\n options = {path: value}\n } else if (typeof value === 'string' || isUint8Array(value)) {\n options = {value}\n } else {\n options = value\n }\n\n /* eslint-disable no-unused-expressions */\n\n /**\n * Base of `path` (default: `process.cwd()` or `'/'` in browsers).\n *\n * @type {string}\n */\n // Prevent calling `cwd` (which could be expensive) if it’s not needed;\n // the empty string will be overridden in the next block.\n this.cwd = 'cwd' in options ? '' : minproc.cwd()\n\n /**\n * Place to store custom info (default: `{}`).\n *\n * It’s OK to store custom data directly on the file but moving it to\n * `data` is recommended.\n *\n * @type {Data}\n */\n this.data = {}\n\n /**\n * List of file paths the file moved between.\n *\n * The first is the original path and the last is the current path.\n *\n * @type {Array}\n */\n this.history = []\n\n /**\n * List of messages associated with the file.\n *\n * @type {Array}\n */\n this.messages = []\n\n /**\n * Raw value.\n *\n * @type {Value}\n */\n this.value\n\n // The below are non-standard, they are “well-known”.\n // As in, used in several tools.\n /**\n * Source map.\n *\n * This type is equivalent to the `RawSourceMap` type from the `source-map`\n * module.\n *\n * @type {Map | null | undefined}\n */\n this.map\n\n /**\n * Custom, non-string, compiled, representation.\n *\n * This is used by unified to store non-string results.\n * One example is when turning markdown into React nodes.\n *\n * @type {unknown}\n */\n this.result\n\n /**\n * Whether a file was saved to disk.\n *\n * This is used by vfile reporters.\n *\n * @type {boolean}\n */\n this.stored\n /* eslint-enable no-unused-expressions */\n\n // Set path related properties in the correct order.\n let index = -1\n\n while (++index < order.length) {\n const field = order[index]\n\n // Note: we specifically use `in` instead of `hasOwnProperty` to accept\n // `vfile`s too.\n if (\n field in options &&\n options[field] !== undefined &&\n options[field] !== null\n ) {\n // @ts-expect-error: TS doesn’t understand basic reality.\n this[field] = field === 'history' ? [...options[field]] : options[field]\n }\n }\n\n /** @type {string} */\n let field\n\n // Set non-path related properties.\n for (field in options) {\n // @ts-expect-error: fine to set other things.\n if (!order.includes(field)) {\n // @ts-expect-error: fine to set other things.\n this[field] = options[field]\n }\n }\n }\n\n /**\n * Get the basename (including extname) (example: `'index.min.js'`).\n *\n * @returns {string | undefined}\n * Basename.\n */\n get basename() {\n return typeof this.path === 'string'\n ? minpath.basename(this.path)\n : undefined\n }\n\n /**\n * Set basename (including extname) (`'index.min.js'`).\n *\n * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\\'`\n * on windows).\n * Cannot be nullified (use `file.path = file.dirname` instead).\n *\n * @param {string} basename\n * Basename.\n * @returns {undefined}\n * Nothing.\n */\n set basename(basename) {\n assertNonEmpty(basename, 'basename')\n assertPart(basename, 'basename')\n this.path = minpath.join(this.dirname || '', basename)\n }\n\n /**\n * Get the parent path (example: `'~'`).\n *\n * @returns {string | undefined}\n * Dirname.\n */\n get dirname() {\n return typeof this.path === 'string'\n ? minpath.dirname(this.path)\n : undefined\n }\n\n /**\n * Set the parent path (example: `'~'`).\n *\n * Cannot be set if there’s no `path` yet.\n *\n * @param {string | undefined} dirname\n * Dirname.\n * @returns {undefined}\n * Nothing.\n */\n set dirname(dirname) {\n assertPath(this.basename, 'dirname')\n this.path = minpath.join(dirname || '', this.basename)\n }\n\n /**\n * Get the extname (including dot) (example: `'.js'`).\n *\n * @returns {string | undefined}\n * Extname.\n */\n get extname() {\n return typeof this.path === 'string'\n ? minpath.extname(this.path)\n : undefined\n }\n\n /**\n * Set the extname (including dot) (example: `'.js'`).\n *\n * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\\'`\n * on windows).\n * Cannot be set if there’s no `path` yet.\n *\n * @param {string | undefined} extname\n * Extname.\n * @returns {undefined}\n * Nothing.\n */\n set extname(extname) {\n assertPart(extname, 'extname')\n assertPath(this.dirname, 'extname')\n\n if (extname) {\n if (extname.codePointAt(0) !== 46 /* `.` */) {\n throw new Error('`extname` must start with `.`')\n }\n\n if (extname.includes('.', 1)) {\n throw new Error('`extname` cannot contain multiple dots')\n }\n }\n\n this.path = minpath.join(this.dirname, this.stem + (extname || ''))\n }\n\n /**\n * Get the full path (example: `'~/index.min.js'`).\n *\n * @returns {string}\n * Path.\n */\n get path() {\n return this.history[this.history.length - 1]\n }\n\n /**\n * Set the full path (example: `'~/index.min.js'`).\n *\n * Cannot be nullified.\n * You can set a file URL (a `URL` object with a `file:` protocol) which will\n * be turned into a path with `url.fileURLToPath`.\n *\n * @param {URL | string} path\n * Path.\n * @returns {undefined}\n * Nothing.\n */\n set path(path) {\n if (isUrl(path)) {\n path = urlToPath(path)\n }\n\n assertNonEmpty(path, 'path')\n\n if (this.path !== path) {\n this.history.push(path)\n }\n }\n\n /**\n * Get the stem (basename w/o extname) (example: `'index.min'`).\n *\n * @returns {string | undefined}\n * Stem.\n */\n get stem() {\n return typeof this.path === 'string'\n ? minpath.basename(this.path, this.extname)\n : undefined\n }\n\n /**\n * Set the stem (basename w/o extname) (example: `'index.min'`).\n *\n * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\\'`\n * on windows).\n * Cannot be nullified (use `file.path = file.dirname` instead).\n *\n * @param {string} stem\n * Stem.\n * @returns {undefined}\n * Nothing.\n */\n set stem(stem) {\n assertNonEmpty(stem, 'stem')\n assertPart(stem, 'stem')\n this.path = minpath.join(this.dirname || '', stem + (this.extname || ''))\n }\n\n // Normal prototypal methods.\n /**\n * Create a fatal message for `reason` associated with the file.\n *\n * The `fatal` field of the message is set to `true` (error; file not usable)\n * and the `file` field is set to the current file path.\n * The message is added to the `messages` field on `file`.\n *\n * > 🪦 **Note**: also has obsolete signatures.\n *\n * @overload\n * @param {string} reason\n * @param {MessageOptions | null | undefined} [options]\n * @returns {never}\n *\n * @overload\n * @param {string} reason\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {string} reason\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {string} reason\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @param {Error | VFileMessage | string} causeOrReason\n * Reason for message, should use markdown.\n * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]\n * Configuration (optional).\n * @param {string | null | undefined} [origin]\n * Place in code where the message originates (example:\n * `'my-package:my-rule'` or `'my-rule'`).\n * @returns {never}\n * Never.\n * @throws {VFileMessage}\n * Message.\n */\n fail(causeOrReason, optionsOrParentOrPlace, origin) {\n // @ts-expect-error: the overloads are fine.\n const message = this.message(causeOrReason, optionsOrParentOrPlace, origin)\n\n message.fatal = true\n\n throw message\n }\n\n /**\n * Create an info message for `reason` associated with the file.\n *\n * The `fatal` field of the message is set to `undefined` (info; change\n * likely not needed) and the `file` field is set to the current file path.\n * The message is added to the `messages` field on `file`.\n *\n * > 🪦 **Note**: also has obsolete signatures.\n *\n * @overload\n * @param {string} reason\n * @param {MessageOptions | null | undefined} [options]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @param {Error | VFileMessage | string} causeOrReason\n * Reason for message, should use markdown.\n * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]\n * Configuration (optional).\n * @param {string | null | undefined} [origin]\n * Place in code where the message originates (example:\n * `'my-package:my-rule'` or `'my-rule'`).\n * @returns {VFileMessage}\n * Message.\n */\n info(causeOrReason, optionsOrParentOrPlace, origin) {\n // @ts-expect-error: the overloads are fine.\n const message = this.message(causeOrReason, optionsOrParentOrPlace, origin)\n\n message.fatal = undefined\n\n return message\n }\n\n /**\n * Create a message for `reason` associated with the file.\n *\n * The `fatal` field of the message is set to `false` (warning; change may be\n * needed) and the `file` field is set to the current file path.\n * The message is added to the `messages` field on `file`.\n *\n * > 🪦 **Note**: also has obsolete signatures.\n *\n * @overload\n * @param {string} reason\n * @param {MessageOptions | null | undefined} [options]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @param {Error | VFileMessage | string} causeOrReason\n * Reason for message, should use markdown.\n * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]\n * Configuration (optional).\n * @param {string | null | undefined} [origin]\n * Place in code where the message originates (example:\n * `'my-package:my-rule'` or `'my-rule'`).\n * @returns {VFileMessage}\n * Message.\n */\n message(causeOrReason, optionsOrParentOrPlace, origin) {\n const message = new VFileMessage(\n // @ts-expect-error: the overloads are fine.\n causeOrReason,\n optionsOrParentOrPlace,\n origin\n )\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n }\n\n /**\n * Serialize the file.\n *\n * > **Note**: which encodings are supported depends on the engine.\n * > For info on Node.js, see:\n * > .\n *\n * @param {string | null | undefined} [encoding='utf8']\n * Character encoding to understand `value` as when it’s a `Uint8Array`\n * (default: `'utf-8'`).\n * @returns {string}\n * Serialized file.\n */\n toString(encoding) {\n if (this.value === undefined) {\n return ''\n }\n\n if (typeof this.value === 'string') {\n return this.value\n }\n\n const decoder = new TextDecoder(encoding || undefined)\n return decoder.decode(this.value)\n }\n}\n\n/**\n * Assert that `part` is not a path (as in, does not contain `path.sep`).\n *\n * @param {string | null | undefined} part\n * File path part.\n * @param {string} name\n * Part name.\n * @returns {undefined}\n * Nothing.\n */\nfunction assertPart(part, name) {\n if (part && part.includes(minpath.sep)) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + minpath.sep + '`'\n )\n }\n}\n\n/**\n * Assert that `part` is not empty.\n *\n * @param {string | undefined} part\n * Thing.\n * @param {string} name\n * Part name.\n * @returns {asserts part is string}\n * Nothing.\n */\nfunction assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}\n\n/**\n * Assert `path` exists.\n *\n * @param {string | undefined} path\n * Path.\n * @param {string} name\n * Dependency name.\n * @returns {asserts path is string}\n * Nothing.\n */\nfunction assertPath(path, name) {\n if (!path) {\n throw new Error('Setting `' + name + '` requires `path` to be set too')\n }\n}\n\n/**\n * Assert `value` is an `Uint8Array`.\n *\n * @param {unknown} value\n * thing.\n * @returns {value is Uint8Array}\n * Whether `value` is an `Uint8Array`.\n */\nfunction isUint8Array(value) {\n return Boolean(\n value &&\n typeof value === 'object' &&\n 'byteLength' in value &&\n 'byteOffset' in value\n )\n}\n","export const CallableInstance =\n /**\n * @type {new , Result>(property: string | symbol) => (...parameters: Parameters) => Result}\n */\n (\n /** @type {unknown} */\n (\n /**\n * @this {Function}\n * @param {string | symbol} property\n * @returns {(...parameters: Array) => unknown}\n */\n function (property) {\n const self = this\n const constr = self.constructor\n const proto = /** @type {Record} */ (\n // Prototypes do exist.\n // type-coverage:ignore-next-line\n constr.prototype\n )\n const value = proto[property]\n /** @type {(...parameters: Array) => unknown} */\n const apply = function () {\n return value.apply(apply, arguments)\n }\n\n Object.setPrototypeOf(apply, proto)\n\n // Not needed for us in `unified`: we only call this on the `copy`\n // function,\n // and we don't need to add its fields (`length`, `name`)\n // over.\n // See also: GH-246.\n // const names = Object.getOwnPropertyNames(value)\n //\n // for (const p of names) {\n // const descriptor = Object.getOwnPropertyDescriptor(value, p)\n // if (descriptor) Object.defineProperty(apply, p, descriptor)\n // }\n\n return apply\n }\n )\n )\n","/**\n * @typedef {import('trough').Pipeline} Pipeline\n *\n * @typedef {import('unist').Node} Node\n *\n * @typedef {import('vfile').Compatible} Compatible\n * @typedef {import('vfile').Value} Value\n *\n * @typedef {import('../index.js').CompileResultMap} CompileResultMap\n * @typedef {import('../index.js').Data} Data\n * @typedef {import('../index.js').Settings} Settings\n */\n\n/**\n * @typedef {CompileResultMap[keyof CompileResultMap]} CompileResults\n * Acceptable results from compilers.\n *\n * To register custom results, add them to\n * {@linkcode CompileResultMap}.\n */\n\n/**\n * @template {Node} [Tree=Node]\n * The node that the compiler receives (default: `Node`).\n * @template {CompileResults} [Result=CompileResults]\n * The thing that the compiler yields (default: `CompileResults`).\n * @callback Compiler\n * A **compiler** handles the compiling of a syntax tree to something else\n * (in most cases, text) (TypeScript type).\n *\n * It is used in the stringify phase and called with a {@linkcode Node}\n * and {@linkcode VFile} representation of the document to compile.\n * It should return the textual representation of the given tree (typically\n * `string`).\n *\n * > **Note**: unified typically compiles by serializing: most compilers\n * > return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@linkcode CompileResultMap}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n * @param {Tree} tree\n * Tree to compile.\n * @param {VFile} file\n * File associated with `tree`.\n * @returns {Result}\n * New content: compiled text (`string` or `Uint8Array`, for `file.value`) or\n * something else (for `file.result`).\n */\n\n/**\n * @template {Node} [Tree=Node]\n * The node that the parser yields (default: `Node`)\n * @callback Parser\n * A **parser** handles the parsing of text to a syntax tree.\n *\n * It is used in the parse phase and is called with a `string` and\n * {@linkcode VFile} of the document to parse.\n * It must return the syntax tree representation of the given file\n * ({@linkcode Node}).\n * @param {string} document\n * Document to parse.\n * @param {VFile} file\n * File associated with `document`.\n * @returns {Tree}\n * Node representing the given file.\n */\n\n/**\n * @typedef {(\n * Plugin, any, any> |\n * PluginTuple, any, any> |\n * Preset\n * )} Pluggable\n * Union of the different ways to add plugins and settings.\n */\n\n/**\n * @typedef {Array} PluggableList\n * List of plugins and presets.\n */\n\n// Note: we can’t use `callback` yet as it messes up `this`:\n// .\n/**\n * @template {Array} [PluginParameters=[]]\n * Arguments passed to the plugin (default: `[]`, the empty tuple).\n * @template {Node | string | undefined} [Input=Node]\n * Value that is expected as input (default: `Node`).\n *\n * * If the plugin returns a {@linkcode Transformer}, this\n * should be the node it expects.\n * * If the plugin sets a {@linkcode Parser}, this should be\n * `string`.\n * * If the plugin sets a {@linkcode Compiler}, this should be the\n * node it expects.\n * @template [Output=Input]\n * Value that is yielded as output (default: `Input`).\n *\n * * If the plugin returns a {@linkcode Transformer}, this\n * should be the node that that yields.\n * * If the plugin sets a {@linkcode Parser}, this should be the\n * node that it yields.\n * * If the plugin sets a {@linkcode Compiler}, this should be\n * result it yields.\n * @typedef {(\n * (this: Processor, ...parameters: PluginParameters) =>\n * Input extends string ? // Parser.\n * Output extends Node | undefined ? undefined | void : never :\n * Output extends CompileResults ? // Compiler.\n * Input extends Node | undefined ? undefined | void : never :\n * Transformer<\n * Input extends Node ? Input : Node,\n * Output extends Node ? Output : Node\n * > | undefined | void\n * )} Plugin\n * Single plugin.\n *\n * Plugins configure the processors they are applied on in the following\n * ways:\n *\n * * they change the processor, such as the parser, the compiler, or by\n * configuring data\n * * they specify how to handle trees and files\n *\n * In practice, they are functions that can receive options and configure the\n * processor (`this`).\n *\n * > **Note**: plugins are called when the processor is *frozen*, not when\n * > they are applied.\n */\n\n/**\n * Tuple of a plugin and its configuration.\n *\n * The first item is a plugin, the rest are its parameters.\n *\n * @template {Array} [TupleParameters=[]]\n * Arguments passed to the plugin (default: `[]`, the empty tuple).\n * @template {Node | string | undefined} [Input=undefined]\n * Value that is expected as input (optional).\n *\n * * If the plugin returns a {@linkcode Transformer}, this\n * should be the node it expects.\n * * If the plugin sets a {@linkcode Parser}, this should be\n * `string`.\n * * If the plugin sets a {@linkcode Compiler}, this should be the\n * node it expects.\n * @template [Output=undefined] (optional).\n * Value that is yielded as output.\n *\n * * If the plugin returns a {@linkcode Transformer}, this\n * should be the node that that yields.\n * * If the plugin sets a {@linkcode Parser}, this should be the\n * node that it yields.\n * * If the plugin sets a {@linkcode Compiler}, this should be\n * result it yields.\n * @typedef {(\n * [\n * plugin: Plugin,\n * ...parameters: TupleParameters\n * ]\n * )} PluginTuple\n */\n\n/**\n * @typedef Preset\n * Sharable configuration.\n *\n * They can contain plugins and settings.\n * @property {PluggableList | undefined} [plugins]\n * List of plugins and presets (optional).\n * @property {Settings | undefined} [settings]\n * Shared settings for parsers and compilers (optional).\n */\n\n/**\n * @template {VFile} [File=VFile]\n * The file that the callback receives (default: `VFile`).\n * @callback ProcessCallback\n * Callback called when the process is done.\n *\n * Called with either an error or a result.\n * @param {Error | undefined} [error]\n * Fatal error (optional).\n * @param {File | undefined} [file]\n * Processed file (optional).\n * @returns {undefined}\n * Nothing.\n */\n\n/**\n * @template {Node} [Tree=Node]\n * The tree that the callback receives (default: `Node`).\n * @callback RunCallback\n * Callback called when transformers are done.\n *\n * Called with either an error or results.\n * @param {Error | undefined} [error]\n * Fatal error (optional).\n * @param {Tree | undefined} [tree]\n * Transformed tree (optional).\n * @param {VFile | undefined} [file]\n * File (optional).\n * @returns {undefined}\n * Nothing.\n */\n\n/**\n * @template {Node} [Output=Node]\n * Node type that the transformer yields (default: `Node`).\n * @callback TransformCallback\n * Callback passed to transforms.\n *\n * If the signature of a `transformer` accepts a third argument, the\n * transformer may perform asynchronous operations, and must call it.\n * @param {Error | undefined} [error]\n * Fatal error to stop the process (optional).\n * @param {Output | undefined} [tree]\n * New, changed, tree (optional).\n * @param {VFile | undefined} [file]\n * New, changed, file (optional).\n * @returns {undefined}\n * Nothing.\n */\n\n/**\n * @template {Node} [Input=Node]\n * Node type that the transformer expects (default: `Node`).\n * @template {Node} [Output=Input]\n * Node type that the transformer yields (default: `Input`).\n * @callback Transformer\n * Transformers handle syntax trees and files.\n *\n * They are functions that are called each time a syntax tree and file are\n * passed through the run phase.\n * When an error occurs in them (either because it’s thrown, returned,\n * rejected, or passed to `next`), the process stops.\n *\n * The run phase is handled by [`trough`][trough], see its documentation for\n * the exact semantics of these functions.\n *\n * > **Note**: you should likely ignore `next`: don’t accept it.\n * > it supports callback-style async work.\n * > But promises are likely easier to reason about.\n *\n * [trough]: https://github.com/wooorm/trough#function-fninput-next\n * @param {Input} tree\n * Tree to handle.\n * @param {VFile} file\n * File to handle.\n * @param {TransformCallback} next\n * Callback.\n * @returns {(\n * Promise |\n * Promise | // For some reason this is needed separately.\n * Output |\n * Error |\n * undefined |\n * void\n * )}\n * If you accept `next`, nothing.\n * Otherwise:\n *\n * * `Error` — fatal error to stop the process\n * * `Promise` or `undefined` — the next transformer keeps using\n * same tree\n * * `Promise` or `Node` — new, changed, tree\n */\n\n/**\n * @template {Node | undefined} ParseTree\n * Output of `parse`.\n * @template {Node | undefined} HeadTree\n * Input for `run`.\n * @template {Node | undefined} TailTree\n * Output for `run`.\n * @template {Node | undefined} CompileTree\n * Input of `stringify`.\n * @template {CompileResults | undefined} CompileResult\n * Output of `stringify`.\n * @template {Node | string | undefined} Input\n * Input of plugin.\n * @template Output\n * Output of plugin (optional).\n * @typedef {(\n * Input extends string\n * ? Output extends Node | undefined\n * ? // Parser.\n * Processor<\n * Output extends undefined ? ParseTree : Output,\n * HeadTree,\n * TailTree,\n * CompileTree,\n * CompileResult\n * >\n * : // Unknown.\n * Processor\n * : Output extends CompileResults\n * ? Input extends Node | undefined\n * ? // Compiler.\n * Processor<\n * ParseTree,\n * HeadTree,\n * TailTree,\n * Input extends undefined ? CompileTree : Input,\n * Output extends undefined ? CompileResult : Output\n * >\n * : // Unknown.\n * Processor\n * : Input extends Node | undefined\n * ? Output extends Node | undefined\n * ? // Transform.\n * Processor<\n * ParseTree,\n * HeadTree extends undefined ? Input : HeadTree,\n * Output extends undefined ? TailTree : Output,\n * CompileTree,\n * CompileResult\n * >\n * : // Unknown.\n * Processor\n * : // Unknown.\n * Processor\n * )} UsePlugin\n * Create a processor based on the input/output of a {@link Plugin plugin}.\n */\n\n/**\n * @template {CompileResults | undefined} Result\n * Node type that the transformer yields.\n * @typedef {(\n * Result extends Value | undefined ?\n * VFile :\n * VFile & {result: Result}\n * )} VFileWithOutput\n * Type to generate a {@linkcode VFile} corresponding to a compiler result.\n *\n * If a result that is not acceptable on a `VFile` is used, that will\n * be stored on the `result` field of {@linkcode VFile}.\n */\n\nimport {bail} from 'bail'\nimport extend from 'extend'\nimport {ok as assert} from 'devlop'\nimport isPlainObj from 'is-plain-obj'\nimport {trough} from 'trough'\nimport {VFile} from 'vfile'\nimport {CallableInstance} from './callable-instance.js'\n\n// To do: next major: drop `Compiler`, `Parser`: prefer lowercase.\n\n// To do: we could start yielding `never` in TS when a parser is missing and\n// `parse` is called.\n// Currently, we allow directly setting `processor.parser`, which is untyped.\n\nconst own = {}.hasOwnProperty\n\n/**\n * @template {Node | undefined} [ParseTree=undefined]\n * Output of `parse` (optional).\n * @template {Node | undefined} [HeadTree=undefined]\n * Input for `run` (optional).\n * @template {Node | undefined} [TailTree=undefined]\n * Output for `run` (optional).\n * @template {Node | undefined} [CompileTree=undefined]\n * Input of `stringify` (optional).\n * @template {CompileResults | undefined} [CompileResult=undefined]\n * Output of `stringify` (optional).\n * @extends {CallableInstance<[], Processor>}\n */\nexport class Processor extends CallableInstance {\n /**\n * Create a processor.\n */\n constructor() {\n // If `Processor()` is called (w/o new), `copy` is called instead.\n super('copy')\n\n /**\n * Compiler to use (deprecated).\n *\n * @deprecated\n * Use `compiler` instead.\n * @type {(\n * Compiler<\n * CompileTree extends undefined ? Node : CompileTree,\n * CompileResult extends undefined ? CompileResults : CompileResult\n * > |\n * undefined\n * )}\n */\n this.Compiler = undefined\n\n /**\n * Parser to use (deprecated).\n *\n * @deprecated\n * Use `parser` instead.\n * @type {(\n * Parser |\n * undefined\n * )}\n */\n this.Parser = undefined\n\n // Note: the following fields are considered private.\n // However, they are needed for tests, and TSC generates an untyped\n // `private freezeIndex` field for, which trips `type-coverage` up.\n // Instead, we use `@deprecated` to visualize that they shouldn’t be used.\n /**\n * Internal list of configured plugins.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {Array>>}\n */\n this.attachers = []\n\n /**\n * Compiler to use.\n *\n * @type {(\n * Compiler<\n * CompileTree extends undefined ? Node : CompileTree,\n * CompileResult extends undefined ? CompileResults : CompileResult\n * > |\n * undefined\n * )}\n */\n this.compiler = undefined\n\n /**\n * Internal state to track where we are while freezing.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {number}\n */\n this.freezeIndex = -1\n\n /**\n * Internal state to track whether we’re frozen.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {boolean | undefined}\n */\n this.frozen = undefined\n\n /**\n * Internal state.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {Data}\n */\n this.namespace = {}\n\n /**\n * Parser to use.\n *\n * @type {(\n * Parser |\n * undefined\n * )}\n */\n this.parser = undefined\n\n /**\n * Internal list of configured transformers.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {Pipeline}\n */\n this.transformers = trough()\n }\n\n /**\n * Copy a processor.\n *\n * @deprecated\n * This is a private internal method and should not be used.\n * @returns {Processor}\n * New *unfrozen* processor ({@linkcode Processor}) that is\n * configured to work the same as its ancestor.\n * When the descendant processor is configured in the future it does not\n * affect the ancestral processor.\n */\n copy() {\n // Cast as the type parameters will be the same after attaching.\n const destination =\n /** @type {Processor} */ (\n new Processor()\n )\n let index = -1\n\n while (++index < this.attachers.length) {\n const attacher = this.attachers[index]\n destination.use(...attacher)\n }\n\n destination.data(extend(true, {}, this.namespace))\n\n return destination\n }\n\n /**\n * Configure the processor with info available to all plugins.\n * Information is stored in an object.\n *\n * Typically, options can be given to a specific plugin, but sometimes it\n * makes sense to have information shared with several plugins.\n * For example, a list of HTML elements that are self-closing, which is\n * needed during all phases.\n *\n * > **Note**: setting information cannot occur on *frozen* processors.\n * > Call the processor first to create a new unfrozen processor.\n *\n * > **Note**: to register custom data in TypeScript, augment the\n * > {@linkcode Data} interface.\n *\n * @example\n * This example show how to get and set info:\n *\n * ```js\n * import {unified} from 'unified'\n *\n * const processor = unified().data('alpha', 'bravo')\n *\n * processor.data('alpha') // => 'bravo'\n *\n * processor.data() // => {alpha: 'bravo'}\n *\n * processor.data({charlie: 'delta'})\n *\n * processor.data() // => {charlie: 'delta'}\n * ```\n *\n * @template {keyof Data} Key\n *\n * @overload\n * @returns {Data}\n *\n * @overload\n * @param {Data} dataset\n * @returns {Processor}\n *\n * @overload\n * @param {Key} key\n * @returns {Data[Key]}\n *\n * @overload\n * @param {Key} key\n * @param {Data[Key]} value\n * @returns {Processor}\n *\n * @param {Data | Key} [key]\n * Key to get or set, or entire dataset to set, or nothing to get the\n * entire dataset (optional).\n * @param {Data[Key]} [value]\n * Value to set (optional).\n * @returns {unknown}\n * The current processor when setting, the value at `key` when getting, or\n * the entire dataset when getting without key.\n */\n data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', this.frozen)\n this.namespace[key] = value\n return this\n }\n\n // Get `key`.\n return (own.call(this.namespace, key) && this.namespace[key]) || undefined\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', this.frozen)\n this.namespace = key\n return this\n }\n\n // Get space.\n return this.namespace\n }\n\n /**\n * Freeze a processor.\n *\n * Frozen processors are meant to be extended and not to be configured\n * directly.\n *\n * When a processor is frozen it cannot be unfrozen.\n * New processors working the same way can be created by calling the\n * processor.\n *\n * It’s possible to freeze processors explicitly by calling `.freeze()`.\n * Processors freeze automatically when `.parse()`, `.run()`, `.runSync()`,\n * `.stringify()`, `.process()`, or `.processSync()` are called.\n *\n * @returns {Processor}\n * The current processor.\n */\n freeze() {\n if (this.frozen) {\n return this\n }\n\n // Cast so that we can type plugins easier.\n // Plugins are supposed to be usable on different processors, not just on\n // this exact processor.\n const self = /** @type {Processor} */ (/** @type {unknown} */ (this))\n\n while (++this.freezeIndex < this.attachers.length) {\n const [attacher, ...options] = this.attachers[this.freezeIndex]\n\n if (options[0] === false) {\n continue\n }\n\n if (options[0] === true) {\n options[0] = undefined\n }\n\n const transformer = attacher.call(self, ...options)\n\n if (typeof transformer === 'function') {\n this.transformers.use(transformer)\n }\n }\n\n this.frozen = true\n this.freezeIndex = Number.POSITIVE_INFINITY\n\n return this\n }\n\n /**\n * Parse text to a syntax tree.\n *\n * > **Note**: `parse` freezes the processor if not already *frozen*.\n *\n * > **Note**: `parse` performs the parse phase, not the run phase or other\n * > phases.\n *\n * @param {Compatible | undefined} [file]\n * file to parse (optional); typically `string` or `VFile`; any value\n * accepted as `x` in `new VFile(x)`.\n * @returns {ParseTree extends undefined ? Node : ParseTree}\n * Syntax tree representing `file`.\n */\n parse(file) {\n this.freeze()\n const realFile = vfile(file)\n const parser = this.parser || this.Parser\n assertParser('parse', parser)\n return parser(String(realFile), realFile)\n }\n\n /**\n * Process the given file as configured on the processor.\n *\n * > **Note**: `process` freezes the processor if not already *frozen*.\n *\n * > **Note**: `process` performs the parse, run, and stringify phases.\n *\n * @overload\n * @param {Compatible | undefined} file\n * @param {ProcessCallback>} done\n * @returns {undefined}\n *\n * @overload\n * @param {Compatible | undefined} [file]\n * @returns {Promise>}\n *\n * @param {Compatible | undefined} [file]\n * File (optional); typically `string` or `VFile`]; any value accepted as\n * `x` in `new VFile(x)`.\n * @param {ProcessCallback> | undefined} [done]\n * Callback (optional).\n * @returns {Promise | undefined}\n * Nothing if `done` is given.\n * Otherwise a promise, rejected with a fatal error or resolved with the\n * processed file.\n *\n * The parsed, transformed, and compiled value is available at\n * `file.value` (see note).\n *\n * > **Note**: unified typically compiles by serializing: most\n * > compilers return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@linkcode CompileResultMap}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n */\n process(file, done) {\n const self = this\n\n this.freeze()\n assertParser('process', this.parser || this.Parser)\n assertCompiler('process', this.compiler || this.Compiler)\n\n return done ? executor(undefined, done) : new Promise(executor)\n\n // Note: `void`s needed for TS.\n /**\n * @param {((file: VFileWithOutput) => undefined | void) | undefined} resolve\n * @param {(error: Error | undefined) => undefined | void} reject\n * @returns {undefined}\n */\n function executor(resolve, reject) {\n const realFile = vfile(file)\n // Assume `ParseTree` (the result of the parser) matches `HeadTree` (the\n // input of the first transform).\n const parseTree =\n /** @type {HeadTree extends undefined ? Node : HeadTree} */ (\n /** @type {unknown} */ (self.parse(realFile))\n )\n\n self.run(parseTree, realFile, function (error, tree, file) {\n if (error || !tree || !file) {\n return realDone(error)\n }\n\n // Assume `TailTree` (the output of the last transform) matches\n // `CompileTree` (the input of the compiler).\n const compileTree =\n /** @type {CompileTree extends undefined ? Node : CompileTree} */ (\n /** @type {unknown} */ (tree)\n )\n\n const compileResult = self.stringify(compileTree, file)\n\n if (looksLikeAValue(compileResult)) {\n file.value = compileResult\n } else {\n file.result = compileResult\n }\n\n realDone(error, /** @type {VFileWithOutput} */ (file))\n })\n\n /**\n * @param {Error | undefined} error\n * @param {VFileWithOutput | undefined} [file]\n * @returns {undefined}\n */\n function realDone(error, file) {\n if (error || !file) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n assert(done, '`done` is defined if `resolve` is not')\n done(undefined, file)\n }\n }\n }\n }\n\n /**\n * Process the given file as configured on the processor.\n *\n * An error is thrown if asynchronous transforms are configured.\n *\n * > **Note**: `processSync` freezes the processor if not already *frozen*.\n *\n * > **Note**: `processSync` performs the parse, run, and stringify phases.\n *\n * @param {Compatible | undefined} [file]\n * File (optional); typically `string` or `VFile`; any value accepted as\n * `x` in `new VFile(x)`.\n * @returns {VFileWithOutput}\n * The processed file.\n *\n * The parsed, transformed, and compiled value is available at\n * `file.value` (see note).\n *\n * > **Note**: unified typically compiles by serializing: most\n * > compilers return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@linkcode CompileResultMap}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n */\n processSync(file) {\n /** @type {boolean} */\n let complete = false\n /** @type {VFileWithOutput | undefined} */\n let result\n\n this.freeze()\n assertParser('processSync', this.parser || this.Parser)\n assertCompiler('processSync', this.compiler || this.Compiler)\n\n this.process(file, realDone)\n assertDone('processSync', 'process', complete)\n assert(result, 'we either bailed on an error or have a tree')\n\n return result\n\n /**\n * @type {ProcessCallback>}\n */\n function realDone(error, file) {\n complete = true\n bail(error)\n result = file\n }\n }\n\n /**\n * Run *transformers* on a syntax tree.\n *\n * > **Note**: `run` freezes the processor if not already *frozen*.\n *\n * > **Note**: `run` performs the run phase, not other phases.\n *\n * @overload\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * @param {RunCallback} done\n * @returns {undefined}\n *\n * @overload\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * @param {Compatible | undefined} file\n * @param {RunCallback} done\n * @returns {undefined}\n *\n * @overload\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * @param {Compatible | undefined} [file]\n * @returns {Promise}\n *\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * Tree to transform and inspect.\n * @param {(\n * RunCallback |\n * Compatible\n * )} [file]\n * File associated with `node` (optional); any value accepted as `x` in\n * `new VFile(x)`.\n * @param {RunCallback} [done]\n * Callback (optional).\n * @returns {Promise | undefined}\n * Nothing if `done` is given.\n * Otherwise, a promise rejected with a fatal error or resolved with the\n * transformed tree.\n */\n run(tree, file, done) {\n assertNode(tree)\n this.freeze()\n\n const transformers = this.transformers\n\n if (!done && typeof file === 'function') {\n done = file\n file = undefined\n }\n\n return done ? executor(undefined, done) : new Promise(executor)\n\n // Note: `void`s needed for TS.\n /**\n * @param {(\n * ((tree: TailTree extends undefined ? Node : TailTree) => undefined | void) |\n * undefined\n * )} resolve\n * @param {(error: Error) => undefined | void} reject\n * @returns {undefined}\n */\n function executor(resolve, reject) {\n assert(\n typeof file !== 'function',\n '`file` can’t be a `done` anymore, we checked'\n )\n const realFile = vfile(file)\n transformers.run(tree, realFile, realDone)\n\n /**\n * @param {Error | undefined} error\n * @param {Node} outputTree\n * @param {VFile} file\n * @returns {undefined}\n */\n function realDone(error, outputTree, file) {\n const resultingTree =\n /** @type {TailTree extends undefined ? Node : TailTree} */ (\n outputTree || tree\n )\n\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(resultingTree)\n } else {\n assert(done, '`done` is defined if `resolve` is not')\n done(undefined, resultingTree, file)\n }\n }\n }\n }\n\n /**\n * Run *transformers* on a syntax tree.\n *\n * An error is thrown if asynchronous transforms are configured.\n *\n * > **Note**: `runSync` freezes the processor if not already *frozen*.\n *\n * > **Note**: `runSync` performs the run phase, not other phases.\n *\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * Tree to transform and inspect.\n * @param {Compatible | undefined} [file]\n * File associated with `node` (optional); any value accepted as `x` in\n * `new VFile(x)`.\n * @returns {TailTree extends undefined ? Node : TailTree}\n * Transformed tree.\n */\n runSync(tree, file) {\n /** @type {boolean} */\n let complete = false\n /** @type {(TailTree extends undefined ? Node : TailTree) | undefined} */\n let result\n\n this.run(tree, file, realDone)\n\n assertDone('runSync', 'run', complete)\n assert(result, 'we either bailed on an error or have a tree')\n return result\n\n /**\n * @type {RunCallback}\n */\n function realDone(error, tree) {\n bail(error)\n result = tree\n complete = true\n }\n }\n\n /**\n * Compile a syntax tree.\n *\n * > **Note**: `stringify` freezes the processor if not already *frozen*.\n *\n * > **Note**: `stringify` performs the stringify phase, not the run phase\n * > or other phases.\n *\n * @param {CompileTree extends undefined ? Node : CompileTree} tree\n * Tree to compile.\n * @param {Compatible | undefined} [file]\n * File associated with `node` (optional); any value accepted as `x` in\n * `new VFile(x)`.\n * @returns {CompileResult extends undefined ? Value : CompileResult}\n * Textual representation of the tree (see note).\n *\n * > **Note**: unified typically compiles by serializing: most compilers\n * > return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@linkcode CompileResultMap}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n */\n stringify(tree, file) {\n this.freeze()\n const realFile = vfile(file)\n const compiler = this.compiler || this.Compiler\n assertCompiler('stringify', compiler)\n assertNode(tree)\n\n return compiler(tree, realFile)\n }\n\n /**\n * Configure the processor to use a plugin, a list of usable values, or a\n * preset.\n *\n * If the processor is already using a plugin, the previous plugin\n * configuration is changed based on the options that are passed in.\n * In other words, the plugin is not added a second time.\n *\n * > **Note**: `use` cannot be called on *frozen* processors.\n * > Call the processor first to create a new unfrozen processor.\n *\n * @example\n * There are many ways to pass plugins to `.use()`.\n * This example gives an overview:\n *\n * ```js\n * import {unified} from 'unified'\n *\n * unified()\n * // Plugin with options:\n * .use(pluginA, {x: true, y: true})\n * // Passing the same plugin again merges configuration (to `{x: true, y: false, z: true}`):\n * .use(pluginA, {y: false, z: true})\n * // Plugins:\n * .use([pluginB, pluginC])\n * // Two plugins, the second with options:\n * .use([pluginD, [pluginE, {}]])\n * // Preset with plugins and settings:\n * .use({plugins: [pluginF, [pluginG, {}]], settings: {position: false}})\n * // Settings only:\n * .use({settings: {position: false}})\n * ```\n *\n * @template {Array} [Parameters=[]]\n * @template {Node | string | undefined} [Input=undefined]\n * @template [Output=Input]\n *\n * @overload\n * @param {Preset | null | undefined} [preset]\n * @returns {Processor}\n *\n * @overload\n * @param {PluggableList} list\n * @returns {Processor}\n *\n * @overload\n * @param {Plugin} plugin\n * @param {...(Parameters | [boolean])} parameters\n * @returns {UsePlugin}\n *\n * @param {PluggableList | Plugin | Preset | null | undefined} value\n * Usable value.\n * @param {...unknown} parameters\n * Parameters, when a plugin is given as a usable value.\n * @returns {Processor}\n * Current processor.\n */\n use(value, ...parameters) {\n const attachers = this.attachers\n const namespace = this.namespace\n\n assertUnfrozen('use', this.frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin(value, parameters)\n } else if (typeof value === 'object') {\n if (Array.isArray(value)) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new TypeError('Expected usable value, not `' + value + '`')\n }\n\n return this\n\n /**\n * @param {Pluggable} value\n * @returns {undefined}\n */\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value, [])\n } else if (typeof value === 'object') {\n if (Array.isArray(value)) {\n const [plugin, ...parameters] =\n /** @type {PluginTuple>} */ (value)\n addPlugin(plugin, parameters)\n } else {\n addPreset(value)\n }\n } else {\n throw new TypeError('Expected usable value, not `' + value + '`')\n }\n }\n\n /**\n * @param {Preset} result\n * @returns {undefined}\n */\n function addPreset(result) {\n if (!('plugins' in result) && !('settings' in result)) {\n throw new Error(\n 'Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither'\n )\n }\n\n addList(result.plugins)\n\n if (result.settings) {\n namespace.settings = extend(true, namespace.settings, result.settings)\n }\n }\n\n /**\n * @param {PluggableList | null | undefined} plugins\n * @returns {undefined}\n */\n function addList(plugins) {\n let index = -1\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (Array.isArray(plugins)) {\n while (++index < plugins.length) {\n const thing = plugins[index]\n add(thing)\n }\n } else {\n throw new TypeError('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n /**\n * @param {Plugin} plugin\n * @param {Array} parameters\n * @returns {undefined}\n */\n function addPlugin(plugin, parameters) {\n let index = -1\n let entryIndex = -1\n\n while (++index < attachers.length) {\n if (attachers[index][0] === plugin) {\n entryIndex = index\n break\n }\n }\n\n if (entryIndex === -1) {\n attachers.push([plugin, ...parameters])\n }\n // Only set if there was at least a `primary` value, otherwise we’d change\n // `arguments.length`.\n else if (parameters.length > 0) {\n let [primary, ...rest] = parameters\n const currentPrimary = attachers[entryIndex][1]\n if (isPlainObj(currentPrimary) && isPlainObj(primary)) {\n primary = extend(true, currentPrimary, primary)\n }\n\n attachers[entryIndex] = [plugin, primary, ...rest]\n }\n }\n }\n}\n\n// Note: this returns a *callable* instance.\n// That’s why it’s documented as a function.\n/**\n * Create a new processor.\n *\n * @example\n * This example shows how a new processor can be created (from `remark`) and linked\n * to **stdin**(4) and **stdout**(4).\n *\n * ```js\n * import process from 'node:process'\n * import concatStream from 'concat-stream'\n * import {remark} from 'remark'\n *\n * process.stdin.pipe(\n * concatStream(function (buf) {\n * process.stdout.write(String(remark().processSync(buf)))\n * })\n * )\n * ```\n *\n * @returns\n * New *unfrozen* processor (`processor`).\n *\n * This processor is configured to work the same as its ancestor.\n * When the descendant processor is configured in the future it does not\n * affect the ancestral processor.\n */\nexport const unified = new Processor().freeze()\n\n/**\n * Assert a parser is available.\n *\n * @param {string} name\n * @param {unknown} value\n * @returns {asserts value is Parser}\n */\nfunction assertParser(name, value) {\n if (typeof value !== 'function') {\n throw new TypeError('Cannot `' + name + '` without `parser`')\n }\n}\n\n/**\n * Assert a compiler is available.\n *\n * @param {string} name\n * @param {unknown} value\n * @returns {asserts value is Compiler}\n */\nfunction assertCompiler(name, value) {\n if (typeof value !== 'function') {\n throw new TypeError('Cannot `' + name + '` without `compiler`')\n }\n}\n\n/**\n * Assert the processor is not frozen.\n *\n * @param {string} name\n * @param {unknown} frozen\n * @returns {asserts frozen is false}\n */\nfunction assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot call `' +\n name +\n '` on a frozen processor.\\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.'\n )\n }\n}\n\n/**\n * Assert `node` is a unist node.\n *\n * @param {unknown} node\n * @returns {asserts node is Node}\n */\nfunction assertNode(node) {\n // `isPlainObj` unfortunately uses `any` instead of `unknown`.\n // type-coverage:ignore-next-line\n if (!isPlainObj(node) || typeof node.type !== 'string') {\n throw new TypeError('Expected node, got `' + node + '`')\n // Fine.\n }\n}\n\n/**\n * Assert that `complete` is `true`.\n *\n * @param {string} name\n * @param {string} asyncName\n * @param {unknown} complete\n * @returns {asserts complete is true}\n */\nfunction assertDone(name, asyncName, complete) {\n if (!complete) {\n throw new Error(\n '`' + name + '` finished async. Use `' + asyncName + '` instead'\n )\n }\n}\n\n/**\n * @param {Compatible | undefined} [value]\n * @returns {VFile}\n */\nfunction vfile(value) {\n return looksLikeAVFile(value) ? value : new VFile(value)\n}\n\n/**\n * @param {Compatible | undefined} [value]\n * @returns {value is VFile}\n */\nfunction looksLikeAVFile(value) {\n return Boolean(\n value &&\n typeof value === 'object' &&\n 'message' in value &&\n 'messages' in value\n )\n}\n\n/**\n * @param {unknown} [value]\n * @returns {value is Value}\n */\nfunction looksLikeAValue(value) {\n return typeof value === 'string' || isUint8Array(value)\n}\n\n/**\n * Assert `value` is an `Uint8Array`.\n *\n * @param {unknown} value\n * thing.\n * @returns {value is Uint8Array}\n * Whether `value` is an `Uint8Array`.\n */\nfunction isUint8Array(value) {\n return Boolean(\n value &&\n typeof value === 'object' &&\n 'byteLength' in value &&\n 'byteOffset' in value\n )\n}\n","/**\n * @import {Element, Nodes, Parents, Root} from 'hast'\n * @import {Root as MdastRoot} from 'mdast'\n * @import {ComponentType, JSX, ReactElement, ReactNode} from 'react'\n * @import {Options as RemarkRehypeOptions} from 'remark-rehype'\n * @import {BuildVisitor} from 'unist-util-visit'\n * @import {PluggableList, Processor} from 'unified'\n */\n\n/**\n * @callback AllowElement\n * Filter elements.\n * @param {Readonly} element\n * Element to check.\n * @param {number} index\n * Index of `element` in `parent`.\n * @param {Readonly | undefined} parent\n * Parent of `element`.\n * @returns {boolean | null | undefined}\n * Whether to allow `element` (default: `false`).\n */\n\n/**\n * @typedef ExtraProps\n * Extra fields we pass.\n * @property {Element | undefined} [node]\n * passed when `passNode` is on.\n */\n\n/**\n * @typedef {{\n * [Key in keyof JSX.IntrinsicElements]?: ComponentType | keyof JSX.IntrinsicElements\n * }} Components\n * Map tag names to components.\n */\n\n/**\n * @typedef Deprecation\n * Deprecation.\n * @property {string} from\n * Old field.\n * @property {string} id\n * ID in readme.\n * @property {keyof Options} [to]\n * New field.\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {AllowElement | null | undefined} [allowElement]\n * Filter elements (optional);\n * `allowedElements` / `disallowedElements` is used first.\n * @property {ReadonlyArray | null | undefined} [allowedElements]\n * Tag names to allow (default: all tag names);\n * cannot combine w/ `disallowedElements`.\n * @property {string | null | undefined} [children]\n * Markdown.\n * @property {Components | null | undefined} [components]\n * Map tag names to components.\n * @property {ReadonlyArray | null | undefined} [disallowedElements]\n * Tag names to disallow (default: `[]`);\n * cannot combine w/ `allowedElements`.\n * @property {PluggableList | null | undefined} [rehypePlugins]\n * List of rehype plugins to use.\n * @property {PluggableList | null | undefined} [remarkPlugins]\n * List of remark plugins to use.\n * @property {Readonly | null | undefined} [remarkRehypeOptions]\n * Options to pass through to `remark-rehype`.\n * @property {boolean | null | undefined} [skipHtml=false]\n * Ignore HTML in markdown completely (default: `false`).\n * @property {boolean | null | undefined} [unwrapDisallowed=false]\n * Extract (unwrap) what’s in disallowed elements (default: `false`);\n * normally when say `strong` is not allowed, it and it’s children are dropped,\n * with `unwrapDisallowed` the element itself is replaced by its children.\n * @property {UrlTransform | null | undefined} [urlTransform]\n * Change URLs (default: `defaultUrlTransform`)\n */\n\n/**\n * @typedef HooksOptionsOnly\n * Configuration specifically for {@linkcode MarkdownHooks}.\n * @property {ReactNode | null | undefined} [fallback]\n * Content to render while the processor processing the markdown (optional).\n */\n\n/**\n * @typedef {Options & HooksOptionsOnly} HooksOptions\n * Configuration for {@linkcode MarkdownHooks};\n * extends the regular {@linkcode Options} with a `fallback` prop.\n */\n\n/**\n * @callback UrlTransform\n * Transform all URLs.\n * @param {string} url\n * URL.\n * @param {string} key\n * Property name (example: `'href'`).\n * @param {Readonly} node\n * Node.\n * @returns {string | null | undefined}\n * Transformed URL (optional).\n */\n\nimport {unreachable} from 'devlop'\nimport {toJsxRuntime} from 'hast-util-to-jsx-runtime'\nimport {urlAttributes} from 'html-url-attributes'\nimport {Fragment, jsx, jsxs} from 'react/jsx-runtime'\nimport {useEffect, useState} from 'react'\nimport remarkParse from 'remark-parse'\nimport remarkRehype from 'remark-rehype'\nimport {unified} from 'unified'\nimport {visit} from 'unist-util-visit'\nimport {VFile} from 'vfile'\n\nconst changelog =\n 'https://github.com/remarkjs/react-markdown/blob/main/changelog.md'\n\n/** @type {PluggableList} */\nconst emptyPlugins = []\n/** @type {Readonly} */\nconst emptyRemarkRehypeOptions = {allowDangerousHtml: true}\nconst safeProtocol = /^(https?|ircs?|mailto|xmpp)$/i\n\n// Mutable because we `delete` any time it’s used and a message is sent.\n/** @type {ReadonlyArray>} */\nconst deprecations = [\n {from: 'astPlugins', id: 'remove-buggy-html-in-markdown-parser'},\n {from: 'allowDangerousHtml', id: 'remove-buggy-html-in-markdown-parser'},\n {\n from: 'allowNode',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes',\n to: 'allowElement'\n },\n {\n from: 'allowedTypes',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes',\n to: 'allowedElements'\n },\n {from: 'className', id: 'remove-classname'},\n {\n from: 'disallowedTypes',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes',\n to: 'disallowedElements'\n },\n {from: 'escapeHtml', id: 'remove-buggy-html-in-markdown-parser'},\n {from: 'includeElementIndex', id: '#remove-includeelementindex'},\n {\n from: 'includeNodeIndex',\n id: 'change-includenodeindex-to-includeelementindex'\n },\n {from: 'linkTarget', id: 'remove-linktarget'},\n {from: 'plugins', id: 'change-plugins-to-remarkplugins', to: 'remarkPlugins'},\n {from: 'rawSourcePos', id: '#remove-rawsourcepos'},\n {from: 'renderers', id: 'change-renderers-to-components', to: 'components'},\n {from: 'source', id: 'change-source-to-children', to: 'children'},\n {from: 'sourcePos', id: '#remove-sourcepos'},\n {from: 'transformImageUri', id: '#add-urltransform', to: 'urlTransform'},\n {from: 'transformLinkUri', id: '#add-urltransform', to: 'urlTransform'}\n]\n\n/**\n * Component to render markdown.\n *\n * This is a synchronous component.\n * When using async plugins,\n * see {@linkcode MarkdownAsync} or {@linkcode MarkdownHooks}.\n *\n * @param {Readonly} options\n * Props.\n * @returns {ReactElement}\n * React element.\n */\nexport function Markdown(options) {\n const processor = createProcessor(options)\n const file = createFile(options)\n return post(processor.runSync(processor.parse(file), file), options)\n}\n\n/**\n * Component to render markdown with support for async plugins\n * through async/await.\n *\n * Components returning promises are supported on the server.\n * For async support on the client,\n * see {@linkcode MarkdownHooks}.\n *\n * @param {Readonly} options\n * Props.\n * @returns {Promise}\n * Promise to a React element.\n */\nexport async function MarkdownAsync(options) {\n const processor = createProcessor(options)\n const file = createFile(options)\n const tree = await processor.run(processor.parse(file), file)\n return post(tree, options)\n}\n\n/**\n * Component to render markdown with support for async plugins through hooks.\n *\n * This uses `useEffect` and `useState` hooks.\n * Hooks run on the client and do not immediately render something.\n * For async support on the server,\n * see {@linkcode MarkdownAsync}.\n *\n * @param {Readonly} options\n * Props.\n * @returns {ReactNode}\n * React node.\n */\nexport function MarkdownHooks(options) {\n const processor = createProcessor(options)\n const [error, setError] = useState(\n /** @type {Error | undefined} */ (undefined)\n )\n const [tree, setTree] = useState(/** @type {Root | undefined} */ (undefined))\n\n useEffect(\n function () {\n let cancelled = false\n const file = createFile(options)\n\n processor.run(processor.parse(file), file, function (error, tree) {\n if (!cancelled) {\n setError(error)\n setTree(tree)\n }\n })\n\n /**\n * @returns {undefined}\n * Nothing.\n */\n return function () {\n cancelled = true\n }\n },\n [\n options.children,\n options.rehypePlugins,\n options.remarkPlugins,\n options.remarkRehypeOptions\n ]\n )\n\n if (error) throw error\n\n return tree ? post(tree, options) : options.fallback\n}\n\n/**\n * Set up the `unified` processor.\n *\n * @param {Readonly} options\n * Props.\n * @returns {Processor}\n * Result.\n */\nfunction createProcessor(options) {\n const rehypePlugins = options.rehypePlugins || emptyPlugins\n const remarkPlugins = options.remarkPlugins || emptyPlugins\n const remarkRehypeOptions = options.remarkRehypeOptions\n ? {...options.remarkRehypeOptions, ...emptyRemarkRehypeOptions}\n : emptyRemarkRehypeOptions\n\n const processor = unified()\n .use(remarkParse)\n .use(remarkPlugins)\n .use(remarkRehype, remarkRehypeOptions)\n .use(rehypePlugins)\n\n return processor\n}\n\n/**\n * Set up the virtual file.\n *\n * @param {Readonly} options\n * Props.\n * @returns {VFile}\n * Result.\n */\nfunction createFile(options) {\n const children = options.children || ''\n const file = new VFile()\n\n if (typeof children === 'string') {\n file.value = children\n } else {\n unreachable(\n 'Unexpected value `' +\n children +\n '` for `children` prop, expected `string`'\n )\n }\n\n return file\n}\n\n/**\n * Process the result from unified some more.\n *\n * @param {Nodes} tree\n * Tree.\n * @param {Readonly} options\n * Props.\n * @returns {ReactElement}\n * React element.\n */\nfunction post(tree, options) {\n const allowedElements = options.allowedElements\n const allowElement = options.allowElement\n const components = options.components\n const disallowedElements = options.disallowedElements\n const skipHtml = options.skipHtml\n const unwrapDisallowed = options.unwrapDisallowed\n const urlTransform = options.urlTransform || defaultUrlTransform\n\n for (const deprecation of deprecations) {\n if (Object.hasOwn(options, deprecation.from)) {\n unreachable(\n 'Unexpected `' +\n deprecation.from +\n '` prop, ' +\n (deprecation.to\n ? 'use `' + deprecation.to + '` instead'\n : 'remove it') +\n ' (see <' +\n changelog +\n '#' +\n deprecation.id +\n '> for more info)'\n )\n }\n }\n\n if (allowedElements && disallowedElements) {\n unreachable(\n 'Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other'\n )\n }\n\n visit(tree, transform)\n\n return toJsxRuntime(tree, {\n Fragment,\n components,\n ignoreInvalidStyle: true,\n jsx,\n jsxs,\n passKeys: true,\n passNode: true\n })\n\n /** @type {BuildVisitor} */\n function transform(node, index, parent) {\n if (node.type === 'raw' && parent && typeof index === 'number') {\n if (skipHtml) {\n parent.children.splice(index, 1)\n } else {\n parent.children[index] = {type: 'text', value: node.value}\n }\n\n return index\n }\n\n if (node.type === 'element') {\n /** @type {string} */\n let key\n\n for (key in urlAttributes) {\n if (\n Object.hasOwn(urlAttributes, key) &&\n Object.hasOwn(node.properties, key)\n ) {\n const value = node.properties[key]\n const test = urlAttributes[key]\n if (test === null || test.includes(node.tagName)) {\n node.properties[key] = urlTransform(String(value || ''), key, node)\n }\n }\n }\n }\n\n if (node.type === 'element') {\n let remove = allowedElements\n ? !allowedElements.includes(node.tagName)\n : disallowedElements\n ? disallowedElements.includes(node.tagName)\n : false\n\n if (!remove && allowElement && typeof index === 'number') {\n remove = !allowElement(node, index, parent)\n }\n\n if (remove && parent && typeof index === 'number') {\n if (unwrapDisallowed && node.children) {\n parent.children.splice(index, 1, ...node.children)\n } else {\n parent.children.splice(index, 1)\n }\n\n return index\n }\n }\n }\n}\n\n/**\n * Make a URL safe.\n *\n * @satisfies {UrlTransform}\n * @param {string} value\n * URL.\n * @returns {string}\n * Safe URL.\n */\nexport function defaultUrlTransform(value) {\n // Same as:\n // \n // But without the `encode` part.\n const colon = value.indexOf(':')\n const questionMark = value.indexOf('?')\n const numberSign = value.indexOf('#')\n const slash = value.indexOf('/')\n\n if (\n // If there is no protocol, it’s relative.\n colon === -1 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n (slash !== -1 && colon > slash) ||\n (questionMark !== -1 && colon > questionMark) ||\n (numberSign !== -1 && colon > numberSign) ||\n // It is a protocol, it should be allowed.\n safeProtocol.test(value.slice(0, colon))\n ) {\n return value\n }\n\n return ''\n}\n","/**\n * Count how often a character (or substring) is used in a string.\n *\n * @param {string} value\n * Value to search in.\n * @param {string} character\n * Character (or substring) to look for.\n * @return {number}\n * Number of times `character` occurred in `value`.\n */\nexport function ccount(value, character) {\n const source = String(value)\n\n if (typeof character !== 'string') {\n throw new TypeError('Expected character')\n }\n\n let count = 0\n let index = source.indexOf(character)\n\n while (index !== -1) {\n count++\n index = source.indexOf(character, index + character.length)\n }\n\n return count\n}\n","export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","/**\n * @import {Nodes, Parents, PhrasingContent, Root, Text} from 'mdast'\n * @import {BuildVisitor, Test, VisitorResult} from 'unist-util-visit-parents'\n */\n\n/**\n * @typedef RegExpMatchObject\n * Info on the match.\n * @property {number} index\n * The index of the search at which the result was found.\n * @property {string} input\n * A copy of the search string in the text node.\n * @property {[...Array, Text]} stack\n * All ancestors of the text node, where the last node is the text itself.\n *\n * @typedef {RegExp | string} Find\n * Pattern to find.\n *\n * Strings are escaped and then turned into global expressions.\n *\n * @typedef {Array} FindAndReplaceList\n * Several find and replaces, in array form.\n *\n * @typedef {[Find, Replace?]} FindAndReplaceTuple\n * Find and replace in tuple form.\n *\n * @typedef {ReplaceFunction | string | null | undefined} Replace\n * Thing to replace with.\n *\n * @callback ReplaceFunction\n * Callback called when a search matches.\n * @param {...any} parameters\n * The parameters are the result of corresponding search expression:\n *\n * * `value` (`string`) — whole match\n * * `...capture` (`Array`) — matches from regex capture groups\n * * `match` (`RegExpMatchObject`) — info on the match\n * @returns {Array | PhrasingContent | string | false | null | undefined}\n * Thing to replace with.\n *\n * * when `null`, `undefined`, `''`, remove the match\n * * …or when `false`, do not replace at all\n * * …or when `string`, replace with a text node of that value\n * * …or when `Node` or `Array`, replace with those nodes\n *\n * @typedef {[RegExp, ReplaceFunction]} Pair\n * Normalized find and replace.\n *\n * @typedef {Array} Pairs\n * All find and replaced.\n *\n * @typedef Options\n * Configuration.\n * @property {Test | null | undefined} [ignore]\n * Test for which nodes to ignore (optional).\n */\n\nimport escape from 'escape-string-regexp'\nimport {visitParents} from 'unist-util-visit-parents'\nimport {convert} from 'unist-util-is'\n\n/**\n * Find patterns in a tree and replace them.\n *\n * The algorithm searches the tree in *preorder* for complete values in `Text`\n * nodes.\n * Partial matches are not supported.\n *\n * @param {Nodes} tree\n * Tree to change.\n * @param {FindAndReplaceList | FindAndReplaceTuple} list\n * Patterns to find.\n * @param {Options | null | undefined} [options]\n * Configuration (when `find` is not `Find`).\n * @returns {undefined}\n * Nothing.\n */\nexport function findAndReplace(tree, list, options) {\n const settings = options || {}\n const ignored = convert(settings.ignore || [])\n const pairs = toPairs(list)\n let pairIndex = -1\n\n while (++pairIndex < pairs.length) {\n visitParents(tree, 'text', visitor)\n }\n\n /** @type {BuildVisitor} */\n function visitor(node, parents) {\n let index = -1\n /** @type {Parents | undefined} */\n let grandparent\n\n while (++index < parents.length) {\n const parent = parents[index]\n /** @type {Array | undefined} */\n const siblings = grandparent ? grandparent.children : undefined\n\n if (\n ignored(\n parent,\n siblings ? siblings.indexOf(parent) : undefined,\n grandparent\n )\n ) {\n return\n }\n\n grandparent = parent\n }\n\n if (grandparent) {\n return handler(node, parents)\n }\n }\n\n /**\n * Handle a text node which is not in an ignored parent.\n *\n * @param {Text} node\n * Text node.\n * @param {Array} parents\n * Parents.\n * @returns {VisitorResult}\n * Result.\n */\n function handler(node, parents) {\n const parent = parents[parents.length - 1]\n const find = pairs[pairIndex][0]\n const replace = pairs[pairIndex][1]\n let start = 0\n /** @type {Array} */\n const siblings = parent.children\n const index = siblings.indexOf(node)\n let change = false\n /** @type {Array} */\n let nodes = []\n\n find.lastIndex = 0\n\n let match = find.exec(node.value)\n\n while (match) {\n const position = match.index\n /** @type {RegExpMatchObject} */\n const matchObject = {\n index: match.index,\n input: match.input,\n stack: [...parents, node]\n }\n let value = replace(...match, matchObject)\n\n if (typeof value === 'string') {\n value = value.length > 0 ? {type: 'text', value} : undefined\n }\n\n // It wasn’t a match after all.\n if (value === false) {\n // False acts as if there was no match.\n // So we need to reset `lastIndex`, which currently being at the end of\n // the current match, to the beginning.\n find.lastIndex = position + 1\n } else {\n if (start !== position) {\n nodes.push({\n type: 'text',\n value: node.value.slice(start, position)\n })\n }\n\n if (Array.isArray(value)) {\n nodes.push(...value)\n } else if (value) {\n nodes.push(value)\n }\n\n start = position + match[0].length\n change = true\n }\n\n if (!find.global) {\n break\n }\n\n match = find.exec(node.value)\n }\n\n if (change) {\n if (start < node.value.length) {\n nodes.push({type: 'text', value: node.value.slice(start)})\n }\n\n parent.children.splice(index, 1, ...nodes)\n } else {\n nodes = [node]\n }\n\n return index + nodes.length\n }\n}\n\n/**\n * Turn a tuple or a list of tuples into pairs.\n *\n * @param {FindAndReplaceList | FindAndReplaceTuple} tupleOrList\n * Schema.\n * @returns {Pairs}\n * Clean pairs.\n */\nfunction toPairs(tupleOrList) {\n /** @type {Pairs} */\n const result = []\n\n if (!Array.isArray(tupleOrList)) {\n throw new TypeError('Expected find and replace tuple or list of tuples')\n }\n\n /** @type {FindAndReplaceList} */\n // @ts-expect-error: correct.\n const list =\n !tupleOrList[0] || Array.isArray(tupleOrList[0])\n ? tupleOrList\n : [tupleOrList]\n\n let index = -1\n\n while (++index < list.length) {\n const tuple = list[index]\n result.push([toExpression(tuple[0]), toFunction(tuple[1])])\n }\n\n return result\n}\n\n/**\n * Turn a find into an expression.\n *\n * @param {Find} find\n * Find.\n * @returns {RegExp}\n * Expression.\n */\nfunction toExpression(find) {\n return typeof find === 'string' ? new RegExp(escape(find), 'g') : find\n}\n\n/**\n * Turn a replace into a function.\n *\n * @param {Replace} replace\n * Replace.\n * @returns {ReplaceFunction}\n * Function.\n */\nfunction toFunction(replace) {\n return typeof replace === 'function'\n ? replace\n : function () {\n return replace\n }\n}\n","/**\n * @import {RegExpMatchObject, ReplaceFunction} from 'mdast-util-find-and-replace'\n * @import {CompileContext, Extension as FromMarkdownExtension, Handle as FromMarkdownHandle, Transform as FromMarkdownTransform} from 'mdast-util-from-markdown'\n * @import {ConstructName, Options as ToMarkdownExtension} from 'mdast-util-to-markdown'\n * @import {Link, PhrasingContent} from 'mdast'\n */\n\nimport {ccount} from 'ccount'\nimport {ok as assert} from 'devlop'\nimport {unicodePunctuation, unicodeWhitespace} from 'micromark-util-character'\nimport {findAndReplace} from 'mdast-util-find-and-replace'\n\n/** @type {ConstructName} */\nconst inConstruct = 'phrasing'\n/** @type {Array} */\nconst notInConstruct = ['autolink', 'link', 'image', 'label']\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralFromMarkdown() {\n return {\n transforms: [transformGfmAutolinkLiterals],\n enter: {\n literalAutolink: enterLiteralAutolink,\n literalAutolinkEmail: enterLiteralAutolinkValue,\n literalAutolinkHttp: enterLiteralAutolinkValue,\n literalAutolinkWww: enterLiteralAutolinkValue\n },\n exit: {\n literalAutolink: exitLiteralAutolink,\n literalAutolinkEmail: exitLiteralAutolinkEmail,\n literalAutolinkHttp: exitLiteralAutolinkHttp,\n literalAutolinkWww: exitLiteralAutolinkWww\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralToMarkdown() {\n return {\n unsafe: [\n {\n character: '@',\n before: '[+\\\\-.\\\\w]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: '.',\n before: '[Ww]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: ':',\n before: '[ps]',\n after: '\\\\/',\n inConstruct,\n notInConstruct\n }\n ]\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolink(token) {\n this.enter({type: 'link', title: null, url: '', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolinkValue(token) {\n this.config.enter.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkHttp(token) {\n this.config.exit.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkWww(token) {\n this.config.exit.data.call(this, token)\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'link')\n node.url = 'http://' + this.sliceSerialize(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkEmail(token) {\n this.config.exit.autolinkEmail.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolink(token) {\n this.exit(token)\n}\n\n/** @type {FromMarkdownTransform} */\nfunction transformGfmAutolinkLiterals(tree) {\n findAndReplace(\n tree,\n [\n [/(https?:\\/\\/|www(?=\\.))([-.\\w]+)([^ \\t\\r\\n]*)/gi, findUrl],\n [/(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)/gu, findEmail]\n ],\n {ignore: ['link', 'linkReference']}\n )\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} protocol\n * @param {string} domain\n * @param {string} path\n * @param {RegExpMatchObject} match\n * @returns {Array | Link | false}\n */\n// eslint-disable-next-line max-params\nfunction findUrl(_, protocol, domain, path, match) {\n let prefix = ''\n\n // Not an expected previous character.\n if (!previous(match)) {\n return false\n }\n\n // Treat `www` as part of the domain.\n if (/^w/i.test(protocol)) {\n domain = protocol + domain\n protocol = ''\n prefix = 'http://'\n }\n\n if (!isCorrectDomain(domain)) {\n return false\n }\n\n const parts = splitUrl(domain + path)\n\n if (!parts[0]) return false\n\n /** @type {Link} */\n const result = {\n type: 'link',\n title: null,\n url: prefix + protocol + parts[0],\n children: [{type: 'text', value: protocol + parts[0]}]\n }\n\n if (parts[1]) {\n return [result, {type: 'text', value: parts[1]}]\n }\n\n return result\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} atext\n * @param {string} label\n * @param {RegExpMatchObject} match\n * @returns {Link | false}\n */\nfunction findEmail(_, atext, label, match) {\n if (\n // Not an expected previous character.\n !previous(match, true) ||\n // Label ends in not allowed character.\n /[-\\d_]$/.test(label)\n ) {\n return false\n }\n\n return {\n type: 'link',\n title: null,\n url: 'mailto:' + atext + '@' + label,\n children: [{type: 'text', value: atext + '@' + label}]\n }\n}\n\n/**\n * @param {string} domain\n * @returns {boolean}\n */\nfunction isCorrectDomain(domain) {\n const parts = domain.split('.')\n\n if (\n parts.length < 2 ||\n (parts[parts.length - 1] &&\n (/_/.test(parts[parts.length - 1]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 1]))) ||\n (parts[parts.length - 2] &&\n (/_/.test(parts[parts.length - 2]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 2])))\n ) {\n return false\n }\n\n return true\n}\n\n/**\n * @param {string} url\n * @returns {[string, string | undefined]}\n */\nfunction splitUrl(url) {\n const trailExec = /[!\"&'),.:;<>?\\]}]+$/.exec(url)\n\n if (!trailExec) {\n return [url, undefined]\n }\n\n url = url.slice(0, trailExec.index)\n\n let trail = trailExec[0]\n let closingParenIndex = trail.indexOf(')')\n const openingParens = ccount(url, '(')\n let closingParens = ccount(url, ')')\n\n while (closingParenIndex !== -1 && openingParens > closingParens) {\n url += trail.slice(0, closingParenIndex + 1)\n trail = trail.slice(closingParenIndex + 1)\n closingParenIndex = trail.indexOf(')')\n closingParens++\n }\n\n return [url, trail]\n}\n\n/**\n * @param {RegExpMatchObject} match\n * @param {boolean | null | undefined} [email=false]\n * @returns {boolean}\n */\nfunction previous(match, email) {\n const code = match.input.charCodeAt(match.index - 1)\n\n return (\n (match.index === 0 ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)) &&\n // If it’s an email, the previous character should not be a slash.\n (!email || code !== 47)\n )\n}\n","/**\n * @import {\n * CompileContext,\n * Extension as FromMarkdownExtension,\n * Handle as FromMarkdownHandle\n * } from 'mdast-util-from-markdown'\n * @import {ToMarkdownOptions} from 'mdast-util-gfm-footnote'\n * @import {\n * Handle as ToMarkdownHandle,\n * Map,\n * Options as ToMarkdownExtension\n * } from 'mdast-util-to-markdown'\n * @import {FootnoteDefinition, FootnoteReference} from 'mdast'\n */\n\nimport {ok as assert} from 'devlop'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\n\nfootnoteReference.peek = footnoteReferencePeek\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCallString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCall(token) {\n this.enter({type: 'footnoteReference', identifier: '', label: ''}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinitionLabelString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinition(token) {\n this.enter(\n {type: 'footnoteDefinition', identifier: '', label: '', children: []},\n token\n )\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCallString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteReference')\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n node.label = label\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCall(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinitionLabelString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteDefinition')\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n node.label = label\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinition(token) {\n this.exit(token)\n}\n\n/** @type {ToMarkdownHandle} */\nfunction footnoteReferencePeek() {\n return '['\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {FootnoteReference} node\n */\nfunction footnoteReference(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteReference')\n const subexit = state.enter('reference')\n value += tracker.move(\n state.safe(state.associationId(node), {after: ']', before: value})\n )\n subexit()\n exit()\n value += tracker.move(']')\n return value\n}\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown`.\n */\nexport function gfmFootnoteFromMarkdown() {\n return {\n enter: {\n gfmFootnoteCallString: enterFootnoteCallString,\n gfmFootnoteCall: enterFootnoteCall,\n gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: enterFootnoteDefinition\n },\n exit: {\n gfmFootnoteCallString: exitFootnoteCallString,\n gfmFootnoteCall: exitFootnoteCall,\n gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: exitFootnoteDefinition\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @param {ToMarkdownOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown`.\n */\nexport function gfmFootnoteToMarkdown(options) {\n // To do: next major: change default.\n let firstLineBlank = false\n\n if (options && options.firstLineBlank) {\n firstLineBlank = true\n }\n\n return {\n handlers: {footnoteDefinition, footnoteReference},\n // This is on by default already.\n unsafe: [{character: '[', inConstruct: ['label', 'phrasing', 'reference']}]\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {FootnoteDefinition} node\n */\n function footnoteDefinition(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteDefinition')\n const subexit = state.enter('label')\n value += tracker.move(\n state.safe(state.associationId(node), {before: value, after: ']'})\n )\n subexit()\n\n value += tracker.move(']:')\n\n if (node.children && node.children.length > 0) {\n tracker.shift(4)\n\n value += tracker.move(\n (firstLineBlank ? '\\n' : ' ') +\n state.indentLines(\n state.containerFlow(node, tracker.current()),\n firstLineBlank ? mapAll : mapExceptFirst\n )\n )\n }\n\n exit()\n\n return value\n }\n}\n\n/** @type {Map} */\nfunction mapExceptFirst(line, index, blank) {\n return index === 0 ? line : mapAll(line, index, blank)\n}\n\n/** @type {Map} */\nfunction mapAll(line, index, blank) {\n return (blank ? '' : ' ') + line\n}\n","/**\n * @typedef {import('mdast').Delete} Delete\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n */\n\n/**\n * List of constructs that occur in phrasing (paragraphs, headings), but cannot\n * contain strikethrough.\n * So they sort of cancel each other out.\n * Note: could use a better name.\n *\n * Note: keep in sync with: \n *\n * @type {Array}\n */\nconst constructsWithoutStrikethrough = [\n 'autolink',\n 'destinationLiteral',\n 'destinationRaw',\n 'reference',\n 'titleQuote',\n 'titleApostrophe'\n]\n\nhandleDelete.peek = peekDelete\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughFromMarkdown() {\n return {\n canContainEols: ['delete'],\n enter: {strikethrough: enterStrikethrough},\n exit: {strikethrough: exitStrikethrough}\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughToMarkdown() {\n return {\n unsafe: [\n {\n character: '~',\n inConstruct: 'phrasing',\n notInConstruct: constructsWithoutStrikethrough\n }\n ],\n handlers: {delete: handleDelete}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterStrikethrough(token) {\n this.enter({type: 'delete', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitStrikethrough(token) {\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {Delete} node\n */\nfunction handleDelete(node, _, state, info) {\n const tracker = state.createTracker(info)\n const exit = state.enter('strikethrough')\n let value = tracker.move('~~')\n value += state.containerPhrasing(node, {\n ...tracker.current(),\n before: value,\n after: '~'\n })\n value += tracker.move('~~')\n exit()\n return value\n}\n\n/** @type {ToMarkdownHandle} */\nfunction peekDelete() {\n return '~'\n}\n","// To do: next major: remove.\n/**\n * @typedef {Options} MarkdownTableOptions\n * Configuration.\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [alignDelimiters=true]\n * Whether to align the delimiters (default: `true`);\n * they are aligned by default:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * Pass `false` to make them staggered:\n *\n * ```markdown\n * | Alpha | B |\n * | - | - |\n * | C | Delta |\n * ```\n * @property {ReadonlyArray | string | null | undefined} [align]\n * How to align columns (default: `''`);\n * one style for all columns or styles for their respective columns;\n * each style is either `'l'` (left), `'r'` (right), or `'c'` (center);\n * other values are treated as `''`, which doesn’t place the colon in the\n * alignment row but does align left;\n * *only the lowercased first character is used, so `Right` is fine.*\n * @property {boolean | null | undefined} [delimiterEnd=true]\n * Whether to end each row with the delimiter (default: `true`).\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are ending delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no ending delimiters:\n *\n * ```markdown\n * | Alpha | B\n * | ----- | -----\n * | C | Delta\n * ```\n * @property {boolean | null | undefined} [delimiterStart=true]\n * Whether to begin each row with the delimiter (default: `true`).\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are starting delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no starting delimiters:\n *\n * ```markdown\n * Alpha | B |\n * ----- | ----- |\n * C | Delta |\n * ```\n * @property {boolean | null | undefined} [padding=true]\n * Whether to add a space of padding between delimiters and cells\n * (default: `true`).\n *\n * When `true`, there is padding:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there is no padding:\n *\n * ```markdown\n * |Alpha|B |\n * |-----|-----|\n * |C |Delta|\n * ```\n * @property {((value: string) => number) | null | undefined} [stringLength]\n * Function to detect the length of table cell content (optional);\n * this is used when aligning the delimiters (`|`) between table cells;\n * full-width characters and emoji mess up delimiter alignment when viewing\n * the markdown source;\n * to fix this, you can pass this function,\n * which receives the cell content and returns its “visible” size;\n * note that what is and isn’t visible depends on where the text is displayed.\n *\n * Without such a function, the following:\n *\n * ```js\n * markdownTable([\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩‍❤️‍👩', 'Delta']\n * ])\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | - | - |\n * | 中文 | Charlie |\n * | 👩‍❤️‍👩 | Delta |\n * ```\n *\n * With [`string-width`](https://github.com/sindresorhus/string-width):\n *\n * ```js\n * import stringWidth from 'string-width'\n *\n * markdownTable(\n * [\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩‍❤️‍👩', 'Delta']\n * ],\n * {stringLength: stringWidth}\n * )\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | ----- | ------- |\n * | 中文 | Charlie |\n * | 👩‍❤️‍👩 | Delta |\n * ```\n */\n\n/**\n * @param {string} value\n * Cell value.\n * @returns {number}\n * Cell size.\n */\nfunction defaultStringLength(value) {\n return value.length\n}\n\n/**\n * Generate a markdown\n * ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables))\n * table.\n *\n * @param {ReadonlyArray>} table\n * Table data (matrix of strings).\n * @param {Readonly | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Result.\n */\nexport function markdownTable(table, options) {\n const settings = options || {}\n // To do: next major: change to spread.\n const align = (settings.align || []).concat()\n const stringLength = settings.stringLength || defaultStringLength\n /** @type {Array} Character codes as symbols for alignment per column. */\n const alignments = []\n /** @type {Array>} Cells per row. */\n const cellMatrix = []\n /** @type {Array>} Sizes of each cell per row. */\n const sizeMatrix = []\n /** @type {Array} */\n const longestCellByColumn = []\n let mostCellsPerRow = 0\n let rowIndex = -1\n\n // This is a superfluous loop if we don’t align delimiters, but otherwise we’d\n // do superfluous work when aligning, so optimize for aligning.\n while (++rowIndex < table.length) {\n /** @type {Array} */\n const row = []\n /** @type {Array} */\n const sizes = []\n let columnIndex = -1\n\n if (table[rowIndex].length > mostCellsPerRow) {\n mostCellsPerRow = table[rowIndex].length\n }\n\n while (++columnIndex < table[rowIndex].length) {\n const cell = serialize(table[rowIndex][columnIndex])\n\n if (settings.alignDelimiters !== false) {\n const size = stringLength(cell)\n sizes[columnIndex] = size\n\n if (\n longestCellByColumn[columnIndex] === undefined ||\n size > longestCellByColumn[columnIndex]\n ) {\n longestCellByColumn[columnIndex] = size\n }\n }\n\n row.push(cell)\n }\n\n cellMatrix[rowIndex] = row\n sizeMatrix[rowIndex] = sizes\n }\n\n // Figure out which alignments to use.\n let columnIndex = -1\n\n if (typeof align === 'object' && 'length' in align) {\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = toAlignment(align[columnIndex])\n }\n } else {\n const code = toAlignment(align)\n\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = code\n }\n }\n\n // Inject the alignment row.\n columnIndex = -1\n /** @type {Array} */\n const row = []\n /** @type {Array} */\n const sizes = []\n\n while (++columnIndex < mostCellsPerRow) {\n const code = alignments[columnIndex]\n let before = ''\n let after = ''\n\n if (code === 99 /* `c` */) {\n before = ':'\n after = ':'\n } else if (code === 108 /* `l` */) {\n before = ':'\n } else if (code === 114 /* `r` */) {\n after = ':'\n }\n\n // There *must* be at least one hyphen-minus in each alignment cell.\n let size =\n settings.alignDelimiters === false\n ? 1\n : Math.max(\n 1,\n longestCellByColumn[columnIndex] - before.length - after.length\n )\n\n const cell = before + '-'.repeat(size) + after\n\n if (settings.alignDelimiters !== false) {\n size = before.length + size + after.length\n\n if (size > longestCellByColumn[columnIndex]) {\n longestCellByColumn[columnIndex] = size\n }\n\n sizes[columnIndex] = size\n }\n\n row[columnIndex] = cell\n }\n\n // Inject the alignment row.\n cellMatrix.splice(1, 0, row)\n sizeMatrix.splice(1, 0, sizes)\n\n rowIndex = -1\n /** @type {Array} */\n const lines = []\n\n while (++rowIndex < cellMatrix.length) {\n const row = cellMatrix[rowIndex]\n const sizes = sizeMatrix[rowIndex]\n columnIndex = -1\n /** @type {Array} */\n const line = []\n\n while (++columnIndex < mostCellsPerRow) {\n const cell = row[columnIndex] || ''\n let before = ''\n let after = ''\n\n if (settings.alignDelimiters !== false) {\n const size =\n longestCellByColumn[columnIndex] - (sizes[columnIndex] || 0)\n const code = alignments[columnIndex]\n\n if (code === 114 /* `r` */) {\n before = ' '.repeat(size)\n } else if (code === 99 /* `c` */) {\n if (size % 2) {\n before = ' '.repeat(size / 2 + 0.5)\n after = ' '.repeat(size / 2 - 0.5)\n } else {\n before = ' '.repeat(size / 2)\n after = before\n }\n } else {\n after = ' '.repeat(size)\n }\n }\n\n if (settings.delimiterStart !== false && !columnIndex) {\n line.push('|')\n }\n\n if (\n settings.padding !== false &&\n // Don’t add the opening space if we’re not aligning and the cell is\n // empty: there will be a closing space.\n !(settings.alignDelimiters === false && cell === '') &&\n (settings.delimiterStart !== false || columnIndex)\n ) {\n line.push(' ')\n }\n\n if (settings.alignDelimiters !== false) {\n line.push(before)\n }\n\n line.push(cell)\n\n if (settings.alignDelimiters !== false) {\n line.push(after)\n }\n\n if (settings.padding !== false) {\n line.push(' ')\n }\n\n if (\n settings.delimiterEnd !== false ||\n columnIndex !== mostCellsPerRow - 1\n ) {\n line.push('|')\n }\n }\n\n lines.push(\n settings.delimiterEnd === false\n ? line.join('').replace(/ +$/, '')\n : line.join('')\n )\n }\n\n return lines.join('\\n')\n}\n\n/**\n * @param {string | null | undefined} [value]\n * Value to serialize.\n * @returns {string}\n * Result.\n */\nfunction serialize(value) {\n return value === null || value === undefined ? '' : String(value)\n}\n\n/**\n * @param {string | null | undefined} value\n * Value.\n * @returns {number}\n * Alignment.\n */\nfunction toAlignment(value) {\n const code = typeof value === 'string' ? value.codePointAt(0) : 0\n\n return code === 67 /* `C` */ || code === 99 /* `c` */\n ? 99 /* `c` */\n : code === 76 /* `L` */ || code === 108 /* `l` */\n ? 108 /* `l` */\n : code === 82 /* `R` */ || code === 114 /* `r` */\n ? 114 /* `r` */\n : 0\n}\n","/**\n * @import {Blockquote, Parents} from 'mdast'\n * @import {Info, Map, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {Blockquote} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function blockquote(node, _, state, info) {\n const exit = state.enter('blockquote')\n const tracker = state.createTracker(info)\n tracker.move('> ')\n tracker.shift(2)\n const value = state.indentLines(\n state.containerFlow(node, tracker.current()),\n map\n )\n exit()\n return value\n}\n\n/** @type {Map} */\nfunction map(line, _, blank) {\n return '>' + (blank ? '' : ' ') + line\n}\n","/**\n * @import {ConstructName, Unsafe} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {Array} stack\n * @param {Unsafe} pattern\n * @returns {boolean}\n */\nexport function patternInScope(stack, pattern) {\n return (\n listInScope(stack, pattern.inConstruct, true) &&\n !listInScope(stack, pattern.notInConstruct, false)\n )\n}\n\n/**\n * @param {Array} stack\n * @param {Unsafe['inConstruct']} list\n * @param {boolean} none\n * @returns {boolean}\n */\nfunction listInScope(stack, list, none) {\n if (typeof list === 'string') {\n list = [list]\n }\n\n if (!list || list.length === 0) {\n return none\n }\n\n let index = -1\n\n while (++index < list.length) {\n if (stack.includes(list[index])) {\n return true\n }\n }\n\n return false\n}\n","/**\n * @import {Break, Parents} from 'mdast'\n * @import {Info, State} from 'mdast-util-to-markdown'\n */\n\nimport {patternInScope} from '../util/pattern-in-scope.js'\n\n/**\n * @param {Break} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function hardBreak(_, _1, state, info) {\n let index = -1\n\n while (++index < state.unsafe.length) {\n // If we can’t put eols in this construct (setext headings, tables), use a\n // space instead.\n if (\n state.unsafe[index].character === '\\n' &&\n patternInScope(state.stack, state.unsafe[index])\n ) {\n return /[ \\t]/.test(info.before) ? '' : ' '\n }\n }\n\n return '\\\\\\n'\n}\n","/**\n * Get the count of the longest repeating streak of `substring` in `value`.\n *\n * @param {string} value\n * Content to search in.\n * @param {string} substring\n * Substring to look for, typically one character.\n * @returns {number}\n * Count of most frequent adjacent `substring`s in `value`.\n */\nexport function longestStreak(value, substring) {\n const source = String(value)\n let index = source.indexOf(substring)\n let expected = index\n let count = 0\n let max = 0\n\n if (typeof substring !== 'string') {\n throw new TypeError('Expected substring')\n }\n\n while (index !== -1) {\n if (index === expected) {\n if (++count > max) {\n max = count\n }\n } else {\n count = 1\n }\n\n expected = index + substring.length\n index = source.indexOf(substring, expected)\n }\n\n return max\n}\n","/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {Code} from 'mdast'\n */\n\n/**\n * @param {Code} node\n * @param {State} state\n * @returns {boolean}\n */\nexport function formatCodeAsIndented(node, state) {\n return Boolean(\n state.options.fences === false &&\n node.value &&\n // If there’s no info…\n !node.lang &&\n // And there’s a non-whitespace character…\n /[^ \\r\\n]/.test(node.value) &&\n // And the value doesn’t start or end in a blank…\n !/^[\\t ]*(?:[\\r\\n]|$)|(?:^|[\\r\\n])[\\t ]*$/.test(node.value)\n )\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkFence(state) {\n const marker = state.options.fence || '`'\n\n if (marker !== '`' && marker !== '~') {\n throw new Error(\n 'Cannot serialize code with `' +\n marker +\n '` for `options.fence`, expected `` ` `` or `~`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Info, Map, State} from 'mdast-util-to-markdown'\n * @import {Code, Parents} from 'mdast'\n */\n\nimport {longestStreak} from 'longest-streak'\nimport {formatCodeAsIndented} from '../util/format-code-as-indented.js'\nimport {checkFence} from '../util/check-fence.js'\n\n/**\n * @param {Code} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function code(node, _, state, info) {\n const marker = checkFence(state)\n const raw = node.value || ''\n const suffix = marker === '`' ? 'GraveAccent' : 'Tilde'\n\n if (formatCodeAsIndented(node, state)) {\n const exit = state.enter('codeIndented')\n const value = state.indentLines(raw, map)\n exit()\n return value\n }\n\n const tracker = state.createTracker(info)\n const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3))\n const exit = state.enter('codeFenced')\n let value = tracker.move(sequence)\n\n if (node.lang) {\n const subexit = state.enter(`codeFencedLang${suffix}`)\n value += tracker.move(\n state.safe(node.lang, {\n before: value,\n after: ' ',\n encode: ['`'],\n ...tracker.current()\n })\n )\n subexit()\n }\n\n if (node.lang && node.meta) {\n const subexit = state.enter(`codeFencedMeta${suffix}`)\n value += tracker.move(' ')\n value += tracker.move(\n state.safe(node.meta, {\n before: value,\n after: '\\n',\n encode: ['`'],\n ...tracker.current()\n })\n )\n subexit()\n }\n\n value += tracker.move('\\n')\n\n if (raw) {\n value += tracker.move(raw + '\\n')\n }\n\n value += tracker.move(sequence)\n exit()\n return value\n}\n\n/** @type {Map} */\nfunction map(line, _, blank) {\n return (blank ? '' : ' ') + line\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkQuote(state) {\n const marker = state.options.quote || '\"'\n\n if (marker !== '\"' && marker !== \"'\") {\n throw new Error(\n 'Cannot serialize title with `' +\n marker +\n '` for `options.quote`, expected `\"`, or `\\'`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Definition, Parents} from 'mdast'\n */\n\nimport {checkQuote} from '../util/check-quote.js'\n\n/**\n * @param {Definition} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function definition(node, _, state, info) {\n const quote = checkQuote(state)\n const suffix = quote === '\"' ? 'Quote' : 'Apostrophe'\n const exit = state.enter('definition')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('[')\n value += tracker.move(\n state.safe(state.associationId(node), {\n before: value,\n after: ']',\n ...tracker.current()\n })\n )\n value += tracker.move(']: ')\n\n subexit()\n\n if (\n // If there’s no url, or…\n !node.url ||\n // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node.url)\n ) {\n subexit = state.enter('destinationLiteral')\n value += tracker.move('<')\n value += tracker.move(\n state.safe(node.url, {before: value, after: '>', ...tracker.current()})\n )\n value += tracker.move('>')\n } else {\n // No whitespace, raw is prettier.\n subexit = state.enter('destinationRaw')\n value += tracker.move(\n state.safe(node.url, {\n before: value,\n after: node.title ? ' ' : '\\n',\n ...tracker.current()\n })\n )\n }\n\n subexit()\n\n if (node.title) {\n subexit = state.enter(`title${suffix}`)\n value += tracker.move(' ' + quote)\n value += tracker.move(\n state.safe(node.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n )\n value += tracker.move(quote)\n subexit()\n }\n\n exit()\n\n return value\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkEmphasis(state) {\n const marker = state.options.emphasis || '*'\n\n if (marker !== '*' && marker !== '_') {\n throw new Error(\n 'Cannot serialize emphasis with `' +\n marker +\n '` for `options.emphasis`, expected `*`, or `_`'\n )\n }\n\n return marker\n}\n","/**\n * Encode a code point as a character reference.\n *\n * @param {number} code\n * Code point to encode.\n * @returns {string}\n * Encoded character reference.\n */\nexport function encodeCharacterReference(code) {\n return '&#x' + code.toString(16).toUpperCase() + ';'\n}\n","/**\n * @import {EncodeSides} from '../types.js'\n */\n\nimport {classifyCharacter} from 'micromark-util-classify-character'\n\n/**\n * Check whether to encode (as a character reference) the characters\n * surrounding an attention run.\n *\n * Which characters are around an attention run influence whether it works or\n * not.\n *\n * See for more info.\n * See this markdown in a particular renderer to see what works:\n *\n * ```markdown\n * | | A (letter inside) | B (punctuation inside) | C (whitespace inside) | D (nothing inside) |\n * | ----------------------- | ----------------- | ---------------------- | --------------------- | ------------------ |\n * | 1 (letter outside) | x*y*z | x*.*z | x* *z | x**z |\n * | 2 (punctuation outside) | .*y*. | .*.*. | .* *. | .**. |\n * | 3 (whitespace outside) | x *y* z | x *.* z | x * * z | x ** z |\n * | 4 (nothing outside) | *x* | *.* | * * | ** |\n * ```\n *\n * @param {number} outside\n * Code point on the outer side of the run.\n * @param {number} inside\n * Code point on the inner side of the run.\n * @param {'*' | '_'} marker\n * Marker of the run.\n * Underscores are handled more strictly (they form less often) than\n * asterisks.\n * @returns {EncodeSides}\n * Whether to encode characters.\n */\n// Important: punctuation must never be encoded.\n// Punctuation is solely used by markdown constructs.\n// And by encoding itself.\n// Encoding them will break constructs or double encode things.\nexport function encodeInfo(outside, inside, marker) {\n const outsideKind = classifyCharacter(outside)\n const insideKind = classifyCharacter(inside)\n\n // Letter outside:\n if (outsideKind === undefined) {\n return insideKind === undefined\n ? // Letter inside:\n // we have to encode *both* letters for `_` as it is looser.\n // it already forms for `*` (and GFMs `~`).\n marker === '_'\n ? {inside: true, outside: true}\n : {inside: false, outside: false}\n : insideKind === 1\n ? // Whitespace inside: encode both (letter, whitespace).\n {inside: true, outside: true}\n : // Punctuation inside: encode outer (letter)\n {inside: false, outside: true}\n }\n\n // Whitespace outside:\n if (outsideKind === 1) {\n return insideKind === undefined\n ? // Letter inside: already forms.\n {inside: false, outside: false}\n : insideKind === 1\n ? // Whitespace inside: encode both (whitespace).\n {inside: true, outside: true}\n : // Punctuation inside: already forms.\n {inside: false, outside: false}\n }\n\n // Punctuation outside:\n return insideKind === undefined\n ? // Letter inside: already forms.\n {inside: false, outside: false}\n : insideKind === 1\n ? // Whitespace inside: encode inner (whitespace).\n {inside: true, outside: false}\n : // Punctuation inside: already forms.\n {inside: false, outside: false}\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Emphasis, Parents} from 'mdast'\n */\n\nimport {checkEmphasis} from '../util/check-emphasis.js'\nimport {encodeCharacterReference} from '../util/encode-character-reference.js'\nimport {encodeInfo} from '../util/encode-info.js'\n\nemphasis.peek = emphasisPeek\n\n/**\n * @param {Emphasis} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function emphasis(node, _, state, info) {\n const marker = checkEmphasis(state)\n const exit = state.enter('emphasis')\n const tracker = state.createTracker(info)\n const before = tracker.move(marker)\n\n let between = tracker.move(\n state.containerPhrasing(node, {\n after: marker,\n before,\n ...tracker.current()\n })\n )\n const betweenHead = between.charCodeAt(0)\n const open = encodeInfo(\n info.before.charCodeAt(info.before.length - 1),\n betweenHead,\n marker\n )\n\n if (open.inside) {\n between = encodeCharacterReference(betweenHead) + between.slice(1)\n }\n\n const betweenTail = between.charCodeAt(between.length - 1)\n const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker)\n\n if (close.inside) {\n between = between.slice(0, -1) + encodeCharacterReference(betweenTail)\n }\n\n const after = tracker.move(marker)\n\n exit()\n\n state.attentionEncodeSurroundingInfo = {\n after: close.outside,\n before: open.outside\n }\n return before + between + after\n}\n\n/**\n * @param {Emphasis} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @returns {string}\n */\nfunction emphasisPeek(_, _1, state) {\n return state.options.emphasis || '*'\n}\n","/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {Heading} from 'mdast'\n */\n\nimport {EXIT, visit} from 'unist-util-visit'\nimport {toString} from 'mdast-util-to-string'\n\n/**\n * @param {Heading} node\n * @param {State} state\n * @returns {boolean}\n */\nexport function formatHeadingAsSetext(node, state) {\n let literalWithBreak = false\n\n // Look for literals with a line break.\n // Note that this also\n visit(node, function (node) {\n if (\n ('value' in node && /\\r?\\n|\\r/.test(node.value)) ||\n node.type === 'break'\n ) {\n literalWithBreak = true\n return EXIT\n }\n })\n\n return Boolean(\n (!node.depth || node.depth < 3) &&\n toString(node) &&\n (state.options.setext || literalWithBreak)\n )\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Heading, Parents} from 'mdast'\n */\n\nimport {encodeCharacterReference} from '../util/encode-character-reference.js'\nimport {formatHeadingAsSetext} from '../util/format-heading-as-setext.js'\n\n/**\n * @param {Heading} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function heading(node, _, state, info) {\n const rank = Math.max(Math.min(6, node.depth || 1), 1)\n const tracker = state.createTracker(info)\n\n if (formatHeadingAsSetext(node, state)) {\n const exit = state.enter('headingSetext')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, {\n ...tracker.current(),\n before: '\\n',\n after: '\\n'\n })\n subexit()\n exit()\n\n return (\n value +\n '\\n' +\n (rank === 1 ? '=' : '-').repeat(\n // The whole size…\n value.length -\n // Minus the position of the character after the last EOL (or\n // 0 if there is none)…\n (Math.max(value.lastIndexOf('\\r'), value.lastIndexOf('\\n')) + 1)\n )\n )\n }\n\n const sequence = '#'.repeat(rank)\n const exit = state.enter('headingAtx')\n const subexit = state.enter('phrasing')\n\n // Note: for proper tracking, we should reset the output positions when there\n // is no content returned, because then the space is not output.\n // Practically, in that case, there is no content, so it doesn’t matter that\n // we’ve tracked one too many characters.\n tracker.move(sequence + ' ')\n\n let value = state.containerPhrasing(node, {\n before: '# ',\n after: '\\n',\n ...tracker.current()\n })\n\n if (/^[\\t ]/.test(value)) {\n // To do: what effect has the character reference on tracking?\n value = encodeCharacterReference(value.charCodeAt(0)) + value.slice(1)\n }\n\n value = value ? sequence + ' ' + value : sequence\n\n if (state.options.closeAtx) {\n value += ' ' + sequence\n }\n\n subexit()\n exit()\n\n return value\n}\n","/**\n * @import {Html} from 'mdast'\n */\n\nhtml.peek = htmlPeek\n\n/**\n * @param {Html} node\n * @returns {string}\n */\nexport function html(node) {\n return node.value || ''\n}\n\n/**\n * @returns {string}\n */\nfunction htmlPeek() {\n return '<'\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Image, Parents} from 'mdast'\n */\n\nimport {checkQuote} from '../util/check-quote.js'\n\nimage.peek = imagePeek\n\n/**\n * @param {Image} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function image(node, _, state, info) {\n const quote = checkQuote(state)\n const suffix = quote === '\"' ? 'Quote' : 'Apostrophe'\n const exit = state.enter('image')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('![')\n value += tracker.move(\n state.safe(node.alt, {before: value, after: ']', ...tracker.current()})\n )\n value += tracker.move('](')\n\n subexit()\n\n if (\n // If there’s no url but there is a title…\n (!node.url && node.title) ||\n // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node.url)\n ) {\n subexit = state.enter('destinationLiteral')\n value += tracker.move('<')\n value += tracker.move(\n state.safe(node.url, {before: value, after: '>', ...tracker.current()})\n )\n value += tracker.move('>')\n } else {\n // No whitespace, raw is prettier.\n subexit = state.enter('destinationRaw')\n value += tracker.move(\n state.safe(node.url, {\n before: value,\n after: node.title ? ' ' : ')',\n ...tracker.current()\n })\n )\n }\n\n subexit()\n\n if (node.title) {\n subexit = state.enter(`title${suffix}`)\n value += tracker.move(' ' + quote)\n value += tracker.move(\n state.safe(node.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n )\n value += tracker.move(quote)\n subexit()\n }\n\n value += tracker.move(')')\n exit()\n\n return value\n}\n\n/**\n * @returns {string}\n */\nfunction imagePeek() {\n return '!'\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {ImageReference, Parents} from 'mdast'\n */\n\nimageReference.peek = imageReferencePeek\n\n/**\n * @param {ImageReference} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function imageReference(node, _, state, info) {\n const type = node.referenceType\n const exit = state.enter('imageReference')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('![')\n const alt = state.safe(node.alt, {\n before: value,\n after: ']',\n ...tracker.current()\n })\n value += tracker.move(alt + '][')\n\n subexit()\n // Hide the fact that we’re in phrasing, because escapes don’t work.\n const stack = state.stack\n state.stack = []\n subexit = state.enter('reference')\n // Note: for proper tracking, we should reset the output positions when we end\n // up making a `shortcut` reference, because then there is no brace output.\n // Practically, in that case, there is no content, so it doesn’t matter that\n // we’ve tracked one too many characters.\n const reference = state.safe(state.associationId(node), {\n before: value,\n after: ']',\n ...tracker.current()\n })\n subexit()\n state.stack = stack\n exit()\n\n if (type === 'full' || !alt || alt !== reference) {\n value += tracker.move(reference + ']')\n } else if (type === 'shortcut') {\n // Remove the unwanted `[`.\n value = value.slice(0, -1)\n } else {\n value += tracker.move(']')\n }\n\n return value\n}\n\n/**\n * @returns {string}\n */\nfunction imageReferencePeek() {\n return '!'\n}\n","/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {InlineCode, Parents} from 'mdast'\n */\n\ninlineCode.peek = inlineCodePeek\n\n/**\n * @param {InlineCode} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @returns {string}\n */\nexport function inlineCode(node, _, state) {\n let value = node.value || ''\n let sequence = '`'\n let index = -1\n\n // If there is a single grave accent on its own in the code, use a fence of\n // two.\n // If there are two in a row, use one.\n while (new RegExp('(^|[^`])' + sequence + '([^`]|$)').test(value)) {\n sequence += '`'\n }\n\n // If this is not just spaces or eols (tabs don’t count), and either the\n // first or last character are a space, eol, or tick, then pad with spaces.\n if (\n /[^ \\r\\n]/.test(value) &&\n ((/^[ \\r\\n]/.test(value) && /[ \\r\\n]$/.test(value)) || /^`|`$/.test(value))\n ) {\n value = ' ' + value + ' '\n }\n\n // We have a potential problem: certain characters after eols could result in\n // blocks being seen.\n // For example, if someone injected the string `'\\n# b'`, then that would\n // result in an ATX heading.\n // We can’t escape characters in `inlineCode`, but because eols are\n // transformed to spaces when going from markdown to HTML anyway, we can swap\n // them out.\n while (++index < state.unsafe.length) {\n const pattern = state.unsafe[index]\n const expression = state.compilePattern(pattern)\n /** @type {RegExpExecArray | null} */\n let match\n\n // Only look for `atBreak`s.\n // Btw: note that `atBreak` patterns will always start the regex at LF or\n // CR.\n if (!pattern.atBreak) continue\n\n while ((match = expression.exec(value))) {\n let position = match.index\n\n // Support CRLF (patterns only look for one of the characters).\n if (\n value.charCodeAt(position) === 10 /* `\\n` */ &&\n value.charCodeAt(position - 1) === 13 /* `\\r` */\n ) {\n position--\n }\n\n value = value.slice(0, position) + ' ' + value.slice(match.index + 1)\n }\n }\n\n return sequence + value + sequence\n}\n\n/**\n * @returns {string}\n */\nfunction inlineCodePeek() {\n return '`'\n}\n","/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {Link} from 'mdast'\n */\n\nimport {toString} from 'mdast-util-to-string'\n\n/**\n * @param {Link} node\n * @param {State} state\n * @returns {boolean}\n */\nexport function formatLinkAsAutolink(node, state) {\n const raw = toString(node)\n\n return Boolean(\n !state.options.resourceLink &&\n // If there’s a url…\n node.url &&\n // And there’s a no title…\n !node.title &&\n // And the content of `node` is a single text node…\n node.children &&\n node.children.length === 1 &&\n node.children[0].type === 'text' &&\n // And if the url is the same as the content…\n (raw === node.url || 'mailto:' + raw === node.url) &&\n // And that starts w/ a protocol…\n /^[a-z][a-z+.-]+:/i.test(node.url) &&\n // And that doesn’t contain ASCII control codes (character escapes and\n // references don’t work), space, or angle brackets…\n !/[\\0- <>\\u007F]/.test(node.url)\n )\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Link, Parents} from 'mdast'\n * @import {Exit} from '../types.js'\n */\n\nimport {checkQuote} from '../util/check-quote.js'\nimport {formatLinkAsAutolink} from '../util/format-link-as-autolink.js'\n\nlink.peek = linkPeek\n\n/**\n * @param {Link} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function link(node, _, state, info) {\n const quote = checkQuote(state)\n const suffix = quote === '\"' ? 'Quote' : 'Apostrophe'\n const tracker = state.createTracker(info)\n /** @type {Exit} */\n let exit\n /** @type {Exit} */\n let subexit\n\n if (formatLinkAsAutolink(node, state)) {\n // Hide the fact that we’re in phrasing, because escapes don’t work.\n const stack = state.stack\n state.stack = []\n exit = state.enter('autolink')\n let value = tracker.move('<')\n value += tracker.move(\n state.containerPhrasing(node, {\n before: value,\n after: '>',\n ...tracker.current()\n })\n )\n value += tracker.move('>')\n exit()\n state.stack = stack\n return value\n }\n\n exit = state.enter('link')\n subexit = state.enter('label')\n let value = tracker.move('[')\n value += tracker.move(\n state.containerPhrasing(node, {\n before: value,\n after: '](',\n ...tracker.current()\n })\n )\n value += tracker.move('](')\n subexit()\n\n if (\n // If there’s no url but there is a title…\n (!node.url && node.title) ||\n // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node.url)\n ) {\n subexit = state.enter('destinationLiteral')\n value += tracker.move('<')\n value += tracker.move(\n state.safe(node.url, {before: value, after: '>', ...tracker.current()})\n )\n value += tracker.move('>')\n } else {\n // No whitespace, raw is prettier.\n subexit = state.enter('destinationRaw')\n value += tracker.move(\n state.safe(node.url, {\n before: value,\n after: node.title ? ' ' : ')',\n ...tracker.current()\n })\n )\n }\n\n subexit()\n\n if (node.title) {\n subexit = state.enter(`title${suffix}`)\n value += tracker.move(' ' + quote)\n value += tracker.move(\n state.safe(node.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n )\n value += tracker.move(quote)\n subexit()\n }\n\n value += tracker.move(')')\n\n exit()\n return value\n}\n\n/**\n * @param {Link} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @returns {string}\n */\nfunction linkPeek(node, _, state) {\n return formatLinkAsAutolink(node, state) ? '<' : '['\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {LinkReference, Parents} from 'mdast'\n */\n\nlinkReference.peek = linkReferencePeek\n\n/**\n * @param {LinkReference} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function linkReference(node, _, state, info) {\n const type = node.referenceType\n const exit = state.enter('linkReference')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('[')\n const text = state.containerPhrasing(node, {\n before: value,\n after: ']',\n ...tracker.current()\n })\n value += tracker.move(text + '][')\n\n subexit()\n // Hide the fact that we’re in phrasing, because escapes don’t work.\n const stack = state.stack\n state.stack = []\n subexit = state.enter('reference')\n // Note: for proper tracking, we should reset the output positions when we end\n // up making a `shortcut` reference, because then there is no brace output.\n // Practically, in that case, there is no content, so it doesn’t matter that\n // we’ve tracked one too many characters.\n const reference = state.safe(state.associationId(node), {\n before: value,\n after: ']',\n ...tracker.current()\n })\n subexit()\n state.stack = stack\n exit()\n\n if (type === 'full' || !text || text !== reference) {\n value += tracker.move(reference + ']')\n } else if (type === 'shortcut') {\n // Remove the unwanted `[`.\n value = value.slice(0, -1)\n } else {\n value += tracker.move(']')\n }\n\n return value\n}\n\n/**\n * @returns {string}\n */\nfunction linkReferencePeek() {\n return '['\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkBullet(state) {\n const marker = state.options.bullet || '*'\n\n if (marker !== '*' && marker !== '+' && marker !== '-') {\n throw new Error(\n 'Cannot serialize items with `' +\n marker +\n '` for `options.bullet`, expected `*`, `+`, or `-`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\nimport {checkBullet} from './check-bullet.js'\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkBulletOther(state) {\n const bullet = checkBullet(state)\n const bulletOther = state.options.bulletOther\n\n if (!bulletOther) {\n return bullet === '*' ? '-' : '*'\n }\n\n if (bulletOther !== '*' && bulletOther !== '+' && bulletOther !== '-') {\n throw new Error(\n 'Cannot serialize items with `' +\n bulletOther +\n '` for `options.bulletOther`, expected `*`, `+`, or `-`'\n )\n }\n\n if (bulletOther === bullet) {\n throw new Error(\n 'Expected `bullet` (`' +\n bullet +\n '`) and `bulletOther` (`' +\n bulletOther +\n '`) to be different'\n )\n }\n\n return bulletOther\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkBulletOrdered(state) {\n const marker = state.options.bulletOrdered || '.'\n\n if (marker !== '.' && marker !== ')') {\n throw new Error(\n 'Cannot serialize items with `' +\n marker +\n '` for `options.bulletOrdered`, expected `.` or `)`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkRule(state) {\n const marker = state.options.rule || '*'\n\n if (marker !== '*' && marker !== '-' && marker !== '_') {\n throw new Error(\n 'Cannot serialize rules with `' +\n marker +\n '` for `options.rule`, expected `*`, `-`, or `_`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {List, Parents} from 'mdast'\n */\n\nimport {checkBullet} from '../util/check-bullet.js'\nimport {checkBulletOther} from '../util/check-bullet-other.js'\nimport {checkBulletOrdered} from '../util/check-bullet-ordered.js'\nimport {checkRule} from '../util/check-rule.js'\n\n/**\n * @param {List} node\n * @param {Parents | undefined} parent\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function list(node, parent, state, info) {\n const exit = state.enter('list')\n const bulletCurrent = state.bulletCurrent\n /** @type {string} */\n let bullet = node.ordered ? checkBulletOrdered(state) : checkBullet(state)\n /** @type {string} */\n const bulletOther = node.ordered\n ? bullet === '.'\n ? ')'\n : '.'\n : checkBulletOther(state)\n let useDifferentMarker =\n parent && state.bulletLastUsed ? bullet === state.bulletLastUsed : false\n\n if (!node.ordered) {\n const firstListItem = node.children ? node.children[0] : undefined\n\n // If there’s an empty first list item directly in two list items,\n // we have to use a different bullet:\n //\n // ```markdown\n // * - *\n // ```\n //\n // …because otherwise it would become one big thematic break.\n if (\n // Bullet could be used as a thematic break marker:\n (bullet === '*' || bullet === '-') &&\n // Empty first list item:\n firstListItem &&\n (!firstListItem.children || !firstListItem.children[0]) &&\n // Directly in two other list items:\n state.stack[state.stack.length - 1] === 'list' &&\n state.stack[state.stack.length - 2] === 'listItem' &&\n state.stack[state.stack.length - 3] === 'list' &&\n state.stack[state.stack.length - 4] === 'listItem' &&\n // That are each the first child.\n state.indexStack[state.indexStack.length - 1] === 0 &&\n state.indexStack[state.indexStack.length - 2] === 0 &&\n state.indexStack[state.indexStack.length - 3] === 0\n ) {\n useDifferentMarker = true\n }\n\n // If there’s a thematic break at the start of the first list item,\n // we have to use a different bullet:\n //\n // ```markdown\n // * ---\n // ```\n //\n // …because otherwise it would become one big thematic break.\n if (checkRule(state) === bullet && firstListItem) {\n let index = -1\n\n while (++index < node.children.length) {\n const item = node.children[index]\n\n if (\n item &&\n item.type === 'listItem' &&\n item.children &&\n item.children[0] &&\n item.children[0].type === 'thematicBreak'\n ) {\n useDifferentMarker = true\n break\n }\n }\n }\n }\n\n if (useDifferentMarker) {\n bullet = bulletOther\n }\n\n state.bulletCurrent = bullet\n const value = state.containerFlow(node, info)\n state.bulletLastUsed = bullet\n state.bulletCurrent = bulletCurrent\n exit()\n return value\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkListItemIndent(state) {\n const style = state.options.listItemIndent || 'one'\n\n if (style !== 'tab' && style !== 'one' && style !== 'mixed') {\n throw new Error(\n 'Cannot serialize items with `' +\n style +\n '` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`'\n )\n }\n\n return style\n}\n","/**\n * @import {Info, Map, State} from 'mdast-util-to-markdown'\n * @import {ListItem, Parents} from 'mdast'\n */\n\nimport {checkBullet} from '../util/check-bullet.js'\nimport {checkListItemIndent} from '../util/check-list-item-indent.js'\n\n/**\n * @param {ListItem} node\n * @param {Parents | undefined} parent\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function listItem(node, parent, state, info) {\n const listItemIndent = checkListItemIndent(state)\n let bullet = state.bulletCurrent || checkBullet(state)\n\n // Add the marker value for ordered lists.\n if (parent && parent.type === 'list' && parent.ordered) {\n bullet =\n (typeof parent.start === 'number' && parent.start > -1\n ? parent.start\n : 1) +\n (state.options.incrementListMarker === false\n ? 0\n : parent.children.indexOf(node)) +\n bullet\n }\n\n let size = bullet.length + 1\n\n if (\n listItemIndent === 'tab' ||\n (listItemIndent === 'mixed' &&\n ((parent && parent.type === 'list' && parent.spread) || node.spread))\n ) {\n size = Math.ceil(size / 4) * 4\n }\n\n const tracker = state.createTracker(info)\n tracker.move(bullet + ' '.repeat(size - bullet.length))\n tracker.shift(size)\n const exit = state.enter('listItem')\n const value = state.indentLines(\n state.containerFlow(node, tracker.current()),\n map\n )\n exit()\n\n return value\n\n /** @type {Map} */\n function map(line, index, blank) {\n if (index) {\n return (blank ? '' : ' '.repeat(size)) + line\n }\n\n return (blank ? bullet : bullet + ' '.repeat(size - bullet.length)) + line\n }\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Paragraph, Parents} from 'mdast'\n */\n\n/**\n * @param {Paragraph} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function paragraph(node, _, state, info) {\n const exit = state.enter('paragraph')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, info)\n subexit()\n exit()\n return value\n}\n","/**\n * @typedef {import('mdast').Html} Html\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n */\n\nimport {convert} from 'unist-util-is'\n\n/**\n * Check if the given value is *phrasing content*.\n *\n * > 👉 **Note**: Excludes `html`, which can be both phrasing or flow.\n *\n * @param node\n * Thing to check, typically `Node`.\n * @returns\n * Whether `value` is phrasing content.\n */\n\nexport const phrasing =\n /** @type {(node?: unknown) => node is Exclude} */\n (\n convert([\n 'break',\n 'delete',\n 'emphasis',\n // To do: next major: removed since footnotes were added to GFM.\n 'footnote',\n 'footnoteReference',\n 'image',\n 'imageReference',\n 'inlineCode',\n // Enabled by `mdast-util-math`:\n 'inlineMath',\n 'link',\n 'linkReference',\n // Enabled by `mdast-util-mdx`:\n 'mdxJsxTextElement',\n // Enabled by `mdast-util-mdx`:\n 'mdxTextExpression',\n 'strong',\n 'text',\n // Enabled by `mdast-util-directive`:\n 'textDirective'\n ])\n )\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Parents, Root} from 'mdast'\n */\n\nimport {phrasing} from 'mdast-util-phrasing'\n\n/**\n * @param {Root} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function root(node, _, state, info) {\n // Note: `html` nodes are ambiguous.\n const hasPhrasing = node.children.some(function (d) {\n return phrasing(d)\n })\n\n const container = hasPhrasing ? state.containerPhrasing : state.containerFlow\n return container.call(state, node, info)\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkStrong(state) {\n const marker = state.options.strong || '*'\n\n if (marker !== '*' && marker !== '_') {\n throw new Error(\n 'Cannot serialize strong with `' +\n marker +\n '` for `options.strong`, expected `*`, or `_`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Parents, Strong} from 'mdast'\n */\n\nimport {checkStrong} from '../util/check-strong.js'\nimport {encodeCharacterReference} from '../util/encode-character-reference.js'\nimport {encodeInfo} from '../util/encode-info.js'\n\nstrong.peek = strongPeek\n\n/**\n * @param {Strong} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function strong(node, _, state, info) {\n const marker = checkStrong(state)\n const exit = state.enter('strong')\n const tracker = state.createTracker(info)\n const before = tracker.move(marker + marker)\n\n let between = tracker.move(\n state.containerPhrasing(node, {\n after: marker,\n before,\n ...tracker.current()\n })\n )\n const betweenHead = between.charCodeAt(0)\n const open = encodeInfo(\n info.before.charCodeAt(info.before.length - 1),\n betweenHead,\n marker\n )\n\n if (open.inside) {\n between = encodeCharacterReference(betweenHead) + between.slice(1)\n }\n\n const betweenTail = between.charCodeAt(between.length - 1)\n const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker)\n\n if (close.inside) {\n between = between.slice(0, -1) + encodeCharacterReference(betweenTail)\n }\n\n const after = tracker.move(marker + marker)\n\n exit()\n\n state.attentionEncodeSurroundingInfo = {\n after: close.outside,\n before: open.outside\n }\n return before + between + after\n}\n\n/**\n * @param {Strong} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @returns {string}\n */\nfunction strongPeek(_, _1, state) {\n return state.options.strong || '*'\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Parents, Text} from 'mdast'\n */\n\n/**\n * @param {Text} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function text(node, _, state, info) {\n return state.safe(node.value, info)\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkRuleRepetition(state) {\n const repetition = state.options.ruleRepetition || 3\n\n if (repetition < 3) {\n throw new Error(\n 'Cannot serialize rules with repetition `' +\n repetition +\n '` for `options.ruleRepetition`, expected `3` or more'\n )\n }\n\n return repetition\n}\n","/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {Parents, ThematicBreak} from 'mdast'\n */\n\nimport {checkRuleRepetition} from '../util/check-rule-repetition.js'\nimport {checkRule} from '../util/check-rule.js'\n\n/**\n * @param {ThematicBreak} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @returns {string}\n */\nexport function thematicBreak(_, _1, state) {\n const value = (\n checkRule(state) + (state.options.ruleSpaces ? ' ' : '')\n ).repeat(checkRuleRepetition(state))\n\n return state.options.ruleSpaces ? value.slice(0, -1) : value\n}\n","import {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {definition} from './definition.js'\nimport {emphasis} from './emphasis.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {image} from './image.js'\nimport {imageReference} from './image-reference.js'\nimport {inlineCode} from './inline-code.js'\nimport {link} from './link.js'\nimport {linkReference} from './link-reference.js'\nimport {list} from './list.js'\nimport {listItem} from './list-item.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default (CommonMark) handlers.\n */\nexport const handle = {\n blockquote,\n break: hardBreak,\n code,\n definition,\n emphasis,\n hardBreak,\n heading,\n html,\n image,\n imageReference,\n inlineCode,\n link,\n linkReference,\n list,\n listItem,\n paragraph,\n root,\n strong,\n text,\n thematicBreak\n}\n","/**\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('mdast').Table} Table\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('mdast').TableRow} TableRow\n *\n * @typedef {import('markdown-table').Options} MarkdownTableOptions\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').State} State\n * @typedef {import('mdast-util-to-markdown').Info} Info\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [tableCellPadding=true]\n * Whether to add a space of padding between delimiters and cells (default:\n * `true`).\n * @property {boolean | null | undefined} [tablePipeAlign=true]\n * Whether to align the delimiters (default: `true`).\n * @property {MarkdownTableOptions['stringLength'] | null | undefined} [stringLength]\n * Function to detect the length of table cell content, used when aligning\n * the delimiters between cells (optional).\n */\n\nimport {ok as assert} from 'devlop'\nimport {markdownTable} from 'markdown-table'\nimport {defaultHandlers} from 'mdast-util-to-markdown'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM tables in\n * markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM tables.\n */\nexport function gfmTableFromMarkdown() {\n return {\n enter: {\n table: enterTable,\n tableData: enterCell,\n tableHeader: enterCell,\n tableRow: enterRow\n },\n exit: {\n codeText: exitCodeText,\n table: exitTable,\n tableData: exit,\n tableHeader: exit,\n tableRow: exit\n }\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterTable(token) {\n const align = token._align\n assert(align, 'expected `_align` on table')\n this.enter(\n {\n type: 'table',\n align: align.map(function (d) {\n return d === 'none' ? null : d\n }),\n children: []\n },\n token\n )\n this.data.inTable = true\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitTable(token) {\n this.exit(token)\n this.data.inTable = undefined\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterRow(token) {\n this.enter({type: 'tableRow', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exit(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterCell(token) {\n this.enter({type: 'tableCell', children: []}, token)\n}\n\n// Overwrite the default code text data handler to unescape escaped pipes when\n// they are in tables.\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCodeText(token) {\n let value = this.resume()\n\n if (this.data.inTable) {\n value = value.replace(/\\\\([\\\\|])/g, replace)\n }\n\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'inlineCode')\n node.value = value\n this.exit(token)\n}\n\n/**\n * @param {string} $0\n * @param {string} $1\n * @returns {string}\n */\nfunction replace($0, $1) {\n // Pipes work, backslashes don’t (but can’t escape pipes).\n return $1 === '|' ? $1 : $0\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM tables in\n * markdown.\n *\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM tables.\n */\nexport function gfmTableToMarkdown(options) {\n const settings = options || {}\n const padding = settings.tableCellPadding\n const alignDelimiters = settings.tablePipeAlign\n const stringLength = settings.stringLength\n const around = padding ? ' ' : '|'\n\n return {\n unsafe: [\n {character: '\\r', inConstruct: 'tableCell'},\n {character: '\\n', inConstruct: 'tableCell'},\n // A pipe, when followed by a tab or space (padding), or a dash or colon\n // (unpadded delimiter row), could result in a table.\n {atBreak: true, character: '|', after: '[\\t :-]'},\n // A pipe in a cell must be encoded.\n {character: '|', inConstruct: 'tableCell'},\n // A colon must be followed by a dash, in which case it could start a\n // delimiter row.\n {atBreak: true, character: ':', after: '-'},\n // A delimiter row can also start with a dash, when followed by more\n // dashes, a colon, or a pipe.\n // This is a stricter version than the built in check for lists, thematic\n // breaks, and setex heading underlines though:\n // \n {atBreak: true, character: '-', after: '[:|-]'}\n ],\n handlers: {\n inlineCode: inlineCodeWithTable,\n table: handleTable,\n tableCell: handleTableCell,\n tableRow: handleTableRow\n }\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {Table} node\n */\n function handleTable(node, _, state, info) {\n return serializeData(handleTableAsData(node, state, info), node.align)\n }\n\n /**\n * This function isn’t really used normally, because we handle rows at the\n * table level.\n * But, if someone passes in a table row, this ensures we make somewhat sense.\n *\n * @type {ToMarkdownHandle}\n * @param {TableRow} node\n */\n function handleTableRow(node, _, state, info) {\n const row = handleTableRowAsData(node, state, info)\n const value = serializeData([row])\n // `markdown-table` will always add an align row\n return value.slice(0, value.indexOf('\\n'))\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {TableCell} node\n */\n function handleTableCell(node, _, state, info) {\n const exit = state.enter('tableCell')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, {\n ...info,\n before: around,\n after: around\n })\n subexit()\n exit()\n return value\n }\n\n /**\n * @param {Array>} matrix\n * @param {Array | null | undefined} [align]\n */\n function serializeData(matrix, align) {\n return markdownTable(matrix, {\n align,\n // @ts-expect-error: `markdown-table` types should support `null`.\n alignDelimiters,\n // @ts-expect-error: `markdown-table` types should support `null`.\n padding,\n // @ts-expect-error: `markdown-table` types should support `null`.\n stringLength\n })\n }\n\n /**\n * @param {Table} node\n * @param {State} state\n * @param {Info} info\n */\n function handleTableAsData(node, state, info) {\n const children = node.children\n let index = -1\n /** @type {Array>} */\n const result = []\n const subexit = state.enter('table')\n\n while (++index < children.length) {\n result[index] = handleTableRowAsData(children[index], state, info)\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @param {TableRow} node\n * @param {State} state\n * @param {Info} info\n */\n function handleTableRowAsData(node, state, info) {\n const children = node.children\n let index = -1\n /** @type {Array} */\n const result = []\n const subexit = state.enter('tableRow')\n\n while (++index < children.length) {\n // Note: the positional info as used here is incorrect.\n // Making it correct would be impossible due to aligning cells?\n // And it would need copy/pasting `markdown-table` into this project.\n result[index] = handleTableCell(children[index], node, state, info)\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {InlineCode} node\n */\n function inlineCodeWithTable(node, parent, state) {\n let value = defaultHandlers.inlineCode(node, parent, state)\n\n if (state.stack.includes('tableCell')) {\n value = value.replace(/\\|/g, '\\\\$&')\n }\n\n return value\n }\n}\n","/**\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n */\n\nimport {ok as assert} from 'devlop'\nimport {defaultHandlers} from 'mdast-util-to-markdown'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM task\n * list items in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM task list items.\n */\nexport function gfmTaskListItemFromMarkdown() {\n return {\n exit: {\n taskListCheckValueChecked: exitCheck,\n taskListCheckValueUnchecked: exitCheck,\n paragraph: exitParagraphWithTaskListItem\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM task list\n * items in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM task list items.\n */\nexport function gfmTaskListItemToMarkdown() {\n return {\n unsafe: [{atBreak: true, character: '-', after: '[:|-]'}],\n handlers: {listItem: listItemWithTaskListItem}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCheck(token) {\n // We’re always in a paragraph, in a list item.\n const node = this.stack[this.stack.length - 2]\n assert(node.type === 'listItem')\n node.checked = token.type === 'taskListCheckValueChecked'\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitParagraphWithTaskListItem(token) {\n const parent = this.stack[this.stack.length - 2]\n\n if (\n parent &&\n parent.type === 'listItem' &&\n typeof parent.checked === 'boolean'\n ) {\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'paragraph')\n const head = node.children[0]\n\n if (head && head.type === 'text') {\n const siblings = parent.children\n let index = -1\n /** @type {Paragraph | undefined} */\n let firstParaghraph\n\n while (++index < siblings.length) {\n const sibling = siblings[index]\n if (sibling.type === 'paragraph') {\n firstParaghraph = sibling\n break\n }\n }\n\n if (firstParaghraph === node) {\n // Must start with a space or a tab.\n head.value = head.value.slice(1)\n\n if (head.value.length === 0) {\n node.children.shift()\n } else if (\n node.position &&\n head.position &&\n typeof head.position.start.offset === 'number'\n ) {\n head.position.start.column++\n head.position.start.offset++\n node.position.start = Object.assign({}, head.position.start)\n }\n }\n }\n }\n\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {ListItem} node\n */\nfunction listItemWithTaskListItem(node, parent, state, info) {\n const head = node.children[0]\n const checkable =\n typeof node.checked === 'boolean' && head && head.type === 'paragraph'\n const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '\n const tracker = state.createTracker(info)\n\n if (checkable) {\n tracker.move(checkbox)\n }\n\n let value = defaultHandlers.listItem(node, parent, state, {\n ...info,\n ...tracker.current()\n })\n\n if (checkable) {\n value = value.replace(/^(?:[*+-]|\\d+\\.)([\\r\\n]| {1,3})/, check)\n }\n\n return value\n\n /**\n * @param {string} $0\n * @returns {string}\n */\n function check($0) {\n return $0 + checkbox\n }\n}\n","/**\n * @import {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown'\n * @import {Options} from 'mdast-util-gfm'\n * @import {Options as ToMarkdownExtension} from 'mdast-util-to-markdown'\n */\n\nimport {\n gfmAutolinkLiteralFromMarkdown,\n gfmAutolinkLiteralToMarkdown\n} from 'mdast-util-gfm-autolink-literal'\nimport {\n gfmFootnoteFromMarkdown,\n gfmFootnoteToMarkdown\n} from 'mdast-util-gfm-footnote'\nimport {\n gfmStrikethroughFromMarkdown,\n gfmStrikethroughToMarkdown\n} from 'mdast-util-gfm-strikethrough'\nimport {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'\nimport {\n gfmTaskListItemFromMarkdown,\n gfmTaskListItemToMarkdown\n} from 'mdast-util-gfm-task-list-item'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @returns {Array}\n * Extension for `mdast-util-from-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmFromMarkdown() {\n return [\n gfmAutolinkLiteralFromMarkdown(),\n gfmFootnoteFromMarkdown(),\n gfmStrikethroughFromMarkdown(),\n gfmTableFromMarkdown(),\n gfmTaskListItemFromMarkdown()\n ]\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmToMarkdown(options) {\n return {\n extensions: [\n gfmAutolinkLiteralToMarkdown(),\n gfmFootnoteToMarkdown(options),\n gfmStrikethroughToMarkdown(),\n gfmTableToMarkdown(options),\n gfmTaskListItemToMarkdown()\n ]\n }\n}\n","/**\n * @import {Code, ConstructRecord, Event, Extension, Previous, State, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { asciiAlpha, asciiAlphanumeric, asciiControl, markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';\nconst wwwPrefix = {\n tokenize: tokenizeWwwPrefix,\n partial: true\n};\nconst domain = {\n tokenize: tokenizeDomain,\n partial: true\n};\nconst path = {\n tokenize: tokenizePath,\n partial: true\n};\nconst trail = {\n tokenize: tokenizeTrail,\n partial: true\n};\nconst emailDomainDotTrail = {\n tokenize: tokenizeEmailDomainDotTrail,\n partial: true\n};\nconst wwwAutolink = {\n name: 'wwwAutolink',\n tokenize: tokenizeWwwAutolink,\n previous: previousWww\n};\nconst protocolAutolink = {\n name: 'protocolAutolink',\n tokenize: tokenizeProtocolAutolink,\n previous: previousProtocol\n};\nconst emailAutolink = {\n name: 'emailAutolink',\n tokenize: tokenizeEmailAutolink,\n previous: previousEmail\n};\n\n/** @type {ConstructRecord} */\nconst text = {};\n\n/**\n * Create an extension for `micromark` to support GitHub autolink literal\n * syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * autolink literal syntax.\n */\nexport function gfmAutolinkLiteral() {\n return {\n text\n };\n}\n\n/** @type {Code} */\nlet code = 48;\n\n// Add alphanumerics.\nwhile (code < 123) {\n text[code] = emailAutolink;\n code++;\n if (code === 58) code = 65;else if (code === 91) code = 97;\n}\ntext[43] = emailAutolink;\ntext[45] = emailAutolink;\ntext[46] = emailAutolink;\ntext[95] = emailAutolink;\ntext[72] = [emailAutolink, protocolAutolink];\ntext[104] = [emailAutolink, protocolAutolink];\ntext[87] = [emailAutolink, wwwAutolink];\ntext[119] = [emailAutolink, wwwAutolink];\n\n// To do: perform email autolink literals on events, afterwards.\n// That’s where `markdown-rs` and `cmark-gfm` perform it.\n// It should look for `@`, then for atext backwards, and then for a label\n// forwards.\n// To do: `mailto:`, `xmpp:` protocol as prefix.\n\n/**\n * Email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailAutolink(effects, ok, nok) {\n const self = this;\n /** @type {boolean | undefined} */\n let dot;\n /** @type {boolean} */\n let data;\n return start;\n\n /**\n * Start of email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (!gfmAtext(code) || !previousEmail.call(self, self.previous) || previousUnbalanced(self.events)) {\n return nok(code);\n }\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkEmail');\n return atext(code);\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function atext(code) {\n if (gfmAtext(code)) {\n effects.consume(code);\n return atext;\n }\n if (code === 64) {\n effects.consume(code);\n return emailDomain;\n }\n return nok(code);\n }\n\n /**\n * In email domain.\n *\n * The reference code is a bit overly complex as it handles the `@`, of which\n * there may be just one.\n * Source: \n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomain(code) {\n // Dot followed by alphanumerical (not `-` or `_`).\n if (code === 46) {\n return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code);\n }\n\n // Alphanumerical, `-`, and `_`.\n if (code === 45 || code === 95 || asciiAlphanumeric(code)) {\n data = true;\n effects.consume(code);\n return emailDomain;\n }\n\n // To do: `/` if xmpp.\n\n // Note: normally we’d truncate trailing punctuation from the link.\n // However, email autolink literals cannot contain any of those markers,\n // except for `.`, but that can only occur if it isn’t trailing.\n // So we can ignore truncating!\n return emailDomainAfter(code);\n }\n\n /**\n * In email domain, on dot that is not a trail.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainDot(code) {\n effects.consume(code);\n dot = true;\n return emailDomain;\n }\n\n /**\n * After email domain.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainAfter(code) {\n // Domain must not be empty, must include a dot, and must end in alphabetical.\n // Source: .\n if (data && dot && asciiAlpha(self.previous)) {\n effects.exit('literalAutolinkEmail');\n effects.exit('literalAutolink');\n return ok(code);\n }\n return nok(code);\n }\n}\n\n/**\n * `www` autolink literal.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwAutolink(effects, ok, nok) {\n const self = this;\n return wwwStart;\n\n /**\n * Start of www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwStart(code) {\n if (code !== 87 && code !== 119 || !previousWww.call(self, self.previous) || previousUnbalanced(self.events)) {\n return nok(code);\n }\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkWww');\n // Note: we *check*, so we can discard the `www.` we parsed.\n // If it worked, we consider it as a part of the domain.\n return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path, wwwAfter), nok), nok)(code);\n }\n\n /**\n * After a www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwAfter(code) {\n effects.exit('literalAutolinkWww');\n effects.exit('literalAutolink');\n return ok(code);\n }\n}\n\n/**\n * Protocol autolink literal.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeProtocolAutolink(effects, ok, nok) {\n const self = this;\n let buffer = '';\n let seen = false;\n return protocolStart;\n\n /**\n * Start of protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolStart(code) {\n if ((code === 72 || code === 104) && previousProtocol.call(self, self.previous) && !previousUnbalanced(self.events)) {\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkHttp');\n buffer += String.fromCodePoint(code);\n effects.consume(code);\n return protocolPrefixInside;\n }\n return nok(code);\n }\n\n /**\n * In protocol.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^^^^\n * ```\n *\n * @type {State}\n */\n function protocolPrefixInside(code) {\n // `5` is size of `https`\n if (asciiAlpha(code) && buffer.length < 5) {\n // @ts-expect-error: definitely number.\n buffer += String.fromCodePoint(code);\n effects.consume(code);\n return protocolPrefixInside;\n }\n if (code === 58) {\n const protocol = buffer.toLowerCase();\n if (protocol === 'http' || protocol === 'https') {\n effects.consume(code);\n return protocolSlashesInside;\n }\n }\n return nok(code);\n }\n\n /**\n * In slashes.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^\n * ```\n *\n * @type {State}\n */\n function protocolSlashesInside(code) {\n if (code === 47) {\n effects.consume(code);\n if (seen) {\n return afterProtocol;\n }\n seen = true;\n return protocolSlashesInside;\n }\n return nok(code);\n }\n\n /**\n * After protocol, before domain.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function afterProtocol(code) {\n // To do: this is different from `markdown-rs`:\n // https://github.com/wooorm/markdown-rs/blob/b3a921c761309ae00a51fe348d8a43adbc54b518/src/construct/gfm_autolink_literal.rs#L172-L182\n return code === null || asciiControl(code) || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || unicodePunctuation(code) ? nok(code) : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code);\n }\n\n /**\n * After a protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolAfter(code) {\n effects.exit('literalAutolinkHttp');\n effects.exit('literalAutolink');\n return ok(code);\n }\n}\n\n/**\n * `www` prefix.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwPrefix(effects, ok, nok) {\n let size = 0;\n return wwwPrefixInside;\n\n /**\n * In www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixInside(code) {\n if ((code === 87 || code === 119) && size < 3) {\n size++;\n effects.consume(code);\n return wwwPrefixInside;\n }\n if (code === 46 && size === 3) {\n effects.consume(code);\n return wwwPrefixAfter;\n }\n return nok(code);\n }\n\n /**\n * After www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixAfter(code) {\n // If there is *anything*, we can link.\n return code === null ? nok(code) : ok(code);\n }\n}\n\n/**\n * Domain.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDomain(effects, ok, nok) {\n /** @type {boolean | undefined} */\n let underscoreInLastSegment;\n /** @type {boolean | undefined} */\n let underscoreInLastLastSegment;\n /** @type {boolean | undefined} */\n let seen;\n return domainInside;\n\n /**\n * In domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^^^^^^^^^^\n * ```\n *\n * @type {State}\n */\n function domainInside(code) {\n // Check whether this marker, which is a trailing punctuation\n // marker, optionally followed by more trailing markers, and then\n // followed by an end.\n if (code === 46 || code === 95) {\n return effects.check(trail, domainAfter, domainAtPunctuation)(code);\n }\n\n // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can\n // occur, which sounds like ASCII only, but they also support `www.點看.com`,\n // so that’s Unicode.\n // Instead of some new production for Unicode alphanumerics, markdown\n // already has that for Unicode punctuation and whitespace, so use those.\n // Source: .\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || code !== 45 && unicodePunctuation(code)) {\n return domainAfter(code);\n }\n seen = true;\n effects.consume(code);\n return domainInside;\n }\n\n /**\n * In domain, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function domainAtPunctuation(code) {\n // There is an underscore in the last segment of the domain\n if (code === 95) {\n underscoreInLastSegment = true;\n }\n // Otherwise, it’s a `.`: save the last segment underscore in the\n // penultimate segment slot.\n else {\n underscoreInLastLastSegment = underscoreInLastSegment;\n underscoreInLastSegment = undefined;\n }\n effects.consume(code);\n return domainInside;\n }\n\n /**\n * After domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^\n * ```\n *\n * @type {State} */\n function domainAfter(code) {\n // Note: that’s GH says a dot is needed, but it’s not true:\n // \n if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {\n return nok(code);\n }\n return ok(code);\n }\n}\n\n/**\n * Path.\n *\n * ```markdown\n * > | a https://example.org/stuff b\n * ^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePath(effects, ok) {\n let sizeOpen = 0;\n let sizeClose = 0;\n return pathInside;\n\n /**\n * In path.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^\n * ```\n *\n * @type {State}\n */\n function pathInside(code) {\n if (code === 40) {\n sizeOpen++;\n effects.consume(code);\n return pathInside;\n }\n\n // To do: `markdown-rs` also needs this.\n // If this is a paren, and there are less closings than openings,\n // we don’t check for a trail.\n if (code === 41 && sizeClose < sizeOpen) {\n return pathAtPunctuation(code);\n }\n\n // Check whether this trailing punctuation marker is optionally\n // followed by more trailing markers, and then followed\n // by an end.\n if (code === 33 || code === 34 || code === 38 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 60 || code === 63 || code === 93 || code === 95 || code === 126) {\n return effects.check(trail, ok, pathAtPunctuation)(code);\n }\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n effects.consume(code);\n return pathInside;\n }\n\n /**\n * In path, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com/a\"b\n * ^\n * ```\n *\n * @type {State}\n */\n function pathAtPunctuation(code) {\n // Count closing parens.\n if (code === 41) {\n sizeClose++;\n }\n effects.consume(code);\n return pathInside;\n }\n}\n\n/**\n * Trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the entire trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | https://example.com\").\n * ^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTrail(effects, ok, nok) {\n return trail;\n\n /**\n * In trail of domain or path.\n *\n * ```markdown\n * > | https://example.com\").\n * ^\n * ```\n *\n * @type {State}\n */\n function trail(code) {\n // Regular trailing punctuation.\n if (code === 33 || code === 34 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 63 || code === 95 || code === 126) {\n effects.consume(code);\n return trail;\n }\n\n // `&` followed by one or more alphabeticals and then a `;`, is\n // as a whole considered as trailing punctuation.\n // In all other cases, it is considered as continuation of the URL.\n if (code === 38) {\n effects.consume(code);\n return trailCharacterReferenceStart;\n }\n\n // Needed because we allow literals after `[`, as we fix:\n // .\n // Check that it is not followed by `(` or `[`.\n if (code === 93) {\n effects.consume(code);\n return trailBracketAfter;\n }\n if (\n // `<` is an end.\n code === 60 ||\n // So is whitespace.\n code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n return nok(code);\n }\n\n /**\n * In trail, after `]`.\n *\n * > 👉 **Note**: this deviates from `cmark-gfm` to fix a bug.\n * > See end of for more.\n *\n * ```markdown\n * > | https://example.com](\n * ^\n * ```\n *\n * @type {State}\n */\n function trailBracketAfter(code) {\n // Whitespace or something that could start a resource or reference is the end.\n // Switch back to trail otherwise.\n if (code === null || code === 40 || code === 91 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n return trail(code);\n }\n\n /**\n * In character-reference like trail, after `&`.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharacterReferenceStart(code) {\n // When non-alpha, it’s not a trail.\n return asciiAlpha(code) ? trailCharacterReferenceInside(code) : nok(code);\n }\n\n /**\n * In character-reference like trail.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharacterReferenceInside(code) {\n // Switch back to trail if this is well-formed.\n if (code === 59) {\n effects.consume(code);\n return trail;\n }\n if (asciiAlpha(code)) {\n effects.consume(code);\n return trailCharacterReferenceInside;\n }\n\n // It’s not a trail.\n return nok(code);\n }\n}\n\n/**\n * Dot in email domain trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | contact@example.org.\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailDomainDotTrail(effects, ok, nok) {\n return start;\n\n /**\n * Dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Must be dot.\n effects.consume(code);\n return after;\n }\n\n /**\n * After dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Not a trail if alphanumeric.\n return asciiAlphanumeric(code) ? nok(code) : ok(code);\n }\n}\n\n/**\n * See:\n * .\n *\n * @type {Previous}\n */\nfunction previousWww(code) {\n return code === null || code === 40 || code === 42 || code === 95 || code === 91 || code === 93 || code === 126 || markdownLineEndingOrSpace(code);\n}\n\n/**\n * See:\n * .\n *\n * @type {Previous}\n */\nfunction previousProtocol(code) {\n return !asciiAlpha(code);\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previousEmail(code) {\n // Do not allow a slash “inside” atext.\n // The reference code is a bit weird, but that’s what it results in.\n // Source: .\n // Other than slash, every preceding character is allowed.\n return !(code === 47 || gfmAtext(code));\n}\n\n/**\n * @param {Code} code\n * @returns {boolean}\n */\nfunction gfmAtext(code) {\n return code === 43 || code === 45 || code === 46 || code === 95 || asciiAlphanumeric(code);\n}\n\n/**\n * @param {Array} events\n * @returns {boolean}\n */\nfunction previousUnbalanced(events) {\n let index = events.length;\n let result = false;\n while (index--) {\n const token = events[index][1];\n if ((token.type === 'labelLink' || token.type === 'labelImage') && !token._balanced) {\n result = true;\n break;\n }\n\n // If we’ve seen this token, and it was marked as not having any unbalanced\n // bracket before it, we can exit.\n if (token._gfmAutolinkLiteralWalkedInto) {\n result = false;\n break;\n }\n }\n if (events.length > 0 && !result) {\n // Mark the last token as “walked into” w/o finding\n // anything.\n events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true;\n }\n return result;\n}","/**\n * @import {Event, Exiter, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { blankLine } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nconst indent = {\n tokenize: tokenizeIndent,\n partial: true\n};\n\n// To do: micromark should support a `_hiddenGfmFootnoteSupport`, which only\n// affects label start (image).\n// That will let us drop `tokenizePotentialGfmFootnote*`.\n// It currently has a `_hiddenFootnoteSupport`, which affects that and more.\n// That can be removed when `micromark-extension-footnote` is archived.\n\n/**\n * Create an extension for `micromark` to enable GFM footnote syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to\n * enable GFM footnote syntax.\n */\nexport function gfmFootnote() {\n /** @type {Extension} */\n return {\n document: {\n [91]: {\n name: 'gfmFootnoteDefinition',\n tokenize: tokenizeDefinitionStart,\n continuation: {\n tokenize: tokenizeDefinitionContinuation\n },\n exit: gfmFootnoteDefinitionEnd\n }\n },\n text: {\n [91]: {\n name: 'gfmFootnoteCall',\n tokenize: tokenizeGfmFootnoteCall\n },\n [93]: {\n name: 'gfmPotentialFootnoteCall',\n add: 'after',\n tokenize: tokenizePotentialGfmFootnoteCall,\n resolveTo: resolveToPotentialGfmFootnoteCall\n }\n }\n };\n}\n\n// To do: remove after micromark update.\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePotentialGfmFootnoteCall(effects, ok, nok) {\n const self = this;\n let index = self.events.length;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n /** @type {Token} */\n let labelStart;\n\n // Find an opening.\n while (index--) {\n const token = self.events[index][1];\n if (token.type === \"labelImage\") {\n labelStart = token;\n break;\n }\n\n // Exit if we’ve walked far enough.\n if (token.type === 'gfmFootnoteCall' || token.type === \"labelLink\" || token.type === \"label\" || token.type === \"image\" || token.type === \"link\") {\n break;\n }\n }\n return start;\n\n /**\n * @type {State}\n */\n function start(code) {\n if (!labelStart || !labelStart._balanced) {\n return nok(code);\n }\n const id = normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n }));\n if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {\n return nok(code);\n }\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n return ok(code);\n }\n}\n\n// To do: remove after micromark update.\n/** @type {Resolver} */\nfunction resolveToPotentialGfmFootnoteCall(events, context) {\n let index = events.length;\n /** @type {Token | undefined} */\n let labelStart;\n\n // Find an opening.\n while (index--) {\n if (events[index][1].type === \"labelImage\" && events[index][0] === 'enter') {\n labelStart = events[index][1];\n break;\n }\n }\n // Change the `labelImageMarker` to a `data`.\n events[index + 1][1].type = \"data\";\n events[index + 3][1].type = 'gfmFootnoteCallLabelMarker';\n\n // The whole (without `!`):\n /** @type {Token} */\n const call = {\n type: 'gfmFootnoteCall',\n start: Object.assign({}, events[index + 3][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n };\n // The `^` marker\n /** @type {Token} */\n const marker = {\n type: 'gfmFootnoteCallMarker',\n start: Object.assign({}, events[index + 3][1].end),\n end: Object.assign({}, events[index + 3][1].end)\n };\n // Increment the end 1 character.\n marker.end.column++;\n marker.end.offset++;\n marker.end._bufferIndex++;\n /** @type {Token} */\n const string = {\n type: 'gfmFootnoteCallString',\n start: Object.assign({}, marker.end),\n end: Object.assign({}, events[events.length - 1][1].start)\n };\n /** @type {Token} */\n const chunk = {\n type: \"chunkString\",\n contentType: 'string',\n start: Object.assign({}, string.start),\n end: Object.assign({}, string.end)\n };\n\n /** @type {Array} */\n const replacement = [\n // Take the `labelImageMarker` (now `data`, the `!`)\n events[index + 1], events[index + 2], ['enter', call, context],\n // The `[`\n events[index + 3], events[index + 4],\n // The `^`.\n ['enter', marker, context], ['exit', marker, context],\n // Everything in between.\n ['enter', string, context], ['enter', chunk, context], ['exit', chunk, context], ['exit', string, context],\n // The ending (`]`, properly parsed and labelled).\n events[events.length - 2], events[events.length - 1], ['exit', call, context]];\n events.splice(index, events.length - index + 1, ...replacement);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeGfmFootnoteCall(effects, ok, nok) {\n const self = this;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n let size = 0;\n /** @type {boolean} */\n let data;\n\n // Note: the implementation of `markdown-rs` is different, because it houses\n // core *and* extensions in one project.\n // Therefore, it can include footnote logic inside `label-end`.\n // We can’t do that, but luckily, we can parse footnotes in a simpler way than\n // needed for labels.\n return start;\n\n /**\n * Start of footnote label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteCall');\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n return callStart;\n }\n\n /**\n * After `[`, at `^`.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callStart(code) {\n if (code !== 94) return nok(code);\n effects.enter('gfmFootnoteCallMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallMarker');\n effects.enter('gfmFootnoteCallString');\n effects.enter('chunkString').contentType = 'string';\n return callData;\n }\n\n /**\n * In label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callData(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n code === 93 && !data ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null || code === 91 || markdownLineEndingOrSpace(code)) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit('chunkString');\n const token = effects.exit('gfmFootnoteCallString');\n if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {\n return nok(code);\n }\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n effects.exit('gfmFootnoteCall');\n return ok;\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true;\n }\n size++;\n effects.consume(code);\n return code === 92 ? callEscape : callData;\n }\n\n /**\n * On character after escape.\n *\n * ```markdown\n * > | a [^b\\c] d\n * ^\n * ```\n *\n * @type {State}\n */\n function callEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return callData;\n }\n return callData(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionStart(effects, ok, nok) {\n const self = this;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n /** @type {string} */\n let identifier;\n let size = 0;\n /** @type {boolean | undefined} */\n let data;\n return start;\n\n /**\n * Start of GFM footnote definition.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteDefinition')._container = true;\n effects.enter('gfmFootnoteDefinitionLabel');\n effects.enter('gfmFootnoteDefinitionLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionLabelMarker');\n return labelAtMarker;\n }\n\n /**\n * In label, at caret.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAtMarker(code) {\n if (code === 94) {\n effects.enter('gfmFootnoteDefinitionMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionMarker');\n effects.enter('gfmFootnoteDefinitionLabelString');\n effects.enter('chunkString').contentType = 'string';\n return labelInside;\n }\n return nok(code);\n }\n\n /**\n * In label.\n *\n * > 👉 **Note**: `cmark-gfm` prevents whitespace from occurring in footnote\n * > definition labels.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n code === 93 && !data ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null || code === 91 || markdownLineEndingOrSpace(code)) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit('chunkString');\n const token = effects.exit('gfmFootnoteDefinitionLabelString');\n identifier = normalizeIdentifier(self.sliceSerialize(token));\n effects.enter('gfmFootnoteDefinitionLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionLabelMarker');\n effects.exit('gfmFootnoteDefinitionLabel');\n return labelAfter;\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true;\n }\n size++;\n effects.consume(code);\n return code === 92 ? labelEscape : labelInside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * > 👉 **Note**: `cmark-gfm` currently does not support escaped brackets:\n * > \n *\n * ```markdown\n * > | [^a\\*b]: c\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return labelInside;\n }\n return labelInside(code);\n }\n\n /**\n * After definition label.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n if (code === 58) {\n effects.enter('definitionMarker');\n effects.consume(code);\n effects.exit('definitionMarker');\n if (!defined.includes(identifier)) {\n defined.push(identifier);\n }\n\n // Any whitespace after the marker is eaten, forming indented code\n // is not possible.\n // No space is also fine, just like a block quote marker.\n return factorySpace(effects, whitespaceAfter, 'gfmFootnoteDefinitionWhitespace');\n }\n return nok(code);\n }\n\n /**\n * After definition prefix.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function whitespaceAfter(code) {\n // `markdown-rs` has a wrapping token for the prefix that is closed here.\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionContinuation(effects, ok, nok) {\n /// Start of footnote definition continuation.\n ///\n /// ```markdown\n /// | [^a]: b\n /// > | c\n /// ^\n /// ```\n //\n // Either a blank line, which is okay, or an indented thing.\n return effects.check(blankLine, ok, effects.attempt(indent, ok, nok));\n}\n\n/** @type {Exiter} */\nfunction gfmFootnoteDefinitionEnd(effects) {\n effects.exit('gfmFootnoteDefinition');\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, 'gfmFootnoteDefinitionIndent', 4 + 1);\n\n /**\n * @type {State}\n */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === 'gfmFootnoteDefinitionIndent' && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok(code) : nok(code);\n }\n}","/**\n * @import {Options} from 'micromark-extension-gfm-strikethrough'\n * @import {Event, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/**\n * Create an extension for `micromark` to enable GFM strikethrough syntax.\n *\n * @param {Options | null | undefined} [options={}]\n * Configuration.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions`, to\n * enable GFM strikethrough syntax.\n */\nexport function gfmStrikethrough(options) {\n const options_ = options || {};\n let single = options_.singleTilde;\n const tokenizer = {\n name: 'strikethrough',\n tokenize: tokenizeStrikethrough,\n resolveAll: resolveAllStrikethrough\n };\n if (single === null || single === undefined) {\n single = true;\n }\n return {\n text: {\n [126]: tokenizer\n },\n insideSpan: {\n null: [tokenizer]\n },\n attentionMarkers: {\n null: [126]\n }\n };\n\n /**\n * Take events and resolve strikethrough.\n *\n * @type {Resolver}\n */\n function resolveAllStrikethrough(events, context) {\n let index = -1;\n\n // Walk through all events.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'strikethroughSequenceTemporary' && events[index][1]._close) {\n let open = index;\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (events[open][0] === 'exit' && events[open][1].type === 'strikethroughSequenceTemporary' && events[open][1]._open &&\n // If the sizes are the same:\n events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) {\n events[index][1].type = 'strikethroughSequence';\n events[open][1].type = 'strikethroughSequence';\n\n /** @type {Token} */\n const strikethrough = {\n type: 'strikethrough',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[index][1].end)\n };\n\n /** @type {Token} */\n const text = {\n type: 'strikethroughText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n };\n\n // Opening.\n /** @type {Array} */\n const nextEvents = [['enter', strikethrough, context], ['enter', events[open][1], context], ['exit', events[open][1], context], ['enter', text, context]];\n const insideSpan = context.parser.constructs.insideSpan.null;\n if (insideSpan) {\n // Between.\n splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan, events.slice(open + 1, index), context));\n }\n\n // Closing.\n splice(nextEvents, nextEvents.length, 0, [['exit', text, context], ['enter', events[index][1], context], ['exit', events[index][1], context], ['exit', strikethrough, context]]);\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - 2;\n break;\n }\n }\n }\n }\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'strikethroughSequenceTemporary') {\n events[index][1].type = \"data\";\n }\n }\n return events;\n }\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeStrikethrough(effects, ok, nok) {\n const previous = this.previous;\n const events = this.events;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (previous === 126 && events[events.length - 1][1].type !== \"characterEscape\") {\n return nok(code);\n }\n effects.enter('strikethroughSequenceTemporary');\n return more(code);\n }\n\n /** @type {State} */\n function more(code) {\n const before = classifyCharacter(previous);\n if (code === 126) {\n // If this is the third marker, exit.\n if (size > 1) return nok(code);\n effects.consume(code);\n size++;\n return more;\n }\n if (size < 2 && !single) return nok(code);\n const token = effects.exit('strikethroughSequenceTemporary');\n const after = classifyCharacter(code);\n token._open = !after || after === 2 && Boolean(before);\n token._close = !before || before === 2 && Boolean(after);\n return ok(code);\n }\n }\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\n// Port of `edit_map.rs` from `markdown-rs`.\n// This should move to `markdown-js` later.\n\n// Deal with several changes in events, batching them together.\n//\n// Preferably, changes should be kept to a minimum.\n// Sometimes, it’s needed to change the list of events, because parsing can be\n// messy, and it helps to expose a cleaner interface of events to the compiler\n// and other users.\n// It can also help to merge many adjacent similar events.\n// And, in other cases, it’s needed to parse subcontent: pass some events\n// through another tokenizer and inject the result.\n\n/**\n * @typedef {[number, number, Array]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n */\n constructor() {\n /**\n * Record of changes.\n *\n * @type {Array}\n */\n this.map = [];\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * @param {number} remove\n * @param {Array} add\n * @returns {undefined}\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add);\n }\n\n // To do: add this when moving to `micromark`.\n // /**\n // * Create an edit: but insert `add` before existing additions.\n // *\n // * @param {number} index\n // * @param {number} remove\n // * @param {Array} add\n // * @returns {undefined}\n // */\n // addBefore(index, remove, add) {\n // addImplementation(this, index, remove, add, true)\n // }\n\n /**\n * Done, change the events.\n *\n * @param {Array} events\n * @returns {undefined}\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0];\n });\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (this.map.length === 0) {\n return;\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // . shiftLinks(events, jumps)\n\n let index = this.map.length;\n /** @type {Array>} */\n const vecs = [];\n while (index > 0) {\n index -= 1;\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);\n\n // Truncate rest.\n events.length = this.map[index][0];\n }\n vecs.push(events.slice());\n events.length = 0;\n let slice = vecs.pop();\n while (slice) {\n for (const element of slice) {\n events.push(element);\n }\n slice = vecs.pop();\n }\n\n // Truncate everything.\n this.map.length = 0;\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * @param {number} at\n * @param {number} remove\n * @param {Array} add\n * @returns {undefined}\n */\nfunction addImplementation(editMap, at, remove, add) {\n let index = 0;\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (remove === 0 && add.length === 0) {\n return;\n }\n while (index < editMap.map.length) {\n if (editMap.map[index][0] === at) {\n editMap.map[index][1] += remove;\n\n // To do: before not used by tables, use when moving to micromark.\n // if (before) {\n // add.push(...editMap.map[index][2])\n // editMap.map[index][2] = add\n // } else {\n editMap.map[index][2].push(...add);\n // }\n\n return;\n }\n index += 1;\n }\n editMap.map.push([at, remove, add]);\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array} events\n// * @param {Array} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }","/**\n * @import {Event} from 'micromark-util-types'\n */\n\n/**\n * @typedef {'center' | 'left' | 'none' | 'right'} Align\n */\n\n/**\n * Figure out the alignment of a GFM table.\n *\n * @param {Readonly>} events\n * List of events.\n * @param {number} index\n * Table enter event.\n * @returns {Array}\n * List of aligns.\n */\nexport function gfmTableAlign(events, index) {\n let inDelimiterRow = false;\n /** @type {Array} */\n const align = [];\n while (index < events.length) {\n const event = events[index];\n if (inDelimiterRow) {\n if (event[0] === 'enter') {\n // Start of alignment value: set a new column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n if (event[1].type === 'tableContent') {\n align.push(events[index + 1][1].type === 'tableDelimiterMarker' ? 'left' : 'none');\n }\n }\n // Exits:\n // End of alignment value: change the column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n else if (event[1].type === 'tableContent') {\n if (events[index - 1][1].type === 'tableDelimiterMarker') {\n const alignIndex = align.length - 1;\n align[alignIndex] = align[alignIndex] === 'left' ? 'center' : 'right';\n }\n }\n // Done!\n else if (event[1].type === 'tableDelimiterRow') {\n break;\n }\n } else if (event[0] === 'enter' && event[1].type === 'tableDelimiterRow') {\n inDelimiterRow = true;\n }\n index += 1;\n }\n return align;\n}","/**\n * @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, number, number]} Range\n * Cell info.\n *\n * @typedef {0 | 1 | 2 | 3} RowKind\n * Where we are: `1` for head row, `2` for delimiter row, `3` for body row.\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nimport { EditMap } from './edit-map.js';\nimport { gfmTableAlign } from './infer.js';\n\n/**\n * Create an HTML extension for `micromark` to support GitHub tables syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * table syntax.\n */\nexport function gfmTable() {\n return {\n flow: {\n null: {\n name: 'table',\n tokenize: tokenizeTable,\n resolveAll: resolveTable\n }\n }\n };\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTable(effects, ok, nok) {\n const self = this;\n let size = 0;\n let sizeB = 0;\n /** @type {boolean | undefined} */\n let seen;\n return start;\n\n /**\n * Start of a GFM table.\n *\n * If there is a valid table row or table head before, then we try to parse\n * another row.\n * Otherwise, we try to parse a head.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * > | | b |\n * ^\n * ```\n * @type {State}\n */\n function start(code) {\n let index = self.events.length - 1;\n while (index > -1) {\n const type = self.events[index][1].type;\n if (type === \"lineEnding\" ||\n // Note: markdown-rs uses `whitespace` instead of `linePrefix`\n type === \"linePrefix\") index--;else break;\n }\n const tail = index > -1 ? self.events[index][1].type : null;\n const next = tail === 'tableHead' || tail === 'tableRow' ? bodyRowStart : headRowBefore;\n\n // Don’t allow lazy body rows.\n if (next === bodyRowStart && self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n return next(code);\n }\n\n /**\n * Before table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBefore(code) {\n effects.enter('tableHead');\n effects.enter('tableRow');\n return headRowStart(code);\n }\n\n /**\n * Before table head row, after whitespace.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowStart(code) {\n if (code === 124) {\n return headRowBreak(code);\n }\n\n // To do: micromark-js should let us parse our own whitespace in extensions,\n // like `markdown-rs`:\n //\n // ```js\n // // 4+ spaces.\n // if (markdownSpace(code)) {\n // return nok(code)\n // }\n // ```\n\n seen = true;\n // Count the first character, that isn’t a pipe, double.\n sizeB += 1;\n return headRowBreak(code);\n }\n\n /**\n * At break in table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * ^\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBreak(code) {\n if (code === null) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n // If anything other than one pipe (ignoring whitespace) was used, it’s fine.\n if (sizeB > 1) {\n sizeB = 0;\n // To do: check if this works.\n // Feel free to interrupt:\n self.interrupt = true;\n effects.exit('tableRow');\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return headDelimiterStart;\n }\n\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n if (markdownSpace(code)) {\n // To do: check if this is fine.\n // effects.attempt(State::Next(StateName::GfmTableHeadRowBreak), State::Nok)\n // State::Retry(space_or_tab(tokenizer))\n return factorySpace(effects, headRowBreak, \"whitespace\")(code);\n }\n sizeB += 1;\n if (seen) {\n seen = false;\n // Header cell count.\n size += 1;\n }\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n // Whether a delimiter was seen.\n seen = true;\n return headRowBreak;\n }\n\n // Anything else is cell data.\n effects.enter(\"data\");\n return headRowData(code);\n }\n\n /**\n * In table head row data.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return headRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? headRowEscape : headRowData;\n }\n\n /**\n * In table head row escape.\n *\n * ```markdown\n * > | | a\\-b |\n * ^\n * | | ---- |\n * | | c |\n * ```\n *\n * @type {State}\n */\n function headRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return headRowData;\n }\n return headRowData(code);\n }\n\n /**\n * Before delimiter row.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterStart(code) {\n // Reset `interrupt`.\n self.interrupt = false;\n\n // Note: in `markdown-rs`, we need to handle piercing here too.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n effects.enter('tableDelimiterRow');\n // Track if we’ve seen a `:` or `|`.\n seen = false;\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterBefore, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n return headDelimiterBefore(code);\n }\n\n /**\n * Before delimiter row, after optional whitespace.\n *\n * Reused when a `|` is found later, to parse another cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterBefore(code) {\n if (code === 45 || code === 58) {\n return headDelimiterValueBefore(code);\n }\n if (code === 124) {\n seen = true;\n // If we start with a pipe, we open a cell marker.\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return headDelimiterCellBefore;\n }\n\n // More whitespace / empty row not allowed at start.\n return headDelimiterNok(code);\n }\n\n /**\n * After `|`, before delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellBefore(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterValueBefore, \"whitespace\")(code);\n }\n return headDelimiterValueBefore(code);\n }\n\n /**\n * Before delimiter cell value.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterValueBefore(code) {\n // Align: left.\n if (code === 58) {\n sizeB += 1;\n seen = true;\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterLeftAlignmentAfter;\n }\n\n // Align: none.\n if (code === 45) {\n sizeB += 1;\n // To do: seems weird that this *isn’t* left aligned, but that state is used?\n return headDelimiterLeftAlignmentAfter(code);\n }\n if (code === null || markdownLineEnding(code)) {\n return headDelimiterCellAfter(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * After delimiter cell left alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | :- |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterLeftAlignmentAfter(code) {\n if (code === 45) {\n effects.enter('tableDelimiterFiller');\n return headDelimiterFiller(code);\n }\n\n // Anything else is not ok after the left-align colon.\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter cell filler.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterFiller(code) {\n if (code === 45) {\n effects.consume(code);\n return headDelimiterFiller;\n }\n\n // Align is `center` if it was `left`, `right` otherwise.\n if (code === 58) {\n seen = true;\n effects.exit('tableDelimiterFiller');\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterRightAlignmentAfter;\n }\n effects.exit('tableDelimiterFiller');\n return headDelimiterRightAlignmentAfter(code);\n }\n\n /**\n * After delimiter cell right alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterRightAlignmentAfter(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterCellAfter, \"whitespace\")(code);\n }\n return headDelimiterCellAfter(code);\n }\n\n /**\n * After delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellAfter(code) {\n if (code === 124) {\n return headDelimiterBefore(code);\n }\n if (code === null || markdownLineEnding(code)) {\n // Exit when:\n // * there was no `:` or `|` at all (it’s a thematic break or setext\n // underline instead)\n // * the header cell count is not the delimiter cell count\n if (!seen || size !== sizeB) {\n return headDelimiterNok(code);\n }\n\n // Note: in markdown-rs`, a reset is needed here.\n effects.exit('tableDelimiterRow');\n effects.exit('tableHead');\n // To do: in `markdown-rs`, resolvers need to be registered manually.\n // effects.register_resolver(ResolveName::GfmTable)\n return ok(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter row, at a disallowed byte.\n *\n * ```markdown\n * | | a |\n * > | | x |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterNok(code) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n\n /**\n * Before table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowStart(code) {\n // Note: in `markdown-rs` we need to manually take care of a prefix,\n // but in `micromark-js` that is done for us, so if we’re here, we’re\n // never at whitespace.\n effects.enter('tableRow');\n return bodyRowBreak(code);\n }\n\n /**\n * At break in table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ^\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowBreak(code) {\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return bodyRowBreak;\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit('tableRow');\n return ok(code);\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, bodyRowBreak, \"whitespace\")(code);\n }\n\n // Anything else is cell content.\n effects.enter(\"data\");\n return bodyRowData(code);\n }\n\n /**\n * In table body row data.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return bodyRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? bodyRowEscape : bodyRowData;\n }\n\n /**\n * In table body row escape.\n *\n * ```markdown\n * | | a |\n * | | ---- |\n * > | | b\\-c |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return bodyRowData;\n }\n return bodyRowData(code);\n }\n}\n\n/** @type {Resolver} */\n\nfunction resolveTable(events, context) {\n let index = -1;\n let inFirstCellAwaitingPipe = true;\n /** @type {RowKind} */\n let rowKind = 0;\n /** @type {Range} */\n let lastCell = [0, 0, 0, 0];\n /** @type {Range} */\n let cell = [0, 0, 0, 0];\n let afterHeadAwaitingFirstBodyRow = false;\n let lastTableEnd = 0;\n /** @type {Token | undefined} */\n let currentTable;\n /** @type {Token | undefined} */\n let currentBody;\n /** @type {Token | undefined} */\n let currentCell;\n const map = new EditMap();\n while (++index < events.length) {\n const event = events[index];\n const token = event[1];\n if (event[0] === 'enter') {\n // Start of head.\n if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = false;\n\n // Inject previous (body end and) table end.\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n currentBody = undefined;\n lastTableEnd = 0;\n }\n\n // Inject table start.\n currentTable = {\n type: 'table',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentTable, context]]);\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n inFirstCellAwaitingPipe = true;\n currentCell = undefined;\n lastCell = [0, 0, 0, 0];\n cell = [0, index + 1, 0, 0];\n\n // Inject table body start.\n if (afterHeadAwaitingFirstBodyRow) {\n afterHeadAwaitingFirstBodyRow = false;\n currentBody = {\n type: 'tableBody',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentBody, context]]);\n }\n rowKind = token.type === 'tableDelimiterRow' ? 2 : currentBody ? 3 : 1;\n }\n // Cell data.\n else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n inFirstCellAwaitingPipe = false;\n\n // First value in cell.\n if (cell[2] === 0) {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n lastCell = [0, 0, 0, 0];\n }\n cell[2] = index;\n }\n } else if (token.type === 'tableCellDivider') {\n if (inFirstCellAwaitingPipe) {\n inFirstCellAwaitingPipe = false;\n } else {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n }\n lastCell = cell;\n cell = [lastCell[1], index, 0, 0];\n }\n }\n }\n // Exit events.\n else if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = true;\n lastTableEnd = index;\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n lastTableEnd = index;\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, index, currentCell);\n } else if (cell[1] !== 0) {\n currentCell = flushCell(map, context, cell, rowKind, index, currentCell);\n }\n rowKind = 0;\n } else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n cell[3] = index;\n }\n }\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n }\n map.consume(context.events);\n\n // To do: move this into `html`, when events are exposed there.\n // That’s what `markdown-rs` does.\n // That needs updates to `mdast-util-gfm-table`.\n index = -1;\n while (++index < context.events.length) {\n const event = context.events[index];\n if (event[0] === 'enter' && event[1].type === 'table') {\n event[1]._align = gfmTableAlign(context.events, index);\n }\n }\n return events;\n}\n\n/**\n * Generate a cell.\n *\n * @param {EditMap} map\n * @param {Readonly} context\n * @param {Readonly} range\n * @param {RowKind} rowKind\n * @param {number | undefined} rowEnd\n * @param {Token | undefined} previousCell\n * @returns {Token | undefined}\n */\n// eslint-disable-next-line max-params\nfunction flushCell(map, context, range, rowKind, rowEnd, previousCell) {\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCell' : 'tableCell'\n const groupName = rowKind === 1 ? 'tableHeader' : rowKind === 2 ? 'tableDelimiter' : 'tableData';\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCellValue' : 'tableCellText'\n const valueName = 'tableContent';\n\n // Insert an exit for the previous cell, if there is one.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[0] !== 0) {\n previousCell.end = Object.assign({}, getPoint(context.events, range[0]));\n map.add(range[0], 0, [['exit', previousCell, context]]);\n }\n\n // Insert enter of this cell.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^^^^-- this cell\n // ```\n const now = getPoint(context.events, range[1]);\n previousCell = {\n type: groupName,\n start: Object.assign({}, now),\n // Note: correct end is set later.\n end: Object.assign({}, now)\n };\n map.add(range[1], 0, [['enter', previousCell, context]]);\n\n // Insert text start at first data start and end at last data end, and\n // remove events between.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[2] !== 0) {\n const relatedStart = getPoint(context.events, range[2]);\n const relatedEnd = getPoint(context.events, range[3]);\n /** @type {Token} */\n const valueToken = {\n type: valueName,\n start: Object.assign({}, relatedStart),\n end: Object.assign({}, relatedEnd)\n };\n map.add(range[2], 0, [['enter', valueToken, context]]);\n if (rowKind !== 2) {\n // Fix positional info on remaining events\n const start = context.events[range[2]];\n const end = context.events[range[3]];\n start[1].end = Object.assign({}, end[1].end);\n start[1].type = \"chunkText\";\n start[1].contentType = \"text\";\n\n // Remove if needed.\n if (range[3] > range[2] + 1) {\n const a = range[2] + 1;\n const b = range[3] - range[2] - 1;\n map.add(a, b, []);\n }\n }\n map.add(range[3] + 1, 0, [['exit', valueToken, context]]);\n }\n\n // Insert an exit for the last cell, if at the row end.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^^^-- this cell (the last one contains two “between” parts)\n // ```\n if (rowEnd !== undefined) {\n previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));\n map.add(rowEnd, 0, [['exit', previousCell, context]]);\n previousCell = undefined;\n }\n return previousCell;\n}\n\n/**\n * Generate table end (and table body end).\n *\n * @param {Readonly} map\n * @param {Readonly} context\n * @param {number} index\n * @param {Token} table\n * @param {Token | undefined} tableBody\n */\n// eslint-disable-next-line max-params\nfunction flushTableEnd(map, context, index, table, tableBody) {\n /** @type {Array} */\n const exits = [];\n const related = getPoint(context.events, index);\n if (tableBody) {\n tableBody.end = Object.assign({}, related);\n exits.push(['exit', tableBody, context]);\n }\n table.end = Object.assign({}, related);\n exits.push(['exit', table, context]);\n map.add(index + 1, 0, exits);\n}\n\n/**\n * @param {Readonly>} events\n * @param {number} index\n * @returns {Readonly}\n */\nfunction getPoint(events, index) {\n const event = events[index];\n const side = event[0] === 'enter' ? 'start' : 'end';\n return event[1][side];\n}","/**\n * @import {Extension, State, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nconst tasklistCheck = {\n name: 'tasklistCheck',\n tokenize: tokenizeTasklistCheck\n};\n\n/**\n * Create an HTML extension for `micromark` to support GFM task list items\n * syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `htmlExtensions` to\n * support GFM task list items when serializing to HTML.\n */\nexport function gfmTaskListItem() {\n return {\n text: {\n [91]: tasklistCheck\n }\n };\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTasklistCheck(effects, ok, nok) {\n const self = this;\n return open;\n\n /**\n * At start of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (\n // Exit if there’s stuff before.\n self.previous !== null ||\n // Exit if not in the first content that is the first child of a list\n // item.\n !self._gfmTasklistFirstContentOfListItem) {\n return nok(code);\n }\n effects.enter('taskListCheck');\n effects.enter('taskListCheckMarker');\n effects.consume(code);\n effects.exit('taskListCheckMarker');\n return inside;\n }\n\n /**\n * In task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // Currently we match how GH works in files.\n // To match how GH works in comments, use `markdownSpace` (`[\\t ]`) instead\n // of `markdownLineEndingOrSpace` (`[\\t\\n\\r ]`).\n if (markdownLineEndingOrSpace(code)) {\n effects.enter('taskListCheckValueUnchecked');\n effects.consume(code);\n effects.exit('taskListCheckValueUnchecked');\n return close;\n }\n if (code === 88 || code === 120) {\n effects.enter('taskListCheckValueChecked');\n effects.consume(code);\n effects.exit('taskListCheckValueChecked');\n return close;\n }\n return nok(code);\n }\n\n /**\n * At close of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function close(code) {\n if (code === 93) {\n effects.enter('taskListCheckMarker');\n effects.consume(code);\n effects.exit('taskListCheckMarker');\n effects.exit('taskListCheck');\n return after;\n }\n return nok(code);\n }\n\n /**\n * @type {State}\n */\n function after(code) {\n // EOL in paragraph means there must be something else after it.\n if (markdownLineEnding(code)) {\n return ok(code);\n }\n\n // Space or tab?\n // Check what comes after.\n if (markdownSpace(code)) {\n return effects.check({\n tokenize: spaceThenNonSpace\n }, ok, nok)(code);\n }\n\n // EOF, or non-whitespace, both wrong.\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction spaceThenNonSpace(effects, ok, nok) {\n return factorySpace(effects, after, \"whitespace\");\n\n /**\n * After whitespace, after task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // EOF means there was nothing, so bad.\n // EOL means there’s content after it, so good.\n // Impossible to have more spaces.\n // Anything else is good.\n return code === null ? nok(code) : ok(code);\n }\n}","/**\n * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions\n * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension\n */\n\nimport {\n combineExtensions,\n combineHtmlExtensions\n} from 'micromark-util-combine-extensions'\nimport {\n gfmAutolinkLiteral,\n gfmAutolinkLiteralHtml\n} from 'micromark-extension-gfm-autolink-literal'\nimport {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote'\nimport {\n gfmStrikethrough,\n gfmStrikethroughHtml\n} from 'micromark-extension-gfm-strikethrough'\nimport {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'\nimport {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'\nimport {\n gfmTaskListItem,\n gfmTaskListItemHtml\n} from 'micromark-extension-gfm-task-list-item'\n\n/**\n * Create an extension for `micromark` to enable GFM syntax.\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n *\n * Passed to `micromark-extens-gfm-strikethrough`.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * syntax.\n */\nexport function gfm(options) {\n return combineExtensions([\n gfmAutolinkLiteral(),\n gfmFootnote(),\n gfmStrikethrough(options),\n gfmTable(),\n gfmTaskListItem()\n ])\n}\n\n/**\n * Create an extension for `micromark` to support GFM when serializing to HTML.\n *\n * @param {HtmlOptions | null | undefined} [options]\n * Configuration (optional).\n *\n * Passed to `micromark-extens-gfm-footnote`.\n * @returns {HtmlExtension}\n * Extension for `micromark` that can be passed in `htmlExtensions` to\n * support GFM when serializing to HTML.\n */\nexport function gfmHtml(options) {\n return combineHtmlExtensions([\n gfmAutolinkLiteralHtml(),\n gfmFootnoteHtml(options),\n gfmStrikethroughHtml(),\n gfmTableHtml(),\n gfmTagfilterHtml(),\n gfmTaskListItemHtml()\n ])\n}\n","/**\n * @import {Root} from 'mdast'\n * @import {Options} from 'remark-gfm'\n * @import {} from 'remark-parse'\n * @import {} from 'remark-stringify'\n * @import {Processor} from 'unified'\n */\n\nimport {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm'\nimport {gfm} from 'micromark-extension-gfm'\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Add support GFM (autolink literals, footnotes, strikethrough, tables,\n * tasklists).\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {undefined}\n * Nothing.\n */\nexport default function remarkGfm(options) {\n // @ts-expect-error: TS is wrong about `this`.\n // eslint-disable-next-line unicorn/no-this-assignment\n const self = /** @type {Processor} */ (this)\n const settings = options || emptyOptions\n const data = self.data()\n\n const micromarkExtensions =\n data.micromarkExtensions || (data.micromarkExtensions = [])\n const fromMarkdownExtensions =\n data.fromMarkdownExtensions || (data.fromMarkdownExtensions = [])\n const toMarkdownExtensions =\n data.toMarkdownExtensions || (data.toMarkdownExtensions = [])\n\n micromarkExtensions.push(gfm(settings))\n fromMarkdownExtensions.push(gfmFromMarkdown())\n toMarkdownExtensions.push(gfmToMarkdown(settings))\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport type { Finding, SampleDetail } from \"../types\";\n\nconst markdownComponents = {\n table: (props: React.ComponentProps<\"table\">) => (\n \n ),\n};\n\ninterface AuditViewProps {\n detail: SampleDetail;\n findings: Finding[];\n onClose: () => void;\n}\n\n/** Full-screen three-pane audit: page image | rendered gold | raw source.\n *\n * Finding lines are file-based (sidecar frontmatter included); the raw pane\n * maps them into the markdown body via the sample's line_offset.\n */\nexport function AuditView({ detail, findings, onClose }: AuditViewProps) {\n const [source, setSource] = useState(\"gold\");\n\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onClose();\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [onClose]);\n\n const pageImage =\n detail.images.find((img) => img.field === \"page\") ?? detail.images[0];\n const offset = detail.line_offset ?? 0;\n const highlighted = useMemo(() => {\n const lines = new Set();\n for (const f of findings) {\n if (f.line != null) lines.add(f.line - offset);\n }\n return lines;\n }, [findings, offset]);\n\n const sourceText =\n source === \"gold\"\n ? detail.answer\n : (detail.tool_outputs?.find((t) => t.name === source)?.text ?? \"\");\n\n return (\n \n
\n
\n Audit — sample {detail.id ?? detail.index}\n \n {findings.length} finding{findings.length !== 1 ? \"s\" : \"\"}\n \n
\n \n \n Close\n \n
\n\n
\n {/* Page image */}\n \n
\n Page\n
\n {pageImage ? (\n \"page\"\n ) : (\n
No page image.
\n )}\n
\n\n {/* Rendered gold */}\n \n
\n Rendered gold\n
\n
\n \n {detail.answer}\n \n
\n \n\n {/* Raw source with finding-line highlights */}\n \n
\n
\n Source\n
\n {detail.tool_outputs && detail.tool_outputs.length > 0 && (\n setSource(e.target.value)}\n >\n \n {detail.tool_outputs.map((t) => (\n \n ))}\n \n )}\n
\n
\n            {sourceText.split(\"\\n\").map((line, i) => {\n              const isHit = source === \"gold\" && highlighted.has(i + 1);\n              return (\n                \n                  \n                    {i + 1}\n                  \n                  {line || \" \"}\n                \n              );\n            })}\n          
\n \n \n \n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport { AuditView } from \"./AuditView\";\nimport { useParams, useSearchParams } from \"react-router-dom\";\nimport { useStore, getFilteredFindings } from \"../store\";\nimport { fetchSampleDetail } from \"../api\";\nimport type { SampleDetail, TriageStatus } from \"../types\";\n\nconst markdownComponents = {\n table: (props: React.ComponentProps<\"table\">) => (\n
\n ),\n};\n\nexport function FindingDetail() {\n const finding = useStore((s) => s.selectedFinding);\n const triageFinding = useStore((s) => s.triageFinding);\n const findings = useStore((s) => s.findings);\n const setSelectedFinding = useStore((s) => s.setSelectedFinding);\n const [searchParams] = useSearchParams();\n const { slug } = useParams<{ slug: string }>();\n const [showAudit, setShowAudit] = useState(false);\n\n // Loaded detail is keyed by (slug, sample_index) so the current sample's\n // detail and loading flag can be derived instead of set in the effect.\n const [loaded, setLoaded] = useState<{\n key: string;\n detail: SampleDetail | null;\n } | null>(null);\n\n useEffect(() => {\n if (finding == null || !slug) return;\n let cancelled = false;\n const key = `${slug}:${finding.sample_index}`;\n fetchSampleDetail(slug, finding.sample_index).then((d) => {\n if (!cancelled) setLoaded({ key, detail: d });\n });\n return () => {\n cancelled = true;\n };\n }, [finding?.sample_index, slug]);\n\n const currentKey =\n finding != null && slug ? `${slug}:${finding.sample_index}` : null;\n const sampleDetail =\n loaded && loaded.key === currentKey ? loaded.detail : null;\n const sampleLoading =\n currentKey != null && (loaded == null || loaded.key !== currentKey);\n\n if (!finding) {\n return (\n \n Select a finding to view details.\n \n );\n }\n\n const handleTriage = (status: TriageStatus) => {\n triageFinding(\n finding.id,\n finding.triage_status === status ? \"pending\" : status,\n );\n };\n\n const filtered = getFilteredFindings(\n findings,\n searchParams.get(\"scanner\"),\n searchParams.get(\"severity\"),\n searchParams.get(\"triage\"),\n );\n const idx = filtered.findIndex((f) => f.id === finding.id);\n\n const navigateFinding = (direction: \"prev\" | \"next\") => {\n const next =\n direction === \"next\"\n ? Math.min(idx + 1, filtered.length - 1)\n : Math.max(idx - 1, 0);\n if (next !== idx) setSelectedFinding(filtered[next]);\n };\n\n const sampleFindings = findings.filter(\n (f) => f.sample_index === finding.sample_index,\n );\n\n const allImages = [\n ...(sampleDetail?.images ?? []).map((img) => ({\n src: img.data_url,\n label: img.field,\n })),\n ...(sampleDetail?.files ?? []).map((f) => ({\n src: f.data_url,\n label: f.name,\n })),\n ];\n\n return (\n \n {showAudit && sampleDetail && (\n setShowAudit(false)}\n />\n )}\n {/* Finding header */}\n
\n
\n
\n {finding.scanner}\n \n
\n \n Sample #{finding.sample_index}\n \n
\n

{finding.explanation}

\n
\n\n {/* Finding metadata */}\n {finding.metadata && Object.keys(finding.metadata).length > 0 && (\n
\n
\n Details\n
\n
\n {Object.entries(finding.metadata).map(([key, value]) => (\n
\n
{key}:
\n
\n {typeof value === \"object\"\n ? JSON.stringify(value)\n : String(value)}\n
\n
\n ))}\n
\n
\n )}\n\n {/* Sample content */}\n
\n
\n Sample\n
\n {sampleLoading ? (\n
Loading…
\n ) : sampleDetail ? (\n <>\n
\n Q: \n {sampleDetail.question}\n
\n
\n A: \n {sampleDetail.answer.includes(\"\\n\") ? (\n
\n \n {sampleDetail.answer}\n \n
\n ) : (\n {sampleDetail.answer}\n )}\n
\n {(allImages.length > 0 || sampleDetail.answer.includes(\"\\n\")) && (\n setShowAudit(true)}\n >\n \n Audit view\n \n )}\n {allImages.map((img) => (\n \n ))}\n \n ) : (\n
No sample data.
\n )}\n
\n\n {/* Triage */}\n
\n
\n Triage\n
\n
\n handleTriage(\"confirmed\")}\n title=\"Confirm this finding (c)\"\n >\n \n Confirm\n \n handleTriage(\"dismissed\")}\n title=\"Dismiss this finding (d)\"\n >\n \n Dismiss\n \n
\n
\n\n {/* Navigation */}\n
\n navigateFinding(\"prev\")}\n title=\"Previous finding (p)\"\n disabled={idx <= 0}\n >\n \n Prev\n \n navigateFinding(\"next\")}\n title=\"Next finding (n)\"\n disabled={idx >= filtered.length - 1}\n >\n Next\n \n \n
\n \n );\n}\n\nfunction SeverityBadge({ severity }: { severity: string }) {\n const cls: Record = {\n high: \"bg-danger\",\n medium: \"bg-warning text-dark\",\n low: \"bg-secondary\",\n };\n return (\n \n {severity.toUpperCase()}\n \n );\n}\n","// packages/ag-grid-community/src/agStack/utils/array.ts\nfunction _last(arr) {\n if (!arr?.length) {\n return;\n }\n return arr[arr.length - 1];\n}\nfunction _areEqual(a, b, comparator) {\n if (a === b) {\n return true;\n }\n if (!a || !b) {\n return a == null && b == null;\n }\n const len = a.length;\n if (len !== b.length) {\n return false;\n }\n for (let i = 0; i < len; i++) {\n if (a[i] !== b[i] && !comparator?.(a[i], b[i])) {\n return false;\n }\n }\n return true;\n}\nfunction _forAll(array, callback) {\n if (!array) {\n return;\n }\n for (const value of array) {\n if (callback(value)) {\n return true;\n }\n }\n}\nfunction _removeFromArray(array, object) {\n const index = array.indexOf(object);\n if (index >= 0) {\n array.splice(index, 1);\n }\n}\nfunction _removeAllFromArray(array, elementsToRemove) {\n let i = 0;\n let j = 0;\n for (; i < array.length; i++) {\n if (!elementsToRemove.includes(array[i])) {\n array[j] = array[i];\n j++;\n }\n }\n while (j < array.length) {\n array.pop();\n }\n}\nfunction _moveInArray(array, objectsToMove, toIndex) {\n for (let i = 0; i < objectsToMove.length; i++) {\n _removeFromArray(array, objectsToMove[i]);\n }\n for (let i = objectsToMove.length - 1; i >= 0; i--) {\n array.splice(toIndex, 0, objectsToMove[i]);\n }\n}\nfunction _flatten(arrays) {\n return [].concat.apply([], arrays);\n}\n\n// packages/ag-grid-community/src/agStack/utils/generic.ts\nvar _makeNull = (value) => {\n if (value == null || value === \"\") {\n return null;\n }\n return value;\n};\nfunction _exists(value) {\n return value != null && value !== \"\";\n}\nfunction _missing(value) {\n return !_exists(value);\n}\nvar _toStringOrNull = (value) => {\n return value != null && typeof value.toString === \"function\" ? value.toString() : null;\n};\nvar _jsonEquals = (val1, val2) => {\n const val1Json = val1 ? JSON.stringify(val1) : null;\n const val2Json = val2 ? JSON.stringify(val2) : null;\n return val1Json === val2Json;\n};\nvar _defaultComparator = (valueA, valueB, accentedCompare = false) => {\n if (valueA == null) {\n return valueB == null ? 0 : -1;\n }\n if (valueB == null) {\n return 1;\n }\n if (typeof valueA === \"object\" && valueA.toNumber) {\n valueA = valueA.toNumber();\n }\n if (typeof valueB === \"object\" && valueB.toNumber) {\n valueB = valueB.toNumber();\n }\n if (!accentedCompare || typeof valueA !== \"string\") {\n if (valueA > valueB) {\n return 1;\n }\n if (valueA < valueB) {\n return -1;\n }\n return 0;\n }\n return valueA.localeCompare(valueB);\n};\n\n// packages/ag-grid-community/src/agStack/events/localEventService.ts\nvar LocalEventService = class {\n constructor() {\n this.allSyncListeners = /* @__PURE__ */ new Map();\n this.allAsyncListeners = /* @__PURE__ */ new Map();\n this.globalSyncListeners = /* @__PURE__ */ new Set();\n this.globalAsyncListeners = /* @__PURE__ */ new Set();\n this.asyncFunctionsQueue = [];\n this.scheduled = false;\n // using an object performs better than a Set for the number of different events we have\n this.firedEvents = {};\n }\n setFrameworkOverrides(frameworkOverrides) {\n this.frameworkOverrides = frameworkOverrides;\n }\n getListeners(eventType, async, autoCreateListenerCollection) {\n const listenerMap = async ? this.allAsyncListeners : this.allSyncListeners;\n let listeners = listenerMap.get(eventType);\n if (!listeners && autoCreateListenerCollection) {\n listeners = /* @__PURE__ */ new Set();\n listenerMap.set(eventType, listeners);\n }\n return listeners;\n }\n noRegisteredListenersExist() {\n return this.allSyncListeners.size === 0 && this.allAsyncListeners.size === 0 && this.globalSyncListeners.size === 0 && this.globalAsyncListeners.size === 0;\n }\n addEventListener(eventType, listener, async = false) {\n this.getListeners(eventType, async, true).add(listener);\n }\n removeEventListener(eventType, listener, async = false) {\n const listeners = this.getListeners(eventType, async, false);\n if (!listeners) {\n return;\n }\n listeners.delete(listener);\n if (listeners.size === 0) {\n (async ? this.allAsyncListeners : this.allSyncListeners).delete(eventType);\n }\n }\n addGlobalListener(listener, async = false) {\n this.getGlobalListeners(async).add(listener);\n }\n removeGlobalListener(listener, async = false) {\n this.getGlobalListeners(async).delete(listener);\n }\n dispatchEvent(event) {\n this.dispatchToListeners(event, true);\n this.dispatchToListeners(event, false);\n this.firedEvents[event.type] = true;\n }\n dispatchEventOnce(event) {\n if (!this.firedEvents[event.type]) {\n this.dispatchEvent(event);\n }\n }\n dispatchToListeners(event, async) {\n const eventType = event.type;\n if (async && \"event\" in event) {\n const browserEvent = event.event;\n if (browserEvent instanceof Event) {\n event.eventPath = browserEvent.composedPath();\n }\n }\n const { frameworkOverrides } = this;\n const runCallback = (func) => {\n const callback = frameworkOverrides ? () => frameworkOverrides.wrapIncoming(func) : func;\n if (async) {\n this.dispatchAsync(callback);\n } else {\n callback();\n }\n };\n const originalListeners = this.getListeners(eventType, async, false);\n if ((originalListeners?.size ?? 0) > 0) {\n const listeners = new Set(originalListeners);\n for (const listener of listeners) {\n if (!originalListeners?.has(listener)) {\n continue;\n }\n runCallback(() => listener(event));\n }\n }\n const globalListenersSrc = this.getGlobalListeners(async);\n if (globalListenersSrc.size > 0) {\n const globalListeners = new Set(globalListenersSrc);\n for (const listener of globalListeners) {\n runCallback(() => listener(eventType, event));\n }\n }\n }\n getGlobalListeners(async) {\n return async ? this.globalAsyncListeners : this.globalSyncListeners;\n }\n // this gets called inside the grid's thread, for each event that it\n // wants to set async. the grid then batches the events into one setTimeout()\n // because setTimeout() is an expensive operation. ideally we would have\n // each event in it's own setTimeout(), but we batch for performance.\n dispatchAsync(func) {\n this.asyncFunctionsQueue.push(func);\n if (!this.scheduled) {\n const flush = () => {\n window.setTimeout(this.flushAsyncQueue.bind(this), 0);\n };\n const frameworkOverrides = this.frameworkOverrides;\n if (frameworkOverrides) {\n frameworkOverrides.wrapIncoming(flush);\n } else {\n flush();\n }\n this.scheduled = true;\n }\n }\n // this happens in the next VM turn only, and empties the queue of events\n flushAsyncQueue() {\n this.scheduled = false;\n const queueCopy = this.asyncFunctionsQueue.slice();\n this.asyncFunctionsQueue = [];\n for (const func of queueCopy) {\n func();\n }\n }\n};\n\n// packages/ag-grid-community/src/agStack/utils/string.ts\nvar reUnescapedHtml = /[&<>\"']/g;\nvar HTML_ESCAPES = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\",\n \"'\": \"'\"\n};\nfunction _toString(toEscape) {\n return toEscape?.toString().toString() ?? null;\n}\nfunction _escapeString(toEscape) {\n return _toString(toEscape)?.replace(reUnescapedHtml, (chr) => HTML_ESCAPES[chr]) ?? null;\n}\nfunction _isExpressionString(value) {\n return typeof value === \"string\" && value.startsWith(\"=\") && value.length > 1;\n}\nfunction _camelCaseToHumanText(camelCase) {\n if (!camelCase || camelCase == null) {\n return null;\n }\n const rex = /([a-z])([A-Z])/g;\n const rexCaps = /([A-Z]+)([A-Z])([a-z])/g;\n const words = camelCase.replace(rex, \"$1 $2\").replace(rexCaps, \"$1 $2$3\").replace(/\\./g, \" \").split(\" \");\n return words.map((word) => word.substring(0, 1).toUpperCase() + (word.length > 1 ? word.substring(1, word.length) : \"\")).join(\" \");\n}\n\n// packages/ag-grid-community/src/agStack/utils/document.ts\nfunction _getRootNode(beans) {\n return beans.eRootDiv.getRootNode();\n}\nfunction _getActiveDomElement(beans) {\n return _getRootNode(beans).activeElement;\n}\nfunction _getDocument(beans) {\n const { gos, eRootDiv } = beans;\n let result = null;\n const optionsGetDocument = gos.get(\"getDocument\");\n if (optionsGetDocument && _exists(optionsGetDocument)) {\n result = optionsGetDocument();\n } else if (eRootDiv) {\n result = eRootDiv.ownerDocument;\n }\n if (result && _exists(result)) {\n return result;\n }\n return document;\n}\nfunction _isNothingFocused(beans) {\n const activeEl = _getActiveDomElement(beans);\n return activeEl === null || activeEl === _getDocument(beans).body;\n}\nfunction _getWindow(beans) {\n const eDocument = _getDocument(beans);\n return eDocument.defaultView || window;\n}\nfunction _getPageBody(beans) {\n let rootNode = null;\n let targetEl = null;\n try {\n rootNode = _getDocument(beans).fullscreenElement;\n } catch (e) {\n } finally {\n if (!rootNode) {\n rootNode = _getRootNode(beans);\n }\n const body = rootNode.querySelector(\"body\");\n if (body) {\n targetEl = body;\n } else if (rootNode instanceof ShadowRoot) {\n targetEl = rootNode;\n } else if (rootNode instanceof Document) {\n targetEl = rootNode?.documentElement;\n } else {\n targetEl = rootNode;\n }\n }\n return targetEl;\n}\nfunction _getBodyWidth(beans) {\n const body = _getPageBody(beans);\n return body?.clientWidth ?? (window.innerWidth || -1);\n}\nfunction _getBodyHeight(beans) {\n const body = _getPageBody(beans);\n return body?.clientHeight ?? (window.innerHeight || -1);\n}\n\n// packages/ag-grid-community/src/agStack/utils/aria.ts\nfunction _toggleAriaAttribute(element, attribute, value) {\n if (value == null || typeof value === \"string\" && value == \"\") {\n _removeAriaAttribute(element, attribute);\n } else {\n _setAriaAttribute(element, attribute, value);\n }\n}\nfunction _setAriaAttribute(element, attribute, value) {\n element.setAttribute(_ariaAttributeName(attribute), value.toString());\n}\nfunction _removeAriaAttribute(element, attribute) {\n element.removeAttribute(_ariaAttributeName(attribute));\n}\nfunction _ariaAttributeName(attribute) {\n return `aria-${attribute}`;\n}\nfunction _setAriaRole(element, role) {\n if (role) {\n element.setAttribute(\"role\", role);\n } else {\n element.removeAttribute(\"role\");\n }\n}\nfunction _getAriaSortState(directionOrDef) {\n const direction = directionOrDef?.direction;\n if (direction === \"asc\") {\n return \"ascending\";\n } else if (direction === \"desc\") {\n return \"descending\";\n } else if (direction === \"mixed\") {\n return \"other\";\n }\n return \"none\";\n}\nfunction _getAriaPosInSet(element) {\n return Number.parseInt(element.getAttribute(\"aria-posinset\"), 10);\n}\nfunction _getAriaLabel(element) {\n return element.getAttribute(\"aria-label\");\n}\nfunction _setAriaLabel(element, label) {\n _toggleAriaAttribute(element, \"label\", label);\n}\nfunction _setAriaLabelledBy(element, labelledBy) {\n _toggleAriaAttribute(element, \"labelledby\", labelledBy);\n}\nfunction _setAriaDescribedBy(element, describedby) {\n _toggleAriaAttribute(element, \"describedby\", describedby);\n}\nfunction _setAriaLive(element, live) {\n _toggleAriaAttribute(element, \"live\", live);\n}\nfunction _setAriaAtomic(element, atomic) {\n _toggleAriaAttribute(element, \"atomic\", atomic);\n}\nfunction _setAriaRelevant(element, relevant) {\n _toggleAriaAttribute(element, \"relevant\", relevant);\n}\nfunction _setAriaInvalid(element, invalid) {\n _toggleAriaAttribute(element, \"invalid\", invalid);\n}\nfunction _setAriaLevel(element, level) {\n _toggleAriaAttribute(element, \"level\", level);\n}\nfunction _setAriaDisabled(element, disabled) {\n _toggleAriaAttribute(element, \"disabled\", disabled);\n}\nfunction _setAriaHidden(element, hidden) {\n _toggleAriaAttribute(element, \"hidden\", hidden);\n}\nfunction _setAriaActiveDescendant(element, descendantId) {\n _toggleAriaAttribute(element, \"activedescendant\", descendantId);\n}\nfunction _setAriaExpanded(element, expanded) {\n _setAriaAttribute(element, \"expanded\", expanded);\n}\nfunction _removeAriaExpanded(element) {\n _removeAriaAttribute(element, \"expanded\");\n}\nfunction _setAriaSetSize(element, setsize) {\n _setAriaAttribute(element, \"setsize\", setsize);\n}\nfunction _setAriaPosInSet(element, position) {\n _setAriaAttribute(element, \"posinset\", position);\n}\nfunction _setAriaMultiSelectable(element, multiSelectable) {\n _setAriaAttribute(element, \"multiselectable\", multiSelectable);\n}\nfunction _setAriaRowCount(element, rowCount) {\n _setAriaAttribute(element, \"rowcount\", rowCount);\n}\nfunction _setAriaRowIndex(element, rowIndex) {\n _setAriaAttribute(element, \"rowindex\", rowIndex);\n}\nfunction _setAriaRowSpan(element, spanCount) {\n _setAriaAttribute(element, \"rowspan\", spanCount);\n}\nfunction _setAriaColCount(element, colCount) {\n _setAriaAttribute(element, \"colcount\", colCount);\n}\nfunction _setAriaColIndex(element, colIndex) {\n _setAriaAttribute(element, \"colindex\", colIndex);\n}\nfunction _setAriaColSpan(element, colSpan) {\n _setAriaAttribute(element, \"colspan\", colSpan);\n}\nfunction _setAriaSort(element, sort) {\n _setAriaAttribute(element, \"sort\", sort);\n}\nfunction _removeAriaSort(element) {\n _removeAriaAttribute(element, \"sort\");\n}\nfunction _setAriaSelected(element, selected) {\n _toggleAriaAttribute(element, \"selected\", selected);\n}\nfunction _setAriaChecked(element, checked) {\n _setAriaAttribute(element, \"checked\", checked === void 0 ? \"mixed\" : checked);\n}\nfunction _setAriaControls(controllerElement, controlledId) {\n _toggleAriaAttribute(controllerElement, \"controls\", controlledId);\n}\nfunction _setAriaControlsAndLabel(controllerElement, controlledElement) {\n _setAriaControls(controllerElement, controlledElement.id);\n _setAriaLabelledBy(controlledElement, controllerElement.id);\n}\nfunction _setAriaOwns(ownerElement, ownedId) {\n _toggleAriaAttribute(ownerElement, \"owns\", ownedId);\n}\nfunction _setAriaHasPopup(element, hasPopup) {\n _toggleAriaAttribute(element, \"haspopup\", hasPopup === false ? null : hasPopup);\n}\nfunction _getAriaCheckboxStateName(translate, state) {\n return state === void 0 ? translate(\"ariaIndeterminate\", \"indeterminate\") : state === true ? translate(\"ariaChecked\", \"checked\") : translate(\"ariaUnchecked\", \"unchecked\");\n}\nfunction _setAriaOrientation(element, orientation) {\n if (orientation) {\n _setAriaAttribute(element, \"orientation\", orientation);\n } else {\n _removeAriaAttribute(element, \"orientation\");\n }\n}\n\n// packages/ag-grid-community/src/agStack/utils/dom.ts\nfunction _radioCssClass(element, elementClass, otherElementClass) {\n const parent = element.parentElement;\n let sibling = parent && parent.firstChild;\n while (sibling) {\n if (elementClass) {\n sibling.classList.toggle(elementClass, sibling === element);\n }\n if (otherElementClass) {\n sibling.classList.toggle(otherElementClass, sibling !== element);\n }\n sibling = sibling.nextSibling;\n }\n}\nvar FOCUSABLE_SELECTOR = \"[tabindex], input, select, button, textarea, [href]\";\nvar FOCUSABLE_EXCLUDE = \"[disabled], .ag-disabled:not(.ag-button), .ag-disabled *\";\nfunction _isFocusableFormField(element) {\n if (!element) {\n return false;\n }\n const isFocusable = element.matches(\"input, select, button, textarea\");\n if (!isFocusable) {\n return false;\n }\n const isNotFocusable = element.matches(FOCUSABLE_EXCLUDE);\n if (!isNotFocusable) {\n return false;\n }\n return _isVisible(element);\n}\nfunction _setDisplayed(element, displayed, options = {}) {\n const { skipAriaHidden } = options;\n element.classList.toggle(\"ag-hidden\", !displayed);\n if (!skipAriaHidden) {\n _setAriaHidden(element, !displayed);\n }\n}\nfunction _setVisible(element, visible, options = {}) {\n const { skipAriaHidden } = options;\n element.classList.toggle(\"ag-invisible\", !visible);\n if (!skipAriaHidden) {\n _setAriaHidden(element, !visible);\n }\n}\nfunction _setDisabled(element, disabled) {\n const attributeName = \"disabled\";\n const addOrRemoveDisabledAttribute = disabled ? (e) => e.setAttribute(attributeName, \"\") : (e) => e.removeAttribute(attributeName);\n addOrRemoveDisabledAttribute(element);\n const inputs = element.querySelectorAll(\"input\") ?? [];\n for (const input of inputs) {\n addOrRemoveDisabledAttribute(input);\n }\n}\nfunction _isElementChildOfClass(element, cls, maxNest) {\n let counter = 0;\n while (element) {\n if (element.classList.contains(cls)) {\n return true;\n }\n element = element.parentElement;\n if (typeof maxNest == \"number\") {\n if (++counter > maxNest) {\n break;\n }\n } else if (element === maxNest) {\n break;\n }\n }\n return false;\n}\nfunction _getElementSize(el) {\n const {\n height,\n width,\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n boxSizing\n } = window.getComputedStyle(el);\n const pf = Number.parseFloat;\n return {\n height: pf(height || \"0\"),\n width: pf(width || \"0\"),\n borderTopWidth: pf(borderTopWidth || \"0\"),\n borderRightWidth: pf(borderRightWidth || \"0\"),\n borderBottomWidth: pf(borderBottomWidth || \"0\"),\n borderLeftWidth: pf(borderLeftWidth || \"0\"),\n paddingTop: pf(paddingTop || \"0\"),\n paddingRight: pf(paddingRight || \"0\"),\n paddingBottom: pf(paddingBottom || \"0\"),\n paddingLeft: pf(paddingLeft || \"0\"),\n marginTop: pf(marginTop || \"0\"),\n marginRight: pf(marginRight || \"0\"),\n marginBottom: pf(marginBottom || \"0\"),\n marginLeft: pf(marginLeft || \"0\"),\n boxSizing\n };\n}\nfunction _getInnerHeight(el) {\n const size = _getElementSize(el);\n if (size.boxSizing === \"border-box\") {\n return size.height - size.paddingTop - size.paddingBottom - size.borderTopWidth - size.borderBottomWidth;\n }\n return size.height;\n}\nfunction _getInnerWidth(el) {\n const size = _getElementSize(el);\n if (size.boxSizing === \"border-box\") {\n return size.width - size.paddingLeft - size.paddingRight - size.borderLeftWidth - size.borderRightWidth;\n }\n return size.width;\n}\nfunction _getAbsoluteHeight(el) {\n const { height, marginBottom, marginTop } = _getElementSize(el);\n return Math.floor(height + marginBottom + marginTop);\n}\nfunction _getAbsoluteWidth(el) {\n const { width, marginLeft, marginRight } = _getElementSize(el);\n return Math.floor(width + marginLeft + marginRight);\n}\nfunction _getElementRectWithOffset(el) {\n const offsetElementRect = el.getBoundingClientRect();\n const { borderTopWidth, borderLeftWidth, borderRightWidth, borderBottomWidth } = _getElementSize(el);\n return {\n top: offsetElementRect.top + (borderTopWidth || 0),\n left: offsetElementRect.left + (borderLeftWidth || 0),\n right: offsetElementRect.right + (borderRightWidth || 0),\n bottom: offsetElementRect.bottom + (borderBottomWidth || 0)\n };\n}\nfunction _getScrollLeft(element, rtl) {\n let scrollLeft = element.scrollLeft;\n if (rtl) {\n scrollLeft = Math.abs(scrollLeft);\n }\n return scrollLeft;\n}\nfunction _setScrollLeft(element, value, rtl) {\n if (rtl) {\n value *= -1;\n }\n element.scrollLeft = value;\n}\nfunction _clearElement(el) {\n while (el?.firstChild) {\n el.firstChild.remove();\n }\n}\nfunction _removeFromParent(node) {\n if (node?.parentNode) {\n node.remove();\n }\n}\nfunction _isInDOM(element) {\n return !!element.offsetParent;\n}\nfunction _isVisible(element) {\n if (element.checkVisibility) {\n return element.checkVisibility({ checkVisibilityCSS: true });\n }\n const isHidden = !_isInDOM(element) || window.getComputedStyle(element).visibility !== \"visible\";\n return !isHidden;\n}\nfunction _loadTemplate(template) {\n const tempDiv = document.createElement(\"div\");\n tempDiv.innerHTML = (template || \"\").trim();\n return tempDiv.firstChild;\n}\nfunction _ensureDomOrder(eContainer, eChild, eChildBefore) {\n if (eChildBefore && eChildBefore.nextSibling === eChild) {\n return;\n }\n if (!eContainer.firstChild) {\n eContainer.appendChild(eChild);\n } else if (eChildBefore) {\n if (eChildBefore.nextSibling) {\n eContainer.insertBefore(eChild, eChildBefore.nextSibling);\n } else {\n eContainer.appendChild(eChild);\n }\n } else if (eContainer.firstChild && eContainer.firstChild !== eChild) {\n eContainer.prepend(eChild);\n }\n}\nfunction _setDomChildOrder(eContainer, orderedChildren) {\n for (let i = 0; i < orderedChildren.length; i++) {\n const correctCellAtIndex = orderedChildren[i];\n const actualCellAtIndex = eContainer.children[i];\n if (actualCellAtIndex !== correctCellAtIndex) {\n eContainer.insertBefore(correctCellAtIndex, actualCellAtIndex);\n }\n }\n}\nfunction _camelCaseToHyphenated(camelCase) {\n return camelCase.replace(/[A-Z]/g, (s) => `-${s.toLocaleLowerCase()}`);\n}\nfunction _addStylesToElement(eElement, styles) {\n if (!styles) {\n return;\n }\n for (const key of Object.keys(styles)) {\n const value = styles[key];\n if (!key?.length || value == null) {\n continue;\n }\n const parsedKey = _camelCaseToHyphenated(key);\n const valueAsString = value.toString();\n const parsedValue = valueAsString.replace(/\\s*!important/g, \"\");\n const priority = parsedValue.length != valueAsString.length ? \"important\" : void 0;\n eElement.style.setProperty(parsedKey, parsedValue, priority);\n }\n}\nfunction _isElementOverflowingCallback(getElement2) {\n return () => {\n const element = getElement2();\n if (!element) {\n return true;\n }\n return _isHorizontalScrollShowing(element) || _isVerticalScrollShowing(element);\n };\n}\nfunction _isHorizontalScrollShowing(element) {\n return element.clientWidth < element.scrollWidth;\n}\nfunction _isVerticalScrollShowing(element) {\n return element.clientHeight < element.scrollHeight;\n}\nfunction _setElementWidth(element, width) {\n if (width === \"flex\") {\n element.style.removeProperty(\"width\");\n element.style.removeProperty(\"minWidth\");\n element.style.removeProperty(\"maxWidth\");\n element.style.flex = \"1 1 auto\";\n } else {\n _setFixedWidth(element, width);\n }\n}\nfunction _setFixedWidth(element, width) {\n width = _formatSize(width);\n element.style.width = width;\n element.style.maxWidth = width;\n element.style.minWidth = width;\n}\nfunction _setFixedHeight(element, height) {\n height = _formatSize(height);\n element.style.height = height;\n element.style.maxHeight = height;\n element.style.minHeight = height;\n}\nfunction _formatSize(size) {\n return typeof size === \"number\" ? `${size}px` : size;\n}\nfunction _isNodeOrElement(o) {\n return o instanceof Node || o instanceof HTMLElement;\n}\nfunction _addOrRemoveAttribute(element, name, value) {\n if (value == null || value === \"\") {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value.toString());\n }\n}\nfunction _placeCaretAtEnd(beans, contentElement) {\n if (!contentElement.isContentEditable) {\n return;\n }\n const selection = _getWindow(beans).getSelection();\n if (!selection) {\n return;\n }\n const range = _getDocument(beans).createRange();\n range.selectNodeContents(contentElement);\n range.collapse(false);\n selection.removeAllRanges();\n selection.addRange(range);\n}\nfunction _observeResize(beans, element, callback) {\n const win = _getWindow(beans);\n const ResizeObserverImpl = win.ResizeObserver;\n const resizeObserver = ResizeObserverImpl ? new ResizeObserverImpl(callback) : null;\n resizeObserver?.observe(element);\n return () => resizeObserver?.disconnect();\n}\nfunction _requestAnimationFrame(beans, callback) {\n const win = _getWindow(beans);\n if (win.requestAnimationFrame) {\n win.requestAnimationFrame(callback);\n } else if (win.webkitRequestAnimationFrame) {\n win.webkitRequestAnimationFrame(callback);\n } else {\n win.setTimeout(callback, 0);\n }\n}\nvar DataRefAttribute = \"data-ref\";\nvar whitespaceNode;\nfunction getWhitespaceNode() {\n whitespaceNode ?? (whitespaceNode = document.createTextNode(\" \"));\n return whitespaceNode.cloneNode();\n}\nfunction _createAgElement(params) {\n const { attrs, children, cls, ref, role, tag } = params;\n const element = document.createElement(tag);\n if (cls) {\n element.className = cls;\n }\n if (ref) {\n element.setAttribute(DataRefAttribute, ref);\n }\n if (role) {\n element.setAttribute(\"role\", role);\n }\n if (attrs) {\n for (const key of Object.keys(attrs)) {\n element.setAttribute(key, attrs[key]);\n }\n }\n if (children) {\n if (typeof children === \"string\") {\n element.textContent = children;\n } else {\n let addFirstWhitespace = true;\n for (const child of children) {\n if (child) {\n if (typeof child === \"string\") {\n element.appendChild(document.createTextNode(child));\n addFirstWhitespace = false;\n } else if (typeof child === \"function\") {\n element.appendChild(child());\n } else {\n if (addFirstWhitespace) {\n element.appendChild(getWhitespaceNode());\n addFirstWhitespace = false;\n }\n element.append(_createAgElement(child));\n element.appendChild(getWhitespaceNode());\n }\n }\n }\n }\n }\n return element;\n}\n\n// packages/ag-grid-community/src/agStack/utils/event.ts\nvar PASSIVE_EVENTS = [\"touchstart\", \"touchend\", \"touchmove\", \"touchcancel\", \"scroll\"];\nvar NON_PASSIVE_EVENTS = [\"wheel\"];\nvar supports = {};\nvar _isEventSupported = /* @__PURE__ */ (() => {\n const tags = {\n select: \"input\",\n change: \"input\",\n submit: \"form\",\n reset: \"form\",\n error: \"img\",\n load: \"img\",\n abort: \"img\"\n };\n const eventChecker = (eventName) => {\n if (typeof supports[eventName] === \"boolean\") {\n return supports[eventName];\n }\n const el = document.createElement(tags[eventName] || \"div\");\n eventName = \"on\" + eventName;\n return supports[eventName] = eventName in el;\n };\n return eventChecker;\n})();\nfunction _isElementInEventPath(element, event) {\n if (!event || !element) {\n return false;\n }\n return _getEventPath(event).indexOf(element) >= 0;\n}\nfunction _createEventPath(event) {\n const res = [];\n let pointer = event.target;\n while (pointer) {\n res.push(pointer);\n pointer = pointer.parentElement;\n }\n return res;\n}\nfunction _getEventPath(event) {\n const eventNoType = event;\n if (eventNoType.path) {\n return eventNoType.path;\n }\n if (eventNoType.composedPath) {\n return eventNoType.composedPath();\n }\n return _createEventPath(eventNoType);\n}\nfunction _addSafePassiveEventListener(eElement, event, listener) {\n const passive = getPassiveStateForEvent(event);\n let options;\n if (passive != null) {\n options = { passive };\n }\n eElement.addEventListener(event, listener, options);\n}\nvar getPassiveStateForEvent = (event) => {\n const isPassive = PASSIVE_EVENTS.includes(event);\n const isNonPassive = NON_PASSIVE_EVENTS.includes(event);\n if (isPassive) {\n return true;\n }\n if (isNonPassive) {\n return false;\n }\n};\nfunction _areEventsNear(e1, e2, pixelCount) {\n if (pixelCount === 0) {\n return false;\n }\n const diffX = Math.abs(e1.clientX - e2.clientX);\n const diffY = Math.abs(e1.clientY - e2.clientY);\n return Math.max(diffX, diffY) <= pixelCount;\n}\nvar _getFirstActiveTouch = (touch, touchList) => {\n const identifier = touch.identifier;\n for (let i = 0, len = touchList.length; i < len; ++i) {\n const item = touchList[i];\n if (item.identifier === identifier) {\n return item;\n }\n }\n return null;\n};\nfunction _isEventFromThisInstance(beans, event) {\n return beans.gos.isElementInThisInstance(event.target);\n}\nfunction _anchorElementToMouseMoveEvent(element, mouseMoveEvent, beans) {\n const eRect = element.getBoundingClientRect();\n const height = eRect.height;\n const browserWidth = _getBodyWidth(beans) - 2;\n const browserHeight = _getBodyHeight(beans) - 2;\n const offsetParent = element.offsetParent;\n if (!offsetParent) {\n return;\n }\n const offsetParentSize = _getElementRectWithOffset(element.offsetParent);\n const { clientY, clientX } = mouseMoveEvent;\n let top = clientY - offsetParentSize.top - height / 2;\n let left = clientX - offsetParentSize.left - 10;\n const eDocument = _getDocument(beans);\n const win = eDocument.defaultView || window;\n const windowScrollY = win.pageYOffset || eDocument.documentElement.scrollTop;\n const windowScrollX = win.pageXOffset || eDocument.documentElement.scrollLeft;\n if (browserWidth > 0 && left + element.clientWidth > browserWidth + windowScrollX) {\n left = browserWidth + windowScrollX - element.clientWidth;\n }\n if (left < 0) {\n left = 0;\n }\n if (browserHeight > 0 && top + element.clientHeight > browserHeight + windowScrollY) {\n top = browserHeight + windowScrollY - element.clientHeight;\n }\n if (top < 0) {\n top = 0;\n }\n element.style.left = `${left}px`;\n element.style.top = `${top}px`;\n}\nvar addTempEventHandlers = (list, ...handlers) => {\n for (const handler of handlers) {\n const [target, type, eventListener, options] = handler;\n target.addEventListener(type, eventListener, options);\n list.push(handler);\n }\n};\nvar clearTempEventHandlers = (list) => {\n if (list) {\n for (const [target, type, listener, options] of list) {\n target.removeEventListener(type, listener, options);\n }\n list.length = 0;\n }\n};\nvar preventEventDefault = (event) => {\n if (event.cancelable) {\n event.preventDefault();\n }\n};\n\n// packages/ag-grid-community/src/agStack/utils/locale.ts\nfunction defaultLocaleTextFunc(_key, defaultValue) {\n return defaultValue;\n}\nfunction _getLocaleTextFunc(localeSvc) {\n return localeSvc?.getLocaleTextFunc() ?? defaultLocaleTextFunc;\n}\nfunction _translate(bean, localeValues, key, variableValues) {\n const defaultValue = localeValues[key];\n return bean.getLocaleTextFunc()(\n key,\n typeof defaultValue === \"function\" ? defaultValue(variableValues) : defaultValue,\n variableValues\n );\n}\nfunction _getLocaleTextFromFunc(getLocaleText) {\n return (key, defaultValue, variableValues) => {\n return getLocaleText({\n key,\n defaultValue,\n variableValues\n });\n };\n}\nfunction _getLocaleTextFromMap(localeText) {\n return (key, defaultValue, variableValues) => {\n let localisedText = localeText?.[key];\n if (localisedText && variableValues?.length) {\n let found = 0;\n while (true) {\n if (found >= variableValues.length) {\n break;\n }\n const idx = localisedText.indexOf(\"${variable}\");\n if (idx === -1) {\n break;\n }\n localisedText = localisedText.replace(\"${variable}\", variableValues[found++]);\n }\n }\n return localisedText ?? defaultValue;\n };\n}\n\n// packages/ag-grid-community/src/agStack/core/agBeanStub.ts\nvar AgBeanStub = class {\n constructor() {\n // not named context to allow children to use 'context' as a variable name\n this.destroyFunctions = [];\n this.destroyed = false;\n // for vue 3 - prevents Vue from trying to make this (and obviously any sub classes) from being reactive\n // prevents vue from creating proxies for created objects and prevents identity related issues\n this.__v_skip = true;\n this.propertyListenerId = 0;\n // Enable multiple grid properties to be updated together by the user but only trigger shared logic once.\n // Closely related to logic in GridOptionsUtils.ts _processOnChange\n this.lastChangeSetIdLookup = {};\n this.isAlive = () => !this.destroyed;\n }\n preWireBeans(beans) {\n this.beans = beans;\n this.stubContext = beans.context;\n this.eventSvc = beans.eventSvc;\n this.gos = beans.gos;\n }\n // this was a test constructor niall built, when active, it prints after 5 seconds all beans/components that are\n // not destroyed. to use, create a new grid, then api.destroy() before 5 seconds. then anything that gets printed\n // points to a bean or component that was not properly disposed of.\n // constructor() {\n // setTimeout(()=> {\n // if (this.isAlive()) {\n // let prototype: any = Object.getPrototypeOf(this);\n // const constructor: any = prototype.constructor;\n // const constructorString = constructor.toString();\n // const beanName = constructorString.substring(9, constructorString.indexOf(\"(\"));\n // console.log('is alive ' + beanName);\n // }\n // }, 5000);\n // }\n destroy() {\n const { destroyFunctions } = this;\n for (let i = 0; i < destroyFunctions.length; i++) {\n destroyFunctions[i]();\n }\n destroyFunctions.length = 0;\n this.destroyed = true;\n this.dispatchLocalEvent({ type: \"destroyed\" });\n }\n /** Add a local event listener against this BeanStub */\n addEventListener(eventType, listener, async) {\n if (!this.localEventService) {\n this.localEventService = new LocalEventService();\n }\n this.localEventService.addEventListener(eventType, listener, async);\n }\n /** Remove a local event listener from this BeanStub */\n removeEventListener(eventType, listener, async) {\n this.localEventService?.removeEventListener(eventType, listener, async);\n }\n dispatchLocalEvent(event) {\n this.localEventService?.dispatchEvent(event);\n }\n addManagedElementListeners(object, handlers) {\n return this._setupListeners(object, handlers);\n }\n addManagedEventListeners(handlers) {\n return this._setupListeners(this.eventSvc, handlers);\n }\n addManagedListeners(object, handlers) {\n return this._setupListeners(object, handlers);\n }\n _setupListeners(object, handlers) {\n const destroyFuncs = [];\n for (const k of Object.keys(handlers)) {\n const handler = handlers[k];\n if (handler) {\n destroyFuncs.push(this._setupListener(object, k, handler));\n }\n }\n return destroyFuncs;\n }\n _setupListener(object, event, listener) {\n if (this.destroyed) {\n return () => null;\n }\n let destroyFunc;\n if (isAgEventEmitter(object)) {\n object.__addEventListener(event, listener);\n destroyFunc = () => {\n object.__removeEventListener(event, listener);\n return null;\n };\n } else {\n const objIsEventService = isEventService(object);\n if (object instanceof HTMLElement) {\n _addSafePassiveEventListener(object, event, listener);\n } else if (objIsEventService) {\n object.addListener(event, listener);\n } else {\n object.addEventListener(event, listener);\n }\n destroyFunc = objIsEventService ? () => {\n object.removeListener(event, listener);\n return null;\n } : () => {\n object.removeEventListener(event, listener);\n return null;\n };\n }\n this.destroyFunctions.push(destroyFunc);\n return () => {\n destroyFunc();\n this.destroyFunctions = this.destroyFunctions.filter((fn) => fn !== destroyFunc);\n return null;\n };\n }\n /**\n * Setup a managed property listener for the given property.\n * However, stores the destroy function in the beanStub so that if this bean\n * is a component the destroy function will be called when the component is destroyed\n * as opposed to being cleaned up only when the properties service is destroyed.\n */\n setupPropertyListener(event, listener) {\n const { gos } = this;\n gos.addPropertyEventListener(event, listener);\n const destroyFunc = () => {\n gos.removePropertyEventListener(event, listener);\n return null;\n };\n this.destroyFunctions.push(destroyFunc);\n return () => {\n destroyFunc();\n this.destroyFunctions = this.destroyFunctions.filter((fn) => fn !== destroyFunc);\n return null;\n };\n }\n /**\n * Setup a managed property listener for the given GridOption property.\n * @param event GridOption property to listen to changes for.\n * @param listener Listener to run when property value changes\n */\n addManagedPropertyListener(event, listener) {\n if (this.destroyed) {\n return () => null;\n }\n return this.setupPropertyListener(event, listener);\n }\n /**\n * Setup managed property listeners for the given set of GridOption properties.\n * The listener will be run if any of the property changes but will only run once if\n * multiple of the properties change within the same framework lifecycle event.\n * Works on the basis that GridOptionsService updates all properties *before* any property change events are fired.\n * @param events Array of GridOption properties to listen for changes too.\n * @param listener Shared listener to run if any of the properties change\n */\n addManagedPropertyListeners(events, listener) {\n if (this.destroyed) {\n return;\n }\n const eventsKey = events.join(\"-\") + this.propertyListenerId++;\n const wrappedListener = (event) => {\n if (event.changeSet) {\n if (event.changeSet && event.changeSet.id === this.lastChangeSetIdLookup[eventsKey]) {\n return;\n }\n this.lastChangeSetIdLookup[eventsKey] = event.changeSet.id;\n }\n const propertiesChangeEvent = {\n type: \"propertyChanged\",\n changeSet: event.changeSet,\n source: event.source\n };\n listener(propertiesChangeEvent);\n };\n for (const event of events) {\n this.setupPropertyListener(event, wrappedListener);\n }\n }\n getLocaleTextFunc() {\n return _getLocaleTextFunc(this.beans.localeSvc);\n }\n addDestroyFunc(func) {\n if (this.isAlive()) {\n this.destroyFunctions.push(func);\n } else {\n func();\n }\n }\n /** doesn't throw an error if `bean` is undefined */\n createOptionalManagedBean(bean, context) {\n return bean ? this.createManagedBean(bean, context) : void 0;\n }\n createManagedBean(bean, context) {\n const res = this.createBean(bean, context);\n this.addDestroyFunc(this.destroyBean.bind(this, bean, context));\n return res;\n }\n createBean(bean, context, afterPreCreateCallback) {\n return (context || this.stubContext).createBean(bean, afterPreCreateCallback);\n }\n /**\n * Destroys a bean and returns undefined to support destruction and clean up in a single line.\n * this.dateComp = this.context.destroyBean(this.dateComp);\n */\n destroyBean(bean, context) {\n return (context || this.stubContext).destroyBean(bean);\n }\n /**\n * Destroys an array of beans and returns an empty array to support destruction and clean up in a single line.\n * this.dateComps = this.context.destroyBeans(this.dateComps);\n */\n destroyBeans(beans, context) {\n return (context || this.stubContext).destroyBeans(beans);\n }\n};\nfunction isAgEventEmitter(object) {\n return object.__addEventListener !== void 0;\n}\nfunction isEventService(object) {\n return object.eventServiceType === \"global\";\n}\n\n// packages/ag-grid-community/src/context/beanStub.ts\nvar BeanStub = class extends AgBeanStub {\n};\n\n// packages/ag-grid-community/src/agStack/utils/function.ts\nvar doOnceSet = /* @__PURE__ */ new Set();\nvar _doOnce = (func, key) => {\n if (!doOnceSet.has(key)) {\n doOnceSet.add(key);\n func();\n }\n};\n_doOnce._set = doOnceSet;\nvar batchedCallsSetTimeout = {\n pending: false,\n funcs: []\n};\nvar batchedCallsRaf = {\n pending: false,\n funcs: []\n};\nfunction _batchCall(func, mode = \"setTimeout\", beans) {\n const batch = mode === \"raf\" ? batchedCallsRaf : batchedCallsSetTimeout;\n batch.funcs.push(func);\n if (batch.pending) {\n return;\n }\n batch.pending = true;\n const runBatch = () => {\n const funcsCopy = batch.funcs.slice();\n batch.funcs.length = 0;\n batch.pending = false;\n for (const func2 of funcsCopy) {\n func2();\n }\n };\n if (mode === \"raf\") {\n _requestAnimationFrame(beans, runBatch);\n } else {\n window.setTimeout(runBatch, 0);\n }\n}\nfunction _debounce(bean, func, delay) {\n let timeout;\n return function(...args) {\n const context = this;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n if (bean.isAlive()) {\n func.apply(context, args);\n }\n }, delay);\n return timeout;\n };\n}\nfunction _throttle(func, wait) {\n let previousCall = 0;\n return function(...args) {\n const context = this;\n const currentCall = Date.now();\n if (currentCall - previousCall < wait) {\n return;\n }\n previousCall = currentCall;\n func.apply(context, args);\n };\n}\nfunction _waitUntil(bean, condition, callback, timeout = 100) {\n const timeStamp = Date.now();\n let interval = null;\n let executed = false;\n const clearWait = () => {\n if (interval != null) {\n window.clearInterval(interval);\n interval = null;\n }\n };\n bean.addDestroyFunc(clearWait);\n const internalCallback = () => {\n const reachedTimeout = Date.now() - timeStamp > timeout;\n if (condition() || reachedTimeout) {\n callback();\n executed = true;\n clearWait();\n }\n };\n internalCallback();\n if (!executed) {\n interval = window.setInterval(internalCallback, 10);\n }\n}\n\n// packages/ag-grid-community/src/utils/mergeDeep.ts\nvar SKIP_JS_BUILTINS = /* @__PURE__ */ new Set([\"__proto__\", \"constructor\", \"prototype\"]);\nfunction _iterateObject(object, callback) {\n if (object == null) {\n return;\n }\n if (Array.isArray(object)) {\n for (let i = 0; i < object.length; i++) {\n callback(i.toString(), object[i]);\n }\n return;\n }\n for (const key of Object.keys(object).filter((key2) => !SKIP_JS_BUILTINS.has(key2))) {\n callback(key, object[key]);\n }\n}\nfunction _mergeDeep(dest, source, copyUndefined = true, makeCopyOfSimpleObjects = false) {\n if (!_exists(source)) {\n return;\n }\n _iterateObject(source, (key, sourceValue) => {\n let destValue = dest[key];\n if (destValue === sourceValue) {\n return;\n }\n if (makeCopyOfSimpleObjects) {\n const objectIsDueToBeCopied = destValue == null && sourceValue != null;\n if (objectIsDueToBeCopied) {\n const doNotCopyAsSourceIsSimpleObject = typeof sourceValue === \"object\" && sourceValue.constructor === Object;\n if (doNotCopyAsSourceIsSimpleObject) {\n destValue = {};\n dest[key] = destValue;\n }\n }\n }\n if (_isNonNullObject(sourceValue) && _isNonNullObject(destValue) && !Array.isArray(destValue)) {\n _mergeDeep(destValue, sourceValue, copyUndefined, makeCopyOfSimpleObjects);\n } else if (copyUndefined || sourceValue !== void 0) {\n dest[key] = sourceValue;\n }\n });\n}\nfunction _isNonNullObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\n// packages/ag-grid-community/src/globalGridOptions.ts\nvar _GlobalGridOptions = class _GlobalGridOptions {\n /**\n * @param providedOptions\n * @returns Shallow copy of the provided options with global options merged in.\n */\n static applyGlobalGridOptions(providedOptions) {\n if (!_GlobalGridOptions.gridOptions) {\n return { ...providedOptions };\n }\n let mergedGridOps = {};\n _mergeDeep(mergedGridOps, _GlobalGridOptions.gridOptions, true, true);\n if (_GlobalGridOptions.mergeStrategy === \"deep\") {\n _mergeDeep(mergedGridOps, providedOptions, true, true);\n } else {\n mergedGridOps = { ...mergedGridOps, ...providedOptions };\n }\n if (_GlobalGridOptions.gridOptions.context) {\n mergedGridOps.context = _GlobalGridOptions.gridOptions.context;\n }\n if (providedOptions.context) {\n if (_GlobalGridOptions.mergeStrategy === \"deep\" && mergedGridOps.context) {\n _mergeDeep(providedOptions.context, mergedGridOps.context, true, true);\n }\n mergedGridOps.context = providedOptions.context;\n }\n return mergedGridOps;\n }\n /**\n * Apply global grid option for a specific option key.\n * If the merge strategy is 'deep' and both global and provided values are objects, they will be merged deeply.\n * Otherwise, the provided value is returned as is.\n * @param optionKey - The key of the grid option to apply.\n * @param providedValue - The value provided to the grid instance.\n * @returns The merged value if applicable, otherwise the provided value.\n */\n static applyGlobalGridOption(optionKey, providedValue) {\n if (_GlobalGridOptions.mergeStrategy === \"deep\") {\n const globalValue = _getGlobalGridOption(optionKey);\n if (globalValue && typeof globalValue === \"object\" && typeof providedValue === \"object\") {\n return _GlobalGridOptions.applyGlobalGridOptions({ [optionKey]: providedValue })[optionKey];\n }\n }\n return providedValue;\n }\n};\n// eslint-disable-next-line no-restricted-syntax\n_GlobalGridOptions.gridOptions = void 0;\n// eslint-disable-next-line no-restricted-syntax\n_GlobalGridOptions.mergeStrategy = \"shallow\";\nvar GlobalGridOptions = _GlobalGridOptions;\nfunction provideGlobalGridOptions(gridOptions, mergeStrategy = \"shallow\") {\n GlobalGridOptions.gridOptions = gridOptions;\n GlobalGridOptions.mergeStrategy = mergeStrategy;\n}\nfunction _getGlobalGridOption(gridOption) {\n return GlobalGridOptions.gridOptions?.[gridOption];\n}\n\n// packages/ag-grid-community/src/gridOptionsDefault.ts\nvar GRID_OPTION_DEFAULTS = {\n suppressContextMenu: false,\n preventDefaultOnContextMenu: false,\n allowContextMenuWithControlKey: false,\n suppressMenuHide: true,\n enableBrowserTooltips: false,\n tooltipTrigger: \"hover\",\n tooltipShowDelay: 2e3,\n tooltipSwitchShowDelay: 200,\n tooltipHideDelay: 1e4,\n tooltipMouseTrack: false,\n tooltipShowMode: \"standard\",\n tooltipInteraction: false,\n copyHeadersToClipboard: false,\n copyGroupHeadersToClipboard: false,\n clipboardDelimiter: \"\t\",\n suppressCopyRowsToClipboard: false,\n suppressCopySingleCellRanges: false,\n suppressLastEmptyLineOnPaste: false,\n suppressClipboardPaste: false,\n suppressClipboardApi: false,\n suppressCutToClipboard: false,\n maintainColumnOrder: false,\n enableStrictPivotColumnOrder: false,\n suppressFieldDotNotation: false,\n allowDragFromColumnsToolPanel: false,\n suppressMovableColumns: false,\n suppressColumnMoveAnimation: false,\n suppressMoveWhenColumnDragging: false,\n suppressDragLeaveHidesColumns: false,\n suppressRowGroupHidesColumns: false,\n suppressAutoSize: false,\n autoSizePadding: 20,\n skipHeaderOnAutoSize: false,\n singleClickEdit: false,\n suppressClickEdit: false,\n readOnlyEdit: false,\n stopEditingWhenCellsLoseFocus: false,\n enterNavigatesVertically: false,\n enterNavigatesVerticallyAfterEdit: false,\n enableCellEditingOnBackspace: false,\n undoRedoCellEditing: false,\n undoRedoCellEditingLimit: 10,\n suppressCsvExport: false,\n suppressExcelExport: false,\n cacheQuickFilter: false,\n includeHiddenColumnsInQuickFilter: false,\n excludeChildrenWhenTreeDataFiltering: false,\n enableAdvancedFilter: false,\n includeHiddenColumnsInAdvancedFilter: false,\n enableCharts: false,\n masterDetail: false,\n keepDetailRows: false,\n keepDetailRowsCount: 10,\n detailRowAutoHeight: false,\n tabIndex: 0,\n rowBuffer: 10,\n valueCache: false,\n valueCacheNeverExpires: false,\n enableCellExpressions: false,\n suppressTouch: false,\n suppressFocusAfterRefresh: false,\n suppressBrowserResizeObserver: false,\n suppressPropertyNamesCheck: false,\n suppressChangeDetection: false,\n debug: false,\n suppressLoadingOverlay: false,\n suppressNoRowsOverlay: false,\n pagination: false,\n paginationPageSize: 100,\n paginationPageSizeSelector: true,\n paginationAutoPageSize: false,\n paginateChildRows: false,\n suppressPaginationPanel: false,\n pivotMode: false,\n pivotPanelShow: \"never\",\n pivotDefaultExpanded: 0,\n pivotSuppressAutoColumn: false,\n suppressExpandablePivotGroups: false,\n functionsReadOnly: false,\n suppressAggFuncInHeader: false,\n alwaysAggregateAtRootLevel: false,\n aggregateOnlyChangedColumns: false,\n suppressAggFilteredOnly: false,\n removePivotHeaderRowWhenSingleValueColumn: false,\n animateRows: true,\n cellFlashDuration: 500,\n cellFadeDuration: 1e3,\n allowShowChangeAfterFilter: false,\n domLayout: \"normal\",\n ensureDomOrder: false,\n enableRtl: false,\n suppressColumnVirtualisation: false,\n suppressMaxRenderedRowRestriction: false,\n suppressRowVirtualisation: false,\n rowDragManaged: false,\n refreshAfterGroupEdit: false,\n rowDragInsertDelay: 500,\n suppressRowDrag: false,\n suppressMoveWhenRowDragging: false,\n rowDragEntireRow: false,\n rowDragMultiRow: false,\n embedFullWidthRows: false,\n groupDisplayType: \"singleColumn\",\n groupDefaultExpanded: 0,\n groupMaintainOrder: false,\n groupSelectsChildren: false,\n groupSuppressBlankHeader: false,\n groupSelectsFiltered: false,\n showOpenedGroup: false,\n groupRemoveSingleChildren: false,\n groupRemoveLowestSingleChildren: false,\n groupHideOpenParents: false,\n groupHideColumnsUntilExpanded: false,\n groupAllowUnbalanced: false,\n rowGroupPanelShow: \"never\",\n suppressMakeColumnVisibleAfterUnGroup: false,\n treeData: false,\n rowGroupPanelSuppressSort: false,\n suppressGroupRowsSticky: false,\n rowModelType: \"clientSide\",\n asyncTransactionWaitMillis: 50,\n suppressModelUpdateAfterUpdateTransaction: false,\n cacheOverflowSize: 1,\n infiniteInitialRowCount: 1,\n serverSideInitialRowCount: 1,\n cacheBlockSize: 100,\n maxBlocksInCache: -1,\n maxConcurrentDatasourceRequests: 2,\n blockLoadDebounceMillis: 0,\n purgeClosedRowNodes: false,\n serverSideSortAllLevels: false,\n serverSideOnlyRefreshFilteredGroups: false,\n serverSidePivotResultFieldSeparator: \"_\",\n viewportRowModelPageSize: 5,\n viewportRowModelBufferSize: 5,\n alwaysShowHorizontalScroll: false,\n alwaysShowVerticalScroll: false,\n debounceVerticalScrollbar: false,\n suppressHorizontalScroll: false,\n suppressScrollOnNewData: false,\n suppressScrollWhenPopupsAreOpen: false,\n suppressAnimationFrame: false,\n suppressMiddleClickScrolls: false,\n suppressPreventDefaultOnMouseWheel: false,\n rowMultiSelectWithClick: false,\n suppressRowDeselection: false,\n suppressRowClickSelection: false,\n suppressCellFocus: false,\n suppressHeaderFocus: false,\n suppressMultiRangeSelection: false,\n enableCellTextSelection: false,\n enableRangeSelection: false,\n enableRangeHandle: false,\n enableFillHandle: false,\n fillHandleDirection: \"xy\",\n suppressClearOnFillReduction: false,\n accentedSort: false,\n unSortIcon: false,\n suppressMultiSort: false,\n alwaysMultiSort: false,\n suppressMaintainUnsortedOrder: false,\n suppressRowHoverHighlight: false,\n suppressRowTransform: false,\n columnHoverHighlight: false,\n deltaSort: false,\n enableGroupEdit: false,\n groupLockGroupColumns: 0,\n serverSideEnableClientSideSort: false,\n suppressServerSideFullWidthLoadingRow: false,\n pivotMaxGeneratedColumns: -1,\n columnMenu: \"new\",\n reactiveCustomComponents: true,\n suppressSetFilterByDefault: false,\n enableFilterHandlers: false\n};\n\n// packages/ag-grid-community/src/baseUrl.ts\nvar BASE_URL = \"https://www.ag-grid.com\";\n\n// packages/ag-grid-community/src/utils/log.ts\nfunction _logIfDebug(gos, message, ...args) {\n if (gos.get(\"debug\")) {\n console.log(\"AG Grid: \" + message, ...args);\n }\n}\nfunction _warnOnce(msg, ...args) {\n _doOnce(() => _consoleWarn(msg, ...args), msg + args?.join(\"\"));\n}\nfunction _errorOnce(msg, ...args) {\n _doOnce(() => _consoleError(msg, ...args), msg + args?.join(\"\"));\n}\nfunction _consoleError(msg, ...args) {\n console.error(\"AG Grid: \" + msg, ...args);\n}\nfunction _consoleWarn(msg, ...args) {\n console.warn(\"AG Grid: \" + msg, ...args);\n}\n\n// packages/ag-grid-community/src/modules/moduleRegistry.ts\nvar allRegisteredModules = /* @__PURE__ */ new Set();\nvar globalModulesMap = {};\nvar gridModulesMap = {};\nvar currentModuleVersion;\nvar userHasRegistered = false;\nvar areGridScopedModules = false;\nvar isUmd = false;\nfunction isValidModuleVersion(module) {\n const [moduleMajor, moduleMinor] = module.version.split(\".\") || [];\n const [currentModuleMajor, currentModuleMinor] = currentModuleVersion.split(\".\") || [];\n return moduleMajor === currentModuleMajor && moduleMinor === currentModuleMinor;\n}\nfunction runVersionChecks(module) {\n if (!currentModuleVersion) {\n currentModuleVersion = module.version;\n }\n const errorMsg = (details) => `You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${details} Please update all modules to the same version.`;\n if (!module.version) {\n _errorOnce(errorMsg(`'${module.moduleName}' is incompatible.`));\n } else if (!isValidModuleVersion(module)) {\n _errorOnce(\n errorMsg(\n `'${module.moduleName}' is version ${module.version} but the other modules are version ${currentModuleVersion}.`\n )\n );\n }\n const result = module.validate?.();\n if (result && !result.isValid) {\n _errorOnce(`${result.message}`);\n }\n}\nfunction _registerModule(module, gridId, isInternalRegistration = false) {\n if (!isInternalRegistration) {\n userHasRegistered = true;\n }\n runVersionChecks(module);\n const rowModels = module.rowModels ?? [\"all\"];\n allRegisteredModules.add(module);\n let moduleStore;\n if (gridId !== void 0) {\n areGridScopedModules = true;\n if (gridModulesMap[gridId] === void 0) {\n gridModulesMap[gridId] = {};\n }\n moduleStore = gridModulesMap[gridId];\n } else {\n moduleStore = globalModulesMap;\n }\n for (const rowModel of rowModels) {\n if (moduleStore[rowModel] === void 0) {\n moduleStore[rowModel] = {};\n }\n moduleStore[rowModel][module.moduleName] = module;\n }\n if (module.dependsOn) {\n for (const dependency of module.dependsOn) {\n _registerModule(dependency, gridId, isInternalRegistration);\n }\n }\n}\nfunction _unRegisterGridModules(gridId) {\n delete gridModulesMap[gridId];\n}\nfunction _isModuleRegistered(moduleName, gridId, rowModel) {\n const isRegisteredForRowModel = (model) => !!globalModulesMap[model]?.[moduleName] || !!gridModulesMap[gridId]?.[model]?.[moduleName];\n return isRegisteredForRowModel(rowModel) || isRegisteredForRowModel(\"all\");\n}\nfunction _areModulesGridScoped() {\n return areGridScopedModules;\n}\nfunction _getRegisteredModules(gridId, rowModel) {\n const gridModules = gridModulesMap[gridId] ?? {};\n return [\n ...Object.values(globalModulesMap[\"all\"] ?? {}),\n ...Object.values(gridModules[\"all\"] ?? {}),\n ...Object.values(globalModulesMap[rowModel] ?? {}),\n ...Object.values(gridModules[rowModel] ?? {})\n ];\n}\nfunction _getAllRegisteredModules() {\n return new Set(allRegisteredModules);\n}\nfunction _getGridRegisteredModules(gridId, rowModel) {\n const gridModules = gridModulesMap[gridId] ?? {};\n return [...Object.values(gridModules[\"all\"] ?? {}), ...Object.values(gridModules[rowModel] ?? {})];\n}\nfunction _hasUserRegistered() {\n return userHasRegistered;\n}\nfunction _isUmd() {\n return isUmd;\n}\nfunction _setUmd() {\n isUmd = true;\n}\nvar ModuleRegistry = class {\n /**\n * @deprecated v33 Use `registerModules([module])` instead.\n */\n static register(module) {\n _registerModule(module, void 0);\n }\n /**\n * Globally register the given modules for all grids.\n * @param modules - modules to register\n */\n static registerModules(modules) {\n for (const module of modules) {\n _registerModule(module, void 0);\n }\n }\n};\nfunction _findEnterpriseCoreModule(modules) {\n for (const module of modules) {\n if (\"setLicenseKey\" in module) {\n return module;\n }\n if (module.dependsOn) {\n const found = _findEnterpriseCoreModule(module.dependsOn);\n if (found) {\n return found;\n }\n }\n }\n return void 0;\n}\n\n// packages/ag-grid-community/src/version.ts\nvar VERSION = \"35.2.0\";\n\n// packages/ag-grid-community/src/validation/logging.ts\nvar MAX_URL_LENGTH = 2e3;\nvar MIN_PARAM_LENGTH = 100;\nvar VERSION_PARAM_NAME = \"_version_\";\nvar getConsoleMessage = null;\nvar baseDocLink = `${BASE_URL}/javascript-data-grid`;\nfunction provideValidationServiceLogger(logger) {\n getConsoleMessage = logger;\n}\nfunction setValidationDocLink(docLink) {\n baseDocLink = docLink;\n}\nfunction getErrorParts(id, args, defaultMessage) {\n return getConsoleMessage?.(id, args) ?? [minifiedLog(id, args, defaultMessage)];\n}\nfunction getMsgOrDefault(logger, id, args, isWarning, defaultMessage) {\n logger(`${isWarning ? \"warning\" : \"error\"} #${id}`, ...getErrorParts(id, args, defaultMessage));\n}\nfunction stringifyObject(inputObj) {\n if (!inputObj) {\n return String(inputObj);\n }\n const object = {};\n for (const prop of Object.keys(inputObj)) {\n if (typeof inputObj[prop] !== \"object\" && typeof inputObj[prop] !== \"function\") {\n object[prop] = inputObj[prop];\n }\n }\n return JSON.stringify(object);\n}\nfunction stringifyValue(value) {\n let output = value;\n if (value instanceof Error) {\n output = value.toString();\n } else if (typeof value === \"object\") {\n output = stringifyObject(value);\n }\n return output;\n}\nfunction toStringWithNullUndefined(str) {\n return str === void 0 ? \"undefined\" : str === null ? \"null\" : str;\n}\nfunction getParamsUrl(baseUrl, params) {\n return `${baseUrl}?${params.toString()}`;\n}\nfunction truncateUrl(baseUrl, params, maxLength) {\n const sortedParams = Array.from(params.entries()).sort((a, b) => b[1].length - a[1].length);\n let url = getParamsUrl(baseUrl, params);\n for (const [key, value] of sortedParams) {\n if (key === VERSION_PARAM_NAME) {\n continue;\n }\n const excessLength = url.length - maxLength;\n if (excessLength <= 0) {\n break;\n }\n const ellipse = \"...\";\n const truncateAmount = excessLength + ellipse.length;\n const truncatedValue = value.length - truncateAmount > MIN_PARAM_LENGTH ? value.slice(0, value.length - truncateAmount) + ellipse : value.slice(0, MIN_PARAM_LENGTH) + ellipse;\n params.set(key, truncatedValue);\n url = getParamsUrl(baseUrl, params);\n }\n return url;\n}\nfunction getErrorLink(errorNum, args) {\n const params = new URLSearchParams();\n params.append(VERSION_PARAM_NAME, VERSION);\n if (args) {\n for (const key of Object.keys(args)) {\n params.append(key, stringifyValue(args[key]));\n }\n }\n const baseUrl = `${baseDocLink}/errors/${errorNum}`;\n const url = getParamsUrl(baseUrl, params);\n return url.length <= MAX_URL_LENGTH ? url : truncateUrl(baseUrl, params, MAX_URL_LENGTH);\n}\nvar minifiedLog = (errorNum, args, defaultMessage) => {\n const errorLink = getErrorLink(errorNum, args);\n const prefix = `${defaultMessage ? defaultMessage + \" \\n\" : \"\"}Visit ${errorLink}`;\n if (_isUmd()) {\n return prefix;\n }\n return `${prefix}${defaultMessage ? \"\" : \" \\n Alternatively register the ValidationModule to see the full message in the console.\"}`;\n};\nfunction _warn(...args) {\n getMsgOrDefault(_warnOnce, args[0], args[1], true);\n}\nfunction _error(...args) {\n getMsgOrDefault(_errorOnce, args[0], args[1], false);\n}\nfunction _logPreInitErr(id, args, defaultMessage) {\n getMsgOrDefault(_errorOnce, id, args, false, defaultMessage);\n}\nfunction _logPreInitWarn(id, args, defaultMessage) {\n getMsgOrDefault(_warnOnce, id, args, true, defaultMessage);\n}\nfunction getErrMsg(defaultMessage, args) {\n const id = args[0];\n return `error #${id} ` + getErrorParts(id, args[1], defaultMessage).join(\" \");\n}\nfunction _errMsg(...args) {\n return getErrMsg(void 0, args);\n}\nfunction _preInitErrMsg(...args) {\n return getErrMsg(\"\\n\", args);\n}\n\n// packages/ag-grid-community/src/gridOptionsUtils.ts\nfunction isRowModelType(gos, rowModelType) {\n return gos.get(\"rowModelType\") === rowModelType;\n}\nfunction _isClientSideRowModel(gos, rowModel) {\n return isRowModelType(gos, \"clientSide\");\n}\nfunction _isServerSideRowModel(gos, rowModel) {\n return isRowModelType(gos, \"serverSide\");\n}\nfunction _isDomLayout(gos, domLayout) {\n return gos.get(\"domLayout\") === domLayout;\n}\nfunction _isRowSelection(gos) {\n return _getRowSelectionMode(gos) !== void 0;\n}\nfunction _isGetRowHeightFunction(gos) {\n return typeof gos.get(\"getRowHeight\") === \"function\";\n}\nfunction _shouldMaintainColumnOrder(gos, isPivotColumns) {\n if (isPivotColumns) {\n return !gos.get(\"enableStrictPivotColumnOrder\");\n }\n return gos.get(\"maintainColumnOrder\");\n}\nfunction _isRowNumbers({ gos, formula }) {\n const rowNumbers = gos.get(\"rowNumbers\");\n return rowNumbers || !!formula?.active && rowNumbers !== false;\n}\nfunction _getRowHeightForNode(beans, rowNode, allowEstimate = false, defaultRowHeight) {\n const { gos, environment } = beans;\n if (defaultRowHeight == null) {\n defaultRowHeight = environment.getDefaultRowHeight();\n }\n if (_isGetRowHeightFunction(gos)) {\n if (allowEstimate) {\n return { height: defaultRowHeight, estimated: true };\n }\n const params = {\n node: rowNode,\n data: rowNode.data\n };\n const height = gos.getCallback(\"getRowHeight\")(params);\n if (isNumeric(height)) {\n if (height === 0) {\n _warn(23);\n }\n return { height: Math.max(1, height), estimated: false };\n }\n }\n if (rowNode.detail && gos.get(\"masterDetail\")) {\n return getMasterDetailRowHeight(gos);\n }\n const gridOptionsRowHeight = gos.get(\"rowHeight\");\n const rowHeight = gridOptionsRowHeight && isNumeric(gridOptionsRowHeight) ? gridOptionsRowHeight : defaultRowHeight;\n return { height: rowHeight, estimated: false };\n}\nfunction getMasterDetailRowHeight(gos) {\n if (gos.get(\"detailRowAutoHeight\")) {\n return { height: 1, estimated: false };\n }\n const defaultRowHeight = gos.get(\"detailRowHeight\");\n if (isNumeric(defaultRowHeight)) {\n return { height: defaultRowHeight, estimated: false };\n }\n return { height: 300, estimated: false };\n}\nfunction _getRowHeightAsNumber(beans) {\n const { environment, gos } = beans;\n const gridOptionsRowHeight = gos.get(\"rowHeight\");\n if (!gridOptionsRowHeight || _missing(gridOptionsRowHeight)) {\n return environment.getDefaultRowHeight();\n }\n const rowHeight = environment.refreshRowHeightVariable();\n if (rowHeight !== -1) {\n return rowHeight;\n }\n _warn(24);\n return environment.getDefaultRowHeight();\n}\nfunction isNumeric(value) {\n return !isNaN(value) && typeof value === \"number\" && isFinite(value);\n}\nfunction _getDomData(gos, element, key) {\n const domData = element[gos.getDomDataKey()];\n return domData ? domData[key] : void 0;\n}\nfunction _setDomData(gos, element, key, value) {\n const domDataKey = gos.getDomDataKey();\n let domData = element[domDataKey];\n if (_missing(domData)) {\n domData = {};\n element[domDataKey] = domData;\n }\n domData[key] = value;\n}\nfunction _isAnimateRows(gos) {\n if (gos.get(\"ensureDomOrder\")) {\n return false;\n }\n return gos.get(\"animateRows\");\n}\nfunction _isGroupRowsSticky(gos) {\n return !(gos.get(\"paginateChildRows\") || gos.get(\"groupHideOpenParents\") || _isDomLayout(gos, \"print\"));\n}\nfunction _isColumnsSortingCoupledToGroup(gos) {\n const autoGroupColumnDef = gos.get(\"autoGroupColumnDef\");\n return !autoGroupColumnDef?.comparator && !gos.get(\"treeData\");\n}\nfunction _getGroupAggFiltering(gos) {\n const userValue = gos.get(\"groupAggFiltering\");\n if (typeof userValue === \"function\") {\n return gos.getCallback(\"groupAggFiltering\");\n }\n if (userValue === true) {\n return () => true;\n }\n return void 0;\n}\nfunction _getGrandTotalRow(gos) {\n return gos.get(\"grandTotalRow\");\n}\nfunction _getGroupTotalRowCallback(gos) {\n const userValue = gos.get(\"groupTotalRow\");\n if (typeof userValue === \"function\") {\n return gos.getCallback(\"groupTotalRow\");\n }\n return () => userValue ?? void 0;\n}\nfunction _isGroupMultiAutoColumn(gos) {\n const isHideOpenParents = !!gos.get(\"groupHideOpenParents\");\n if (isHideOpenParents) {\n return true;\n }\n return gos.get(\"groupDisplayType\") === \"multipleColumns\";\n}\nfunction _isGroupHideColumnsUntilExpanded(gos) {\n return _isGroupMultiAutoColumn(gos) && gos.get(\"groupHideColumnsUntilExpanded\") && _isClientSideRowModel(gos);\n}\nfunction _isGroupUseEntireRow(gos, pivotMode) {\n if (pivotMode) {\n return false;\n }\n return gos.get(\"groupDisplayType\") === \"groupRows\";\n}\nfunction _isFullWidthGroupRow(gos, node, pivotMode) {\n return !!node.group && !node.footer && _isGroupUseEntireRow(gos, pivotMode);\n}\nfunction _getRowIdCallback(gos) {\n const getRowId = gos.getCallback(\"getRowId\");\n if (getRowId === void 0) {\n return getRowId;\n }\n return (params) => {\n let id = getRowId(params);\n if (typeof id !== \"string\") {\n _doOnce(() => _warn(25, { id }), \"getRowIdString\");\n id = String(id);\n }\n return id;\n };\n}\nfunction _canSkipShowingRowGroup(gos, node) {\n const isSkippingGroups = gos.get(\"groupHideParentOfSingleChild\");\n if (isSkippingGroups === true) {\n return true;\n }\n if (isSkippingGroups === \"leafGroupsOnly\" && node.leafGroup) {\n return true;\n }\n if (gos.get(\"groupRemoveSingleChildren\")) {\n return true;\n }\n if (gos.get(\"groupRemoveLowestSingleChildren\") && node.leafGroup) {\n return true;\n }\n return false;\n}\nfunction _getMaxConcurrentDatasourceRequests(gos) {\n const res = gos.get(\"maxConcurrentDatasourceRequests\");\n return res > 0 ? res : void 0;\n}\nfunction _shouldUpdateColVisibilityAfterGroup(gos, isGrouped) {\n const preventVisibilityChanges = gos.get(\"suppressGroupChangesColumnVisibility\");\n if (preventVisibilityChanges === true) {\n return false;\n }\n if (isGrouped && preventVisibilityChanges === \"suppressHideOnGroup\") {\n return false;\n }\n if (!isGrouped && preventVisibilityChanges === \"suppressShowOnUngroup\") {\n return false;\n }\n const legacySuppressOnGroup = gos.get(\"suppressRowGroupHidesColumns\");\n if (isGrouped && legacySuppressOnGroup === true) {\n return false;\n }\n const legacySuppressOnUngroup = gos.get(\"suppressMakeColumnVisibleAfterUnGroup\");\n if (!isGrouped && legacySuppressOnUngroup === true) {\n return false;\n }\n return true;\n}\nfunction _getCheckboxes(selection) {\n return selection?.checkboxes ?? true;\n}\nfunction _getHeaderCheckbox(selection) {\n return selection?.mode === \"multiRow\" && (selection.headerCheckbox ?? true);\n}\nfunction _getCheckboxLocation(rowSelection) {\n if (typeof rowSelection !== \"object\") {\n return void 0;\n }\n return rowSelection.checkboxLocation ?? \"selectionColumn\";\n}\nfunction _getHideDisabledCheckboxes(selection) {\n return selection?.hideDisabledCheckboxes ?? false;\n}\nfunction _isUsingNewRowSelectionAPI(gos) {\n const rowSelection = gos.get(\"rowSelection\");\n return typeof rowSelection !== \"string\";\n}\nfunction _isUsingNewCellSelectionAPI(gos) {\n return gos.get(\"cellSelection\") !== void 0;\n}\nfunction _getSuppressMultiRanges(gos) {\n const selection = gos.get(\"cellSelection\");\n const useNewAPI = selection !== void 0;\n if (!useNewAPI) {\n return gos.get(\"suppressMultiRangeSelection\");\n }\n return typeof selection !== \"boolean\" ? selection?.suppressMultiRanges ?? false : false;\n}\nfunction _isCellSelectionEnabled(gos) {\n const selection = gos.get(\"cellSelection\");\n const useNewAPI = selection !== void 0;\n return useNewAPI ? !!selection : gos.get(\"enableRangeSelection\");\n}\nfunction _getFillHandle(gos) {\n const selection = gos.get(\"cellSelection\");\n const useNewAPI = selection !== void 0;\n if (!useNewAPI) {\n return {\n mode: \"fill\",\n setFillValue: gos.get(\"fillOperation\"),\n direction: gos.get(\"fillHandleDirection\"),\n suppressClearOnFillReduction: gos.get(\"suppressClearOnFillReduction\")\n };\n }\n return typeof selection !== \"boolean\" && selection.handle?.mode === \"fill\" ? selection.handle : void 0;\n}\nfunction _getEnableColumnSelection(gos) {\n const cellSelection = gos.get(\"cellSelection\") ?? false;\n return (typeof cellSelection === \"object\" && cellSelection.enableColumnSelection) ?? false;\n}\nfunction _getEnableClickSelection(gos) {\n const selection = gos.get(\"rowSelection\") ?? \"single\";\n if (typeof selection === \"string\") {\n const suppressRowClickSelection = gos.get(\"suppressRowClickSelection\");\n const suppressRowDeselection = gos.get(\"suppressRowDeselection\");\n if (suppressRowClickSelection && suppressRowDeselection) {\n return false;\n } else if (suppressRowClickSelection) {\n return \"enableDeselection\";\n } else if (suppressRowDeselection) {\n return \"enableSelection\";\n } else {\n return true;\n }\n }\n return selection.mode === \"singleRow\" || selection.mode === \"multiRow\" ? selection.enableClickSelection ?? false : false;\n}\nfunction _getEnableSelection(gos) {\n const enableClickSelection = _getEnableClickSelection(gos);\n return enableClickSelection === true || enableClickSelection === \"enableSelection\";\n}\nfunction _getEnableDeselection(gos) {\n const enableClickSelection = _getEnableClickSelection(gos);\n return enableClickSelection === true || enableClickSelection === \"enableDeselection\";\n}\nfunction _getIsRowSelectable(gos) {\n const selection = gos.get(\"rowSelection\");\n if (typeof selection === \"string\") {\n return gos.get(\"isRowSelectable\");\n }\n return selection?.isRowSelectable;\n}\nfunction _getRowSelectionMode(arg) {\n const selection = \"beanName\" in arg && arg.beanName === \"gos\" ? arg.get(\"rowSelection\") : arg.rowSelection;\n if (typeof selection === \"string\") {\n switch (selection) {\n case \"multiple\":\n return \"multiRow\";\n case \"single\":\n return \"singleRow\";\n default:\n return;\n }\n }\n switch (selection?.mode) {\n case \"multiRow\":\n case \"singleRow\":\n return selection.mode;\n default:\n return;\n }\n}\nfunction _isMultiRowSelection(arg) {\n const mode = _getRowSelectionMode(arg);\n return mode === \"multiRow\";\n}\nfunction _getEnableSelectionWithoutKeys(gos) {\n const selection = gos.get(\"rowSelection\");\n if (typeof selection === \"string\") {\n return gos.get(\"rowMultiSelectWithClick\");\n }\n return selection?.enableSelectionWithoutKeys ?? false;\n}\nfunction _getGroupSelection(gos) {\n const selection = gos.get(\"rowSelection\");\n if (typeof selection === \"string\") {\n const groupSelectsChildren = gos.get(\"groupSelectsChildren\");\n const groupSelectsFiltered = gos.get(\"groupSelectsFiltered\");\n if (groupSelectsChildren && groupSelectsFiltered) {\n return \"filteredDescendants\";\n } else if (groupSelectsChildren) {\n return \"descendants\";\n } else {\n return \"self\";\n }\n }\n return selection?.mode === \"multiRow\" ? selection.groupSelects : void 0;\n}\nfunction _getSelectAll(gos, defaultValue = true) {\n const rowSelection = gos.get(\"rowSelection\");\n if (typeof rowSelection !== \"object\") {\n return defaultValue ? \"all\" : void 0;\n }\n return rowSelection.mode === \"multiRow\" ? rowSelection.selectAll : \"all\";\n}\nfunction _getCtrlASelectsRows(gos) {\n const rowSelection = gos.get(\"rowSelection\");\n if (typeof rowSelection === \"string\") {\n return false;\n }\n return rowSelection?.mode === \"multiRow\" ? rowSelection.ctrlASelectsRows ?? false : false;\n}\nfunction _getGroupSelectsDescendants(gos) {\n const groupSelection = _getGroupSelection(gos);\n return groupSelection === \"descendants\" || groupSelection === \"filteredDescendants\";\n}\nfunction _getMasterSelects(gos) {\n const rowSelection = gos.get(\"rowSelection\");\n return typeof rowSelection === \"object\" && rowSelection.masterSelects || \"self\";\n}\nfunction _isSetFilterByDefault(gos) {\n return gos.isModuleRegistered(\"SetFilter\") && !gos.get(\"suppressSetFilterByDefault\");\n}\nfunction _isLegacyMenuEnabled(gos) {\n return gos.get(\"columnMenu\") === \"legacy\";\n}\nfunction _isColumnMenuAnchoringEnabled(gos) {\n return !_isLegacyMenuEnabled(gos);\n}\nfunction _getCallbackForEvent(eventName) {\n if (!eventName || eventName.length < 2) {\n return eventName;\n }\n return \"on\" + eventName[0].toUpperCase() + eventName.substring(1);\n}\nfunction _combineAttributesAndGridOptions(gridOptions, component, gridOptionsKeys) {\n if (typeof gridOptions !== \"object\") {\n gridOptions = {};\n }\n const mergedOptions = { ...gridOptions };\n for (const key of gridOptionsKeys) {\n const value = component[key];\n if (typeof value !== \"undefined\") {\n mergedOptions[key] = value;\n }\n }\n return mergedOptions;\n}\nfunction _processOnChange(changes, api) {\n if (!changes) {\n return;\n }\n const gridChanges = {};\n let hasChanges = false;\n for (const key of Object.keys(changes)) {\n gridChanges[key] = changes[key];\n hasChanges = true;\n }\n if (!hasChanges) {\n return;\n }\n const internalUpdateEvent = {\n type: \"gridOptionsChanged\",\n options: gridChanges\n };\n api.dispatchEvent(internalUpdateEvent);\n const event = {\n type: \"componentStateChanged\",\n ...gridChanges\n };\n api.dispatchEvent(event);\n}\nfunction _addGridCommonParams(gos, params) {\n return gos.addCommon(params);\n}\nfunction _getGridOption(providedGridOptions, gridOption) {\n return providedGridOptions[gridOption] ?? providedGridOptions[`gridOptions`]?.[gridOption] ?? _getGlobalGridOption(gridOption) ?? GRID_OPTION_DEFAULTS[gridOption];\n}\nfunction _interpretAsRightClick({ gos }, event) {\n return event.button === 2 || event.ctrlKey && gos.get(\"allowContextMenuWithControlKey\");\n}\n\n// packages/ag-grid-community/src/entities/agColumn.ts\nvar COL_DEF_DEFAULTS = {\n resizable: true,\n sortable: true\n};\nvar instanceIdSequence = 0;\nfunction getNextColInstanceId() {\n return instanceIdSequence++;\n}\nfunction isColumn(col) {\n return col instanceof AgColumn;\n}\nvar DEFAULT_SORTING_ORDER = [\"asc\", \"desc\", null];\nvar DEFAULT_ABSOLUTE_SORTING_ORDER = [\n { type: \"absolute\", direction: \"asc\" },\n { type: \"absolute\", direction: \"desc\" },\n null\n];\nvar AgColumn = class extends BeanStub {\n constructor(colDef, userProvidedColDef, colId, primary) {\n super();\n this.colDef = colDef;\n this.userProvidedColDef = userProvidedColDef;\n this.colId = colId;\n this.primary = primary;\n this.isColumn = true;\n // used by React (and possibly other frameworks) as key for rendering. also used to\n // identify old vs new columns for destroying cols when no longer used.\n this.instanceId = getNextColInstanceId();\n // The measured height of this column's header when autoHeaderHeight is enabled\n this.autoHeaderHeight = null;\n this.sortDef = _getSortDefFromInput();\n this._wasSortExplicitlyRemoved = false;\n this.moving = false;\n this.resizing = false;\n this.menuVisible = false;\n this.formulaRef = null;\n this.lastLeftPinned = false;\n this.firstRightPinned = false;\n this.filterActive = false;\n this.colEventSvc = new LocalEventService();\n this.tooltipEnabled = false;\n this.rowGroupActive = false;\n this.pivotActive = false;\n this.aggregationActive = false;\n this.flex = null;\n this.colIdSanitised = _escapeString(colId);\n }\n destroy() {\n super.destroy();\n this.beans.rowSpanSvc?.deregister(this);\n }\n getInstanceId() {\n return this.instanceId;\n }\n initState() {\n const {\n colDef,\n beans: { sortSvc, pinnedCols, colFlex }\n } = this;\n sortSvc?.initCol(this);\n const hide = colDef.hide;\n if (hide !== void 0) {\n this.visible = !hide;\n } else {\n this.visible = !colDef.initialHide;\n }\n pinnedCols?.initCol(this);\n colFlex?.initCol(this);\n }\n // gets called when user provides an alternative colDef, eg\n setColDef(colDef, userProvidedColDef, source) {\n const colSpanChanged = colDef.spanRows !== this.colDef.spanRows;\n this.colDef = colDef;\n this.userProvidedColDef = userProvidedColDef;\n this.initMinAndMaxWidths();\n this.initDotNotation();\n this.initTooltip();\n if (colSpanChanged) {\n this.beans.rowSpanSvc?.deregister(this);\n this.initRowSpan();\n }\n this.dispatchColEvent(\"colDefChanged\", source);\n }\n getUserProvidedColDef() {\n return this.userProvidedColDef;\n }\n getParent() {\n return this.parent;\n }\n getOriginalParent() {\n return this.originalParent;\n }\n // this is done after constructor as it uses gridOptionsService\n postConstruct() {\n this.initState();\n this.initMinAndMaxWidths();\n this.resetActualWidth(\"gridInitializing\");\n this.initDotNotation();\n this.initTooltip();\n this.initRowSpan();\n this.addPivotListener();\n }\n initDotNotation() {\n const {\n gos,\n colDef: { field, tooltipField }\n } = this;\n const suppressDotNotation = gos.get(\"suppressFieldDotNotation\");\n this.fieldContainsDots = _exists(field) && field.includes(\".\") && !suppressDotNotation;\n this.tooltipFieldContainsDots = _exists(tooltipField) && tooltipField.includes(\".\") && !suppressDotNotation;\n }\n initMinAndMaxWidths() {\n const colDef = this.colDef;\n this.minWidth = colDef.minWidth ?? this.beans.environment.getDefaultColumnMinWidth();\n this.maxWidth = colDef.maxWidth ?? Number.MAX_SAFE_INTEGER;\n }\n initTooltip() {\n this.beans.tooltipSvc?.initCol(this);\n }\n initRowSpan() {\n if (this.colDef.spanRows) {\n this.beans.rowSpanSvc?.register(this);\n }\n }\n addPivotListener() {\n const pivotColDefSvc = this.beans.pivotColDefSvc;\n const pivotValueColumn = this.colDef.pivotValueColumn;\n if (!pivotColDefSvc || !pivotValueColumn) {\n return;\n }\n this.addManagedListeners(pivotValueColumn, {\n colDefChanged: (evt) => {\n const colDef = pivotColDefSvc.recreateColDef(this.colDef);\n this.setColDef(colDef, colDef, evt.source);\n }\n });\n }\n resetActualWidth(source) {\n const initialWidth = this.calculateColInitialWidth(this.colDef);\n this.setActualWidth(initialWidth, source, true);\n }\n calculateColInitialWidth(colDef) {\n const width = colDef.width ?? colDef.initialWidth ?? 200;\n return Math.max(Math.min(width, this.maxWidth), this.minWidth);\n }\n isEmptyGroup() {\n return false;\n }\n isRowGroupDisplayed(colId) {\n return this.beans.showRowGroupCols?.isRowGroupDisplayed(this, colId) ?? false;\n }\n isPrimary() {\n return this.primary;\n }\n isFilterAllowed() {\n const filterDefined = !!this.colDef.filter;\n return filterDefined;\n }\n isFieldContainsDots() {\n return this.fieldContainsDots;\n }\n isTooltipEnabled() {\n return this.tooltipEnabled;\n }\n isTooltipFieldContainsDots() {\n return this.tooltipFieldContainsDots;\n }\n getHighlighted() {\n return this.highlighted;\n }\n __addEventListener(eventType, listener) {\n this.colEventSvc.addEventListener(eventType, listener);\n }\n __removeEventListener(eventType, listener) {\n this.colEventSvc.removeEventListener(eventType, listener);\n }\n /**\n * PUBLIC USE ONLY: for internal use within AG Grid use the `__addEventListener` and `__removeEventListener` methods.\n */\n addEventListener(eventType, userListener) {\n this.frameworkEventListenerService = this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(\n this.frameworkEventListenerService,\n this.colEventSvc\n );\n const listener = this.frameworkEventListenerService?.wrap(eventType, userListener) ?? userListener;\n this.colEventSvc.addEventListener(eventType, listener);\n }\n /**\n * PUBLIC USE ONLY: for internal use within AG Grid use the `__addEventListener` and `__removeEventListener` methods.\n */\n removeEventListener(eventType, userListener) {\n const listener = this.frameworkEventListenerService?.unwrap(eventType, userListener) ?? userListener;\n this.colEventSvc.removeEventListener(eventType, listener);\n }\n createColumnFunctionCallbackParams(rowNode) {\n return _addGridCommonParams(this.gos, {\n node: rowNode,\n data: rowNode.data,\n column: this,\n colDef: this.colDef\n });\n }\n isSuppressNavigable(rowNode) {\n return this.beans.cellNavigation?.isSuppressNavigable(this, rowNode) ?? false;\n }\n isCellEditable(rowNode) {\n return this.beans.editSvc?.isCellEditable({ rowNode, column: this }) ?? false;\n }\n isSuppressFillHandle() {\n return !!this.colDef.suppressFillHandle;\n }\n isAutoHeight() {\n return !!this.colDef.autoHeight;\n }\n isAutoHeaderHeight() {\n return !!this.colDef.autoHeaderHeight;\n }\n isRowDrag(rowNode) {\n return this.isColumnFunc(rowNode, this.colDef.rowDrag);\n }\n isDndSource(rowNode) {\n return this.isColumnFunc(rowNode, this.colDef.dndSource);\n }\n isCellCheckboxSelection(rowNode) {\n return this.beans.selectionSvc?.isCellCheckboxSelection(this, rowNode) ?? false;\n }\n isSuppressPaste(rowNode) {\n return this.isColumnFunc(rowNode, this.colDef?.suppressPaste ?? null);\n }\n isResizable() {\n return !!this.getColDefValue(\"resizable\");\n }\n /** Get value from ColDef or default if it exists. */\n getColDefValue(key) {\n return this.colDef[key] ?? COL_DEF_DEFAULTS[key];\n }\n isColumnFunc(rowNode, value) {\n if (typeof value === \"boolean\") {\n return value;\n }\n if (typeof value === \"function\") {\n const params = this.createColumnFunctionCallbackParams(rowNode);\n const editableFunc = value;\n return editableFunc(params);\n }\n return false;\n }\n createColumnEvent(type, source) {\n return _addGridCommonParams(this.gos, {\n type,\n column: this,\n columns: [this],\n source\n });\n }\n isMoving() {\n return this.moving;\n }\n getSort() {\n return this.sortDef.direction;\n }\n /**\n * Returns null if no sort direction applied\n */\n getSortDef() {\n if (!this.sortDef.direction) {\n return null;\n }\n return this.sortDef;\n }\n getColDefAllowedSortTypes() {\n const res = [];\n const { sort, initialSort } = this.colDef;\n const colDefSortType = sort === null ? sort : _normalizeSortType(sort?.type);\n const colDefInitialSortType = initialSort === null ? initialSort : _normalizeSortType(initialSort?.type);\n if (colDefSortType) {\n res.push(colDefSortType);\n }\n if (colDefInitialSortType) {\n res.push(colDefInitialSortType);\n }\n return res;\n }\n getSortingOrder() {\n const defaultSortingOrder = this.getColDefAllowedSortTypes().includes(\"absolute\") ? DEFAULT_ABSOLUTE_SORTING_ORDER : DEFAULT_SORTING_ORDER;\n return (this.colDef.sortingOrder ?? this.gos.get(\"sortingOrder\") ?? defaultSortingOrder).map(\n (objOrDirection) => _getSortDefFromInput(objOrDirection)\n );\n }\n getAvailableSortTypes() {\n const explicitSortTypesFromSortingOrder = this.getSortingOrder().reduce((acc, so) => {\n if (so.direction) {\n acc.push(so.type);\n }\n return acc;\n }, this.getColDefAllowedSortTypes());\n return new Set(explicitSortTypesFromSortingOrder);\n }\n get wasSortExplicitlyRemoved() {\n return this._wasSortExplicitlyRemoved;\n }\n setSortDef(sortDef, initial = false) {\n if (!initial) {\n this._wasSortExplicitlyRemoved = !sortDef.direction;\n }\n this.sortDef = sortDef;\n }\n isSortable() {\n return !!this.getColDefValue(\"sortable\");\n }\n /** @deprecated v32 use col.getSort() === 'asc */\n isSortAscending() {\n return this.getSort() === \"asc\";\n }\n /** @deprecated v32 use col.getSort() === 'desc */\n isSortDescending() {\n return this.getSort() === \"desc\";\n }\n /** @deprecated v32 use col.getSort() === undefined */\n isSortNone() {\n return _missing(this.getSort());\n }\n /** @deprecated v32 use col.getSort() !== undefined */\n isSorting() {\n return _exists(this.getSort());\n }\n getSortIndex() {\n return this.sortIndex;\n }\n isMenuVisible() {\n return this.menuVisible;\n }\n getAggFunc() {\n return this.aggFunc;\n }\n getLeft() {\n return this.left;\n }\n getOldLeft() {\n return this.oldLeft;\n }\n getRight() {\n return this.left + this.actualWidth;\n }\n setLeft(left, source) {\n this.oldLeft = this.left;\n if (this.left !== left) {\n this.left = left;\n this.dispatchColEvent(\"leftChanged\", source);\n }\n }\n isFilterActive() {\n return this.filterActive;\n }\n /** @deprecated v33 Use `api.isColumnHovered(column)` instead. */\n isHovered() {\n _warn(261);\n return !!this.beans.colHover?.isHovered(this);\n }\n setFirstRightPinned(firstRightPinned, source) {\n if (this.firstRightPinned !== firstRightPinned) {\n this.firstRightPinned = firstRightPinned;\n this.dispatchColEvent(\"firstRightPinnedChanged\", source);\n }\n }\n setLastLeftPinned(lastLeftPinned, source) {\n if (this.lastLeftPinned !== lastLeftPinned) {\n this.lastLeftPinned = lastLeftPinned;\n this.dispatchColEvent(\"lastLeftPinnedChanged\", source);\n }\n }\n isFirstRightPinned() {\n return this.firstRightPinned;\n }\n isLastLeftPinned() {\n return this.lastLeftPinned;\n }\n isPinned() {\n return this.pinned === \"left\" || this.pinned === \"right\";\n }\n isPinnedLeft() {\n return this.pinned === \"left\";\n }\n isPinnedRight() {\n return this.pinned === \"right\";\n }\n getPinned() {\n return this.pinned;\n }\n setVisible(visible, source) {\n const newValue = visible === true;\n if (this.visible !== newValue) {\n this.visible = newValue;\n this.dispatchColEvent(\"visibleChanged\", source);\n }\n this.dispatchStateUpdatedEvent(\"hide\");\n }\n isVisible() {\n return this.visible;\n }\n isSpanHeaderHeight() {\n const colDef = this.getColDef();\n return !colDef.suppressSpanHeaderHeight;\n }\n /**\n * Returns the first parent that is not a padding group.\n */\n getFirstRealParent() {\n let parent = this.getOriginalParent();\n while (parent?.isPadding()) {\n parent = parent.getOriginalParent();\n }\n return parent;\n }\n getColumnGroupPaddingInfo() {\n let parent = this.getParent();\n if (!parent?.isPadding()) {\n return { numberOfParents: 0, isSpanningTotal: false };\n }\n const numberOfParents = parent.getPaddingLevel() + 1;\n let isSpanningTotal = true;\n while (parent) {\n if (!parent.isPadding()) {\n isSpanningTotal = false;\n break;\n }\n parent = parent.getParent();\n }\n return { numberOfParents, isSpanningTotal };\n }\n getColDef() {\n return this.colDef;\n }\n getDefinition() {\n return this.colDef;\n }\n getColumnGroupShow() {\n return this.colDef.columnGroupShow;\n }\n getColId() {\n return this.colId;\n }\n getId() {\n return this.colId;\n }\n getUniqueId() {\n return this.colId;\n }\n getActualWidth() {\n return this.actualWidth;\n }\n getAutoHeaderHeight() {\n return this.autoHeaderHeight;\n }\n /** Returns true if the header height has changed */\n setAutoHeaderHeight(height) {\n const changed = height !== this.autoHeaderHeight;\n this.autoHeaderHeight = height;\n return changed;\n }\n createBaseColDefParams(rowNode) {\n const params = _addGridCommonParams(this.gos, {\n node: rowNode,\n data: rowNode.data,\n colDef: this.colDef,\n column: this\n });\n return params;\n }\n getColSpan(rowNode) {\n if (_missing(this.colDef.colSpan)) {\n return 1;\n }\n const params = this.createBaseColDefParams(rowNode);\n const colSpan = this.colDef.colSpan(params);\n return Math.max(colSpan, 1);\n }\n getRowSpan(rowNode) {\n if (_missing(this.colDef.rowSpan)) {\n return 1;\n }\n const params = this.createBaseColDefParams(rowNode);\n const rowSpan = this.colDef.rowSpan(params);\n return Math.max(rowSpan, 1);\n }\n setActualWidth(actualWidth, source, silent = false) {\n actualWidth = Math.max(actualWidth, this.minWidth);\n actualWidth = Math.min(actualWidth, this.maxWidth);\n if (this.actualWidth !== actualWidth) {\n this.actualWidth = actualWidth;\n if (this.flex != null && source !== \"flex\" && source !== \"gridInitializing\") {\n this.flex = null;\n }\n if (!silent) {\n this.fireColumnWidthChangedEvent(source);\n }\n }\n this.dispatchStateUpdatedEvent(\"width\");\n }\n fireColumnWidthChangedEvent(source) {\n this.dispatchColEvent(\"widthChanged\", source);\n }\n isGreaterThanMax(width) {\n return width > this.maxWidth;\n }\n getMinWidth() {\n return this.minWidth;\n }\n getMaxWidth() {\n return this.maxWidth;\n }\n getFlex() {\n return this.flex;\n }\n isRowGroupActive() {\n return this.rowGroupActive;\n }\n isPivotActive() {\n return this.pivotActive;\n }\n isAnyFunctionActive() {\n return this.isPivotActive() || this.isRowGroupActive() || this.isValueActive();\n }\n isAnyFunctionAllowed() {\n return this.isAllowPivot() || this.isAllowRowGroup() || this.isAllowValue();\n }\n isValueActive() {\n return this.aggregationActive;\n }\n isAllowPivot() {\n return this.colDef.enablePivot === true;\n }\n isAllowValue() {\n return this.colDef.enableValue === true;\n }\n isAllowRowGroup() {\n return this.colDef.enableRowGroup === true;\n }\n isAllowFormula() {\n return this.colDef.allowFormula === true;\n }\n dispatchColEvent(type, source, additionalEventAttributes) {\n const colEvent = this.createColumnEvent(type, source);\n if (additionalEventAttributes) {\n _mergeDeep(colEvent, additionalEventAttributes);\n }\n this.colEventSvc.dispatchEvent(colEvent);\n }\n dispatchStateUpdatedEvent(key) {\n this.colEventSvc.dispatchEvent({\n type: \"columnStateUpdated\",\n key\n });\n }\n};\nfunction _getSortDefFromInput(input) {\n if (_isSortDefValid(input)) {\n return { direction: input.direction, type: input.type };\n }\n return { direction: _normalizeSortDirection(input), type: _normalizeSortType(input) };\n}\nfunction _isSortDirectionValid(maybeSortDir) {\n return maybeSortDir === \"asc\" || maybeSortDir === \"desc\" || maybeSortDir === null;\n}\nfunction _isSortTypeValid(maybeSortType) {\n return maybeSortType === \"default\" || maybeSortType === \"absolute\";\n}\nfunction _isSortDefValid(maybeSortDef) {\n if (!maybeSortDef || typeof maybeSortDef !== \"object\") {\n return false;\n }\n const maybeSortDefT = maybeSortDef;\n return _isSortTypeValid(maybeSortDefT.type) && _isSortDirectionValid(maybeSortDefT.direction);\n}\nfunction _areSortDefsEqual(sortDef1, sortDef2) {\n if (!sortDef1) {\n return sortDef2 ? sortDef2.direction === null : true;\n }\n if (!sortDef2) {\n return sortDef1 ? sortDef1.direction === null : true;\n }\n return sortDef1.type === sortDef2.type && sortDef1.direction === sortDef2.direction;\n}\nfunction _normalizeSortDirection(sortDirectionLike) {\n return _isSortDirectionValid(sortDirectionLike) ? sortDirectionLike : null;\n}\nfunction _normalizeSortType(sortTypeLike) {\n return _isSortTypeValid(sortTypeLike) ? sortTypeLike : \"default\";\n}\nfunction _getDisplaySortForColumn(column, beans, getSortDefOverride) {\n const overrideSortDef = getSortDefOverride?.();\n const sortDef = overrideSortDef ?? beans.sortSvc.getDisplaySortForColumn(column);\n const type = _normalizeSortType(sortDef?.type);\n const direction = _normalizeSortDirection(sortDef?.direction);\n const allowedSortTypes = column.getAvailableSortTypes();\n const isDefaultSortAllowed = allowedSortTypes.has(\"default\");\n const isAbsoluteSortAllowed = allowedSortTypes.has(\"absolute\");\n const isAbsoluteSort = type === \"absolute\";\n const isDefaultSort = type === \"default\";\n const isAscending = direction === \"asc\";\n const isDescending = direction === \"desc\";\n return {\n isDefaultSortAllowed,\n isAbsoluteSortAllowed,\n isAbsoluteSort,\n isDefaultSort,\n isAscending,\n isDescending,\n direction\n };\n}\n\n// packages/ag-grid-community/src/entities/agProvidedColumnGroup.ts\nfunction isProvidedColumnGroup(col) {\n return col instanceof AgProvidedColumnGroup;\n}\nvar AgProvidedColumnGroup = class extends BeanStub {\n constructor(colGroupDef, groupId, padding, level) {\n super();\n this.colGroupDef = colGroupDef;\n this.groupId = groupId;\n this.padding = padding;\n this.level = level;\n this.isColumn = false;\n this.expandable = false;\n // used by React (and possibly other frameworks) as key for rendering. also used to\n // identify old vs new columns for destroying cols when no longer used.\n this.instanceId = getNextColInstanceId();\n this.expandableListenerRemoveCallback = null;\n this.expanded = !!colGroupDef?.openByDefault;\n }\n destroy() {\n if (this.expandableListenerRemoveCallback) {\n this.reset(null, void 0);\n }\n super.destroy();\n }\n reset(colGroupDef, level) {\n this.colGroupDef = colGroupDef;\n this.level = level;\n this.originalParent = null;\n if (this.expandableListenerRemoveCallback) {\n this.expandableListenerRemoveCallback();\n }\n this.children = void 0;\n this.expandable = void 0;\n }\n getInstanceId() {\n return this.instanceId;\n }\n getOriginalParent() {\n return this.originalParent;\n }\n getLevel() {\n return this.level;\n }\n isVisible() {\n if (this.children) {\n return this.children.some((child) => child.isVisible());\n }\n return false;\n }\n isPadding() {\n return this.padding;\n }\n setExpanded(expanded) {\n this.expanded = expanded === void 0 ? false : expanded;\n this.dispatchLocalEvent({ type: \"expandedChanged\" });\n }\n isExpandable() {\n return this.expandable;\n }\n isExpanded() {\n return this.expanded;\n }\n getGroupId() {\n return this.groupId;\n }\n getId() {\n return this.getGroupId();\n }\n setChildren(children) {\n this.children = children;\n }\n getChildren() {\n return this.children;\n }\n getColGroupDef() {\n return this.colGroupDef;\n }\n getLeafColumns() {\n const result = [];\n this.addLeafColumns(result);\n return result;\n }\n forEachLeafColumn(callback) {\n if (!this.children) {\n return;\n }\n for (const child of this.children) {\n if (isColumn(child)) {\n callback(child);\n } else if (isProvidedColumnGroup(child)) {\n child.forEachLeafColumn(callback);\n }\n }\n }\n addLeafColumns(leafColumns) {\n if (!this.children) {\n return;\n }\n for (const child of this.children) {\n if (isColumn(child)) {\n leafColumns.push(child);\n } else if (isProvidedColumnGroup(child)) {\n child.addLeafColumns(leafColumns);\n }\n }\n }\n getColumnGroupShow() {\n const colGroupDef = this.colGroupDef;\n if (!colGroupDef) {\n return;\n }\n return colGroupDef.columnGroupShow;\n }\n // need to check that this group has at least one col showing when both expanded and contracted.\n // if not, then we don't allow expanding and contracting on this group\n setupExpandable() {\n this.setExpandable();\n if (this.expandableListenerRemoveCallback) {\n this.expandableListenerRemoveCallback();\n }\n const listener = this.onColumnVisibilityChanged.bind(this);\n for (const col of this.getLeafColumns()) {\n col.__addEventListener(\"visibleChanged\", listener);\n }\n this.expandableListenerRemoveCallback = () => {\n for (const col of this.getLeafColumns()) {\n col.__removeEventListener(\"visibleChanged\", listener);\n }\n this.expandableListenerRemoveCallback = null;\n };\n }\n setExpandable() {\n if (this.isPadding()) {\n return;\n }\n let atLeastOneShowingWhenOpen = false;\n let atLeastOneShowingWhenClosed = false;\n let atLeastOneChangeable = false;\n const children = this.findChildrenRemovingPadding();\n for (let i = 0, j = children.length; i < j; i++) {\n const abstractColumn = children[i];\n if (!abstractColumn.isVisible()) {\n continue;\n }\n const headerGroupShow = abstractColumn.getColumnGroupShow();\n if (headerGroupShow === \"open\") {\n atLeastOneShowingWhenOpen = true;\n atLeastOneChangeable = true;\n } else if (headerGroupShow === \"closed\") {\n atLeastOneShowingWhenClosed = true;\n atLeastOneChangeable = true;\n } else {\n atLeastOneShowingWhenOpen = true;\n atLeastOneShowingWhenClosed = true;\n }\n }\n const expandable = atLeastOneShowingWhenOpen && atLeastOneShowingWhenClosed && atLeastOneChangeable;\n if (this.expandable !== expandable) {\n this.expandable = expandable;\n this.dispatchLocalEvent({ type: \"expandableChanged\" });\n }\n }\n findChildrenRemovingPadding() {\n const res = [];\n const process = (items) => {\n for (const item of items) {\n const skipBecausePadding = isProvidedColumnGroup(item) && item.isPadding();\n if (skipBecausePadding) {\n process(item.children);\n } else {\n res.push(item);\n }\n }\n };\n process(this.children);\n return res;\n }\n onColumnVisibilityChanged() {\n this.setExpandable();\n }\n};\n\n// packages/ag-grid-community/src/entities/defaultColumnTypes.ts\nvar DefaultColumnTypes = {\n numericColumn: {\n headerClass: \"ag-right-aligned-header\",\n cellClass: \"ag-right-aligned-cell\"\n },\n rightAligned: {\n headerClass: \"ag-right-aligned-header\",\n cellClass: \"ag-right-aligned-cell\"\n }\n};\n\n// packages/ag-grid-community/src/columns/columnGroups/columnGroupUtils.ts\nfunction createMergedColGroupDef(beans, colGroupDef, groupId) {\n const colGroupDefMerged = {};\n const gos = beans.gos;\n Object.assign(colGroupDefMerged, gos.get(\"defaultColGroupDef\"));\n Object.assign(colGroupDefMerged, colGroupDef);\n gos.validateColDef(colGroupDefMerged, groupId);\n return colGroupDefMerged;\n}\n\n// packages/ag-grid-community/src/columns/columnKeyCreator.ts\nvar ColumnKeyCreator = class {\n constructor() {\n this.existingKeys = {};\n }\n addExistingKeys(keys) {\n for (let i = 0; i < keys.length; i++) {\n this.existingKeys[keys[i]] = true;\n }\n }\n getUniqueKey(colId, colField) {\n colId = _toStringOrNull(colId);\n let count = 0;\n while (true) {\n let idToTry = colId ?? colField;\n if (idToTry) {\n if (count !== 0) {\n idToTry += \"_\" + count;\n }\n } else {\n idToTry = count;\n }\n if (!this.existingKeys[idToTry]) {\n const usedId = String(idToTry);\n if (colId && count > 0) {\n _warn(273, { providedId: colId, usedId });\n }\n this.existingKeys[usedId] = true;\n return usedId;\n }\n count++;\n }\n }\n};\n\n// packages/ag-grid-community/src/columns/columnFactoryUtils.ts\nvar depthFirstCallback = (child, parent) => {\n if (isProvidedColumnGroup(child)) {\n child.setupExpandable();\n }\n child.originalParent = parent;\n};\nfunction _createColumnTreeWithIds(beans, defs = null, primaryColumns, existingTree, source) {\n const { existingCols, existingGroups } = extractExistingTreeData(existingTree);\n const colIdMap = new Map(existingCols.map((col) => [col.getId(), col]));\n const colGroupIdMap = new Map(existingGroups.map((group) => [group.getId(), group]));\n let maxDepth = 0;\n const recursivelyProcessColDef = (def, level) => {\n maxDepth = Math.max(maxDepth, level);\n if (isColumnGroupDef(def)) {\n if (!beans.colGroupSvc) {\n return null;\n }\n const groupId = def.groupId;\n const group = colGroupIdMap.get(groupId);\n const colGroupDef = createMergedColGroupDef(beans, def, groupId);\n const newGroup = new AgProvidedColumnGroup(colGroupDef, groupId, false, level);\n beans.context.createBean(newGroup);\n if (group) {\n newGroup.setExpanded(group.isExpanded());\n }\n newGroup.setChildren(def.children.map((child) => recursivelyProcessColDef(child, level + 1)));\n return newGroup;\n }\n const colId = def.colId;\n let column = colIdMap.get(colId);\n const colDefMerged = _addColumnDefaultAndTypes(beans, def, column?.getColId() ?? colId);\n if (!column) {\n column = new AgColumn(colDefMerged, def, colId, primaryColumns);\n beans.context.createBean(column);\n } else {\n column.setColDef(colDefMerged, def, source);\n _updateColumnState(beans, column, colDefMerged, source);\n }\n beans.dataTypeSvc?.addColumnListeners(column);\n return column;\n };\n const root = defs?.map((def) => recursivelyProcessColDef(def, 0)) ?? [];\n let counter = 0;\n const keyCreator = {\n getUniqueKey: (_colId, _field) => String(++counter)\n };\n const columnTree = beans.colGroupSvc ? beans.colGroupSvc.balanceColumnTree(root, 0, maxDepth, keyCreator) : root;\n depthFirstOriginalTreeSearch(null, columnTree, depthFirstCallback);\n return {\n columnTree,\n treeDepth: maxDepth\n };\n}\nfunction _createColumnTree(beans, defs = null, primaryColumns, existingTree, source) {\n const columnKeyCreator = new ColumnKeyCreator();\n const { existingCols, existingGroups, existingColKeys } = extractExistingTreeData(existingTree);\n columnKeyCreator.addExistingKeys(existingColKeys);\n const unbalancedTree = _recursivelyCreateColumns(\n beans,\n defs,\n 0,\n primaryColumns,\n existingCols,\n columnKeyCreator,\n existingGroups,\n source\n );\n const { colGroupSvc } = beans;\n const treeDepth = colGroupSvc?.findMaxDepth(unbalancedTree, 0) ?? 0;\n const columnTree = colGroupSvc ? colGroupSvc.balanceColumnTree(unbalancedTree, 0, treeDepth, columnKeyCreator) : unbalancedTree;\n depthFirstOriginalTreeSearch(null, columnTree, depthFirstCallback);\n return {\n columnTree,\n treeDepth\n };\n}\nfunction extractExistingTreeData(existingTree) {\n const existingCols = [];\n const existingGroups = [];\n const existingColKeys = [];\n if (existingTree) {\n depthFirstOriginalTreeSearch(null, existingTree, (item) => {\n if (isProvidedColumnGroup(item)) {\n const group = item;\n existingGroups.push(group);\n } else {\n const col = item;\n existingColKeys.push(col.getId());\n existingCols.push(col);\n }\n });\n }\n return { existingCols, existingGroups, existingColKeys };\n}\nfunction _recursivelyCreateColumns(beans, defs, level, primaryColumns, existingColsCopy, columnKeyCreator, existingGroups, source) {\n if (!defs) {\n return [];\n }\n const { colGroupSvc } = beans;\n const result = new Array(defs.length);\n for (let i = 0; i < result.length; i++) {\n const def = defs[i];\n if (colGroupSvc && isColumnGroupDef(def)) {\n result[i] = colGroupSvc.createProvidedColumnGroup(\n primaryColumns,\n def,\n level,\n existingColsCopy,\n columnKeyCreator,\n existingGroups,\n source\n );\n } else {\n result[i] = createColumn(beans, primaryColumns, def, existingColsCopy, columnKeyCreator, source);\n }\n }\n return result;\n}\nfunction createColumn(beans, primaryColumns, colDef, existingColsCopy, columnKeyCreator, source) {\n const existingColAndIndex = findExistingColumn(colDef, existingColsCopy);\n if (existingColAndIndex) {\n existingColsCopy?.splice(existingColAndIndex.idx, 1);\n }\n let column = existingColAndIndex?.column;\n if (!column) {\n const colId = columnKeyCreator.getUniqueKey(colDef.colId, colDef.field);\n const colDefMerged = _addColumnDefaultAndTypes(beans, colDef, colId);\n column = new AgColumn(colDefMerged, colDef, colId, primaryColumns);\n beans.context.createBean(column);\n } else {\n const colDefMerged = _addColumnDefaultAndTypes(beans, colDef, column.getColId());\n column.setColDef(colDefMerged, colDef, source);\n _updateColumnState(beans, column, colDefMerged, source);\n }\n beans.dataTypeSvc?.addColumnListeners(column);\n return column;\n}\nfunction updateSomeColumnState(beans, column, hide, sort, sortIndex, pinned, flex, source) {\n const { sortSvc, pinnedCols, colFlex } = beans;\n if (hide !== void 0) {\n column.setVisible(!hide, source);\n }\n if (sortSvc) {\n sortSvc.updateColSort(column, sort, source);\n if (sortIndex !== void 0) {\n sortSvc.setColSortIndex(column, sortIndex);\n }\n }\n if (pinned !== void 0) {\n pinnedCols?.setColPinned(column, pinned);\n }\n if (flex !== void 0) {\n colFlex?.setColFlex(column, flex);\n }\n}\nfunction _updateColumnState(beans, column, colDef, source) {\n updateSomeColumnState(\n beans,\n column,\n colDef.hide,\n colDef.sort,\n colDef.sortIndex,\n colDef.pinned,\n colDef.flex,\n source\n );\n const colFlex = column.getFlex();\n if (colFlex != null && colFlex > 0) {\n return;\n }\n if (colDef.width != null) {\n column.setActualWidth(colDef.width, source);\n } else {\n const widthBeforeUpdate = column.getActualWidth();\n column.setActualWidth(widthBeforeUpdate, source);\n }\n}\nfunction findExistingColumn(newColDef, existingColsCopy) {\n if (!existingColsCopy) {\n return void 0;\n }\n for (let i = 0; i < existingColsCopy.length; i++) {\n const def = existingColsCopy[i].getUserProvidedColDef();\n if (!def) {\n continue;\n }\n const newHasId = newColDef.colId != null;\n if (newHasId) {\n if (existingColsCopy[i].getId() === newColDef.colId) {\n return { idx: i, column: existingColsCopy[i] };\n }\n continue;\n }\n const newHasField = newColDef.field != null;\n if (newHasField) {\n if (def.field === newColDef.field) {\n return { idx: i, column: existingColsCopy[i] };\n }\n continue;\n }\n if (def === newColDef) {\n return { idx: i, column: existingColsCopy[i] };\n }\n }\n return void 0;\n}\nfunction _addColumnDefaultAndTypes(beans, colDef, colId, isAutoCol) {\n const { gos, dataTypeSvc } = beans;\n const res = {};\n const defaultColDef = gos.get(\"defaultColDef\");\n _mergeDeep(res, defaultColDef, false, true);\n const columnType = updateColDefAndGetColumnType(beans, res, colDef, colId);\n if (columnType) {\n assignColumnTypes(beans, columnType, res);\n }\n const cellDataType = res.cellDataType;\n _mergeDeep(res, colDef, false, true);\n if (cellDataType !== void 0) {\n res.cellDataType = cellDataType;\n }\n const autoGroupColDef = gos.get(\"autoGroupColumnDef\");\n const isSortingCoupled = _isColumnsSortingCoupledToGroup(gos);\n if (colDef.rowGroup && autoGroupColDef && isSortingCoupled) {\n _mergeDeep(\n res,\n {\n sort: autoGroupColDef.sort,\n initialSort: autoGroupColDef.initialSort\n },\n false,\n true\n );\n }\n dataTypeSvc?.postProcess(res);\n dataTypeSvc?.validateColDef(res, colDef, defaultColDef, colId);\n gos.validateColDef(res, colId, isAutoCol);\n return res;\n}\nfunction updateColDefAndGetColumnType(beans, colDef, userColDef, colId) {\n const dataTypeDefinitionColumnType = beans.dataTypeSvc?.updateColDefAndGetColumnType(colDef, userColDef, colId);\n const columnTypes = userColDef.type ?? dataTypeDefinitionColumnType ?? colDef.type;\n colDef.type = columnTypes;\n return columnTypes ? convertColumnTypes(columnTypes) : void 0;\n}\nfunction assignColumnTypes(beans, typeKeys, colDefMerged) {\n if (!typeKeys.length) {\n return;\n }\n const allColumnTypes = Object.assign({}, DefaultColumnTypes);\n const userTypes = beans.gos.get(\"columnTypes\") || {};\n for (const key of Object.keys(userTypes)) {\n const value = userTypes[key];\n if (key in allColumnTypes) {\n _warn(34, { key });\n } else {\n const colType = value;\n if (colType.type) {\n _warn(35);\n }\n allColumnTypes[key] = value;\n }\n }\n for (const t of typeKeys) {\n const typeColDef = allColumnTypes[t.trim()];\n if (typeColDef) {\n _mergeDeep(colDefMerged, typeColDef, false, true);\n } else {\n _warn(36, { t });\n }\n }\n}\nfunction isColumnGroupDef(abstractColDef) {\n return abstractColDef.children !== void 0;\n}\nfunction depthFirstOriginalTreeSearch(parent, tree, callback) {\n if (!tree) {\n return;\n }\n for (let i = 0; i < tree.length; i++) {\n const child = tree[i];\n if (isProvidedColumnGroup(child)) {\n depthFirstOriginalTreeSearch(child, child.getChildren(), callback);\n }\n callback(child, parent);\n }\n}\n\n// packages/ag-grid-community/src/columns/columnUtils.ts\nvar GROUP_AUTO_COLUMN_ID = \"ag-Grid-AutoColumn\";\nvar SELECTION_COLUMN_ID = \"ag-Grid-SelectionColumn\";\nvar ROW_NUMBERS_COLUMN_ID = \"ag-Grid-RowNumbersColumn\";\nvar GROUP_HIERARCHY_COLUMN_ID_PREFIX = \"ag-Grid-HierarchyColumn\";\nfunction _getColumnsFromTree(rootColumns) {\n const result = [];\n const recursiveFindColumns = (childColumns) => {\n for (let i = 0; i < childColumns.length; i++) {\n const child = childColumns[i];\n if (isColumn(child)) {\n result.push(child);\n } else if (isProvidedColumnGroup(child)) {\n recursiveFindColumns(child.getChildren());\n }\n }\n };\n recursiveFindColumns(rootColumns);\n return result;\n}\nfunction getWidthOfColsInList(columnList) {\n return columnList.reduce((width, col) => width + col.getActualWidth(), 0);\n}\nfunction _destroyColumnTree(beans, oldTree, newTree) {\n const oldObjectsById = {};\n if (!oldTree) {\n return;\n }\n depthFirstOriginalTreeSearch(null, oldTree, (child) => {\n oldObjectsById[child.getInstanceId()] = child;\n });\n if (newTree) {\n depthFirstOriginalTreeSearch(null, newTree, (child) => {\n oldObjectsById[child.getInstanceId()] = null;\n });\n }\n const colsToDestroy = Object.values(oldObjectsById).filter((item) => item != null);\n beans.context.destroyBeans(colsToDestroy);\n}\nfunction isColumnGroupAutoCol(col) {\n const colId = col.getId();\n return colId.startsWith(GROUP_AUTO_COLUMN_ID);\n}\nfunction isColumnSelectionCol(col) {\n const id = typeof col === \"string\" ? col : \"getColId\" in col ? col.getColId() : col.colId;\n return id?.startsWith(SELECTION_COLUMN_ID) ?? false;\n}\nfunction isRowNumberCol(col) {\n const id = typeof col === \"string\" ? col : \"getColId\" in col ? col.getColId() : col.colId;\n return id?.startsWith(ROW_NUMBERS_COLUMN_ID) ?? false;\n}\nfunction isSpecialCol(col) {\n return isColumnSelectionCol(col) || isRowNumberCol(col);\n}\nfunction convertColumnTypes(type) {\n let typeKeys = [];\n if (type instanceof Array) {\n typeKeys = type;\n } else if (typeof type === \"string\") {\n typeKeys = type.split(\",\");\n }\n return typeKeys;\n}\nfunction _areColIdsEqual(colsA, colsB) {\n return _areEqual(colsA, colsB, (a, b) => a.getColId() === b.getColId());\n}\nfunction _updateColsMap(cols) {\n cols.map = {};\n for (const col of cols.list) {\n cols.map[col.getId()] = col;\n }\n}\nfunction _convertColumnEventSourceType(source) {\n return source === \"optionsUpdated\" ? \"gridOptionsChanged\" : source;\n}\nfunction _columnsMatch(column, key) {\n return column === key || column.colId == key || column.getColDef() === key;\n}\nvar getValueFactory = (stateItem, defaultState) => (key1, key2) => {\n const obj = {\n value1: void 0,\n value2: void 0\n };\n let calculated = false;\n if (stateItem) {\n if (stateItem[key1] !== void 0) {\n obj.value1 = stateItem[key1];\n calculated = true;\n }\n if (_exists(key2) && stateItem[key2] !== void 0) {\n obj.value2 = stateItem[key2];\n calculated = true;\n }\n }\n if (!calculated && defaultState) {\n if (defaultState[key1] !== void 0) {\n obj.value1 = defaultState[key1];\n }\n if (_exists(key2) && defaultState[key2] !== void 0) {\n obj.value2 = defaultState[key2];\n }\n }\n return obj;\n};\nfunction _getColumnStateFromColDef(colDef, colId) {\n const state = {\n ...colDef,\n sort: void 0,\n colId\n };\n const sortDef = _getSortDefFromColDef(colDef);\n if (sortDef) {\n state.sort = sortDef.direction;\n state.sortType = sortDef.type;\n }\n return state;\n}\nfunction _getSortDefFromColDef(colDef) {\n const { sort, initialSort } = colDef;\n const sortIsValid = _isSortDefValid(sort) || _isSortDirectionValid(sort);\n const initialSortIsValid = _isSortDefValid(initialSort) || _isSortDirectionValid(initialSort);\n if (sortIsValid) {\n return _getSortDefFromInput(sort);\n }\n if (initialSortIsValid) {\n return _getSortDefFromInput(initialSort);\n }\n return null;\n}\n\n// packages/ag-grid-community/src/entities/agColumnGroup.ts\nfunction createUniqueColumnGroupId(groupId, instanceId) {\n return groupId + \"_\" + instanceId;\n}\nfunction isColumnGroup(col) {\n return col instanceof AgColumnGroup;\n}\nvar AgColumnGroup = class extends BeanStub {\n constructor(providedColumnGroup, groupId, partId, pinned) {\n super();\n this.providedColumnGroup = providedColumnGroup;\n this.groupId = groupId;\n this.partId = partId;\n this.pinned = pinned;\n this.isColumn = false;\n // depends on the open/closed state of the group, only displaying columns are stored here\n this.displayedChildren = [];\n // The measured height of this column's header when autoHeaderHeight is enabled\n this.autoHeaderHeight = null;\n this.parent = null;\n this.colIdSanitised = _escapeString(this.getUniqueId());\n }\n // as the user is adding and removing columns, the groups are recalculated.\n // this reset clears out all children, ready for children to be added again\n reset() {\n this.parent = null;\n this.children = null;\n this.displayedChildren = null;\n }\n getParent() {\n return this.parent;\n }\n getUniqueId() {\n return createUniqueColumnGroupId(this.groupId, this.partId);\n }\n isEmptyGroup() {\n return this.displayedChildren.length === 0;\n }\n isMoving() {\n const allLeafColumns = this.getProvidedColumnGroup().getLeafColumns();\n if (!allLeafColumns || allLeafColumns.length === 0) {\n return false;\n }\n return allLeafColumns.every((col) => col.isMoving());\n }\n checkLeft() {\n for (const child of this.displayedChildren) {\n if (isColumnGroup(child)) {\n child.checkLeft();\n }\n }\n if (this.displayedChildren.length > 0) {\n if (this.gos.get(\"enableRtl\")) {\n const lastChild = _last(this.displayedChildren);\n const lastChildLeft = lastChild.getLeft();\n this.setLeft(lastChildLeft);\n } else {\n const firstChildLeft = this.displayedChildren[0].getLeft();\n this.setLeft(firstChildLeft);\n }\n } else {\n this.setLeft(null);\n }\n }\n getLeft() {\n return this.left;\n }\n getOldLeft() {\n return this.oldLeft;\n }\n setLeft(left) {\n this.oldLeft = this.left;\n if (this.left !== left) {\n this.left = left;\n this.dispatchLocalEvent({ type: \"leftChanged\" });\n }\n }\n getPinned() {\n return this.pinned;\n }\n getGroupId() {\n return this.groupId;\n }\n getPartId() {\n return this.partId;\n }\n getActualWidth() {\n let groupActualWidth = 0;\n for (const child of this.displayedChildren ?? []) {\n groupActualWidth += child.getActualWidth();\n }\n return groupActualWidth;\n }\n isResizable() {\n if (!this.displayedChildren) {\n return false;\n }\n let result = false;\n for (const child of this.displayedChildren) {\n if (child.isResizable()) {\n result = true;\n }\n }\n return result;\n }\n getMinWidth() {\n let result = 0;\n for (const groupChild of this.displayedChildren) {\n result += groupChild.getMinWidth();\n }\n return result;\n }\n addChild(child) {\n if (!this.children) {\n this.children = [];\n }\n this.children.push(child);\n }\n getDisplayedChildren() {\n return this.displayedChildren;\n }\n getLeafColumns() {\n const result = [];\n this.addLeafColumns(result);\n return result;\n }\n getDisplayedLeafColumns() {\n const result = [];\n this.addDisplayedLeafColumns(result);\n return result;\n }\n getDefinition() {\n return this.providedColumnGroup.getColGroupDef();\n }\n getColGroupDef() {\n return this.providedColumnGroup.getColGroupDef();\n }\n isPadding() {\n return this.providedColumnGroup.isPadding();\n }\n isExpandable() {\n return this.providedColumnGroup.isExpandable();\n }\n isExpanded() {\n return this.providedColumnGroup.isExpanded();\n }\n setExpanded(expanded) {\n this.providedColumnGroup.setExpanded(expanded);\n }\n isAutoHeaderHeight() {\n return !!this.getColGroupDef()?.autoHeaderHeight;\n }\n getAutoHeaderHeight() {\n return this.autoHeaderHeight;\n }\n /** Returns true if the header height has changed */\n setAutoHeaderHeight(height) {\n const changed = height !== this.autoHeaderHeight;\n this.autoHeaderHeight = height;\n return changed;\n }\n addDisplayedLeafColumns(leafColumns) {\n for (const child of this.displayedChildren ?? []) {\n if (isColumn(child)) {\n leafColumns.push(child);\n } else if (isColumnGroup(child)) {\n child.addDisplayedLeafColumns(leafColumns);\n }\n }\n }\n addLeafColumns(leafColumns) {\n for (const child of this.children ?? []) {\n if (isColumn(child)) {\n leafColumns.push(child);\n } else if (isColumnGroup(child)) {\n child.addLeafColumns(leafColumns);\n }\n }\n }\n getChildren() {\n return this.children;\n }\n getColumnGroupShow() {\n return this.providedColumnGroup.getColumnGroupShow();\n }\n getProvidedColumnGroup() {\n return this.providedColumnGroup;\n }\n getPaddingLevel() {\n const parent = this.getParent();\n if (!this.isPadding() || !parent?.isPadding()) {\n return 0;\n }\n return 1 + parent.getPaddingLevel();\n }\n calculateDisplayedColumns() {\n this.displayedChildren = [];\n let parentWithExpansion = this;\n while (parentWithExpansion?.isPadding()) {\n parentWithExpansion = parentWithExpansion.getParent();\n }\n const isExpandable = parentWithExpansion ? parentWithExpansion.getProvidedColumnGroup().isExpandable() : false;\n if (!isExpandable) {\n this.displayedChildren = this.children;\n this.dispatchLocalEvent({ type: \"displayedChildrenChanged\" });\n return;\n }\n for (const child of this.children ?? []) {\n const emptyGroup = isColumnGroup(child) && !child.displayedChildren?.length;\n if (emptyGroup) {\n continue;\n }\n const headerGroupShow = child.getColumnGroupShow();\n switch (headerGroupShow) {\n case \"open\":\n if (parentWithExpansion.getProvidedColumnGroup().isExpanded()) {\n this.displayedChildren.push(child);\n }\n break;\n case \"closed\":\n if (!parentWithExpansion.getProvidedColumnGroup().isExpanded()) {\n this.displayedChildren.push(child);\n }\n break;\n default:\n this.displayedChildren.push(child);\n break;\n }\n }\n this.dispatchLocalEvent({ type: \"displayedChildrenChanged\" });\n }\n};\n\n// packages/ag-grid-community/src/agStack/constants/keyCode.ts\nvar KeyCode = {\n BACKSPACE: \"Backspace\",\n TAB: \"Tab\",\n ENTER: \"Enter\",\n ESCAPE: \"Escape\",\n SPACE: \" \",\n LEFT: \"ArrowLeft\",\n UP: \"ArrowUp\",\n RIGHT: \"ArrowRight\",\n DOWN: \"ArrowDown\",\n DELETE: \"Delete\",\n F2: \"F2\",\n PAGE_UP: \"PageUp\",\n PAGE_DOWN: \"PageDown\",\n PAGE_HOME: \"Home\",\n PAGE_END: \"End\",\n // these should be used with `event.code` instead of `event.key`\n // as `event.key` changes when non-latin keyboards are used\n A: \"KeyA\",\n C: \"KeyC\",\n D: \"KeyD\",\n V: \"KeyV\",\n X: \"KeyX\",\n Y: \"KeyY\",\n Z: \"KeyZ\"\n};\nvar A_KEYCODE = 65;\nvar C_KEYCODE = 67;\nvar V_KEYCODE = 86;\nvar D_KEYCODE = 68;\nvar Z_KEYCODE = 90;\nvar Y_KEYCODE = 89;\nfunction _normaliseQwertyAzerty(keyboardEvent) {\n const { keyCode } = keyboardEvent;\n let code;\n switch (keyCode) {\n case A_KEYCODE:\n code = KeyCode.A;\n break;\n case C_KEYCODE:\n code = KeyCode.C;\n break;\n case V_KEYCODE:\n code = KeyCode.V;\n break;\n case D_KEYCODE:\n code = KeyCode.D;\n break;\n case Z_KEYCODE:\n code = KeyCode.Z;\n break;\n case Y_KEYCODE:\n code = KeyCode.Y;\n break;\n default:\n code = keyboardEvent.code;\n }\n return code;\n}\n\n// packages/ag-grid-community/src/agStack/utils/promise.ts\nfunction _isPromise(fn) {\n return typeof fn.then === \"function\";\n}\nfunction _wrapInterval(action, timeout) {\n return new AgPromise((resolve) => {\n resolve(window.setInterval(action, timeout));\n });\n}\nvar AgPromise = class _AgPromise {\n constructor(callback) {\n this.status = 0 /* IN_PROGRESS */;\n this.resolution = null;\n this.waiters = [];\n callback(\n (value) => this.onDone(value),\n (params) => this.onReject(params)\n );\n }\n static all(promises) {\n return promises.length ? new _AgPromise((resolve) => {\n let remainingToResolve = promises.length;\n const combinedValues = new Array(remainingToResolve);\n promises.forEach((promise, index) => {\n promise.then((value) => {\n combinedValues[index] = value;\n remainingToResolve--;\n if (remainingToResolve === 0) {\n resolve(combinedValues);\n }\n });\n });\n }) : _AgPromise.resolve();\n }\n static resolve(value = null) {\n return new _AgPromise((resolve) => resolve(value));\n }\n then(func) {\n return new _AgPromise((resolve) => {\n if (this.status === 1 /* RESOLVED */) {\n resolve(func(this.resolution));\n } else {\n this.waiters.push((value) => resolve(func(value)));\n }\n });\n }\n onDone(value) {\n this.status = 1 /* RESOLVED */;\n this.resolution = value;\n for (const waiter of this.waiters) {\n waiter(value);\n }\n }\n onReject(_) {\n }\n};\n\n// packages/ag-grid-community/src/agStack/core/baseDragAndDropService.ts\nvar BaseDragAndDropService = class extends AgBeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"dragAndDrop\";\n this.dragSourceAndParamsList = [];\n this.dragItem = null;\n this.dragInitialSourcePointerOffsetX = 0;\n this.dragInitialSourcePointerOffsetY = 0;\n this.lastMouseEvent = null;\n this.lastDraggingEvent = null;\n this.dragSource = null;\n this.dragImageCompPromise = null;\n this.dragImageComp = null;\n this.dragImageLastIcon = void 0;\n this.dragImageLastLabel = void 0;\n this.dropTargets = [];\n this.externalDropZoneCount = 0;\n this.lastDropTarget = null;\n }\n addDragSource(dragSource, allowTouch = false) {\n const entry = {\n capturePointer: true,\n dragSource,\n eElement: dragSource.eElement,\n dragStartPixels: dragSource.dragStartPixels,\n onDragStart: (mouseEvent) => this.onDragStart(dragSource, mouseEvent),\n onDragStop: this.onDragStop.bind(this),\n onDragging: this.onDragging.bind(this),\n onDragCancel: this.onDragCancel.bind(this),\n includeTouch: allowTouch\n };\n this.dragSourceAndParamsList.push(entry);\n this.beans.dragSvc.addDragSource(entry);\n }\n setDragImageCompIcon(iconName, shake = false) {\n const component = this.dragImageComp;\n if (component && (shake || this.dragImageLastIcon !== iconName)) {\n this.dragImageLastIcon = iconName;\n component.setIcon(iconName, shake);\n }\n }\n removeDragSource(dragSource) {\n const { dragSourceAndParamsList, beans } = this;\n for (let i = 0, len = dragSourceAndParamsList.length; i < len; i++) {\n if (dragSourceAndParamsList[i].dragSource === dragSource) {\n const sourceAndParams = dragSourceAndParamsList[i];\n beans.dragSvc?.removeDragSource(sourceAndParams);\n dragSourceAndParamsList.splice(i, 1);\n break;\n }\n }\n }\n destroy() {\n const { dragSourceAndParamsList, dropTargets, beans } = this;\n const dragSvc = beans.dragSvc;\n for (const sourceAndParams of dragSourceAndParamsList) {\n dragSvc?.removeDragSource(sourceAndParams);\n }\n dragSourceAndParamsList.length = 0;\n dropTargets.length = 0;\n this.externalDropZoneCount = 0;\n this.clearDragAndDropProperties();\n super.destroy();\n }\n nudge() {\n const lastMouseEvent = this.lastMouseEvent;\n if (lastMouseEvent) {\n this.onDragging(lastMouseEvent, true);\n }\n }\n onDragStart(dragSource, mouseEvent) {\n this.lastMouseEvent = mouseEvent;\n this.dragSource = dragSource;\n this.dragItem = dragSource.getDragItem();\n const rect = dragSource.eElement.getBoundingClientRect();\n this.dragInitialSourcePointerOffsetX = mouseEvent.clientX - rect.left;\n this.dragInitialSourcePointerOffsetY = mouseEvent.clientY - rect.top;\n dragSource.onDragStarted?.();\n this.createAndUpdateDragImageComp(dragSource);\n }\n onDragStop(mouseEvent) {\n const { dragSource, lastDropTarget } = this;\n dragSource?.onDragStopped?.();\n if (lastDropTarget) {\n const dragEndEvent = this.dropTargetEvent(lastDropTarget, mouseEvent, false);\n lastDropTarget.onDragStop?.(dragEndEvent);\n }\n this.clearDragAndDropProperties();\n }\n onDragCancel() {\n const { dragSource, lastDropTarget, lastMouseEvent } = this;\n dragSource?.onDragCancelled?.();\n if (lastDropTarget && lastMouseEvent) {\n const dragCancelEvent = this.dropTargetEvent(lastDropTarget, lastMouseEvent, false);\n lastDropTarget.onDragCancel?.(dragCancelEvent);\n }\n this.clearDragAndDropProperties();\n }\n onDragging(mouseEvent, fromNudge = false) {\n this.positionDragImageComp(mouseEvent);\n const dropTarget = this.findCurrentDropTarget(mouseEvent);\n const { lastDropTarget, dragSource, dragItem } = this;\n let needUpdate = false;\n if (dropTarget !== lastDropTarget) {\n needUpdate = true;\n if (lastDropTarget) {\n const dragLeaveEvent = this.dropTargetEvent(lastDropTarget, mouseEvent, fromNudge);\n lastDropTarget.onDragLeave?.(dragLeaveEvent);\n }\n if (lastDropTarget !== null && !dropTarget) {\n this.handleExit(dragSource, dragItem);\n } else if (lastDropTarget === null && dropTarget) {\n this.handleEnter(dragSource, dragItem);\n }\n if (dropTarget) {\n const dragEnterEvent = this.dropTargetEvent(dropTarget, mouseEvent, fromNudge);\n dropTarget.onDragEnter?.(dragEnterEvent);\n }\n this.lastDropTarget = dropTarget;\n } else if (dropTarget) {\n const dragMoveEvent = this.dropTargetEvent(dropTarget, mouseEvent, fromNudge);\n dropTarget.onDragging?.(dragMoveEvent);\n if (dragMoveEvent?.changed) {\n needUpdate = true;\n }\n }\n this.lastMouseEvent = mouseEvent;\n if (needUpdate) {\n this.updateDragImageComp();\n }\n }\n clearDragAndDropProperties() {\n this.removeDragImageComp(this.dragImageComp);\n this.dragImageCompPromise = null;\n this.dragImageLastIcon = void 0;\n this.dragImageLastLabel = void 0;\n this.lastMouseEvent = null;\n this.lastDraggingEvent = null;\n this.lastDropTarget = null;\n this.dragItem = null;\n this.dragInitialSourcePointerOffsetX = 0;\n this.dragInitialSourcePointerOffsetY = 0;\n this.dragSource = null;\n }\n getAllContainersFromDropTarget(dropTarget) {\n const primaryContainer = dropTarget.getContainer();\n const secondaryContainers = dropTarget.getSecondaryContainers?.();\n const secondaryContainersLen = secondaryContainers?.length;\n if (!secondaryContainersLen) {\n return [[primaryContainer]];\n }\n const containers = new Array(secondaryContainersLen + 1);\n containers[0] = [primaryContainer];\n for (let i = 0; i < secondaryContainersLen; ++i) {\n containers[i + 1] = secondaryContainers[i];\n }\n return containers;\n }\n // checks if the mouse is on the drop target. it checks eContainer and eSecondaryContainers\n isMouseOnDropTarget(mouseEvent, dropTarget) {\n const allContainersFromDropTarget = this.getAllContainersFromDropTarget(dropTarget);\n let mouseOverTarget = false;\n const allContainersIntersect = (mouseEvent2, containers) => {\n for (const container of containers) {\n const { width, height, left, right, top, bottom } = container.getBoundingClientRect();\n if (width === 0 || height === 0) {\n return false;\n }\n const horizontalFit = mouseEvent2.clientX >= left && mouseEvent2.clientX < right;\n const verticalFit = mouseEvent2.clientY >= top && mouseEvent2.clientY < bottom;\n if (!horizontalFit || !verticalFit) {\n return false;\n }\n }\n return true;\n };\n for (const currentContainers of allContainersFromDropTarget) {\n if (allContainersIntersect(mouseEvent, currentContainers)) {\n mouseOverTarget = true;\n break;\n }\n }\n const { eElement, type } = this.dragSource;\n if (dropTarget.targetContainsSource && !dropTarget.getContainer().contains(eElement)) {\n return false;\n }\n return mouseOverTarget && dropTarget.isInterestedIn(type, eElement);\n }\n findCurrentDropTarget(mouseEvent) {\n const validDropTargets = [];\n const dropTargets = this.dropTargets;\n for (let i = 0, len2 = dropTargets.length; i < len2; ++i) {\n const target = dropTargets[i];\n if (this.isMouseOnDropTarget(mouseEvent, target)) {\n validDropTargets.push(target);\n }\n }\n const len = validDropTargets.length;\n if (len === 0) {\n return null;\n }\n if (len === 1) {\n return validDropTargets[0];\n }\n const rootNode = _getRootNode(this.beans);\n const elementStack = rootNode.elementsFromPoint(mouseEvent.clientX, mouseEvent.clientY);\n for (let i = 0, stackLen = elementStack.length; i < stackLen; ++i) {\n const el = elementStack[i];\n for (let targetIndex = 0, targetsLen = validDropTargets.length; targetIndex < targetsLen; targetIndex++) {\n const dropTarget = validDropTargets[targetIndex];\n const containerGroups = this.getAllContainersFromDropTarget(dropTarget);\n let matched = false;\n for (let groupIdx = 0, groupLen = containerGroups.length; groupIdx < groupLen && !matched; groupIdx++) {\n const group = containerGroups[groupIdx];\n for (let elIdx = 0, elLen = group.length; elIdx < elLen; elIdx++) {\n if (group[elIdx] === el) {\n matched = true;\n break;\n }\n }\n }\n if (matched) {\n return dropTarget;\n }\n }\n }\n return null;\n }\n addDropTarget(dropTarget) {\n this.dropTargets.push(dropTarget);\n if (dropTarget.external) {\n this.externalDropZoneCount++;\n }\n }\n removeDropTarget(dropTarget) {\n const container = dropTarget.getContainer();\n const dropTargets = this.dropTargets;\n let writeIndex = 0;\n for (let readIndex = 0, len = dropTargets.length; readIndex < len; ++readIndex) {\n const target = dropTargets[readIndex];\n if (target.getContainer() === container) {\n if (target.external) {\n --this.externalDropZoneCount;\n }\n continue;\n }\n if (writeIndex !== readIndex) {\n dropTargets[writeIndex] = target;\n }\n ++writeIndex;\n }\n dropTargets.length = writeIndex;\n }\n hasExternalDropZones() {\n return this.externalDropZoneCount > 0;\n }\n findExternalZone(container) {\n const dropTargets = this.dropTargets;\n for (let i = 0, len = dropTargets.length; i < len; ++i) {\n const zone = dropTargets[i];\n if (zone.external && zone.getContainer() === container) {\n return zone;\n }\n }\n return null;\n }\n dropTargetEvent(dropTarget, mouseEvent, fromNudge) {\n const {\n dragSource,\n dragItem,\n lastDraggingEvent,\n lastMouseEvent,\n dragInitialSourcePointerOffsetX,\n dragInitialSourcePointerOffsetY\n } = this;\n const dropZoneTarget = dropTarget.getContainer();\n const rect = dropZoneTarget.getBoundingClientRect();\n const { clientX, clientY } = mouseEvent;\n const xDir = clientX - (lastMouseEvent?.clientX || 0);\n const yDir = clientY - (lastMouseEvent?.clientY || 0);\n const draggingEvent = this.createEvent({\n event: mouseEvent,\n x: clientX - rect.left,\n // relative x\n y: clientY - rect.top,\n // relative y\n vDirection: yDir > 0 ? \"down\" : yDir < 0 ? \"up\" : null,\n hDirection: xDir < 0 ? \"left\" : xDir > 0 ? \"right\" : null,\n initialSourcePointerOffsetX: dragInitialSourcePointerOffsetX,\n initialSourcePointerOffsetY: dragInitialSourcePointerOffsetY,\n dragSource,\n fromNudge,\n dragItem,\n dropZoneTarget,\n dropTarget: lastDraggingEvent?.dropTarget ?? null,\n // updated by rowDragFeature\n changed: !!lastDraggingEvent?.changed\n });\n this.lastDraggingEvent = draggingEvent;\n return draggingEvent;\n }\n positionDragImageComp(event) {\n const gui = this.dragImageComp?.getGui();\n if (gui) {\n _anchorElementToMouseMoveEvent(gui, event, this.beans);\n }\n }\n removeDragImageComp(comp) {\n if (this.dragImageComp === comp) {\n this.dragImageComp = null;\n }\n if (comp) {\n comp.getGui()?.remove();\n this.destroyBean(comp);\n }\n }\n createAndUpdateDragImageComp(dragSource) {\n const promise = this.createDragImageComp(dragSource) ?? null;\n this.dragImageCompPromise = promise;\n promise?.then((dragImageComp) => {\n const lastMouseEvent = this.lastMouseEvent;\n if (promise !== this.dragImageCompPromise || !lastMouseEvent || !this.isAlive()) {\n this.destroyBean(dragImageComp);\n return;\n }\n this.dragImageCompPromise = null;\n this.dragImageLastIcon = void 0;\n this.dragImageLastLabel = void 0;\n const oldDragImageComp = this.dragImageComp;\n if (oldDragImageComp !== dragImageComp) {\n this.dragImageComp = dragImageComp;\n this.removeDragImageComp(oldDragImageComp);\n }\n if (dragImageComp) {\n this.appendDragImageComp(dragImageComp);\n this.updateDragImageComp();\n this.positionDragImageComp(lastMouseEvent);\n }\n });\n }\n appendDragImageComp(component) {\n const eGui = component.getGui();\n const style = eGui.style;\n style.position = \"absolute\";\n style.zIndex = \"9999\";\n if (this.beans.dragSvc?.hasPointerCapture()) {\n style.pointerEvents = \"none\";\n }\n this.gos.setInstanceDomData(eGui);\n this.beans.environment.applyThemeClasses(eGui);\n style.top = \"20px\";\n style.left = \"20px\";\n const targetEl = _getPageBody(this.beans);\n if (!targetEl) {\n this.warnNoBody();\n } else {\n targetEl.appendChild(eGui);\n }\n }\n updateDragImageComp() {\n const { dragImageComp, dragSource, lastDropTarget, lastDraggingEvent, dragImageLastLabel } = this;\n if (!dragImageComp) {\n return;\n }\n this.setDragImageCompIcon(lastDropTarget?.getIconName?.(lastDraggingEvent) ?? null);\n let label = dragSource?.dragItemName;\n if (typeof label === \"function\") {\n label = label(lastDraggingEvent);\n }\n label || (label = \"\");\n if (dragImageLastLabel !== label) {\n this.dragImageLastLabel = label;\n dragImageComp.setLabel(label);\n }\n }\n};\n\n// packages/ag-grid-community/src/interfaces/iFilter.ts\nfunction isColumnFilterComp(filter) {\n return typeof filter === \"object\" && !!filter.component;\n}\n\n// packages/ag-grid-community/src/components/framework/userComponentFactory.ts\nfunction doesImplementIComponent(candidate) {\n if (!candidate) {\n return false;\n }\n return candidate.prototype && \"getGui\" in candidate.prototype;\n}\nfunction _getUserCompKeys(frameworkOverrides, defObject, type, params) {\n const { name } = type;\n let compName;\n let jsComp;\n let fwComp;\n let paramsFromSelector;\n let popupFromSelector;\n let popupPositionFromSelector;\n if (defObject) {\n const defObjectAny = defObject;\n const selectorFunc = defObjectAny[name + \"Selector\"];\n const selectorRes = selectorFunc ? selectorFunc(params) : null;\n const assignComp = (providedJsComp) => {\n if (typeof providedJsComp === \"string\") {\n compName = providedJsComp;\n } else if (providedJsComp != null && providedJsComp !== true) {\n const isFwkComp = frameworkOverrides.isFrameworkComponent(providedJsComp);\n if (isFwkComp) {\n fwComp = providedJsComp;\n } else {\n jsComp = providedJsComp;\n }\n }\n };\n if (selectorRes) {\n assignComp(selectorRes.component);\n paramsFromSelector = selectorRes.params;\n popupFromSelector = selectorRes.popup;\n popupPositionFromSelector = selectorRes.popupPosition;\n } else {\n assignComp(defObjectAny[name]);\n }\n }\n return { compName, jsComp, fwComp, paramsFromSelector, popupFromSelector, popupPositionFromSelector };\n}\nvar UserComponentFactory = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"userCompFactory\";\n }\n wireBeans(beans) {\n this.agCompUtils = beans.agCompUtils;\n this.registry = beans.registry;\n this.frameworkCompWrapper = beans.frameworkCompWrapper;\n this.gridOptions = beans.gridOptions;\n }\n getCompDetailsFromGridOptions(type, defaultName, params, mandatory = false) {\n return this.getCompDetails(this.gridOptions, type, defaultName, params, mandatory);\n }\n getCompDetails(defObject, type, defaultName, params, mandatory = false) {\n const { name, cellRenderer } = type;\n let { compName, jsComp, fwComp, paramsFromSelector, popupFromSelector, popupPositionFromSelector } = _getUserCompKeys(this.beans.frameworkOverrides, defObject, type, params);\n let defaultCompParams;\n let defaultCompProcessParams;\n const lookupFromRegistry = (key) => {\n const item = this.registry.getUserComponent(name, key);\n if (item) {\n jsComp = !item.componentFromFramework ? item.component : void 0;\n fwComp = item.componentFromFramework ? item.component : void 0;\n defaultCompParams = item.params;\n defaultCompProcessParams = item.processParams;\n }\n };\n if (compName != null) {\n lookupFromRegistry(compName);\n }\n if (jsComp == null && fwComp == null && defaultName != null) {\n lookupFromRegistry(defaultName);\n }\n if (jsComp && cellRenderer && !doesImplementIComponent(jsComp)) {\n jsComp = this.agCompUtils?.adaptFunction(type, jsComp);\n }\n if (!jsComp && !fwComp) {\n const { validation } = this.beans;\n if (mandatory && (compName !== defaultName || !defaultName)) {\n if (compName) {\n if (!validation?.isProvidedUserComp(compName)) {\n _error(50, { compName });\n }\n } else if (defaultName) {\n if (!validation) {\n _error(260, {\n ...this.gos.getModuleErrorParams(),\n propName: name,\n compName: defaultName\n });\n }\n } else {\n _error(216, { name });\n }\n } else if (defaultName && !validation) {\n _error(146, { comp: defaultName });\n }\n return;\n }\n const paramsMerged = this.mergeParams(\n defObject,\n type,\n params,\n paramsFromSelector,\n defaultCompParams,\n defaultCompProcessParams\n );\n const componentFromFramework = jsComp == null;\n const componentClass = jsComp ?? fwComp;\n return {\n componentFromFramework,\n componentClass,\n params: paramsMerged,\n type,\n popupFromSelector,\n popupPositionFromSelector,\n newAgStackInstance: () => this.newAgStackInstance(componentClass, componentFromFramework, paramsMerged, type)\n };\n }\n newAgStackInstance(ComponentClass, componentFromFramework, params, type) {\n const jsComponent = !componentFromFramework;\n let instance;\n if (jsComponent) {\n instance = new ComponentClass();\n } else {\n instance = this.frameworkCompWrapper.wrap(\n ComponentClass,\n type.mandatoryMethods,\n type.optionalMethods,\n type\n );\n }\n this.createBean(instance);\n const deferredInit = instance.init?.(params);\n if (deferredInit == null) {\n return AgPromise.resolve(instance);\n }\n return deferredInit.then(() => instance);\n }\n /**\n * merges params with application provided params\n * used by Floating Filter\n */\n mergeParams(defObject, type, paramsFromGrid, paramsFromSelector = null, defaultCompParams, defaultCompProcessParams) {\n const params = { ...paramsFromGrid, ...defaultCompParams };\n const defObjectAny = defObject;\n const userParams = defObjectAny?.[type.name + \"Params\"];\n if (typeof userParams === \"function\") {\n const userParamsFromFunc = userParams(paramsFromGrid);\n _mergeDeep(params, userParamsFromFunc);\n } else if (typeof userParams === \"object\") {\n _mergeDeep(params, userParams);\n }\n _mergeDeep(params, paramsFromSelector);\n return defaultCompProcessParams ? defaultCompProcessParams(params) : params;\n }\n};\n\n// packages/ag-grid-community/src/components/framework/userCompUtils.ts\nvar DateComponent = {\n name: \"dateComponent\",\n mandatoryMethods: [\"getDate\", \"setDate\"],\n optionalMethods: [\"afterGuiAttached\", \"setInputPlaceholder\", \"setInputAriaLabel\", \"setDisabled\", \"refresh\"]\n};\nvar DragAndDropImageComponent = {\n name: \"dragAndDropImageComponent\",\n mandatoryMethods: [\"setIcon\", \"setLabel\"]\n};\nvar HeaderComponent = { name: \"headerComponent\", optionalMethods: [\"refresh\"] };\nvar InnerHeaderComponent = { name: \"innerHeaderComponent\" };\nvar InnerHeaderGroupComponent = { name: \"innerHeaderGroupComponent\" };\nvar HeaderGroupComponent = { name: \"headerGroupComponent\" };\nvar InnerCellRendererComponent = {\n name: \"innerRenderer\",\n cellRenderer: true,\n optionalMethods: [\"afterGuiAttached\"]\n};\nvar CellRendererComponent = {\n name: \"cellRenderer\",\n optionalMethods: [\"refresh\", \"afterGuiAttached\"],\n cellRenderer: true\n};\nvar EditorRendererComponent = {\n name: \"cellRenderer\",\n optionalMethods: [\"refresh\", \"afterGuiAttached\"]\n};\nvar LoadingCellRendererComponent = { name: \"loadingCellRenderer\", cellRenderer: true };\nvar CellEditorComponent = {\n name: \"cellEditor\",\n mandatoryMethods: [\"getValue\"],\n optionalMethods: [\n \"isPopup\",\n \"isCancelBeforeStart\",\n \"isCancelAfterEnd\",\n \"getPopupPosition\",\n \"focusIn\",\n \"focusOut\",\n \"afterGuiAttached\",\n \"refresh\"\n ]\n};\nvar TooltipComponent = { name: \"tooltipComponent\" };\nvar FilterComponent = {\n name: \"filter\",\n mandatoryMethods: [\"isFilterActive\", \"doesFilterPass\", \"getModel\", \"setModel\"],\n optionalMethods: [\n \"afterGuiAttached\",\n \"afterGuiDetached\",\n \"onNewRowsLoaded\",\n \"getModelAsString\",\n \"onFloatingFilterChanged\",\n \"onAnyFilterChanged\",\n \"refresh\"\n ]\n};\nvar FloatingFilterComponent = {\n name: \"floatingFilterComponent\",\n mandatoryMethods: [\"onParentModelChanged\"],\n optionalMethods: [\"afterGuiAttached\", \"refresh\"]\n};\nvar FullWidth = {\n name: \"fullWidthCellRenderer\",\n optionalMethods: [\"refresh\", \"afterGuiAttached\"],\n cellRenderer: true\n};\nvar FullWidthLoading = { name: \"loadingCellRenderer\", cellRenderer: true };\nvar FullWidthGroup = {\n name: \"groupRowRenderer\",\n optionalMethods: [\"afterGuiAttached\"],\n cellRenderer: true\n};\nvar FullWidthDetail = { name: \"detailCellRenderer\", optionalMethods: [\"refresh\"], cellRenderer: true };\nfunction _getDragAndDropImageCompDetails(userCompFactory, params) {\n return userCompFactory.getCompDetailsFromGridOptions(DragAndDropImageComponent, \"agDragAndDropImage\", params, true);\n}\nfunction _getInnerCellRendererDetails(userCompFactory, def, params) {\n return userCompFactory.getCompDetails(def, InnerCellRendererComponent, void 0, params);\n}\nfunction _getHeaderCompDetails(userCompFactory, colDef, params) {\n return userCompFactory.getCompDetails(colDef, HeaderComponent, \"agColumnHeader\", params);\n}\nfunction _getInnerHeaderCompDetails(userCompFactory, headerCompParams, params) {\n return userCompFactory.getCompDetails(headerCompParams, InnerHeaderComponent, void 0, params);\n}\nfunction _getHeaderGroupCompDetails(userCompFactory, params) {\n const colGroupDef = params.columnGroup.getColGroupDef();\n return userCompFactory.getCompDetails(colGroupDef, HeaderGroupComponent, \"agColumnGroupHeader\", params);\n}\nfunction _getInnerHeaderGroupCompDetails(userCompFactory, headerGroupCompParams, params) {\n return userCompFactory.getCompDetails(headerGroupCompParams, InnerHeaderGroupComponent, void 0, params);\n}\nfunction _getFullWidthCellRendererDetails(userCompFactory, params) {\n return userCompFactory.getCompDetailsFromGridOptions(FullWidth, void 0, params, true);\n}\nfunction _getFullWidthLoadingCellRendererDetails(userCompFactory, params) {\n return userCompFactory.getCompDetailsFromGridOptions(FullWidthLoading, \"agLoadingCellRenderer\", params, true);\n}\nfunction _getFullWidthGroupCellRendererDetails(userCompFactory, params) {\n return userCompFactory.getCompDetailsFromGridOptions(FullWidthGroup, \"agGroupRowRenderer\", params, true);\n}\nfunction _getFullWidthDetailCellRendererDetails(userCompFactory, params) {\n return userCompFactory.getCompDetailsFromGridOptions(FullWidthDetail, \"agDetailCellRenderer\", params, true);\n}\nfunction _getCellRendererDetails(userCompFactory, def, params) {\n return userCompFactory.getCompDetails(def, CellRendererComponent, void 0, params);\n}\nfunction _getEditorRendererDetails(userCompFactory, def, params) {\n return userCompFactory.getCompDetails(\n def,\n EditorRendererComponent,\n void 0,\n params\n );\n}\nfunction _getLoadingCellRendererDetails(userCompFactory, def, params) {\n return userCompFactory.getCompDetails(def, LoadingCellRendererComponent, \"agSkeletonCellRenderer\", params, true);\n}\nfunction _getCellEditorDetails(userCompFactory, def, params) {\n return userCompFactory.getCompDetails(def, CellEditorComponent, \"agCellEditor\", params, true);\n}\nfunction _getFilterDetails(userCompFactory, def, params, defaultFilter) {\n const filter = def.filter;\n if (isColumnFilterComp(filter)) {\n def = {\n filter: filter.component,\n filterParams: def.filterParams\n };\n }\n return userCompFactory.getCompDetails(def, FilterComponent, defaultFilter, params, true);\n}\nfunction _getDateCompDetails(userCompFactory, def, params) {\n return userCompFactory.getCompDetails(def, DateComponent, \"agDateInput\", params, true);\n}\nfunction _getTooltipCompDetails(userCompFactory, params) {\n return userCompFactory.getCompDetails(params.colDef, TooltipComponent, \"agTooltipComponent\", params, true);\n}\nfunction _getFloatingFilterCompDetails(userCompFactory, def, params, defaultFloatingFilter) {\n return userCompFactory.getCompDetails(def, FloatingFilterComponent, defaultFloatingFilter, params);\n}\nfunction _getFilterCompKeys(frameworkOverrides, def) {\n return _getUserCompKeys(frameworkOverrides, def, FilterComponent);\n}\nfunction _mergeFilterParamsWithApplicationProvidedParams(userCompFactory, defObject, paramsFromGrid) {\n return userCompFactory.mergeParams(defObject, FilterComponent, paramsFromGrid);\n}\n\n// packages/ag-grid-community/src/dragAndDrop/dragAndDropService.ts\nvar DragSourceType = /* @__PURE__ */ ((DragSourceType2) => {\n DragSourceType2[DragSourceType2[\"ToolPanel\"] = 0] = \"ToolPanel\";\n DragSourceType2[DragSourceType2[\"HeaderCell\"] = 1] = \"HeaderCell\";\n DragSourceType2[DragSourceType2[\"RowDrag\"] = 2] = \"RowDrag\";\n DragSourceType2[DragSourceType2[\"ChartPanel\"] = 3] = \"ChartPanel\";\n DragSourceType2[DragSourceType2[\"AdvancedFilterBuilder\"] = 4] = \"AdvancedFilterBuilder\";\n return DragSourceType2;\n})(DragSourceType || {});\nvar DragAndDropService = class extends BaseDragAndDropService {\n createEvent(event) {\n return _addGridCommonParams(this.gos, event);\n }\n createDragImageComp(dragSource) {\n const { gos, beans } = this;\n const userCompDetails = _getDragAndDropImageCompDetails(\n beans.userCompFactory,\n _addGridCommonParams(gos, {\n dragSource\n })\n );\n return userCompDetails?.newAgStackInstance();\n }\n handleEnter(dragSource, dragItem) {\n dragSource?.onGridEnter?.(dragItem);\n }\n handleExit(dragSource, dragItem) {\n dragSource?.onGridExit?.(dragItem);\n }\n warnNoBody() {\n _warn(54);\n }\n isDropZoneWithinThisGrid(draggingEvent) {\n return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(draggingEvent.dropZoneTarget);\n }\n registerGridDropTarget(elementFn, ctrl) {\n const dropTarget = {\n getContainer: elementFn,\n isInterestedIn: (type) => type === 1 /* HeaderCell */ || type === 0 /* ToolPanel */,\n getIconName: () => \"notAllowed\"\n };\n this.addDropTarget(dropTarget);\n ctrl.addDestroyFunc(() => this.removeDropTarget(dropTarget));\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/iSimpleFilter.ts\nfunction isCombinedFilterModel(model) {\n return !!model.operator;\n}\n\n// packages/ag-grid-community/src/agStack/rendering/agPositionableFeature.ts\nvar RESIZE_CONTAINER_STYLE = \"ag-resizer-wrapper\";\nvar makeDiv = (dataRefPrefix, classSuffix) => ({\n tag: \"div\",\n ref: `${dataRefPrefix}Resizer`,\n cls: `ag-resizer ag-resizer-${classSuffix}`\n});\nvar RESIZE_TEMPLATE = {\n tag: \"div\",\n cls: RESIZE_CONTAINER_STYLE,\n children: [\n makeDiv(\"eTopLeft\", \"topLeft\"),\n makeDiv(\"eTop\", \"top\"),\n makeDiv(\"eTopRight\", \"topRight\"),\n makeDiv(\"eRight\", \"right\"),\n makeDiv(\"eBottomRight\", \"bottomRight\"),\n makeDiv(\"eBottom\", \"bottom\"),\n makeDiv(\"eBottomLeft\", \"bottomLeft\"),\n makeDiv(\"eLeft\", \"left\")\n ]\n};\nvar AgPositionableFeature = class extends AgBeanStub {\n constructor(element, config) {\n super();\n this.element = element;\n this.dragStartPosition = {\n x: 0,\n y: 0\n };\n this.position = {\n x: 0,\n y: 0\n };\n this.lastSize = {\n width: -1,\n height: -1\n };\n this.positioned = false;\n this.resizersAdded = false;\n this.resizeListeners = [];\n this.boundaryEl = null;\n this.isResizing = false;\n this.isMoving = false;\n this.resizable = {};\n this.movable = false;\n this.currentResizer = null;\n this.config = { popup: false, ...config };\n }\n wireBeans(beans) {\n this.popupSvc = beans.popupSvc;\n this.dragSvc = beans.dragSvc;\n }\n center(postProcessCallback) {\n const { clientHeight, clientWidth } = this.offsetParent;\n const x = clientWidth / 2 - this.getWidth() / 2;\n const y = clientHeight / 2 - this.getHeight() / 2;\n this.offsetElement(x, y, postProcessCallback);\n }\n initialisePosition(postProcessCallback) {\n if (this.positioned) {\n return;\n }\n const { centered, forcePopupParentAsOffsetParent, minWidth, width, minHeight, height, x, y } = this.config;\n if (!this.offsetParent) {\n this.setOffsetParent();\n }\n let computedMinHeight = 0;\n let computedMinWidth = 0;\n const isElementVisible = _isVisible(this.element);\n if (isElementVisible) {\n const boundaryEl = this.findBoundaryElement();\n const offsetParentComputedStyles = window.getComputedStyle(boundaryEl);\n if (offsetParentComputedStyles.minWidth != null) {\n const paddingWidth = boundaryEl.offsetWidth - this.element.offsetWidth;\n computedMinWidth = Number.parseInt(offsetParentComputedStyles.minWidth, 10) - paddingWidth;\n }\n if (offsetParentComputedStyles.minHeight != null) {\n const paddingHeight = boundaryEl.offsetHeight - this.element.offsetHeight;\n computedMinHeight = Number.parseInt(offsetParentComputedStyles.minHeight, 10) - paddingHeight;\n }\n }\n this.minHeight = minHeight || computedMinHeight;\n this.minWidth = minWidth || computedMinWidth;\n if (width) {\n this.setWidth(width);\n }\n if (height) {\n this.setHeight(height);\n }\n if (!width || !height) {\n this.refreshSize();\n }\n if (centered) {\n this.center(postProcessCallback);\n } else if (x || y) {\n this.offsetElement(x, y, postProcessCallback);\n } else if (isElementVisible && forcePopupParentAsOffsetParent) {\n let boundaryEl = this.boundaryEl;\n let initialisedDuringPositioning = true;\n if (!boundaryEl) {\n boundaryEl = this.findBoundaryElement();\n initialisedDuringPositioning = false;\n }\n if (boundaryEl) {\n const top = Number.parseFloat(boundaryEl.style.top);\n const left = Number.parseFloat(boundaryEl.style.left);\n if (initialisedDuringPositioning) {\n this.offsetElement(Number.isNaN(left) ? 0 : left, Number.isNaN(top) ? 0 : top, postProcessCallback);\n } else {\n this.setPosition(left, top);\n }\n }\n }\n this.positioned = !!this.offsetParent;\n }\n isPositioned() {\n return this.positioned;\n }\n getPosition() {\n return this.position;\n }\n setMovable(movable, moveElement) {\n if (!this.config.popup || movable === this.movable) {\n return;\n }\n this.movable = movable;\n const params = this.moveElementDragListener || {\n eElement: moveElement,\n onDragStart: this.onMoveStart.bind(this),\n onDragging: this.onMove.bind(this),\n onDragStop: this.onMoveEnd.bind(this)\n };\n if (movable) {\n this.dragSvc?.addDragSource(params);\n this.moveElementDragListener = params;\n } else {\n this.dragSvc?.removeDragSource(params);\n this.moveElementDragListener = void 0;\n }\n }\n setResizable(resizable) {\n this.clearResizeListeners();\n if (resizable) {\n this.addResizers();\n } else {\n this.removeResizers();\n }\n if (typeof resizable === \"boolean\") {\n if (resizable === false) {\n return;\n }\n resizable = {\n topLeft: resizable,\n top: resizable,\n topRight: resizable,\n right: resizable,\n bottomRight: resizable,\n bottom: resizable,\n bottomLeft: resizable,\n left: resizable\n };\n }\n for (const side of Object.keys(resizable)) {\n const isSideResizable = !!resizable[side];\n const resizerEl = this.getResizerElement(side);\n const params = {\n dragStartPixels: 0,\n eElement: resizerEl,\n onDragStart: (e) => this.onResizeStart(e, side),\n onDragging: this.onResize.bind(this),\n onDragStop: (e) => this.onResizeEnd(e, side)\n };\n if (isSideResizable || !this.isAlive() && !isSideResizable) {\n if (isSideResizable) {\n this.dragSvc?.addDragSource(params);\n this.resizeListeners.push(params);\n resizerEl.style.pointerEvents = \"all\";\n } else {\n resizerEl.style.pointerEvents = \"none\";\n }\n this.resizable[side] = isSideResizable;\n }\n }\n }\n removeSizeFromEl() {\n this.element.style.removeProperty(\"height\");\n this.element.style.removeProperty(\"width\");\n this.element.style.removeProperty(\"flex\");\n }\n restoreLastSize() {\n this.element.style.flex = \"0 0 auto\";\n const { height, width } = this.lastSize;\n if (width !== -1) {\n this.element.style.width = `${width}px`;\n }\n if (height !== -1) {\n this.element.style.height = `${height}px`;\n }\n }\n getHeight() {\n return this.element.offsetHeight;\n }\n setHeight(height) {\n const { popup } = this.config;\n const eGui = this.element;\n let isPercent = false;\n if (typeof height === \"string\" && height.includes(\"%\")) {\n _setFixedHeight(eGui, height);\n height = _getAbsoluteHeight(eGui);\n isPercent = true;\n } else {\n height = Math.max(this.minHeight, height);\n if (this.positioned) {\n const availableHeight = this.getAvailableHeight();\n if (availableHeight && height > availableHeight) {\n height = availableHeight;\n }\n }\n }\n if (this.getHeight() === height) {\n return;\n }\n if (isPercent) {\n eGui.style.maxHeight = \"unset\";\n eGui.style.minHeight = \"unset\";\n } else if (popup) {\n _setFixedHeight(eGui, height);\n } else {\n eGui.style.height = `${height}px`;\n eGui.style.flex = \"0 0 auto\";\n this.lastSize.height = typeof height === \"number\" ? height : Number.parseFloat(height);\n }\n }\n getAvailableHeight() {\n const { popup, forcePopupParentAsOffsetParent } = this.config;\n if (!this.positioned) {\n this.initialisePosition();\n }\n const { clientHeight } = this.offsetParent;\n if (!clientHeight) {\n return null;\n }\n const elRect = this.element.getBoundingClientRect();\n const offsetParentRect = this.offsetParent.getBoundingClientRect();\n const yPosition = popup ? this.position.y : elRect.top;\n const parentTop = popup ? 0 : offsetParentRect.top;\n let additionalHeight = 0;\n if (forcePopupParentAsOffsetParent) {\n const parentEl = this.element.parentElement;\n if (parentEl) {\n const { bottom } = parentEl.getBoundingClientRect();\n additionalHeight = bottom - elRect.bottom;\n }\n }\n const availableHeight = clientHeight + parentTop - yPosition - additionalHeight;\n return availableHeight;\n }\n getWidth() {\n return this.element.offsetWidth;\n }\n setWidth(width) {\n const eGui = this.element;\n const { popup } = this.config;\n let isPercent = false;\n if (typeof width === \"string\" && width.includes(\"%\")) {\n _setFixedWidth(eGui, width);\n width = _getAbsoluteWidth(eGui);\n isPercent = true;\n } else if (this.positioned) {\n width = Math.max(this.minWidth, width);\n const { clientWidth } = this.offsetParent;\n const xPosition = popup ? this.position.x : this.element.getBoundingClientRect().left;\n if (clientWidth && width + xPosition > clientWidth) {\n width = clientWidth - xPosition;\n }\n }\n if (this.getWidth() === width) {\n return;\n }\n if (isPercent) {\n eGui.style.maxWidth = \"unset\";\n eGui.style.minWidth = \"unset\";\n } else if (this.config.popup) {\n _setFixedWidth(eGui, width);\n } else {\n eGui.style.width = `${width}px`;\n eGui.style.flex = \" unset\";\n this.lastSize.width = typeof width === \"number\" ? width : Number.parseFloat(width);\n }\n }\n offsetElement(x = 0, y = 0, postProcessCallback) {\n const { forcePopupParentAsOffsetParent } = this.config;\n const ePopup = forcePopupParentAsOffsetParent ? this.boundaryEl : this.element;\n if (!ePopup) {\n return;\n }\n this.popupSvc?.positionPopup({\n ePopup,\n keepWithinBounds: true,\n skipObserver: this.movable || this.isResizable(),\n updatePosition: () => ({ x, y }),\n postProcessCallback\n });\n this.setPosition(Number.parseFloat(ePopup.style.left), Number.parseFloat(ePopup.style.top));\n }\n constrainSizeToAvailableHeight(constrain) {\n if (!this.config.forcePopupParentAsOffsetParent) {\n return;\n }\n const applyMaxHeightToElement = () => {\n const availableHeight = this.getAvailableHeight();\n this.element.style.setProperty(\"max-height\", `${availableHeight}px`);\n };\n if (constrain && this.popupSvc) {\n this.resizeObserverSubscriber?.();\n this.resizeObserverSubscriber = _observeResize(\n this.beans,\n this.popupSvc?.getPopupParent(),\n applyMaxHeightToElement\n );\n } else {\n this.element.style.removeProperty(\"max-height\");\n if (this.resizeObserverSubscriber) {\n this.resizeObserverSubscriber();\n this.resizeObserverSubscriber = void 0;\n }\n }\n }\n setPosition(x, y) {\n this.position.x = x;\n this.position.y = y;\n }\n updateDragStartPosition(x, y) {\n this.dragStartPosition = { x, y };\n }\n calculateMouseMovement(params) {\n const { e, isLeft, isTop, anywhereWithin, topBuffer } = params;\n const xDiff = e.clientX - this.dragStartPosition.x;\n const yDiff = e.clientY - this.dragStartPosition.y;\n const movementX = this.shouldSkipX(e, !!isLeft, !!anywhereWithin, xDiff) ? 0 : xDiff;\n const movementY = this.shouldSkipY(e, !!isTop, topBuffer, yDiff) ? 0 : yDiff;\n return { movementX, movementY };\n }\n shouldSkipX(e, isLeft, anywhereWithin, diff) {\n const elRect = this.element.getBoundingClientRect();\n const parentRect = this.offsetParent.getBoundingClientRect();\n const boundaryElRect = this.boundaryEl.getBoundingClientRect();\n const xPosition = this.config.popup ? this.position.x : elRect.left;\n let skipX = xPosition <= 0 && parentRect.left >= e.clientX || parentRect.right <= e.clientX && parentRect.right <= boundaryElRect.right;\n if (skipX) {\n return true;\n }\n if (isLeft) {\n skipX = // skip if we are moving to the left and the cursor\n // is positioned to the right of the left side anchor\n diff < 0 && e.clientX > xPosition + parentRect.left || // skip if we are moving to the right and the cursor\n // is positioned to the left of the dialog\n diff > 0 && e.clientX < xPosition + parentRect.left;\n } else if (anywhereWithin) {\n skipX = diff < 0 && e.clientX > boundaryElRect.right || diff > 0 && e.clientX < xPosition + parentRect.left;\n } else {\n skipX = // if the movement is bound to the right side of the dialog\n // we skip if we are moving to the left and the cursor\n // is to the right of the dialog\n diff < 0 && e.clientX > boundaryElRect.right || // or skip if we are moving to the right and the cursor\n // is to the left of the right side anchor\n diff > 0 && e.clientX < boundaryElRect.right;\n }\n return skipX;\n }\n shouldSkipY(e, isTop, topBuffer = 0, diff) {\n const elRect = this.element.getBoundingClientRect();\n const parentRect = this.offsetParent.getBoundingClientRect();\n const boundaryElRect = this.boundaryEl.getBoundingClientRect();\n const yPosition = this.config.popup ? this.position.y : elRect.top;\n let skipY = yPosition <= 0 && parentRect.top >= e.clientY || parentRect.bottom <= e.clientY && parentRect.bottom <= boundaryElRect.bottom;\n if (skipY) {\n return true;\n }\n if (isTop) {\n skipY = // skip if we are moving to towards top and the cursor is\n // below the top anchor + topBuffer\n // note: topBuffer is used when moving the dialog using the title bar\n diff < 0 && e.clientY > yPosition + parentRect.top + topBuffer || // skip if we are moving to the bottom and the cursor is\n // above the top anchor\n diff > 0 && e.clientY < yPosition + parentRect.top;\n } else {\n skipY = // skip if we are moving towards the top and the cursor\n // is below the bottom anchor\n diff < 0 && e.clientY > boundaryElRect.bottom || // skip if we are moving towards the bottom and the cursor\n // is above the bottom anchor\n diff > 0 && e.clientY < boundaryElRect.bottom;\n }\n return skipY;\n }\n createResizeMap() {\n const getElement2 = (ref) => ({\n element: this.element.querySelector(`[data-ref=${ref}Resizer]`)\n });\n this.resizerMap = {\n topLeft: getElement2(\"eTopLeft\"),\n top: getElement2(\"eTop\"),\n topRight: getElement2(\"eTopRight\"),\n right: getElement2(\"eRight\"),\n bottomRight: getElement2(\"eBottomRight\"),\n bottom: getElement2(\"eBottom\"),\n bottomLeft: getElement2(\"eBottomLeft\"),\n left: getElement2(\"eLeft\")\n };\n }\n addResizers() {\n if (this.resizersAdded) {\n return;\n }\n const eGui = this.element;\n if (!eGui) {\n return;\n }\n eGui.appendChild(_createAgElement(RESIZE_TEMPLATE));\n this.createResizeMap();\n this.resizersAdded = true;\n }\n removeResizers() {\n this.resizerMap = void 0;\n const resizerEl = this.element.querySelector(`.${RESIZE_CONTAINER_STYLE}`);\n resizerEl?.remove();\n this.resizersAdded = false;\n }\n getResizerElement(side) {\n return this.resizerMap[side].element;\n }\n onResizeStart(e, side) {\n this.boundaryEl = this.findBoundaryElement();\n if (!this.positioned) {\n this.initialisePosition();\n }\n this.currentResizer = {\n isTop: !!side.match(/top/i),\n isRight: !!side.match(/right/i),\n isBottom: !!side.match(/bottom/i),\n isLeft: !!side.match(/left/i)\n };\n this.element.classList.add(\"ag-resizing\");\n this.resizerMap[side].element.classList.add(\"ag-active\");\n const { popup, forcePopupParentAsOffsetParent } = this.config;\n if (!popup && !forcePopupParentAsOffsetParent) {\n this.applySizeToSiblings(this.currentResizer.isBottom || this.currentResizer.isTop);\n }\n this.isResizing = true;\n this.updateDragStartPosition(e.clientX, e.clientY);\n }\n getSiblings() {\n const element = this.element;\n const parent = element.parentElement;\n if (!parent) {\n return null;\n }\n return Array.prototype.slice.call(parent.children).filter((el) => !el.classList.contains(\"ag-hidden\"));\n }\n getMinSizeOfSiblings() {\n const siblings = this.getSiblings() || [];\n let height = 0;\n let width = 0;\n for (const currentEl of siblings) {\n const isFlex = !!currentEl.style.flex && currentEl.style.flex !== \"0 0 auto\";\n if (currentEl === this.element) {\n continue;\n }\n let nextHeight = this.minHeight || 0;\n let nextWidth = this.minWidth || 0;\n if (isFlex) {\n const computedStyle = window.getComputedStyle(currentEl);\n if (computedStyle.minHeight) {\n nextHeight = Number.parseInt(computedStyle.minHeight, 10);\n }\n if (computedStyle.minWidth) {\n nextWidth = Number.parseInt(computedStyle.minWidth, 10);\n }\n } else {\n nextHeight = currentEl.offsetHeight;\n nextWidth = currentEl.offsetWidth;\n }\n height += nextHeight;\n width += nextWidth;\n }\n return { height, width };\n }\n applySizeToSiblings(vertical) {\n let containerToFlex = null;\n const siblings = this.getSiblings();\n if (!siblings) {\n return;\n }\n for (let i = 0; i < siblings.length; i++) {\n const el = siblings[i];\n if (el === containerToFlex) {\n continue;\n }\n if (vertical) {\n el.style.height = `${el.offsetHeight}px`;\n } else {\n el.style.width = `${el.offsetWidth}px`;\n }\n el.style.flex = \"0 0 auto\";\n if (el === this.element) {\n containerToFlex = siblings[i + 1];\n }\n }\n if (containerToFlex) {\n containerToFlex.style.removeProperty(\"height\");\n containerToFlex.style.removeProperty(\"min-height\");\n containerToFlex.style.removeProperty(\"max-height\");\n containerToFlex.style.flex = \"1 1 auto\";\n }\n }\n isResizable() {\n return Object.values(this.resizable).some((value) => value);\n }\n onResize(e) {\n if (!this.isResizing || !this.currentResizer) {\n return;\n }\n const { popup, forcePopupParentAsOffsetParent } = this.config;\n const { isTop, isRight, isBottom, isLeft } = this.currentResizer;\n const isHorizontal = isRight || isLeft;\n const isVertical = isBottom || isTop;\n const { movementX, movementY } = this.calculateMouseMovement({ e, isLeft, isTop });\n const xPosition = this.position.x;\n const yPosition = this.position.y;\n let offsetLeft = 0;\n let offsetTop = 0;\n if (isHorizontal && movementX) {\n const direction = isLeft ? -1 : 1;\n const oldWidth = this.getWidth();\n const newWidth = oldWidth + movementX * direction;\n let skipWidth = false;\n if (isLeft) {\n offsetLeft = oldWidth - newWidth;\n if (xPosition + offsetLeft <= 0 || newWidth <= this.minWidth) {\n skipWidth = true;\n offsetLeft = 0;\n }\n }\n if (!skipWidth) {\n this.setWidth(newWidth);\n }\n }\n if (isVertical && movementY) {\n const direction = isTop ? -1 : 1;\n const oldHeight = this.getHeight();\n const newHeight = oldHeight + movementY * direction;\n let skipHeight = false;\n if (isTop) {\n offsetTop = oldHeight - newHeight;\n if (yPosition + offsetTop <= 0 || newHeight <= this.minHeight) {\n skipHeight = true;\n offsetTop = 0;\n }\n } else if (\n // do not let the size of all siblings be higher than the parent container\n !this.config.popup && !this.config.forcePopupParentAsOffsetParent && oldHeight < newHeight && this.getMinSizeOfSiblings().height + newHeight > this.element.parentElement.offsetHeight\n ) {\n skipHeight = true;\n }\n if (!skipHeight) {\n this.setHeight(newHeight);\n }\n }\n this.updateDragStartPosition(e.clientX, e.clientY);\n if ((popup || forcePopupParentAsOffsetParent) && offsetLeft || offsetTop) {\n this.offsetElement(xPosition + offsetLeft, yPosition + offsetTop);\n }\n }\n onResizeEnd(e, side) {\n this.isResizing = false;\n this.currentResizer = null;\n this.boundaryEl = null;\n this.element.classList.remove(\"ag-resizing\");\n this.resizerMap[side].element.classList.remove(\"ag-active\");\n this.dispatchLocalEvent({ type: \"resize\" });\n }\n refreshSize() {\n const eGui = this.element;\n if (this.config.popup) {\n if (!this.config.width) {\n this.setWidth(eGui.offsetWidth);\n }\n if (!this.config.height) {\n this.setHeight(eGui.offsetHeight);\n }\n }\n }\n onMoveStart(e) {\n this.boundaryEl = this.findBoundaryElement();\n if (!this.positioned) {\n this.initialisePosition();\n }\n this.isMoving = true;\n this.element.classList.add(\"ag-moving\");\n this.updateDragStartPosition(e.clientX, e.clientY);\n }\n onMove(e) {\n if (!this.isMoving) {\n return;\n }\n const { x, y } = this.position;\n let topBuffer;\n if (this.config.calculateTopBuffer) {\n topBuffer = this.config.calculateTopBuffer();\n }\n const { movementX, movementY } = this.calculateMouseMovement({\n e,\n isTop: true,\n anywhereWithin: true,\n topBuffer\n });\n this.offsetElement(x + movementX, y + movementY);\n this.updateDragStartPosition(e.clientX, e.clientY);\n }\n onMoveEnd() {\n this.isMoving = false;\n this.boundaryEl = null;\n this.element.classList.remove(\"ag-moving\");\n }\n setOffsetParent() {\n if (this.config.forcePopupParentAsOffsetParent && this.popupSvc) {\n this.offsetParent = this.popupSvc.getPopupParent();\n } else {\n this.offsetParent = this.element.offsetParent;\n }\n }\n findBoundaryElement() {\n let el = this.element;\n while (el) {\n if (window.getComputedStyle(el).position !== \"static\") {\n return el;\n }\n el = el.parentElement;\n }\n return this.element;\n }\n clearResizeListeners() {\n while (this.resizeListeners.length) {\n const params = this.resizeListeners.pop();\n this.dragSvc?.removeDragSource(params);\n }\n }\n destroy() {\n super.destroy();\n if (this.moveElementDragListener) {\n this.dragSvc?.removeDragSource(this.moveElementDragListener);\n }\n this.constrainSizeToAvailableHeight(false);\n this.clearResizeListeners();\n this.removeResizers();\n }\n};\n\n// packages/ag-grid-community/src/rendering/features/positionableFeature.ts\nvar PositionableFeature = class extends AgPositionableFeature {\n};\n\n// packages/ag-grid-community/src/agStack/interfaces/agComponent.ts\nvar RefPlaceholder = null;\nfunction _isComponent(item) {\n return typeof item?.getGui === \"function\";\n}\n\n// packages/ag-grid-community/src/agStack/rendering/cssClassManager.ts\nvar CssClassManager = class {\n constructor(getGui) {\n // to minimise DOM hits, we only apply CSS classes if they have changed. as adding a CSS class that is already\n // there, or removing one that wasn't present, all takes CPU.\n this.cssClassStates = {};\n this.getGui = getGui;\n }\n toggleCss(className, addOrRemove) {\n if (!className) {\n return;\n }\n if (className.includes(\" \")) {\n const list = (className || \"\").split(\" \");\n if (list.length > 1) {\n for (const cls of list) {\n this.toggleCss(cls, addOrRemove);\n }\n return;\n }\n }\n const updateNeeded = this.cssClassStates[className] !== addOrRemove;\n if (updateNeeded && className.length) {\n this.getGui()?.classList.toggle(className, addOrRemove);\n this.cssClassStates[className] = addOrRemove;\n }\n }\n};\n\n// packages/ag-grid-community/src/agStack/core/agComponentStub.ts\nvar compIdSequence = 0;\nvar AgComponentStub = class extends AgBeanStub {\n constructor(templateOrParams, componentSelectors) {\n super();\n this.suppressDataRefValidation = false;\n // if false, then CSS class \"ag-hidden\" is applied, which sets \"display: none\"\n this.displayed = true;\n // if false, then CSS class \"ag-invisible\" is applied, which sets \"visibility: hidden\"\n this.visible = true;\n // unique id for this row component. this is used for getting a reference to the HTML dom.\n // we cannot use the RowNode id as this is not unique (due to animation, old rows can be lying\n // around as we create a new rowComp instance for the same row node).\n this.compId = compIdSequence++;\n this.cssManager = new CssClassManager(() => this.eGui);\n this.componentSelectors = new Map((componentSelectors ?? []).map((comp) => [comp.selector, comp]));\n if (templateOrParams) {\n this.setTemplate(templateOrParams);\n }\n }\n preConstruct() {\n this.wireTemplate(this.getGui());\n this.addGlobalCss();\n }\n wireTemplate(element, paramsMap) {\n if (element && this.gos) {\n this.applyElementsToComponent(element);\n this.createChildComponentsFromTags(element, paramsMap);\n }\n }\n getCompId() {\n return this.compId;\n }\n getDataRefAttribute(element) {\n if (element.getAttribute) {\n return element.getAttribute(DataRefAttribute);\n }\n return null;\n }\n applyElementsToComponent(element, elementRef, paramsMap, newComponent = null) {\n if (elementRef === void 0) {\n elementRef = this.getDataRefAttribute(element);\n }\n if (elementRef) {\n const current = this[elementRef];\n if (current === RefPlaceholder) {\n this[elementRef] = newComponent ?? element;\n } else {\n const usedAsParamRef = paramsMap?.[elementRef];\n if (!this.suppressDataRefValidation && !usedAsParamRef) {\n throw new Error(`data-ref: ${elementRef} on ${this.constructor.name} with ${current}`);\n }\n }\n }\n }\n // for registered components only, eg creates AgCheckbox instance from ag-checkbox HTML tag\n createChildComponentsFromTags(parentNode, paramsMap) {\n const childNodeList = [];\n for (const childNode of parentNode.childNodes ?? []) {\n childNodeList.push(childNode);\n }\n for (const childNode of childNodeList) {\n if (!(childNode instanceof HTMLElement)) {\n continue;\n }\n const childComp = this.createComponentFromElement(\n childNode,\n (childComp2) => {\n const childGui = childComp2.getGui();\n if (childGui) {\n for (const attr of childNode.attributes ?? []) {\n childGui.setAttribute(attr.name, attr.value);\n }\n }\n },\n paramsMap\n );\n if (childComp) {\n if (childComp.addItems && childNode.children.length) {\n this.createChildComponentsFromTags(childNode, paramsMap);\n const items = Array.prototype.slice.call(childNode.children);\n childComp.addItems(items);\n }\n this.swapComponentForNode(childComp, parentNode, childNode);\n } else if (childNode.childNodes) {\n this.createChildComponentsFromTags(childNode, paramsMap);\n }\n }\n }\n createComponentFromElement(element, afterPreCreateCallback, paramsMap) {\n const key = element.nodeName;\n const elementRef = this.getDataRefAttribute(element);\n const isAgGridComponent = key.indexOf(\"AG-\") === 0;\n const componentSelector = isAgGridComponent ? this.componentSelectors.get(key) : null;\n let newComponent = null;\n if (componentSelector) {\n const componentParams = paramsMap && elementRef ? paramsMap[elementRef] : void 0;\n newComponent = new componentSelector.component(componentParams);\n newComponent.setParentComponent(\n this\n );\n this.createBean(newComponent, null, afterPreCreateCallback);\n } else if (isAgGridComponent) {\n throw new Error(`selector: ${key}`);\n }\n this.applyElementsToComponent(element, elementRef, paramsMap, newComponent);\n return newComponent;\n }\n swapComponentForNode(newComponent, parentNode, childNode) {\n const eComponent = newComponent.getGui();\n parentNode.replaceChild(eComponent, childNode);\n parentNode.insertBefore(document.createComment(childNode.nodeName), eComponent);\n this.addDestroyFunc(this.destroyBean.bind(this, newComponent));\n }\n activateTabIndex(elements, overrideTabIndex) {\n const tabIndex = overrideTabIndex ?? this.gos.get(\"tabIndex\");\n if (!elements) {\n elements = [];\n }\n if (!elements.length) {\n elements.push(this.getGui());\n }\n for (const el of elements) {\n el.setAttribute(\"tabindex\", tabIndex.toString());\n }\n }\n setTemplate(templateOrParams, componentSelectors, paramsMap) {\n let eGui;\n if (typeof templateOrParams === \"string\" || templateOrParams == null) {\n eGui = _loadTemplate(templateOrParams);\n } else {\n eGui = _createAgElement(templateOrParams);\n }\n this.setTemplateFromElement(eGui, componentSelectors, paramsMap);\n }\n setTemplateFromElement(element, components, paramsMap, suppressDataRefValidation = false) {\n this.eGui = element;\n this.suppressDataRefValidation = suppressDataRefValidation;\n if (components) {\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n this.componentSelectors.set(component.selector, component);\n }\n }\n this.wireTemplate(element, paramsMap);\n }\n getGui() {\n return this.eGui;\n }\n getFocusableElement() {\n return this.eGui;\n }\n getAriaElement() {\n return this.getFocusableElement();\n }\n setParentComponent(component) {\n this.parentComponent = component;\n }\n getParentComponent() {\n return this.parentComponent;\n }\n // this method is for older code, that wants to provide the gui element,\n // it is not intended for this to be in ag-Stack\n setGui(eGui) {\n this.eGui = eGui;\n }\n queryForHtmlElement(cssSelector) {\n return this.eGui.querySelector(cssSelector);\n }\n getContainerAndElement(newChild, container) {\n let parent = container;\n if (newChild == null) {\n return null;\n }\n if (!parent) {\n parent = this.eGui;\n }\n if (_isNodeOrElement(newChild)) {\n return {\n element: newChild,\n parent\n };\n }\n return {\n element: newChild.getGui(),\n parent\n };\n }\n prependChild(newChild, container) {\n const { element, parent } = this.getContainerAndElement(newChild, container) || {};\n if (!element || !parent) {\n return;\n }\n parent.prepend(element);\n }\n appendChild(newChild, container) {\n const { element, parent } = this.getContainerAndElement(newChild, container) || {};\n if (!element || !parent) {\n return;\n }\n parent.appendChild(element);\n }\n isDisplayed() {\n return this.displayed;\n }\n setVisible(visible, options = {}) {\n if (visible !== this.visible) {\n this.visible = visible;\n const { skipAriaHidden } = options;\n _setVisible(this.eGui, visible, { skipAriaHidden });\n }\n }\n setDisplayed(displayed, options = {}) {\n if (displayed !== this.displayed) {\n this.displayed = displayed;\n const { skipAriaHidden } = options;\n _setDisplayed(this.eGui, displayed, { skipAriaHidden });\n const event = {\n type: \"displayChanged\",\n visible: this.displayed\n };\n this.dispatchLocalEvent(event);\n }\n }\n destroy() {\n if (this.parentComponent) {\n this.parentComponent = void 0;\n }\n super.destroy();\n }\n addGuiEventListener(event, listener, options) {\n this.eGui.addEventListener(event, listener, options);\n this.addDestroyFunc(() => this.eGui.removeEventListener(event, listener));\n }\n addCss(className) {\n this.cssManager.toggleCss(className, true);\n }\n removeCss(className) {\n this.cssManager.toggleCss(className, false);\n }\n toggleCss(className, addOrRemove) {\n this.cssManager.toggleCss(className, addOrRemove);\n }\n registerCSS(css) {\n if (this.css === globalCssAdded) {\n this.css = [css];\n this.addGlobalCss();\n } else {\n this.css || (this.css = []);\n this.css.push(css);\n }\n }\n addGlobalCss() {\n if (Array.isArray(this.css)) {\n const debugId = \"component-\" + Object.getPrototypeOf(this)?.constructor?.name;\n for (const css of this.css ?? []) {\n this.beans.environment.addGlobalCSS(css, debugId);\n }\n }\n this.css = globalCssAdded;\n }\n};\nvar globalCssAdded = Symbol();\n\n// packages/ag-grid-community/src/widgets/component.ts\nvar Component = class extends AgComponentStub {\n};\n\n// packages/ag-grid-community/src/agStack/utils/browser.ts\nvar isSafari;\nvar isFirefox;\nvar isMacOs;\nvar isIOS;\nvar invisibleScrollbar;\nvar browserScrollbarWidth;\nvar maxDivHeight;\nfunction _isBrowserSafari() {\n if (isSafari === void 0) {\n isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n }\n return isSafari;\n}\nfunction _isBrowserFirefox() {\n if (isFirefox === void 0) {\n isFirefox = /(firefox)/i.test(navigator.userAgent);\n }\n return isFirefox;\n}\nfunction _isMacOsUserAgent() {\n if (isMacOs === void 0) {\n isMacOs = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);\n }\n return isMacOs;\n}\nfunction _isIOSUserAgent() {\n if (isIOS === void 0) {\n isIOS = /iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === \"MacIntel\" && navigator.maxTouchPoints > 1;\n }\n return isIOS;\n}\nfunction _getTabIndex(el) {\n if (!el) {\n return null;\n }\n const numberTabIndex = el.tabIndex;\n const tabIndex = el.getAttribute(\"tabIndex\");\n if (numberTabIndex === -1 && (tabIndex === null || tabIndex === \"\" && !_isBrowserFirefox())) {\n return null;\n }\n return numberTabIndex.toString();\n}\nfunction _getMaxDivHeight() {\n if (maxDivHeight !== void 0) {\n return maxDivHeight;\n }\n if (!document.body) {\n return -1;\n }\n let res = 1e6;\n const testUpTo = _isBrowserFirefox() ? 6e6 : 1e9;\n const div = document.createElement(\"div\");\n document.body.appendChild(div);\n while (true) {\n const test = res * 2;\n div.style.height = test + \"px\";\n if (test > testUpTo || div.clientHeight !== test) {\n break;\n } else {\n res = test;\n }\n }\n div.remove();\n maxDivHeight = res;\n return res;\n}\nfunction _getScrollbarWidth() {\n if (browserScrollbarWidth == null) {\n initScrollbarWidthAndVisibility();\n }\n return browserScrollbarWidth;\n}\nfunction initScrollbarWidthAndVisibility() {\n const body = document.body;\n const div = document.createElement(\"div\");\n div.style.width = div.style.height = \"100px\";\n div.style.opacity = \"0\";\n div.style.overflow = \"scroll\";\n div.style.msOverflowStyle = \"scrollbar\";\n div.style.position = \"absolute\";\n body.appendChild(div);\n let width = div.offsetWidth - div.clientWidth;\n if (width === 0 && div.clientWidth === 0) {\n width = null;\n }\n if (div.parentNode) {\n div.remove();\n }\n if (width != null) {\n browserScrollbarWidth = width;\n invisibleScrollbar = width === 0;\n }\n}\nfunction _isInvisibleScrollbar() {\n if (invisibleScrollbar == null) {\n initScrollbarWidthAndVisibility();\n }\n return invisibleScrollbar;\n}\n\n// packages/ag-grid-community/src/agStack/utils/focus.ts\nvar keyboardModeActive = false;\nvar instanceCount = 0;\nfunction addKeyboardModeEvents(doc) {\n if (instanceCount > 0) {\n return;\n }\n doc.addEventListener(\"keydown\", toggleKeyboardMode);\n doc.addEventListener(\"mousedown\", toggleKeyboardMode);\n}\nfunction removeKeyboardModeEvents(doc) {\n if (instanceCount > 0) {\n return;\n }\n doc.removeEventListener(\"keydown\", toggleKeyboardMode);\n doc.removeEventListener(\"mousedown\", toggleKeyboardMode);\n}\nfunction toggleKeyboardMode(event) {\n const isKeyboardActive = keyboardModeActive;\n const isKeyboardEvent = event.type === \"keydown\";\n if (isKeyboardEvent) {\n if (event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n }\n if (isKeyboardActive === isKeyboardEvent) {\n return;\n }\n keyboardModeActive = isKeyboardEvent;\n}\nfunction _registerKeyboardFocusEvents(beans) {\n const eDocument = _getDocument(beans);\n addKeyboardModeEvents(eDocument);\n instanceCount++;\n return () => {\n instanceCount--;\n removeKeyboardModeEvents(eDocument);\n };\n}\nfunction _isKeyboardMode() {\n return keyboardModeActive;\n}\nfunction _findFocusableElements(rootNode, exclude, onlyUnmanaged = false) {\n const focusableString = FOCUSABLE_SELECTOR;\n let excludeString = FOCUSABLE_EXCLUDE;\n if (exclude) {\n excludeString += \", \" + exclude;\n }\n if (onlyUnmanaged) {\n excludeString += ', [tabindex=\"-1\"]';\n }\n const nodes = Array.prototype.slice.apply(rootNode.querySelectorAll(focusableString)).filter((node) => {\n return _isVisible(node);\n });\n const excludeNodes = Array.prototype.slice.apply(rootNode.querySelectorAll(excludeString));\n if (!excludeNodes.length) {\n return nodes;\n }\n const diff = (a, b) => a.filter((element) => b.indexOf(element) === -1);\n return diff(nodes, excludeNodes);\n}\nfunction _focusInto(rootNode, up = false, onlyUnmanaged = false, excludeTabGuards = false) {\n const focusableElements = _findFocusableElements(\n rootNode,\n excludeTabGuards ? \".ag-tab-guard\" : null,\n onlyUnmanaged\n );\n const toFocus = up ? _last(focusableElements) : focusableElements[0];\n if (toFocus) {\n toFocus.focus({ preventScroll: true });\n return true;\n }\n return false;\n}\nfunction _findNextFocusableElement(beans, rootNode, onlyManaged, backwards) {\n const focusable = _findFocusableElements(rootNode, onlyManaged ? ':not([tabindex=\"-1\"])' : null);\n const activeEl = _getActiveDomElement(beans);\n let currentIndex;\n if (onlyManaged) {\n currentIndex = focusable.findIndex((el) => el.contains(activeEl));\n } else {\n currentIndex = focusable.indexOf(activeEl);\n }\n const nextIndex = currentIndex + (backwards ? -1 : 1);\n if (nextIndex < 0 || nextIndex >= focusable.length) {\n return null;\n }\n return focusable[nextIndex];\n}\nfunction _findTabbableParent(node, limit = 5) {\n let counter = 0;\n while (node && _getTabIndex(node) === null && ++counter <= limit) {\n node = node.parentElement;\n }\n if (_getTabIndex(node) === null) {\n return null;\n }\n return node;\n}\n\n// packages/ag-grid-community/src/agStack/focus/agManagedFocusFeature.ts\nvar FOCUS_MANAGED_CLASS = \"ag-focus-managed\";\nvar AgManagedFocusFeature = class extends AgBeanStub {\n constructor(eFocusable, stopPropagationCallbacks = {\n isStopPropagation: () => false,\n stopPropagation: () => {\n }\n }, callbacks = {}) {\n super();\n this.eFocusable = eFocusable;\n this.stopPropagationCallbacks = stopPropagationCallbacks;\n this.callbacks = callbacks;\n this.callbacks = {\n shouldStopEventPropagation: () => false,\n onTabKeyDown: (e) => {\n if (e.defaultPrevented) {\n return;\n }\n const nextRoot = _findNextFocusableElement(this.beans, this.eFocusable, false, e.shiftKey);\n if (!nextRoot) {\n return;\n }\n nextRoot.focus();\n e.preventDefault();\n },\n ...callbacks\n };\n }\n postConstruct() {\n const {\n eFocusable,\n callbacks: { onFocusIn, onFocusOut }\n } = this;\n eFocusable.classList.add(FOCUS_MANAGED_CLASS);\n this.addKeyDownListeners(eFocusable);\n if (onFocusIn) {\n this.addManagedElementListeners(eFocusable, { focusin: onFocusIn });\n }\n if (onFocusOut) {\n this.addManagedElementListeners(eFocusable, { focusout: onFocusOut });\n }\n }\n addKeyDownListeners(eGui) {\n this.addManagedElementListeners(eGui, {\n keydown: (e) => {\n if (e.defaultPrevented || this.stopPropagationCallbacks.isStopPropagation(e)) {\n return;\n }\n const { callbacks } = this;\n if (callbacks.shouldStopEventPropagation(e)) {\n this.stopPropagationCallbacks.stopPropagation(e);\n return;\n }\n if (e.key === KeyCode.TAB) {\n callbacks.onTabKeyDown(e);\n } else if (callbacks.handleKeyDown) {\n callbacks.handleKeyDown(e);\n }\n }\n });\n }\n};\n\n// packages/ag-grid-community/src/utils/gridEvent.ts\nvar AG_GRID_STOP_PROPAGATION = \"__ag_Grid_Stop_Propagation\";\nfunction _stopPropagationForAgGrid(event) {\n event[AG_GRID_STOP_PROPAGATION] = true;\n}\nfunction _isStopPropagationForAgGrid(event) {\n return event[AG_GRID_STOP_PROPAGATION] === true;\n}\n\n// packages/ag-grid-community/src/widgets/managedFocusFeature.ts\nvar STOP_PROPAGATION_CALLBACKS = {\n isStopPropagation: _isStopPropagationForAgGrid,\n stopPropagation: _stopPropagationForAgGrid\n};\nvar ManagedFocusFeature = class extends AgManagedFocusFeature {\n constructor(eFocusable, callbacks) {\n super(eFocusable, STOP_PROPAGATION_CALLBACKS, callbacks);\n }\n};\n\n// packages/ag-grid-community/src/filter/filterLocaleText.ts\nvar FILTER_LOCALE_TEXT = {\n applyFilter: \"Apply\",\n clearFilter: \"Clear\",\n resetFilter: \"Reset\",\n cancelFilter: \"Cancel\",\n textFilter: \"Text Filter\",\n numberFilter: \"Number Filter\",\n bigintFilter: \"BigInt Filter\",\n dateFilter: \"Date Filter\",\n setFilter: \"Set Filter\",\n filterOoo: \"Filter...\",\n empty: \"Choose one\",\n equals: \"Equals\",\n notEqual: \"Does not equal\",\n lessThan: \"Less than\",\n greaterThan: \"Greater than\",\n inRange: \"Between\",\n inRangeStart: \"From\",\n inRangeEnd: \"To\",\n lessThanOrEqual: \"Less than or equal to\",\n greaterThanOrEqual: \"Greater than or equal to\",\n contains: \"Contains\",\n notContains: \"Does not contain\",\n startsWith: \"Begins with\",\n endsWith: \"Ends with\",\n blank: \"Blank\",\n notBlank: \"Not blank\",\n before: \"Before\",\n after: \"After\",\n andCondition: \"AND\",\n orCondition: \"OR\",\n dateFormatOoo: \"yyyy-mm-dd\",\n filterSummaryInactive: \"is (All)\",\n filterSummaryContains: \"contains\",\n filterSummaryNotContains: \"does not contain\",\n filterSummaryTextEquals: \"equals\",\n filterSummaryTextNotEqual: \"does not equal\",\n filterSummaryStartsWith: \"begins with\",\n filterSummaryEndsWith: \"ends with\",\n filterSummaryBlank: \"is blank\",\n filterSummaryNotBlank: \"is not blank\",\n filterSummaryEquals: \"=\",\n filterSummaryNotEqual: \"!=\",\n filterSummaryGreaterThan: \">\",\n filterSummaryGreaterThanOrEqual: \">=\",\n filterSummaryLessThan: \"<\",\n filterSummaryLessThanOrEqual: \"<=\",\n filterSummaryInRange: \"between\",\n yesterday: \"Yesterday\",\n today: \"Today\",\n tomorrow: \"Tomorrow\",\n last7Days: \"Last 7 Days\",\n lastWeek: \"Last Week\",\n thisWeek: \"This Week\",\n nextWeek: \"Next Week\",\n last30Days: \"Last 30 Days\",\n lastMonth: \"Last Month\",\n thisMonth: \"This Month\",\n nextMonth: \"Next Month\",\n last90Days: \"Last 90 Days\",\n lastQuarter: \"Last Quarter\",\n thisQuarter: \"This Quarter\",\n nextQuarter: \"Next Quarter\",\n lastYear: \"Last Year\",\n thisYear: \"This Year\",\n yearToDate: \"Year To Date\",\n nextYear: \"Next Year\",\n last6Months: \"Last 6 Months\",\n last12Months: \"Last 12 Months\",\n last24Months: \"Last 24 Months\",\n filterSummaryInRangeValues: (variableValues) => `(${variableValues[0]}, ${variableValues[1]})`,\n filterSummaryTextQuote: (variableValues) => `\"${variableValues[0]}\"`,\n minDateValidation: (variableValues) => `Date must be after ${variableValues[0]}`,\n maxDateValidation: (variableValues) => `Date must be before ${variableValues[0]}`,\n strictMinValueValidation: (variableValues) => `Must be greater than ${variableValues[0]}`,\n strictMaxValueValidation: (variableValues) => `Must be less than ${variableValues[0]}`\n};\nfunction translateForFilter(bean, key, variableValues) {\n return _translate(bean, FILTER_LOCALE_TEXT, key, variableValues);\n}\n\n// packages/ag-grid-community/src/filter/provided/providedFilterUtils.ts\nfunction getDebounceMs(params, debounceDefault) {\n const { debounceMs } = params;\n if (_isUseApplyButton(params)) {\n if (debounceMs != null) {\n _warn(71);\n }\n return 0;\n }\n return debounceMs ?? debounceDefault;\n}\nfunction _isUseApplyButton(params) {\n return (params.buttons?.indexOf(\"apply\") ?? -1) >= 0;\n}\nfunction getPlaceholderText(bean, filterPlaceholder, defaultPlaceholder, filterOptionKey) {\n let placeholder = translateForFilter(bean, defaultPlaceholder);\n if (typeof filterPlaceholder === \"function\") {\n const filterOption = translateForFilter(bean, filterOptionKey);\n placeholder = filterPlaceholder({\n filterOptionKey,\n filterOption,\n placeholder\n });\n } else if (typeof filterPlaceholder === \"string\") {\n placeholder = filterPlaceholder;\n }\n return placeholder;\n}\n\n// packages/ag-grid-community/src/filter/provided/providedFilter.ts\nvar ProvidedFilter = class extends Component {\n constructor(filterNameKey, cssIdentifier) {\n super();\n this.filterNameKey = filterNameKey;\n this.cssIdentifier = cssIdentifier;\n this.applyActive = false;\n this.debouncePending = false;\n // subclasses can override this to provide alternative debounce defaults\n this.defaultDebounceMs = 0;\n }\n postConstruct() {\n const element = {\n tag: \"div\",\n cls: `ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,\n children: [this.createBodyTemplate()]\n };\n this.setTemplate(element, this.getAgComponents());\n this.createManagedBean(\n new ManagedFocusFeature(this.getFocusableElement(), {\n handleKeyDown: this.handleKeyDown.bind(this)\n })\n );\n this.positionableFeature = this.createBean(\n new PositionableFeature(this.getPositionableElement(), {\n forcePopupParentAsOffsetParent: true\n })\n );\n }\n handleKeyDown(_e) {\n }\n init(legacyParams) {\n const params = legacyParams;\n this.setParams(params);\n this.setModelIntoUi(params.state.model, true).then(() => this.updateUiVisibility());\n }\n areStatesEqual(stateA, stateB) {\n return stateA === stateB;\n }\n refresh(legacyNewParams) {\n const newParams = legacyNewParams;\n const oldParams = this.params;\n this.params = newParams;\n const { source, state: newState, additionalEventAttributes } = newParams;\n if (source === \"colDef\") {\n this.updateParams(newParams, oldParams);\n }\n const oldState = this.state;\n this.state = newState;\n const fromAction = additionalEventAttributes?.fromAction;\n if (fromAction && fromAction !== \"apply\" || newState.model !== oldState.model || !this.areStatesEqual(newState.state, oldState.state)) {\n this.setModelIntoUi(newState.model);\n }\n return true;\n }\n /** Called on init only. Override in subclasses */\n setParams(params) {\n this.params = params;\n this.state = params.state;\n this.commonUpdateParams(params);\n }\n /** Called on refresh only. Override in subclasses */\n updateParams(newParams, oldParams) {\n this.commonUpdateParams(newParams, oldParams);\n }\n commonUpdateParams(newParams, _oldParams) {\n this.applyActive = _isUseApplyButton(newParams);\n this.setupApplyDebounced();\n }\n /**\n * @deprecated v34 Use the same method on the filter handler (`api.getColumnFilterHandler()`) instead.\n */\n doesFilterPass(params) {\n _warn(283);\n const { getHandler, model, column } = this.params;\n return getHandler().doesFilterPass({\n ...params,\n model,\n handlerParams: this.beans.colFilter.getHandlerParams(column)\n });\n }\n getFilterTitle() {\n return this.translate(this.filterNameKey);\n }\n /**\n * @deprecated v34 Filters are active when they have a model. Use `api.getColumnFilterModel()` instead.\n */\n isFilterActive() {\n _warn(284);\n return this.params.model != null;\n }\n setupApplyDebounced() {\n const debounceMs = getDebounceMs(this.params, this.defaultDebounceMs);\n const debounceFunc = _debounce(this, this.checkApplyDebounce.bind(this), debounceMs);\n this.applyDebounced = () => {\n this.debouncePending = true;\n debounceFunc();\n };\n }\n checkApplyDebounce() {\n if (this.debouncePending) {\n this.debouncePending = false;\n this.doApplyModel();\n }\n }\n /**\n * @deprecated v34 Use (`api.getColumnFilterModel()`) instead.\n */\n getModel() {\n _warn(285);\n return this.params.model;\n }\n /**\n * @deprecated v34 Use (`api.setColumnFilterModel()`) instead.\n */\n setModel(model) {\n _warn(286);\n const { beans, params } = this;\n return beans.colFilter.setModelForColumnLegacy(params.column, model);\n }\n /**\n * Applies changes made in the UI to the filter, and returns true if the model has changed.\n */\n applyModel(_source = \"api\") {\n return this.doApplyModel();\n }\n canApply(_model) {\n return true;\n }\n doApplyModel(additionalEventAttributes) {\n const {\n params,\n state: { valid = true, model }\n } = this;\n if (!valid) {\n return false;\n }\n const changed = !this.areModelsEqual(params.model, model);\n if (changed) {\n params.onAction(\"apply\", additionalEventAttributes);\n }\n return changed;\n }\n /**\n * @deprecated v34 Internal method - should only be called by the grid.\n */\n onNewRowsLoaded() {\n }\n /**\n * By default, if the change came from a floating filter it will be applied immediately, otherwise if there is no\n * apply button it will be applied after a debounce, otherwise it will not be applied at all. This behaviour can\n * be adjusted by using the apply parameter.\n */\n onUiChanged(apply, afterFloatingFilter = false) {\n this.updateUiVisibility();\n const model = this.getModelFromUi();\n const state = {\n model,\n state: this.getState(),\n valid: this.canApply(model)\n };\n this.state = state;\n const { params, gos, eventSvc, applyActive } = this;\n params.onStateChange(state);\n params.onUiChange(this.getUiChangeEventParams());\n if (!gos.get(\"enableFilterHandlers\")) {\n eventSvc.dispatchEvent({\n type: \"filterModified\",\n column: params.column,\n filterInstance: this\n });\n }\n if (!state.valid) {\n return;\n }\n apply ?? (apply = applyActive ? void 0 : \"debounce\");\n if (apply === \"immediately\") {\n this.doApplyModel({ afterFloatingFilter, afterDataChange: false });\n } else if (apply === \"debounce\") {\n this.applyDebounced();\n }\n }\n getState() {\n return void 0;\n }\n getUiChangeEventParams() {\n return void 0;\n }\n afterGuiAttached(params) {\n this.lastContainerType = params?.container;\n this.refreshFilterResizer(params?.container);\n }\n refreshFilterResizer(containerType) {\n const { positionableFeature, gos } = this;\n if (!positionableFeature) {\n return;\n }\n const isResizable = containerType === \"floatingFilter\" || containerType === \"columnFilter\";\n if (isResizable) {\n positionableFeature.restoreLastSize();\n positionableFeature.setResizable(\n gos.get(\"enableRtl\") ? { bottom: true, bottomLeft: true, left: true } : { bottom: true, bottomRight: true, right: true }\n );\n } else {\n positionableFeature.removeSizeFromEl();\n positionableFeature.setResizable(false);\n }\n positionableFeature.constrainSizeToAvailableHeight(isResizable);\n }\n afterGuiDetached() {\n this.checkApplyDebounce();\n this.positionableFeature?.constrainSizeToAvailableHeight(false);\n }\n destroy() {\n this.positionableFeature = this.destroyBean(this.positionableFeature);\n super.destroy();\n }\n translate(key, variableValues) {\n return translateForFilter(this, key, variableValues);\n }\n // override to control positionable feature\n getPositionableElement() {\n return this.getGui();\n }\n areModelsEqual(a, b) {\n if (a === b || a == null && b == null) {\n return true;\n }\n if (a == null || b == null) {\n return false;\n }\n return this.areNonNullModelsEqual(a, b);\n }\n};\n\n// packages/ag-grid-community/src/interfaces/structuredSchemaParams.ts\nvar STRUCTURED_SCHEMA_FEATURES = [\n \"aggregation\",\n \"filter\",\n \"sort\",\n \"pivot\",\n \"columnVisibility\",\n \"columnSizing\",\n \"rowGroup\"\n];\n\n// packages/ag-grid-community/src/agStack/popup/agPopupComponent.ts\nvar AgPopupComponent = class extends AgComponentStub {\n isPopup() {\n return true;\n }\n setParentComponent(container) {\n container.addCss(\"ag-has-popup\");\n super.setParentComponent(container);\n }\n destroy() {\n const parentComp = this.parentComponent;\n const hasParent = parentComp?.isAlive();\n if (hasParent) {\n parentComp.getGui().classList.remove(\"ag-has-popup\");\n }\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/edit/cellEditors/agAbstractCellEditor.ts\nvar AgAbstractCellEditor = class extends AgPopupComponent {\n constructor() {\n super(...arguments);\n this.errorMessages = null;\n }\n init(params) {\n this.params = params;\n this.initialiseEditor(params);\n this.eEditor.onValueChange(() => params.validate());\n }\n destroy() {\n this.eEditor.destroy();\n this.errorMessages = null;\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/api/rowModelApiUtils.ts\nfunction _getClientSideRowModel(beans) {\n const rowModel = beans.rowModel;\n return rowModel.getType() === \"clientSide\" ? rowModel : void 0;\n}\nfunction _getInfiniteRowModel(beans) {\n const rowModel = beans.rowModel;\n return rowModel.getType() === \"infinite\" ? rowModel : void 0;\n}\nfunction _getServerSideRowModel(beans) {\n const rowModel = beans.rowModel;\n return rowModel.getType() === \"serverSide\" ? rowModel : void 0;\n}\nfunction _getViewportRowModel(beans) {\n const rowModel = beans.rowModel;\n return rowModel.getType() === \"viewport\" ? rowModel : void 0;\n}\n\n// packages/ag-grid-community/src/entities/rowNode.ts\nvar ROW_ID_PREFIX_ROW_GROUP = \"row-group-\";\nvar ROW_ID_PREFIX_TOP_PINNED = \"t-\";\nvar ROW_ID_PREFIX_BOTTOM_PINNED = \"b-\";\nvar OBJECT_ID_SEQUENCE = 0;\nvar RowNode = class {\n constructor(beans) {\n /** Unique ID for the node. Either provided by the application, or generated by the grid if not. */\n this.id = void 0;\n /**\n * Indicates whether this row node has been removed from the grid.\n * A row node is considered removed if it is no longer part of the row model.\n * A removed row model instance will never be reused even if the same data item is added back to the grid.\n */\n this.destroyed = false;\n /**\n * Backing field for groupData property.\n * If re-naming this property, you must also update `IGNORED_SIBLING_PROPERTIES`\n */\n this._groupData = void 0;\n /** `true` if this row is a master row, part of master / detail (ie row can be expanded to show detail) */\n this.master = false;\n /** `true` if this row is a detail row, part of master / detail (ie child row of an expanded master row)*/\n this.detail = void 0;\n /** The current row index. If the row is filtered out or in a collapsed group, this value is set to `null`. */\n this.rowIndex = null;\n /** The field we are grouping on eg 'country'. */\n this.field = null;\n /** The row group column used for this group, e.g. the Country column instance. */\n this.rowGroupColumn = null;\n /** The key for the group eg Ireland, UK, USA */\n this.key = null;\n /**\n * CSRM only - The index of the row in the source rowData array including any updates via transactions.\n * It does not change when sorting, filtering, grouping, pivoting or any other UI related operations.\n * If this is a filler node (a visual row created by AG Grid in tree data or grouping) the value is set to `-1`.\n */\n this.sourceRowIndex = -1;\n /**\n * CSRM only - all lowest level nodes beneath this node, no groups. Backing field for allLeafChildren property.\n * - undefined if not yet loaded.\n * - null if there are no no leaf children.\n * - not empty array containing all the leaf children.\n * If re-naming this property, you must also update `IGNORED_SIBLING_PROPERTIES`\n */\n this._leafs = void 0;\n /**\n * Children of this group. If multi levels of grouping, shows only immediate children.\n * Do not modify this array directly. The grouping module relies on mutable references to the array.\n */\n this.childrenAfterGroup = null;\n /** Filtered children of this group. */\n this.childrenAfterFilter = null;\n /** Aggregated and re-filtered children of this group. */\n this.childrenAfterAggFilter = null;\n /** Sorted children of this group. */\n this.childrenAfterSort = null;\n /** Number of children and grand children. */\n this.allChildrenCount = null;\n /** Children mapped by the pivot columns or group key */\n this.childrenMapped = null;\n /**\n * Parent RowNode for tree data.\n * When set, the parent node in the hierarchy is updated during Client-Side Row Model (CSRM) grouping.\n * Used by the ClientSideChildrenTreeNodeManager, TreeGroupStrategy, RowDragFeature\n * If re-naming this property, you must also update `IGNORED_SIBLING_PROPERTIES`\n */\n this.treeParent = null;\n /**\n * The flags associated to this node. Used only internally within TreeGroupStrategy.\n * If re-naming this property, you must also update `IGNORED_SIBLING_PROPERTIES`\n */\n this.treeNodeFlags = 0;\n /**\n * Backing field for `expanded` property.\n * - `true`/`false`: explicit expansion state.\n * - `null`: triggers lazy evaluation — in CSRM, SSRM, getter resolves the default on first access and caches it.\n * - `undefined`: uninitialized, means false.\n */\n this._expanded = void 0;\n /**\n * This is `true` if the row has a rowIndex assigned, otherwise `false`.\n */\n this.displayed = false;\n /** The row top position in pixels. */\n this.rowTop = null;\n /** The top pixel for this row last time, makes sense if data set was ordered or filtered,\n * it is used so new rows can animate in from their old position. */\n this.oldRowTop = null;\n /** `true` by default - can be overridden via gridOptions.isRowSelectable(rowNode) */\n this.selectable = true;\n /**\n * Used by sorting service - to give deterministic sort to groups. Previously we\n * just id for this, however id is a string and had slower sorting compared to numbers.\n * If re-naming this property, you must also update `IGNORED_SIBLING_PROPERTIES`\n */\n this.__objectId = OBJECT_ID_SEQUENCE++;\n /** `true` when nodes with the same id are being removed and added as part of the same batch transaction */\n this.alreadyRendered = false;\n this.formulaRowIndex = null;\n this.hovered = false;\n this.__selected = false;\n this.beans = beans;\n }\n /**\n * If using row grouping, contains the group values for this group.\n * When using CSRM, this field is lazily loaded via the GroupStage when required.\n */\n get groupData() {\n const groupData = this._groupData;\n if (groupData !== void 0) {\n return groupData;\n }\n if (this.footer) {\n return this.sibling?.groupData;\n }\n return this.beans.groupStage?.loadGroupData(this) ?? null;\n }\n set groupData(value) {\n this._groupData = value;\n }\n /** @inheritDoc */\n get primaryRow() {\n let node = this.footer && this.sibling ? this.sibling : this;\n const { pinnedSibling } = node;\n if (pinnedSibling && node.rowPinned) {\n node = pinnedSibling;\n if (node.footer && node.sibling) {\n node = node.sibling;\n }\n }\n return node;\n }\n /** CSRM only - do not use this property internally, this is exposed to the end user only. Use `_leafs` instead. */\n get allLeafChildren() {\n const leafs = this._leafs;\n return leafs === void 0 ? this.beans.groupStage?.loadLeafs?.(this) ?? null : leafs;\n }\n set allLeafChildren(value) {\n this._leafs = value;\n }\n /** `true` if group or master row is expanded. */\n get expanded() {\n const expansionSvc = this.beans.expansionSvc;\n return expansionSvc ? expansionSvc.isExpanded(this) : this.level === -1 ? true : !!this._expanded;\n }\n set expanded(value) {\n this._expanded = value;\n }\n /**\n * Replaces the data on the `rowNode`. When this method is called, the grid refreshes the entire rendered row if it is displayed.\n */\n setData(data) {\n this.setDataCommon(data, false);\n }\n // similar to setRowData, however it is expected that the data is the same data item. this\n // is intended to be used with Redux type stores, where the whole data can be changed. we are\n // guaranteed that the data is the same entity (so grid doesn't need to worry about the id of the\n // underlying data changing, hence doesn't need to worry about selection). the grid, upon receiving\n // dataChanged event, refreshes the cells rather than rip them all out (so user can show transitions).\n /**\n * Updates the data on the `rowNode`. When this method is called, the grid refreshes the entire rendered row if it is displayed.\n */\n updateData(data) {\n this.setDataCommon(data, true);\n }\n setDataCommon(data, update) {\n const { valueCache, eventSvc } = this.beans;\n const oldData = this.data;\n this.data = data;\n valueCache?.onDataChanged();\n this.updateDataOnDetailNode();\n this.resetQuickFilterAggregateText();\n const event = this.createDataChangedEvent(data, oldData, update);\n this.__localEventService?.dispatchEvent(event);\n if (this.sibling) {\n this.sibling.data = data;\n const event2 = this.sibling.createDataChangedEvent(data, oldData, update);\n this.sibling.__localEventService?.dispatchEvent(event2);\n }\n eventSvc.dispatchEvent({ type: \"rowNodeDataChanged\", node: this });\n const pinnedSibling = this.pinnedSibling;\n if (pinnedSibling) {\n pinnedSibling.data = data;\n pinnedSibling.__localEventService?.dispatchEvent(\n pinnedSibling.createDataChangedEvent(data, oldData, update)\n );\n eventSvc.dispatchEvent({ type: \"rowNodeDataChanged\", node: pinnedSibling });\n }\n }\n // when we are doing master / detail, the detail node is lazy created, but then kept around.\n // so if we show / hide the detail, the same detail rowNode is used. so we need to keep the data\n // in sync, otherwise expand/collapse of the detail would still show the old values.\n updateDataOnDetailNode() {\n const detailNode = this.detailNode;\n if (detailNode) {\n detailNode.data = this.data;\n }\n }\n createDataChangedEvent(newData, oldData, update) {\n return {\n type: \"dataChanged\",\n node: this,\n oldData,\n newData,\n update\n };\n }\n getRowIndexString() {\n if (this.rowIndex == null) {\n _error(13);\n return null;\n }\n if (this.rowPinned === \"top\") {\n return ROW_ID_PREFIX_TOP_PINNED + this.rowIndex;\n }\n if (this.rowPinned === \"bottom\") {\n return ROW_ID_PREFIX_BOTTOM_PINNED + this.rowIndex;\n }\n return this.rowIndex.toString();\n }\n setDataAndId(data, id) {\n const { selectionSvc } = this.beans;\n const oldNode = selectionSvc?.createDaemonNode?.(this);\n const oldData = this.data;\n this.data = data;\n this.updateDataOnDetailNode();\n this.setId(id);\n if (selectionSvc) {\n selectionSvc.updateRowSelectable(this);\n selectionSvc.syncInRowNode(this, oldNode);\n }\n const event = this.createDataChangedEvent(data, oldData, false);\n this.__localEventService?.dispatchEvent(event);\n }\n setId(id) {\n const getRowIdFunc = _getRowIdCallback(this.beans.gos);\n if (getRowIdFunc) {\n if (this.data) {\n const parentKeys = this.parent?.getRoute() ?? [];\n this.id = getRowIdFunc({\n data: this.data,\n parentKeys: parentKeys.length > 0 ? parentKeys : void 0,\n level: this.level,\n rowPinned: this.rowPinned\n });\n if (this.id.startsWith(ROW_ID_PREFIX_ROW_GROUP)) {\n _error(14, {\n groupPrefix: ROW_ID_PREFIX_ROW_GROUP\n });\n }\n } else {\n this.id = void 0;\n }\n } else {\n this.id = id;\n }\n }\n setRowTop(rowTop) {\n this.oldRowTop = this.rowTop;\n if (this.rowTop === rowTop) {\n return;\n }\n this.rowTop = rowTop;\n this.dispatchRowEvent(\"topChanged\");\n const displayed = rowTop !== null;\n if (this.displayed !== displayed) {\n this.displayed = displayed;\n this.dispatchRowEvent(\"displayedChanged\");\n }\n }\n clearRowTopAndRowIndex() {\n this.oldRowTop = null;\n this.setRowTop(null);\n this.setRowIndex(null);\n }\n setHovered(hovered) {\n this.hovered = hovered;\n }\n isHovered() {\n return this.hovered;\n }\n /**\n * Sets the row height.\n * Call if you want to change the height initially assigned to the row.\n * After calling, you must call `api.onRowHeightChanged()` so the grid knows it needs to work out the placement of the rows. */\n setRowHeight(rowHeight, estimated = false) {\n this.rowHeight = rowHeight;\n this.rowHeightEstimated = estimated;\n this.dispatchRowEvent(\"heightChanged\");\n }\n setExpanded(expanded, e, forceSync) {\n this.beans.expansionSvc?.setExpanded(this, expanded, e, forceSync);\n }\n /**\n * Sets the value on the `rowNode` for the specified column and refreshes the rendered cell.\n *\n * In **Read Only** mode, this fires `onCellEditRequest` instead of writing directly.\n *\n * In **Pivot Mode**, pivot columns on leaf rows resolve to their underlying value column.\n *\n * The `eventSource` parameter controls how the value is written:\n *\n * - `(default)` — Closes the active editor, writes to the pending batch if batching, otherwise writes to committed data.\n * - `'edit'` — Writes directly into the active editor if present (via `refresh()` or recreation); falls back to pending batch or committed data.\n * - `'batch'` — Leaves the active editor open, writes to the pending batch if batching, otherwise writes to committed data.\n * - `'data'` — Leaves the active editor open, skips the pending batch, always writes to committed data.\n *\n * With `'edit'`, the active editor receives the new value via `refresh()` if implemented;\n * otherwise the editor is recreated with focus preserved.\n *\n * @param colKey The column to update (field name, `colId`, or `Column` object)\n * @param newValue The new value to set\n * @param eventSource Controls how the value is written\n * @returns `true` if the value changed, `false` otherwise\n */\n setDataValue(colKey, newValue, eventSource) {\n const { colModel, valueSvc, gos, editSvc } = this.beans;\n if (colKey == null) {\n return false;\n }\n let column = colModel.getCol(colKey) ?? colModel.getColDefCol(colKey);\n if (!column) {\n return false;\n }\n if (!this.group) {\n const colDef = column.getColDef();\n if (colDef.pivotValueColumn) {\n column = colDef.pivotValueColumn;\n }\n }\n const oldValue = valueSvc.getValueForDisplay({ column, node: this, from: \"data\" }).value;\n if (gos.get(\"readOnlyEdit\")) {\n const {\n beans: { eventSvc },\n data,\n rowIndex,\n rowPinned\n } = this;\n eventSvc.dispatchEvent({\n type: \"cellEditRequest\",\n event: null,\n rowIndex,\n rowPinned,\n column,\n colDef: column.colDef,\n data,\n node: this,\n oldValue,\n newValue,\n value: newValue,\n source: eventSource\n });\n return false;\n }\n if (eventSource !== \"data\" && editSvc && !editSvc.committing) {\n const result = editSvc.setDataValue({ rowNode: this, column }, newValue, eventSource);\n if (result != null) {\n return result;\n }\n }\n const valueChanged = valueSvc.setValue(this, column, newValue, eventSource);\n this.dispatchCellChangedEvent(column, newValue, oldValue);\n if (valueChanged) {\n this.pinnedSibling?.dispatchCellChangedEvent(column, newValue, oldValue);\n }\n return valueChanged;\n }\n getDataValue(colKey, from = \"data\") {\n const { colModel, valueSvc, formula } = this.beans;\n if (colKey == null) {\n return void 0;\n }\n const column = colModel.getCol(colKey) ?? colModel.getColDefCol(colKey);\n if (!column) {\n return void 0;\n }\n const dataRaw = from === \"data-raw\";\n const resolvedFrom = dataRaw || from === \"value\" ? \"data\" : from;\n let value = valueSvc.getValue(column, this, resolvedFrom, dataRaw);\n if (!dataRaw) {\n if (formula && column.isAllowFormula() && formula.isFormula(value)) {\n value = formula.resolveValue(column, this);\n }\n if (from !== \"data\" && column.getAggFunc() && typeof value === \"object\" && value != null) {\n if (typeof value.toNumber === \"function\") {\n return value.toNumber();\n }\n if (\"value\" in value) {\n return value.value;\n }\n }\n }\n return value;\n }\n updateHasChildren() {\n let newValue = this.group && !this.footer || !!this.childrenAfterGroup?.length;\n const { rowChildrenSvc } = this.beans;\n if (rowChildrenSvc) {\n newValue = rowChildrenSvc.getHasChildrenValue(this);\n }\n if (newValue !== this.__hasChildren) {\n this.__hasChildren = !!newValue;\n this.dispatchRowEvent(\"hasChildrenChanged\");\n }\n }\n hasChildren() {\n if (this.__hasChildren == null) {\n this.updateHasChildren();\n }\n return this.__hasChildren;\n }\n dispatchCellChangedEvent(column, newValue, oldValue) {\n const cellChangedEvent = {\n type: \"cellChanged\",\n node: this,\n column,\n newValue,\n oldValue\n };\n this.__localEventService?.dispatchEvent(cellChangedEvent);\n }\n /**\n * The first time `quickFilter` runs, the grid creates a one-off string representation of the row.\n * This string is then used for the quick filter instead of hitting each column separately.\n * When you edit, using grid editing, this string gets cleared down.\n * However, if you edit without using grid editing, you need to clear this string down for the row to be updated with the new values.\n * Otherwise, new values would not work with the `quickFilter`. */\n resetQuickFilterAggregateText() {\n this.quickFilterAggregateText = null;\n }\n /** Returns:\n * - `true` if the node can be expanded, i.e it is a group or master row.\n * - `false` if the node cannot be expanded\n */\n isExpandable() {\n return this.beans.expansionSvc?.isExpandable(this) ?? false;\n }\n /** Returns:\n * - `true` if node is selected,\n * - `false` if the node isn't selected\n * - `undefined` if it's partially selected (group where not all children are selected). */\n isSelected() {\n if (this.footer) {\n return this.sibling.isSelected();\n }\n const pinnedSibling = this.rowPinned && this.pinnedSibling;\n if (pinnedSibling) {\n return pinnedSibling.isSelected();\n }\n return this.__selected;\n }\n /** Perform a depth-first search of this node and its children. */\n depthFirstSearch(callback) {\n const childrenAfterGroup = this.childrenAfterGroup;\n if (childrenAfterGroup) {\n for (let i = 0, len = childrenAfterGroup.length; i < len; ++i) {\n childrenAfterGroup[i].depthFirstSearch(callback);\n }\n }\n callback(this);\n }\n getAggregatedChildren(colKey, recursive) {\n const beans = this.beans;\n return beans.aggChildrenSvc?.getAggregatedChildren(this, beans.colModel.getCol(colKey), recursive) ?? [];\n }\n dispatchRowEvent(type) {\n this.__localEventService?.dispatchEvent({\n type,\n node: this\n });\n }\n /**\n * Select (or deselect) the node.\n * @param newValue -`true` for selection, `false` for deselection.\n * @param clearSelection - If selecting, then passing `true` selects the node exclusively (i.e. NOT do multi select). If doing deselection, `clearSelection` has no impact.\n * @param source - Source property that appears in the `selectionChanged` event.\n */\n setSelected(newValue, clearSelection = false, source = \"api\") {\n this.beans.selectionSvc?.setNodesSelected({\n nodes: [this],\n newValue,\n clearSelection,\n source\n });\n }\n /**\n * Returns:\n * - `true` if node is either pinned to the `top` or `bottom`\n * - `false` if the node isn't pinned\n */\n isRowPinned() {\n return !!this.rowPinned;\n }\n __addEventListener(eventType, listener) {\n const localEventService = this.__localEventService ?? (this.__localEventService = new LocalEventService());\n localEventService.addEventListener(eventType, listener);\n }\n __removeEventListener(eventType, listener) {\n this.removeLocalListener(eventType, listener);\n }\n /**\n * PUBLIC USE ONLY: for internal use within AG Grid use the `__addEventListener` and `__removeEventListener` methods.\n */\n addEventListener(eventType, userListener) {\n this.beans.validation?.checkRowEvents(eventType);\n const localEventService = this.__localEventService ?? (this.__localEventService = new LocalEventService());\n this.frameworkEventListenerService = this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(\n this.frameworkEventListenerService,\n localEventService\n );\n const listener = this.frameworkEventListenerService?.wrap(eventType, userListener) ?? userListener;\n localEventService.addEventListener(eventType, listener);\n }\n /**\n * PUBLIC USE ONLY: for internal use within AG Grid use the `__addEventListener` and `__removeEventListener` methods.\n */\n removeEventListener(eventType, userListener) {\n const listener = this.frameworkEventListenerService?.unwrap(eventType, userListener) ?? userListener;\n this.removeLocalListener(eventType, listener);\n }\n removeLocalListener(eventType, listener) {\n const localEventService = this.__localEventService;\n if (localEventService) {\n localEventService.removeEventListener(eventType, listener);\n if (localEventService.noRegisteredListenersExist()) {\n this.__localEventService = null;\n }\n }\n }\n /**\n * @deprecated v32.2.0 Check `node.detail` then user provided callback `isFullWidthRow` instead.\n *\n * Returns:\n * - `true` if the node is a full width cell\n * - `false` if the node is not a full width cell\n */\n isFullWidthCell() {\n _warn(61);\n if (this.detail) {\n return true;\n }\n const isFullWidthCellFunc = this.beans.gos.getCallback(\"isFullWidthRow\");\n return isFullWidthCellFunc ? isFullWidthCellFunc({ rowNode: this }) : false;\n }\n /**\n * Returns the route of keys to the row node. Returns undefined if the node has no key.\n */\n getRoute() {\n if (this.level === -1) {\n return [];\n }\n if (this.key == null) {\n return void 0;\n }\n const res = [];\n let pointer = this;\n while (pointer?.key != null) {\n res.push(pointer.key);\n pointer = pointer.parent;\n }\n return res.reverse();\n }\n setRowIndex(rowIndex) {\n if (this.rowIndex !== rowIndex) {\n this.rowIndex = rowIndex;\n this.dispatchRowEvent(\"rowIndexChanged\");\n }\n }\n setAllChildrenCount(allChildrenCount) {\n if (this.allChildrenCount !== allChildrenCount) {\n this.allChildrenCount = allChildrenCount;\n this.dispatchRowEvent(\"allChildrenCountChanged\");\n }\n }\n setUiLevel(uiLevel) {\n if (this.uiLevel !== uiLevel) {\n this.uiLevel = uiLevel;\n this.dispatchRowEvent(\"uiLevelChanged\");\n }\n }\n getFirstChild() {\n const childStore = this.childStore;\n if (childStore) {\n return childStore.getFirstNode();\n }\n return this.childrenAfterSort?.[0] ?? null;\n }\n /** Called internally to destroy this node */\n _destroy(fadeOut) {\n if (this.destroyed) {\n return false;\n }\n this.destroyed = true;\n const pinnedSibling = this.pinnedSibling;\n if (pinnedSibling?.rowPinned && !this.rowPinned) {\n this.beans.pinnedRowModel?.pinRow(pinnedSibling, null);\n }\n if (fadeOut) {\n this.clearRowTopAndRowIndex();\n } else {\n this.setRowTop(null);\n this.setRowIndex(null);\n }\n if (!this.footer) {\n const detailNode = this.detailNode;\n if (detailNode) {\n detailNode._destroy(fadeOut);\n }\n const sibling = this.sibling;\n if (sibling) {\n sibling._destroy(fadeOut);\n }\n }\n return true;\n }\n};\n\n// packages/ag-grid-community/src/entities/rowNodeUtils.ts\nfunction _createGlobalRowEvent(rowNode, gos, type) {\n return _addGridCommonParams(gos, {\n type,\n node: rowNode,\n data: rowNode.data,\n rowIndex: rowNode.rowIndex,\n rowPinned: rowNode.rowPinned\n });\n}\nvar IGNORED_SIBLING_PROPERTIES = /* @__PURE__ */ new Set([\n \"__autoHeights\",\n \"__checkAutoHeightsDebounced\",\n \"__localEventService\",\n \"__objectId\",\n \"_groupData\",\n \"_leafs\",\n \"childStore\",\n \"groupValue\",\n \"oldRowTop\",\n \"sticky\",\n \"treeNodeFlags\",\n \"treeParent\"\n]);\nvar _createRowNodeSibling = (rowNode, beans) => {\n const sibling = new RowNode(beans);\n for (const key of Object.keys(rowNode)) {\n if (IGNORED_SIBLING_PROPERTIES.has(key)) {\n continue;\n }\n sibling[key] = rowNode[key];\n }\n sibling.oldRowTop = null;\n return sibling;\n};\nvar _prevOrNextDisplayedRow = (rowModel, direction, initial) => {\n if (!initial) {\n return void 0;\n }\n let rowIndex = initial.rowIndex;\n if (rowIndex == null) {\n return void 0;\n }\n rowIndex += direction;\n const rowCount = rowModel.getRowCount();\n while (rowIndex >= 0 && rowIndex < rowCount) {\n const row = rowModel.getRow(rowIndex);\n if (!row || !row.footer && !row.detail) {\n return row;\n }\n rowIndex += direction;\n }\n return void 0;\n};\n\n// packages/ag-grid-community/src/pinnedRowModel/manualPinnedRowUtils.ts\nvar PinnedRows = class {\n constructor(beans, floating) {\n this.beans = beans;\n this.floating = floating;\n /** Canonical set of pinned nodes */\n this.all = /* @__PURE__ */ new Set();\n /**\n * Set of nodes that should currently be visible given the context of the grid.\n * This is currently used for hiding leaf nodes in pivot mode and filtered nodes.\n */\n this.visible = /* @__PURE__ */ new Set();\n /** Ordering of nodes in the pinned area */\n this.order = [];\n /** IDs of nodes that need to be pinned once they are available from the row model (SSRM) */\n this.queued = /* @__PURE__ */ new Set();\n }\n size() {\n return this.visible.size;\n }\n add(node) {\n const { all, visible, order } = this;\n if (all.has(node)) {\n return;\n }\n all.add(node);\n visible.add(node);\n order.push(node);\n this.sort();\n }\n delete(item) {\n this.all.delete(item);\n this.visible.delete(item);\n this.queued.delete(item.id);\n _removeFromArray(this.order, item);\n }\n has(item) {\n return this.visible.has(item);\n }\n forEach(fn) {\n this.order.forEach(fn);\n }\n getByIndex(i) {\n return this.order[i];\n }\n getById(id) {\n for (const node of this.visible) {\n if (node.id == id) {\n return node;\n }\n }\n }\n clear() {\n const { all, visible, order, queued } = this;\n all.clear();\n queued.clear();\n visible.clear();\n order.length = 0;\n }\n sort() {\n const { sortSvc, rowNodeSorter, gos } = this.beans;\n const sortOptions = sortSvc?.getSortOptions() ?? [];\n const order = this.order;\n const grandTotalNode = _removeGrandTotalRow(order);\n order.sort(\n (a, b) => rowNodeSorter?.compareRowNodes(sortOptions, a, b) || (a.pinnedSibling?.rowIndex ?? 0) - (b.pinnedSibling?.rowIndex ?? 0)\n );\n if (!grandTotalNode) {\n return;\n }\n const grandTotalRow = _getGrandTotalRow(gos);\n if (grandTotalRow === \"bottom\" || grandTotalRow === \"pinnedBottom\") {\n this.order.push(grandTotalNode);\n } else {\n this.order.unshift(grandTotalNode);\n }\n }\n hide(shouldHide) {\n const { all, visible } = this;\n const sizeBefore = visible.size;\n all.forEach((node) => shouldHide(node) ? visible.delete(node) : visible.add(node));\n this.order = Array.from(visible);\n this.sort();\n return sizeBefore != visible.size;\n }\n queue(id) {\n this.queued.add(id);\n }\n unqueue(id) {\n this.queued.delete(id);\n }\n forEachQueued(fn) {\n this.queued.forEach(fn);\n }\n};\nfunction _isDisplayedAfterFilterCSRM(node) {\n if (node.level === -1) {\n return true;\n }\n const parent = node.parent;\n if (parent?.childrenAfterSort?.some((child) => child == node)) {\n return _isDisplayedAfterFilterCSRM(parent);\n }\n return false;\n}\nfunction _shouldHidePinnedRows(beans, node) {\n const { gos, rowModel, filterManager } = beans;\n if (_isServerSideRowModel(gos, rowModel)) {\n return !rowModel.getRowNode(node.id);\n }\n if (filterManager?.isAnyFilterPresent()) {\n return !_isDisplayedAfterFilterCSRM(node);\n }\n if (gos.get(\"pivotMode\")) {\n return !node.group;\n }\n return false;\n}\nfunction _isNodeGrandTotal(node) {\n return !!node.footer && node.level === -1;\n}\nfunction _isPinnedNodeGrandTotal(node) {\n return !!node.pinnedSibling && _isNodeGrandTotal(node.pinnedSibling);\n}\nfunction _removeGrandTotalRow(order) {\n const index = order.findIndex(_isPinnedNodeGrandTotal);\n if (index > -1) {\n return order.splice(index, 1)?.[0];\n }\n}\n\n// packages/ag-grid-community/src/pinnedRowModel/manualPinnedRowModel.ts\nvar ManualPinnedRowModel = class extends BeanStub {\n constructor() {\n super(...arguments);\n /** Cached CSRM reference, null if not using client-side row model */\n this.csrm = null;\n }\n postConstruct() {\n const { gos, beans } = this;\n this.top = new PinnedRows(beans, \"top\");\n this.bottom = new PinnedRows(beans, \"bottom\");\n this.csrm = _getClientSideRowModel(beans) ?? null;\n const shouldHide = (node) => _shouldHidePinnedRows(beans, node.pinnedSibling);\n const runIsRowPinned = () => {\n const isRowPinned = gos.get(\"isRowPinned\");\n if (isRowPinned && gos.get(\"enableRowPinning\")) {\n beans.rowModel.forEachNode((node) => this.pinRow(node, isRowPinned(node)), true);\n }\n this.refreshRowPositions();\n this.dispatchRowPinnedEvents();\n };\n this.addManagedEventListeners({\n stylesChanged: this.onGridStylesChanges.bind(this),\n modelUpdated: ({ keepRenderedRows }) => {\n this.tryToEmptyQueues();\n this.pinGrandTotalRow();\n let visibilityChanged = false;\n this.forContainers((container) => {\n visibilityChanged || (visibilityChanged = container.hide(shouldHide));\n });\n const positionsChanged = this.refreshRowPositions();\n if (!keepRenderedRows || positionsChanged || visibilityChanged) {\n this.dispatchRowPinnedEvents();\n }\n },\n columnRowGroupChanged: () => {\n this.forContainers(removeGroupRows);\n this.refreshRowPositions();\n },\n rowNodeDataChanged: ({ node }) => {\n const isRowPinnable = gos.get(\"isRowPinnable\");\n const pinnable = isRowPinnable?.(node) ?? true;\n if (!pinnable) {\n this.pinRow(node, null);\n }\n },\n firstDataRendered: runIsRowPinned\n });\n this.addManagedPropertyListener(\"pivotMode\", () => {\n this.forContainers((container) => container.hide(shouldHide));\n this.dispatchRowPinnedEvents();\n });\n this.addManagedPropertyListener(\"grandTotalRow\", ({ currentValue }) => {\n this._grandTotalPinned = currentValue === \"pinnedBottom\" ? \"bottom\" : currentValue === \"pinnedTop\" ? \"top\" : null;\n });\n this.addManagedPropertyListener(\"isRowPinned\", runIsRowPinned);\n }\n destroy() {\n this.reset(false);\n super.destroy();\n }\n reset(dispatch = true) {\n this.forContainers((container) => {\n const nodesToUnpin = [];\n container.forEach((n) => nodesToUnpin.push(n));\n nodesToUnpin.forEach((n) => this.pinRow(n, null));\n container.clear();\n });\n if (dispatch) {\n this.dispatchRowPinnedEvents();\n }\n }\n pinRow(rowNode, float, column) {\n if (float != null && rowNode.destroyed) {\n return;\n }\n if (rowNode.footer) {\n const level = rowNode.level;\n if (level > -1) {\n return;\n }\n if (level === -1) {\n this._grandTotalPinned = float;\n this.csrm?.reMapRows();\n return;\n }\n }\n const currentFloat = rowNode.rowPinned ?? rowNode.pinnedSibling?.rowPinned;\n const switching = currentFloat != null && float != null && float != currentFloat;\n if (switching) {\n const pinned = rowNode.rowPinned ? rowNode : rowNode.pinnedSibling;\n const source = rowNode.rowPinned ? rowNode.pinnedSibling : rowNode;\n this.pinRow(pinned, null, column);\n this.pinRow(source, float, column);\n return;\n }\n const spannedRows = column && getSpannedRows(this.beans, rowNode, column);\n if (spannedRows) {\n spannedRows.forEach((node) => this.pinRow(node, float));\n return;\n }\n if (float == null) {\n const node = rowNode.rowPinned ? rowNode : rowNode.pinnedSibling;\n const found = this.findPinnedRowNode(node);\n if (!found) {\n return;\n }\n found.delete(node);\n const source = node.pinnedSibling;\n _destroyRowNodeSibling(node);\n this.refreshRowPositions(float);\n this.dispatchRowPinnedEvents(source);\n } else {\n const sibling = _createPinnedSibling(this.beans, rowNode, float);\n const container = this.getContainer(float);\n container.add(sibling);\n if (_shouldHidePinnedRows(this.beans, rowNode)) {\n container.hide((node) => _shouldHidePinnedRows(this.beans, node.pinnedSibling));\n }\n this.refreshRowPositions(float);\n this.dispatchRowPinnedEvents(rowNode);\n }\n }\n isManual() {\n return true;\n }\n isEmpty(floating) {\n return this.getContainer(floating).size() === 0;\n }\n isRowsToRender(floating) {\n return !this.isEmpty(floating);\n }\n ensureRowHeightsValid() {\n let anyChange = false;\n let rowTop = 0;\n const updateRowHeight = (rowNode) => {\n if (rowNode.rowHeightEstimated) {\n const rowHeight = _getRowHeightForNode(this.beans, rowNode);\n rowNode.setRowTop(rowTop);\n rowNode.setRowHeight(rowHeight.height);\n rowTop += rowHeight.height;\n anyChange = true;\n }\n };\n this.bottom.forEach(updateRowHeight);\n rowTop = 0;\n this.top.forEach(updateRowHeight);\n this.eventSvc.dispatchEvent({\n type: \"pinnedHeightChanged\"\n });\n return anyChange;\n }\n getPinnedTopTotalHeight() {\n return getTotalHeight(this.top);\n }\n getPinnedBottomTotalHeight() {\n return getTotalHeight(this.bottom);\n }\n getPinnedTopRowCount() {\n return this.top.size();\n }\n getPinnedBottomRowCount() {\n return this.bottom.size();\n }\n getPinnedTopRow(index) {\n return this.top.getByIndex(index);\n }\n getPinnedBottomRow(index) {\n return this.bottom.getByIndex(index);\n }\n getPinnedRowById(id, floating) {\n return this.getContainer(floating).getById(id);\n }\n forEachPinnedRow(floating, callback) {\n this.getContainer(floating).forEach(callback);\n }\n getPinnedState() {\n const buildState = (floating) => {\n const list = [];\n this.forEachPinnedRow(floating, (node) => {\n const id = node.pinnedSibling?.id;\n if (id != null) {\n list.push(id);\n }\n });\n return list;\n };\n return {\n top: buildState(\"top\"),\n bottom: buildState(\"bottom\")\n };\n }\n setPinnedState(state) {\n this.forContainers((pinned, floating) => {\n for (const id of state[floating]) {\n const node = this.beans.rowModel.getRowNode(id);\n if (node) {\n this.pinRow(node, floating);\n } else {\n pinned.queue(id);\n }\n }\n });\n }\n getGrandTotalPinned() {\n return this._grandTotalPinned;\n }\n setGrandTotalPinned(value) {\n this._grandTotalPinned = value;\n }\n tryToEmptyQueues() {\n this.forContainers((pinned, container) => {\n const nodesToPin = /* @__PURE__ */ new Set();\n pinned.forEachQueued((id) => {\n const node = this.beans.rowModel.getRowNode(id);\n if (node) {\n nodesToPin.add(node);\n }\n });\n for (const node of nodesToPin) {\n pinned.unqueue(node.id);\n this.pinRow(node, container);\n }\n });\n }\n pinGrandTotalRow() {\n const { csrm, beans, _grandTotalPinned: float } = this;\n if (!csrm) {\n return;\n }\n const sibling = csrm.rootNode?.sibling;\n if (!sibling) {\n return;\n }\n const pinnedSibling = sibling.pinnedSibling;\n const container = pinnedSibling && this.findPinnedRowNode(pinnedSibling);\n if (!float) {\n if (!container) {\n return;\n }\n _destroyRowNodeSibling(pinnedSibling);\n container.delete(pinnedSibling);\n } else {\n if (container && container.floating !== float) {\n _destroyRowNodeSibling(pinnedSibling);\n container.delete(pinnedSibling);\n }\n if (!container || container.floating !== float) {\n const newPinnedSibling = _createPinnedSibling(beans, sibling, float);\n this.getContainer(float).add(newPinnedSibling);\n }\n }\n }\n onGridStylesChanges(e) {\n if (e.rowHeightChanged) {\n this.forContainers(\n (container) => container.forEach((rowNode) => rowNode.setRowHeight(rowNode.rowHeight, true))\n );\n }\n }\n getContainer(floating) {\n return floating === \"top\" ? this.top : this.bottom;\n }\n findPinnedRowNode(node) {\n if (this.top.has(node)) {\n return this.top;\n }\n if (this.bottom.has(node)) {\n return this.bottom;\n }\n }\n refreshRowPositions(floating) {\n const refreshAll = (pinned) => refreshRowPositions(this.beans, pinned);\n if (floating) {\n return refreshAll(this.getContainer(floating));\n }\n let changed = false;\n this.forContainers((container) => {\n const updated = refreshAll(container);\n changed || (changed = updated);\n });\n return changed;\n }\n forContainers(fn) {\n fn(this.top, \"top\");\n fn(this.bottom, \"bottom\");\n }\n dispatchRowPinnedEvents(node) {\n this.eventSvc.dispatchEvent({ type: \"pinnedRowsChanged\" });\n node?.dispatchRowEvent(\"rowPinned\");\n }\n};\nfunction refreshRowPositions(beans, container) {\n let rowTop = 0;\n let changed = false;\n container.forEach((node, index) => {\n changed || (changed = node.rowTop !== rowTop);\n node.setRowTop(rowTop);\n if (node.rowHeightEstimated || node.rowHeight == null) {\n const rowHeight = _getRowHeightForNode(beans, node).height;\n changed || (changed = node.rowHeight !== rowHeight);\n node.setRowHeight(rowHeight);\n }\n node.setRowIndex(index);\n rowTop += node.rowHeight;\n });\n return changed;\n}\nfunction _createPinnedSibling(beans, rowNode, floating) {\n if (rowNode.pinnedSibling) {\n return rowNode.pinnedSibling;\n }\n const sibling = _createRowNodeSibling(rowNode, beans);\n sibling.setRowTop(null);\n sibling.setRowIndex(null);\n sibling.rowPinned = floating;\n const prefix = floating === \"top\" ? ROW_ID_PREFIX_TOP_PINNED : ROW_ID_PREFIX_BOTTOM_PINNED;\n sibling.id = `${prefix}${floating}-${rowNode.id}`;\n sibling.pinnedSibling = rowNode;\n rowNode.pinnedSibling = sibling;\n return sibling;\n}\nfunction _destroyRowNodeSibling(rowNode) {\n if (!rowNode.pinnedSibling) {\n return;\n }\n rowNode.rowPinned = null;\n rowNode._destroy(false);\n const mainNode = rowNode.pinnedSibling;\n rowNode.pinnedSibling = void 0;\n if (mainNode) {\n mainNode.pinnedSibling = void 0;\n mainNode.rowPinned = null;\n }\n}\nfunction removeGroupRows(set) {\n const rowsToRemove = /* @__PURE__ */ new Set();\n set.forEach((node) => {\n if (node.group) {\n rowsToRemove.add(node);\n }\n });\n rowsToRemove.forEach((node) => set.delete(node));\n}\nfunction getSpannedRows(beans, rowNode, column) {\n const { rowSpanSvc } = beans;\n const isCellSpanning = (column && rowSpanSvc?.isCellSpanning(column, rowNode)) ?? false;\n if (column && isCellSpanning) {\n return rowSpanSvc?.getCellSpan(column, rowNode)?.spannedNodes;\n }\n}\nfunction getTotalHeight(container) {\n const size = container.size();\n if (size === 0) {\n return 0;\n }\n const node = container.getByIndex(size - 1);\n if (node === void 0) {\n return 0;\n }\n return node.rowTop + node.rowHeight;\n}\n\n// packages/ag-grid-community/src/pinnedRowModel/staticPinnedRowModel.ts\nvar StaticPinnedRowModel = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.nextId = 0;\n this.pinnedTopRows = { cache: {}, order: [] };\n this.pinnedBottomRows = { cache: {}, order: [] };\n }\n postConstruct() {\n const gos = this.gos;\n this.setPinnedRowData(gos.get(\"pinnedTopRowData\"), \"top\");\n this.setPinnedRowData(gos.get(\"pinnedBottomRowData\"), \"bottom\");\n this.addManagedPropertyListener(\"pinnedTopRowData\", (e) => this.setPinnedRowData(e.currentValue, \"top\"));\n this.addManagedPropertyListener(\"pinnedBottomRowData\", (e) => this.setPinnedRowData(e.currentValue, \"bottom\"));\n this.addManagedEventListeners({ stylesChanged: this.onGridStylesChanges.bind(this) });\n }\n reset() {\n }\n isEmpty(floating) {\n return this.getCache(floating).order.length === 0;\n }\n isRowsToRender(floating) {\n return !this.isEmpty(floating);\n }\n isManual() {\n return false;\n }\n pinRow(_node, _container) {\n }\n onGridStylesChanges(e) {\n if (e.rowHeightChanged) {\n const estimateRowHeight = (rowNode) => {\n rowNode.setRowHeight(rowNode.rowHeight, true);\n };\n forEach(this.pinnedBottomRows, estimateRowHeight);\n forEach(this.pinnedTopRows, estimateRowHeight);\n }\n }\n ensureRowHeightsValid() {\n let anyChange = false;\n let rowTop = 0;\n const updateRowHeight = (rowNode) => {\n if (rowNode.rowHeightEstimated) {\n const rowHeight = _getRowHeightForNode(this.beans, rowNode);\n rowNode.setRowTop(rowTop);\n rowNode.setRowHeight(rowHeight.height);\n rowTop += rowHeight.height;\n anyChange = true;\n }\n };\n forEach(this.pinnedBottomRows, updateRowHeight);\n rowTop = 0;\n forEach(this.pinnedTopRows, updateRowHeight);\n this.eventSvc.dispatchEvent({\n type: \"pinnedHeightChanged\"\n });\n return anyChange;\n }\n setPinnedRowData(rowData, floating) {\n this.updateNodesFromRowData(rowData, floating);\n this.eventSvc.dispatchEvent({\n type: \"pinnedRowDataChanged\"\n });\n }\n /**\n * Updates existing RowNode instances and creates new ones if necessary\n *\n * Setting data as `undefined` will clear row nodes\n */\n updateNodesFromRowData(allData, floating) {\n const nodes = this.getCache(floating);\n if (allData === void 0) {\n nodes.order.length = 0;\n nodes.cache = {};\n return;\n }\n const getRowId = _getRowIdCallback(this.gos);\n const idPrefix = floating === \"top\" ? ROW_ID_PREFIX_TOP_PINNED : ROW_ID_PREFIX_BOTTOM_PINNED;\n const nodesToRemove = new Set(nodes.order);\n const newOrder = [];\n const dataIds = /* @__PURE__ */ new Set();\n let nextRowTop = 0;\n let i = -1;\n for (const data of allData) {\n const id = getRowId?.({ data, level: 0, rowPinned: floating }) ?? idPrefix + this.nextId++;\n if (dataIds.has(id)) {\n _warn(96, { id, data });\n continue;\n }\n i++;\n dataIds.add(id);\n newOrder.push(id);\n const existingNode = getById(nodes, id);\n if (existingNode !== void 0) {\n if (existingNode.data !== data) {\n existingNode.updateData(data);\n }\n nextRowTop += this.setRowTopAndRowIndex(existingNode, nextRowTop, i);\n nodesToRemove.delete(id);\n } else {\n const rowNode = new RowNode(this.beans);\n rowNode.id = id;\n rowNode.data = data;\n rowNode.rowPinned = floating;\n nextRowTop += this.setRowTopAndRowIndex(rowNode, nextRowTop, i);\n nodes.cache[id] = rowNode;\n nodes.order.push(id);\n }\n }\n for (const id of nodesToRemove) {\n getById(nodes, id)?.clearRowTopAndRowIndex();\n delete nodes.cache[id];\n }\n nodes.order = newOrder;\n }\n setRowTopAndRowIndex(rowNode, rowTop, rowIndex) {\n rowNode.setRowTop(rowTop);\n rowNode.setRowHeight(_getRowHeightForNode(this.beans, rowNode).height);\n rowNode.setRowIndex(rowIndex);\n return rowNode.rowHeight;\n }\n getPinnedTopTotalHeight() {\n return getTotalHeight2(this.pinnedTopRows);\n }\n getPinnedBottomTotalHeight() {\n return getTotalHeight2(this.pinnedBottomRows);\n }\n getPinnedTopRowCount() {\n return getSize(this.pinnedTopRows);\n }\n getPinnedBottomRowCount() {\n return getSize(this.pinnedBottomRows);\n }\n getPinnedTopRow(index) {\n return getByIndex(this.pinnedTopRows, index);\n }\n getPinnedBottomRow(index) {\n return getByIndex(this.pinnedBottomRows, index);\n }\n getPinnedRowById(id, floating) {\n return getById(this.getCache(floating), id);\n }\n forEachPinnedRow(floating, callback) {\n return forEach(this.getCache(floating), callback);\n }\n getCache(floating) {\n return floating === \"top\" ? this.pinnedTopRows : this.pinnedBottomRows;\n }\n getPinnedState() {\n return { top: [], bottom: [] };\n }\n setPinnedState() {\n }\n getGrandTotalPinned() {\n return;\n }\n setGrandTotalPinned() {\n }\n};\nfunction getTotalHeight2(rowNodes) {\n const size = getSize(rowNodes);\n if (size === 0) {\n return 0;\n }\n const node = getByIndex(rowNodes, size - 1);\n if (node === void 0) {\n return 0;\n }\n return node.rowTop + node.rowHeight;\n}\nfunction getById(cache, id) {\n return cache.cache[id];\n}\nfunction getByIndex(cache, i) {\n return getById(cache, cache.order[i]);\n}\nfunction forEach(cache, callback) {\n cache.order.forEach((id, index) => {\n const node = getById(cache, id);\n if (node) {\n callback(node, index);\n }\n });\n}\nfunction getSize(cache) {\n return cache.order.length;\n}\n\n// packages/ag-grid-community/src/pinnedRowModel/pinnedRowModel.ts\nvar PinnedRowModel = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"pinnedRowModel\";\n }\n postConstruct() {\n const { gos } = this;\n const initialiseRowModel = () => {\n const enableRowPinning = gos.get(\"enableRowPinning\");\n const grandTotalRow = _getGrandTotalRow(gos);\n const isGrandTotalRowPinned = grandTotalRow === \"pinnedBottom\" || grandTotalRow === \"pinnedTop\";\n const useManualPinnedRowModel = !!enableRowPinning || isGrandTotalRowPinned;\n const shouldDestroy = useManualPinnedRowModel ? this.inner instanceof StaticPinnedRowModel : this.inner instanceof ManualPinnedRowModel;\n if (this.inner && shouldDestroy) {\n this.destroyBean(this.inner);\n }\n if (shouldDestroy || !this.inner) {\n this.inner = this.createManagedBean(\n useManualPinnedRowModel ? new ManualPinnedRowModel() : new StaticPinnedRowModel()\n );\n }\n };\n this.addManagedPropertyListeners([\"enableRowPinning\", \"grandTotalRow\"], initialiseRowModel);\n initialiseRowModel();\n }\n reset() {\n return this.inner.reset();\n }\n isEmpty(container) {\n return this.inner.isEmpty(container);\n }\n isManual() {\n return this.inner.isManual();\n }\n isRowsToRender(container) {\n return this.inner.isRowsToRender(container);\n }\n pinRow(node, container, column) {\n return this.inner.pinRow(node, container, column);\n }\n ensureRowHeightsValid() {\n return this.inner.ensureRowHeightsValid();\n }\n getPinnedRowById(id, container) {\n return this.inner.getPinnedRowById(id, container);\n }\n getPinnedTopTotalHeight() {\n return this.inner.getPinnedTopTotalHeight();\n }\n getPinnedBottomTotalHeight() {\n return this.inner.getPinnedBottomTotalHeight();\n }\n getPinnedTopRowCount() {\n return this.inner.getPinnedTopRowCount();\n }\n getPinnedBottomRowCount() {\n return this.inner.getPinnedBottomRowCount();\n }\n getPinnedTopRow(index) {\n return this.inner.getPinnedTopRow(index);\n }\n getPinnedBottomRow(index) {\n return this.inner.getPinnedBottomRow(index);\n }\n forEachPinnedRow(container, callback) {\n return this.inner.forEachPinnedRow(container, callback);\n }\n getPinnedState() {\n return this.inner.getPinnedState();\n }\n setPinnedState(state) {\n return this.inner.setPinnedState(state);\n }\n setGrandTotalPinned(value) {\n return this.inner.setGrandTotalPinned(value);\n }\n getGrandTotalPinned() {\n return this.inner.getGrandTotalPinned();\n }\n};\n\n// packages/ag-grid-community/src/interfaces/serverSideTransaction.ts\nvar ServerSideTransactionResultStatus = /* @__PURE__ */ ((ServerSideTransactionResultStatus2) => {\n ServerSideTransactionResultStatus2[\"Applied\"] = \"Applied\";\n ServerSideTransactionResultStatus2[\"StoreNotFound\"] = \"StoreNotFound\";\n ServerSideTransactionResultStatus2[\"StoreLoading\"] = \"StoreLoading\";\n ServerSideTransactionResultStatus2[\"StoreWaitingToLoad\"] = \"StoreWaitingToLoad\";\n ServerSideTransactionResultStatus2[\"StoreLoadingFailed\"] = \"StoreLoadingFailed\";\n ServerSideTransactionResultStatus2[\"StoreWrongType\"] = \"StoreWrongType\";\n ServerSideTransactionResultStatus2[\"Cancelled\"] = \"Cancelled\";\n ServerSideTransactionResultStatus2[\"StoreNotStarted\"] = \"StoreNotStarted\";\n return ServerSideTransactionResultStatus2;\n})(ServerSideTransactionResultStatus || {});\n\n// packages/ag-grid-community/src/widgets/touchListener.ts\nvar DOUBLE_TAP_MILLISECONDS = 500;\nvar LONG_PRESS_MILLISECONDS = 550;\nvar handledTouchEvents;\nvar addHandledTouchEvent = (event) => {\n if (!handledTouchEvents) {\n handledTouchEvents = /* @__PURE__ */ new WeakSet();\n } else if (handledTouchEvents.has(event)) {\n return false;\n }\n handledTouchEvents.add(event);\n return true;\n};\nvar TouchListener = class {\n constructor(eElement, preventClick = false) {\n this.eElement = eElement;\n this.preventClick = preventClick;\n this.startListener = null;\n this.handlers = [];\n this.eventSvc = void 0;\n this.touchStart = null;\n this.lastTapTime = null;\n this.longPressTimer = 0;\n this.moved = false;\n }\n addEventListener(eventType, listener) {\n let eventSvc = this.eventSvc;\n if (!eventSvc) {\n if (eventSvc === null) {\n return;\n }\n this.eventSvc = eventSvc = new LocalEventService();\n const startListener = this.onTouchStart.bind(this);\n this.startListener = startListener;\n this.eElement.addEventListener(\"touchstart\", startListener, { passive: true });\n }\n eventSvc.addEventListener(eventType, listener);\n }\n removeEventListener(eventType, listener) {\n this.eventSvc?.removeEventListener(eventType, listener);\n }\n onTouchStart(touchEvent) {\n if (this.touchStart || !addHandledTouchEvent(touchEvent)) {\n return;\n }\n const touchStart = touchEvent.touches[0];\n this.touchStart = touchStart;\n const handlers = this.handlers;\n if (!handlers.length) {\n const eElement = this.eElement;\n const doc = eElement.ownerDocument;\n const touchMove = this.onTouchMove.bind(this);\n const touchEnd = this.onTouchEnd.bind(this);\n const touchCancel = this.onTouchCancel.bind(this);\n const passiveTrue = { passive: true };\n const passiveFalse = { passive: false };\n addTempEventHandlers(\n handlers,\n [eElement, \"touchmove\", touchMove, passiveTrue],\n [doc, \"touchcancel\", touchCancel, passiveTrue],\n // we set passive=false, as we want to prevent default on this event\n [doc, \"touchend\", touchEnd, passiveFalse],\n [doc, \"contextmenu\", preventEventDefault, passiveFalse]\n );\n }\n this.clearLongPress();\n this.longPressTimer = window.setTimeout(() => {\n this.longPressTimer = 0;\n if (this.touchStart === touchStart && !this.moved) {\n this.moved = true;\n this.eventSvc?.dispatchEvent({ type: \"longTap\", touchStart, touchEvent });\n }\n }, LONG_PRESS_MILLISECONDS);\n }\n onTouchMove(touchEvent) {\n const { moved, touchStart } = this;\n if (!moved && touchStart) {\n const touch = _getFirstActiveTouch(touchStart, touchEvent.touches);\n const eventIsFarAway = touch && !_areEventsNear(touch, touchStart, 4);\n if (eventIsFarAway) {\n this.clearLongPress();\n this.moved = true;\n }\n }\n }\n onTouchEnd(touchEvent) {\n const touchStart = this.touchStart;\n if (!touchStart || !_getFirstActiveTouch(touchStart, touchEvent.changedTouches)) {\n return;\n }\n if (!this.moved) {\n this.eventSvc?.dispatchEvent({ type: \"tap\", touchStart });\n this.checkDoubleTap(touchStart);\n }\n if (this.preventClick) {\n preventEventDefault(touchEvent);\n }\n this.cancel();\n }\n onTouchCancel(touchEvent) {\n const touchStart = this.touchStart;\n if (!touchStart || !_getFirstActiveTouch(touchStart, touchEvent.changedTouches)) {\n return;\n }\n this.lastTapTime = null;\n this.cancel();\n }\n checkDoubleTap(touchStart) {\n let now = Date.now();\n const lastTapTime = this.lastTapTime;\n if (lastTapTime) {\n const interval = now - lastTapTime;\n if (interval > DOUBLE_TAP_MILLISECONDS) {\n this.eventSvc?.dispatchEvent({ type: \"doubleTap\", touchStart });\n now = null;\n }\n }\n this.lastTapTime = now;\n }\n cancel() {\n this.clearLongPress();\n clearTempEventHandlers(this.handlers);\n this.touchStart = null;\n }\n clearLongPress() {\n window.clearTimeout(this.longPressTimer);\n this.longPressTimer = 0;\n this.moved = false;\n }\n destroy() {\n const startListener = this.startListener;\n if (startListener) {\n this.startListener = null;\n this.eElement.removeEventListener(\"touchstart\", startListener);\n }\n this.cancel();\n this.eElement = null;\n this.eventSvc = null;\n }\n};\n\n// packages/ag-grid-community/src/interfaces/IRangeService.ts\nvar CellRangeType = /* @__PURE__ */ ((CellRangeType2) => {\n CellRangeType2[CellRangeType2[\"VALUE\"] = 0] = \"VALUE\";\n CellRangeType2[CellRangeType2[\"DIMENSION\"] = 1] = \"DIMENSION\";\n return CellRangeType2;\n})(CellRangeType || {});\n\n// packages/ag-grid-community/src/agStack/core/agContext.ts\nvar contextId = 1;\nvar AgContext = class {\n constructor(params) {\n this.beans = {};\n this.createdBeans = [];\n this.destroyed = false;\n this.instanceId = contextId++;\n if (!params?.beanClasses) {\n return;\n }\n this.beanDestroyComparator = params.beanDestroyComparator;\n this.init(params);\n }\n init(params) {\n this.id = params.id;\n this.beans.context = this;\n this.destroyCallback = params.destroyCallback;\n for (const beanName of Object.keys(params.providedBeanInstances)) {\n this.beans[beanName] = params.providedBeanInstances[beanName];\n }\n for (const BeanClass of params.beanClasses) {\n const instance = new BeanClass();\n if (instance.beanName) {\n this.beans[instance.beanName] = instance;\n } else {\n console.error(`Bean ${BeanClass.name} is missing beanName`);\n }\n this.createdBeans.push(instance);\n }\n for (const beanFunc of params.derivedBeans ?? []) {\n const { beanName, bean } = beanFunc(this);\n this.beans[beanName] = bean;\n this.createdBeans.push(bean);\n }\n if (params.beanInitComparator) {\n this.createdBeans.sort(params.beanInitComparator);\n }\n this.initBeans(this.createdBeans);\n }\n getBeanInstances() {\n return Object.values(this.beans);\n }\n createBean(bean, afterPreCreateCallback) {\n this.initBeans([bean], afterPreCreateCallback);\n return bean;\n }\n initBeans(beanInstances, afterPreCreateCallback) {\n const beans = this.beans;\n for (const instance of beanInstances) {\n instance.preWireBeans?.(beans);\n instance.wireBeans?.(beans);\n }\n for (const instance of beanInstances) {\n instance.preConstruct?.();\n }\n if (afterPreCreateCallback) {\n beanInstances.forEach(afterPreCreateCallback);\n }\n for (const instance of beanInstances) {\n instance.postConstruct?.();\n }\n }\n getBeans() {\n return this.beans;\n }\n getBean(name) {\n return this.beans[name];\n }\n getId() {\n return this.id;\n }\n destroy() {\n if (this.destroyed) {\n return;\n }\n this.destroyed = true;\n const beanInstances = this.getBeanInstances();\n if (this.beanDestroyComparator) {\n beanInstances.sort(this.beanDestroyComparator);\n }\n this.destroyBeans(beanInstances);\n this.beans = {};\n this.createdBeans = [];\n this.destroyCallback?.();\n }\n /**\n * Destroys a bean and returns undefined to support destruction and clean up in a single line.\n * this.dateComp = this.context.destroyBean(this.dateComp);\n */\n destroyBean(bean) {\n bean?.destroy?.();\n }\n /**\n * Destroys an array of beans and returns an empty array to support destruction and clean up in a single line.\n * this.dateComps = this.context.destroyBeans(this.dateComps);\n */\n destroyBeans(beans) {\n if (beans) {\n for (let i = 0; i < beans.length; i++) {\n this.destroyBean(beans[i]);\n }\n }\n return [];\n }\n isDestroyed() {\n return this.destroyed;\n }\n};\n\n// packages/ag-grid-community/src/api/apiUtils.ts\nfunction createGridApi(context) {\n return {\n beanName: \"gridApi\",\n bean: context.getBean(\"apiFunctionSvc\").api\n };\n}\n\n// packages/ag-grid-community/src/context/gridBeanComparator.ts\nvar orderedCoreBeans = [\n // Validate license first\n \"licenseManager\",\n // core beans only\n \"environment\",\n \"eventSvc\",\n \"gos\",\n \"paginationAutoPageSizeSvc\",\n \"apiFunctionSvc\",\n \"gridApi\",\n \"registry\",\n \"agCompUtils\",\n \"userCompFactory\",\n \"rowContainerHeight\",\n \"horizontalResizeSvc\",\n \"localeSvc\",\n \"pinnedRowModel\",\n \"dragSvc\",\n \"colGroupSvc\",\n \"visibleCols\",\n \"popupSvc\",\n \"selectionSvc\",\n \"colFilter\",\n \"quickFilter\",\n \"filterManager\",\n \"colModel\",\n \"headerNavigation\",\n \"pageBounds\",\n \"pagination\",\n \"pageBoundsListener\",\n \"rowSpanSvc\",\n \"stickyRowSvc\",\n \"rowRenderer\",\n \"expressionSvc\",\n \"alignedGridsSvc\",\n \"navigation\",\n \"valueCache\",\n \"valueSvc\",\n \"autoWidthCalc\",\n \"filterMenuFactory\",\n \"dragAndDrop\",\n \"focusSvc\",\n \"cellNavigation\",\n \"cellStyles\",\n \"scrollVisibleSvc\",\n \"sortSvc\",\n \"colHover\",\n \"colAnimation\",\n \"autoColSvc\",\n \"selectionColSvc\",\n \"changeDetectionSvc\",\n \"animationFrameSvc\",\n \"undoRedo\",\n \"colDefFactory\",\n \"rowStyleSvc\",\n \"rowNodeBlockLoader\",\n \"rowNodeSorter\",\n \"ctrlsSvc\",\n \"pinnedCols\",\n \"dataTypeSvc\",\n \"syncSvc\",\n \"overlays\",\n \"stateSvc\",\n \"expansionSvc\",\n \"apiEventSvc\",\n \"ariaAnnounce\",\n \"menuSvc\",\n \"colMoves\",\n \"colAutosize\",\n \"colFlex\",\n \"colResize\",\n \"pivotColsSvc\",\n \"valueColsSvc\",\n \"rowGroupColsSvc\",\n \"colNames\",\n \"colViewport\",\n \"pivotResultCols\",\n \"showRowGroupCols\",\n \"validation\"\n // Have validations run last\n];\nvar beanNamePosition = Object.fromEntries(\n orderedCoreBeans.map((beanName, index) => [beanName, index])\n);\nfunction gridBeanInitComparator(bean1, bean2) {\n const index1 = (bean1.beanName ? beanNamePosition[bean1.beanName] : void 0) ?? Number.MAX_SAFE_INTEGER;\n const index2 = (bean2.beanName ? beanNamePosition[bean2.beanName] : void 0) ?? Number.MAX_SAFE_INTEGER;\n return index1 - index2;\n}\nfunction gridBeanDestroyComparator(bean1, bean2) {\n if (bean1?.beanName === \"gridDestroySvc\") {\n return -1;\n }\n if (bean2?.beanName === \"gridDestroySvc\") {\n return 1;\n }\n return 0;\n}\n\n// packages/ag-grid-community/src/entities/positionUtils.ts\nfunction _createCellId(cellPosition) {\n const { rowIndex, rowPinned, column } = cellPosition;\n return `${rowIndex}.${rowPinned == null ? \"null\" : rowPinned}.${column.getId()}`;\n}\nfunction _areCellsEqual(cellA, cellB) {\n const colsMatch = cellA.column === cellB.column;\n const floatingMatch = cellA.rowPinned === cellB.rowPinned;\n const indexMatch = cellA.rowIndex === cellB.rowIndex;\n return colsMatch && floatingMatch && indexMatch;\n}\nfunction _isRowBefore(rowA, rowB) {\n switch (rowA.rowPinned) {\n case \"top\":\n if (rowB.rowPinned !== \"top\") {\n return true;\n }\n break;\n case \"bottom\":\n if (rowB.rowPinned !== \"bottom\") {\n return false;\n }\n break;\n default:\n if (_exists(rowB.rowPinned)) {\n return rowB.rowPinned !== \"top\";\n }\n break;\n }\n return rowA.rowIndex < rowB.rowIndex;\n}\nfunction _isSameRow(rowA, rowB) {\n if (!rowA && !rowB) {\n return true;\n }\n if (!rowA || !rowB) {\n return false;\n }\n return rowA.rowIndex === rowB.rowIndex && rowA.rowPinned == rowB.rowPinned;\n}\nfunction _getFirstRow(beans) {\n let rowIndex = 0;\n let rowPinned;\n const { pinnedRowModel, rowModel, pageBounds } = beans;\n if (pinnedRowModel?.getPinnedTopRowCount()) {\n rowPinned = \"top\";\n } else if (rowModel.getRowCount()) {\n rowPinned = null;\n rowIndex = pageBounds.getFirstRow();\n } else if (pinnedRowModel?.getPinnedBottomRowCount()) {\n rowPinned = \"bottom\";\n }\n return rowPinned === void 0 ? null : { rowIndex, rowPinned };\n}\nfunction _getLastRow(beans) {\n let rowIndex;\n let rowPinned = null;\n const { pinnedRowModel, pageBounds } = beans;\n const pinnedBottomCount = pinnedRowModel?.getPinnedBottomRowCount();\n const pinnedTopCount = pinnedRowModel?.getPinnedTopRowCount();\n if (pinnedBottomCount) {\n rowPinned = \"bottom\";\n rowIndex = pinnedBottomCount - 1;\n } else if (beans.rowModel.getRowCount()) {\n rowIndex = pageBounds.getLastRow();\n } else if (pinnedTopCount) {\n rowPinned = \"top\";\n rowIndex = pinnedTopCount - 1;\n }\n return rowIndex === void 0 ? null : { rowIndex, rowPinned };\n}\nfunction _getRowNode(beans, gridRow) {\n switch (gridRow.rowPinned) {\n case \"top\":\n return beans.pinnedRowModel?.getPinnedTopRow(gridRow.rowIndex);\n case \"bottom\":\n return beans.pinnedRowModel?.getPinnedBottomRow(gridRow.rowIndex);\n default:\n return beans.rowModel.getRow(gridRow.rowIndex);\n }\n}\nfunction _getCellByPosition(beans, cellPosition) {\n const spannedCellCtrl = beans.spannedRowRenderer?.getCellByPosition(cellPosition);\n if (spannedCellCtrl) {\n return spannedCellCtrl;\n }\n const rowCtrl = beans.rowRenderer.getRowByPosition(cellPosition);\n if (!rowCtrl) {\n return null;\n }\n return rowCtrl.getCellCtrl(cellPosition.column);\n}\nfunction _getRowById(beans, rowId, rowPinned) {\n const { rowModel: rm, pinnedRowModel: prm } = beans;\n let node;\n node ?? (node = rm?.getRowNode(rowId));\n if (rowPinned) {\n node ?? (node = prm?.getPinnedRowById(rowId, rowPinned));\n } else {\n node ?? (node = prm?.getPinnedRowById(rowId, \"top\"));\n node ?? (node = prm?.getPinnedRowById(rowId, \"bottom\"));\n }\n return node;\n}\nfunction _getRowAbove(beans, rowPosition, checkSticky = false) {\n const { rowIndex: index, rowPinned: pinned } = rowPosition;\n const { pageBounds, pinnedRowModel, rowModel } = beans;\n if (index === 0) {\n if (pinned === \"top\") {\n return null;\n }\n if (pinned === \"bottom\" && rowModel.isRowsToRender()) {\n return { rowIndex: pageBounds.getLastRow(), rowPinned: null };\n }\n return pinnedRowModel?.isRowsToRender(\"top\") ? { rowIndex: pinnedRowModel.getPinnedTopRowCount() - 1, rowPinned: \"top\" } : null;\n }\n if (checkSticky) {\n const rowNode = pinned ? void 0 : rowModel.getRow(index);\n return getNextStickyPosition(beans, rowNode, true) ?? { rowIndex: index - 1, rowPinned: pinned };\n }\n return { rowIndex: index - 1, rowPinned: pinned };\n}\nfunction _getAbsoluteRowIndex(beans, rowPosition) {\n const { pinnedRowModel, rowModel } = beans;\n const pinnedTopRowCount = pinnedRowModel?.getPinnedTopRowCount() ?? 0;\n const unpinnedRowCount = rowModel.getRowCount();\n const { rowPinned, rowIndex } = rowPosition;\n if (rowPinned === \"top\") {\n return rowIndex;\n }\n if (rowPinned === \"bottom\") {\n return pinnedTopRowCount + unpinnedRowCount + rowIndex;\n }\n return pinnedTopRowCount + rowIndex;\n}\nfunction _getRowBelow(beans, rowPosition, checkSticky = false) {\n const { rowIndex: index, rowPinned: pinned } = rowPosition;\n const { pageBounds, pinnedRowModel, rowModel } = beans;\n if (isLastRowInContainer(beans, rowPosition)) {\n if (pinned === \"bottom\") {\n return null;\n }\n if (pinned === \"top\" && rowModel.isRowsToRender()) {\n return { rowIndex: pageBounds.getFirstRow(), rowPinned: null };\n }\n return pinnedRowModel?.isRowsToRender(\"bottom\") ? { rowIndex: 0, rowPinned: \"bottom\" } : null;\n }\n if (checkSticky) {\n const rowNode = pinned ? void 0 : rowModel.getRow(index);\n return getNextStickyPosition(beans, rowNode) ?? { rowIndex: index + 1, rowPinned: pinned };\n }\n return { rowIndex: index + 1, rowPinned: pinned };\n}\nfunction getNextStickyPosition(beans, rowNode, up = false) {\n const { gos, rowRenderer } = beans;\n if (!rowNode?.sticky || !_isGroupRowsSticky(gos)) {\n return;\n }\n const stickyTopCtrls = rowRenderer.getStickyTopRowCtrls();\n const stickyBottomCtrls = rowRenderer.getStickyBottomRowCtrls();\n const isStickyTop = !stickyBottomCtrls.some((ctrl) => ctrl.rowNode.rowIndex === rowNode.rowIndex);\n const stickyRowCtrls = isStickyTop ? stickyTopCtrls : stickyBottomCtrls;\n const increment = (up ? -1 : 1) * (isStickyTop ? -1 : 1);\n let nextCtrl;\n for (let i = 0; i < stickyRowCtrls.length; i++) {\n if (stickyRowCtrls[i].rowNode.rowIndex === rowNode.rowIndex) {\n nextCtrl = stickyRowCtrls[i + increment];\n break;\n }\n }\n return nextCtrl ? { rowIndex: nextCtrl.rowNode.rowIndex, rowPinned: null } : void 0;\n}\nfunction isLastRowInContainer(beans, rowPosition) {\n const { rowPinned, rowIndex } = rowPosition;\n const { pinnedRowModel, pageBounds } = beans;\n if (rowPinned === \"top\") {\n const lastTopIndex = (pinnedRowModel?.getPinnedTopRowCount() ?? 0) - 1;\n return lastTopIndex <= rowIndex;\n }\n if (rowPinned === \"bottom\") {\n const lastBottomIndex = (pinnedRowModel?.getPinnedBottomRowCount() ?? 0) - 1;\n return lastBottomIndex <= rowIndex;\n }\n const lastBodyIndex = pageBounds.getLastRow();\n return lastBodyIndex <= rowIndex;\n}\n\n// packages/ag-grid-community/src/utils/gridFocus.ts\nfunction _addFocusableContainerListener(beans, comp, eGui) {\n comp.addManagedElementListeners(eGui, {\n keydown: (e) => {\n if (!e.defaultPrevented && !_shouldSkipFocusableContainerListener(e) && e.key === KeyCode.TAB) {\n const backwards = e.shiftKey;\n if (!_findNextFocusableElement(beans, eGui, false, backwards)) {\n if (_focusNextGridCoreContainer(beans, backwards)) {\n e.preventDefault();\n }\n }\n }\n }\n });\n}\nfunction _focusGridInnerElement(beans, fromBottom) {\n return beans.ctrlsSvc.get(\"gridCtrl\").focusInnerElement(fromBottom);\n}\nfunction _isHeaderFocusSuppressed(beans) {\n return beans.gos.get(\"suppressHeaderFocus\") || !!beans.overlays?.exclusive;\n}\nfunction _isCellFocusSuppressed(beans) {\n return beans.gos.get(\"suppressCellFocus\") || !!beans.overlays?.exclusive;\n}\nfunction _focusNextGridCoreContainer(beans, backwards, forceOut = false) {\n const gridCtrl = beans.ctrlsSvc.get(\"gridCtrl\");\n const focusResult = gridCtrl.focusNextInnerContainer(backwards);\n if (focusResult === true) {\n return true;\n }\n if (focusResult === false) {\n return focusResult;\n }\n if (forceOut || !backwards && !gridCtrl.isDetailGrid() && gridCtrl.isFocusInsideGridBody()) {\n gridCtrl.forceFocusOutOfContainer(backwards);\n }\n return false;\n}\nfunction _attemptToRestoreCellFocus(beans, focusedCell) {\n const focusSvc = beans.focusSvc;\n const currentFocusedCell = focusSvc.getFocusedCell();\n if (currentFocusedCell && focusedCell && _areCellsEqual(currentFocusedCell, focusedCell)) {\n const { rowIndex, rowPinned, column } = focusedCell;\n if (_isNothingFocused(beans)) {\n focusSvc.setFocusedCell({\n rowIndex,\n column,\n rowPinned,\n forceBrowserFocus: true,\n preventScrollOnBrowserFocus: !_isKeyboardMode()\n });\n }\n }\n}\nfunction _getDefaultTabTargetForContainer(container, getGridBodyTabTarget) {\n const containerName = container.getFocusableContainerName();\n if (containerName === \"gridBody\") {\n return getGridBodyTabTarget();\n }\n return _runWithContainerFocusAllowed(\n container,\n () => _findFocusableElements(container.getGui(), \".ag-tab-guard\").length > 0\n ) ? containerName : null;\n}\nfunction _runWithContainerFocusAllowed(container, callback) {\n container.setAllowFocus?.(true);\n try {\n return callback();\n } finally {\n container.setAllowFocus?.(false);\n }\n}\nvar AG_GRID_SKIP_FOCUSABLE_CONTAINER = \"__ag_Grid_Skip_Focusable_Container\";\nfunction _skipFocusableContainerListenerForAgGrid(event) {\n event[AG_GRID_SKIP_FOCUSABLE_CONTAINER] = true;\n}\nfunction _shouldSkipFocusableContainerListener(event) {\n return event[AG_GRID_SKIP_FOCUSABLE_CONTAINER] === true;\n}\n\n// packages/ag-grid-community/src/headerRendering/headerUtils.ts\nfunction getHeaderRowCount(colModel) {\n if (!colModel.cols) {\n return -1;\n }\n return colModel.cols.treeDepth + 1;\n}\nfunction getFocusHeaderRowCount(beans) {\n return beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0;\n}\nfunction getGroupRowsHeight(beans) {\n const heights = [];\n const headerRowContainerCtrls = beans.ctrlsSvc.getHeaderRowContainerCtrls();\n for (const headerRowContainerCtrl of headerRowContainerCtrls) {\n if (!headerRowContainerCtrl) {\n continue;\n }\n const groupRowCount = headerRowContainerCtrl.getGroupRowCount() || 0;\n for (let i = 0; i < groupRowCount; i++) {\n const headerRowCtrl = headerRowContainerCtrl.getGroupRowCtrlAtIndex(i);\n const currentHeightAtPos = heights[i];\n if (headerRowCtrl) {\n const newHeight = getColumnGroupHeaderRowHeight(beans, headerRowCtrl);\n if (currentHeightAtPos == null || newHeight > currentHeightAtPos) {\n heights[i] = newHeight;\n }\n }\n }\n }\n return heights;\n}\nfunction getColumnGroupHeaderRowHeight(beans, headerRowCtrl) {\n const defaultHeight = beans.colModel.isPivotMode() ? getPivotGroupHeaderHeight(beans) : getGroupHeaderHeight(beans);\n let maxDisplayedHeight = defaultHeight;\n const headerRowCellCtrls = headerRowCtrl.getHeaderCellCtrls();\n for (const headerCellCtrl of headerRowCellCtrls) {\n const { column } = headerCellCtrl;\n const height = column.getAutoHeaderHeight();\n if (height != null && height > maxDisplayedHeight && column.isAutoHeaderHeight()) {\n maxDisplayedHeight = height;\n }\n }\n return maxDisplayedHeight;\n}\nfunction getColumnHeaderRowHeight(beans) {\n const defaultHeight = beans.colModel.isPivotMode() ? getPivotHeaderHeight(beans) : getHeaderHeight(beans);\n let maxDisplayedHeight = defaultHeight;\n beans.colModel.forAllCols((col) => {\n const height = col.getAutoHeaderHeight();\n if (height != null && height > maxDisplayedHeight && col.isAutoHeaderHeight()) {\n maxDisplayedHeight = height;\n }\n });\n return maxDisplayedHeight;\n}\nfunction getHeaderHeight(beans) {\n return beans.gos.get(\"headerHeight\") ?? beans.environment.getDefaultHeaderHeight();\n}\nfunction getFloatingFiltersHeight(beans) {\n return beans.gos.get(\"floatingFiltersHeight\") ?? getHeaderHeight(beans);\n}\nfunction getGroupHeaderHeight(beans) {\n return beans.gos.get(\"groupHeaderHeight\") ?? getHeaderHeight(beans);\n}\nfunction getPivotHeaderHeight(beans) {\n return beans.gos.get(\"pivotHeaderHeight\") ?? getHeaderHeight(beans);\n}\nfunction getPivotGroupHeaderHeight(beans) {\n return beans.gos.get(\"pivotGroupHeaderHeight\") ?? getGroupHeaderHeight(beans);\n}\nfunction isHeaderPositionEqual(headerPosA, headerPosB) {\n return headerPosA.headerRowIndex === headerPosB.headerRowIndex && headerPosA.column === headerPosB.column;\n}\nfunction isHeaderPosition(position) {\n return position?.headerRowIndex != null;\n}\n\n// packages/ag-grid-community/src/headerRendering/gridHeaderCtrl.ts\nvar GridHeaderCtrl = class extends BeanStub {\n setComp(comp, eGui, eFocusableElement) {\n this.comp = comp;\n this.eGui = eGui;\n const { beans } = this;\n const { headerNavigation, touchSvc, ctrlsSvc } = beans;\n if (headerNavigation) {\n this.createManagedBean(\n new ManagedFocusFeature(eFocusableElement, {\n onTabKeyDown: this.onTabKeyDown.bind(this),\n handleKeyDown: this.handleKeyDown.bind(this),\n onFocusOut: this.onFocusOut.bind(this)\n })\n );\n }\n this.addManagedEventListeners({\n columnPivotModeChanged: this.onPivotModeChanged.bind(this, beans),\n displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this, beans)\n });\n this.onPivotModeChanged(beans);\n this.setupHeaderHeight();\n const listener = this.onHeaderContextMenu.bind(this);\n this.addManagedElementListeners(this.eGui, { contextmenu: listener });\n touchSvc?.mockHeaderContextMenu(this, listener);\n ctrlsSvc.register(\"gridHeaderCtrl\", this);\n }\n setupHeaderHeight() {\n const listener = this.setHeaderHeight.bind(this);\n listener();\n this.addManagedPropertyListeners(\n [\n \"headerHeight\",\n \"pivotHeaderHeight\",\n \"groupHeaderHeight\",\n \"pivotGroupHeaderHeight\",\n \"floatingFiltersHeight\"\n ],\n listener\n );\n this.addManagedEventListeners({\n headerRowsChanged: listener,\n columnHeaderHeightChanged: listener,\n // add this to the animation frame to avoid a feedback loop\n columnGroupHeaderHeightChanged: () => _requestAnimationFrame(this.beans, () => listener()),\n stylesChanged: listener,\n advancedFilterEnabledChanged: listener\n });\n }\n setHeaderHeight() {\n const { beans } = this;\n let totalHeaderHeight = 0;\n const groupHeight = getGroupRowsHeight(beans).reduce((prev, curr) => prev + curr, 0);\n const headerHeight = getColumnHeaderRowHeight(beans);\n if (beans.filterManager?.hasFloatingFilters()) {\n totalHeaderHeight += getFloatingFiltersHeight(beans);\n }\n totalHeaderHeight += groupHeight;\n totalHeaderHeight += headerHeight;\n const headerBorderWidth = beans.environment.getHeaderRowBorderWidth();\n const totalHeaderHeightWithBorder = totalHeaderHeight + headerBorderWidth;\n if (this.headerHeightWithBorder !== totalHeaderHeightWithBorder) {\n this.headerHeightWithBorder = totalHeaderHeightWithBorder;\n const px = `${totalHeaderHeightWithBorder}px`;\n this.comp.setHeightAndMinHeight(px);\n }\n if (this.headerHeight !== totalHeaderHeight) {\n this.headerHeight = totalHeaderHeight;\n this.eventSvc.dispatchEvent({\n type: \"headerHeightChanged\"\n });\n }\n }\n onPivotModeChanged(beans) {\n const pivotMode = beans.colModel.isPivotMode();\n this.comp.toggleCss(\"ag-pivot-on\", pivotMode);\n this.comp.toggleCss(\"ag-pivot-off\", !pivotMode);\n }\n onDisplayedColumnsChanged(beans) {\n const columns = beans.visibleCols.allCols;\n const shouldAllowOverflow = columns.some((col) => col.isSpanHeaderHeight());\n this.comp.toggleCss(\"ag-header-allow-overflow\", shouldAllowOverflow);\n }\n onTabKeyDown(e) {\n const isRtl = this.gos.get(\"enableRtl\");\n const backwards = e.shiftKey;\n const direction = backwards !== isRtl ? \"LEFT\" : \"RIGHT\";\n const { beans } = this;\n const { headerNavigation, focusSvc } = beans;\n if (headerNavigation.navigateHorizontally(direction, true, e) || !backwards && focusSvc.focusOverlay(false) || _focusNextGridCoreContainer(beans, backwards, true)) {\n e.preventDefault();\n }\n }\n handleKeyDown(e) {\n let direction = null;\n const { headerNavigation } = this.beans;\n switch (e.key) {\n case KeyCode.LEFT:\n direction = \"LEFT\";\n case KeyCode.RIGHT: {\n if (!_exists(direction)) {\n direction = \"RIGHT\";\n }\n if (headerNavigation.navigateHorizontally(direction, false, e)) {\n e.preventDefault();\n }\n break;\n }\n case KeyCode.UP:\n direction = \"UP\";\n case KeyCode.DOWN: {\n if (!_exists(direction)) {\n direction = \"DOWN\";\n }\n if (headerNavigation.navigateVertically(direction, e)) {\n e.preventDefault();\n }\n break;\n }\n default:\n return;\n }\n }\n onFocusOut(e) {\n const { relatedTarget } = e;\n const { eGui, beans } = this;\n if (!relatedTarget && eGui.contains(_getActiveDomElement(beans))) {\n return;\n }\n if (!eGui.contains(relatedTarget)) {\n beans.focusSvc.focusedHeader = null;\n }\n }\n onHeaderContextMenu(mouseEvent, touch, touchEvent) {\n const { menuSvc, ctrlsSvc } = this.beans;\n if (!mouseEvent && !touchEvent || !menuSvc?.isHeaderContextMenuEnabled()) {\n return;\n }\n const { target } = mouseEvent ?? touch;\n if (target === this.eGui || target === ctrlsSvc.getHeaderRowContainerCtrl()?.eViewport) {\n menuSvc.showHeaderContextMenu(void 0, mouseEvent, touchEvent);\n }\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/cells/abstractCell/abstractHeaderCellComp.ts\nvar AbstractHeaderCellComp = class extends Component {\n constructor(template, ctrl) {\n super(template);\n this.ctrl = ctrl;\n }\n getCtrl() {\n return this.ctrl;\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/cells/column/headerCellComp.ts\nvar HeaderCellElement = {\n tag: \"div\",\n cls: \"ag-header-cell\",\n role: \"columnheader\",\n children: [\n { tag: \"div\", ref: \"eResize\", cls: \"ag-header-cell-resize\", role: \"presentation\" },\n { tag: \"div\", ref: \"eHeaderCompWrapper\", cls: \"ag-header-cell-comp-wrapper\", role: \"presentation\" }\n ]\n};\nvar HeaderCellComp = class extends AbstractHeaderCellComp {\n constructor(ctrl) {\n super(HeaderCellElement, ctrl);\n this.eResize = RefPlaceholder;\n this.eHeaderCompWrapper = RefPlaceholder;\n this.headerCompVersion = 0;\n }\n postConstruct() {\n const eGui = this.getGui();\n const refreshSelectAllGui = () => {\n const selectAllGui = this.ctrl.getSelectAllGui();\n if (selectAllGui) {\n this.eResize.insertAdjacentElement(\"afterend\", selectAllGui);\n this.addDestroyFunc(() => selectAllGui.remove());\n }\n };\n const compProxy = {\n setWidth: (width) => eGui.style.width = width,\n toggleCss: (cssClassName, on) => this.toggleCss(cssClassName, on),\n setUserStyles: (styles) => _addStylesToElement(eGui, styles),\n setAriaSort: (sort) => sort ? _setAriaSort(eGui, sort) : _removeAriaSort(eGui),\n setUserCompDetails: (compDetails) => this.setUserCompDetails(compDetails),\n getUserCompInstance: () => this.headerComp,\n refreshSelectAllGui,\n removeSelectAllGui: () => this.ctrl.getSelectAllGui()?.remove()\n };\n this.ctrl.setComp(compProxy, this.getGui(), this.eResize, this.eHeaderCompWrapper, void 0);\n refreshSelectAllGui();\n }\n destroy() {\n this.destroyHeaderComp();\n super.destroy();\n }\n destroyHeaderComp() {\n if (this.headerComp) {\n this.headerCompGui?.remove();\n this.headerComp = this.destroyBean(this.headerComp);\n this.headerCompGui = void 0;\n }\n }\n setUserCompDetails(compDetails) {\n this.headerCompVersion++;\n const versionCopy = this.headerCompVersion;\n compDetails.newAgStackInstance().then((comp) => this.afterCompCreated(versionCopy, comp));\n }\n afterCompCreated(version, headerComp) {\n if (version != this.headerCompVersion || !this.isAlive()) {\n this.destroyBean(headerComp);\n return;\n }\n this.destroyHeaderComp();\n this.headerComp = headerComp;\n this.headerCompGui = headerComp.getGui();\n this.eHeaderCompWrapper.appendChild(this.headerCompGui);\n this.ctrl.setDragSource(this.getGui());\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/cells/columnGroup/headerGroupCellComp.ts\nvar HeaderGroupCellCompElement = {\n tag: \"div\",\n cls: \"ag-header-group-cell\",\n role: \"columnheader\",\n children: [\n { tag: \"div\", ref: \"eHeaderCompWrapper\", cls: \"ag-header-cell-comp-wrapper\", role: \"presentation\" },\n { tag: \"div\", ref: \"eResize\", cls: \"ag-header-cell-resize\", role: \"presentation\" }\n ]\n};\nvar HeaderGroupCellComp = class extends AbstractHeaderCellComp {\n constructor(ctrl) {\n super(HeaderGroupCellCompElement, ctrl);\n this.eResize = RefPlaceholder;\n this.eHeaderCompWrapper = RefPlaceholder;\n }\n postConstruct() {\n const eGui = this.getGui();\n const setAttribute = (key, value) => value != void 0 ? eGui.setAttribute(key, value) : eGui.removeAttribute(key);\n const compProxy = {\n toggleCss: (cssClassName, on) => this.toggleCss(cssClassName, on),\n setUserStyles: (styles) => _addStylesToElement(eGui, styles),\n setHeaderWrapperHidden: (hidden) => {\n if (hidden) {\n this.eHeaderCompWrapper.style.setProperty(\"display\", \"none\");\n } else {\n this.eHeaderCompWrapper.style.removeProperty(\"display\");\n }\n },\n setHeaderWrapperMaxHeight: (value) => {\n if (value != null) {\n this.eHeaderCompWrapper.style.setProperty(\"max-height\", `${value}px`);\n } else {\n this.eHeaderCompWrapper.style.removeProperty(\"max-height\");\n }\n this.eHeaderCompWrapper.classList.toggle(\"ag-header-cell-comp-wrapper-limited-height\", value != null);\n },\n setResizableDisplayed: (displayed) => _setDisplayed(this.eResize, displayed),\n setWidth: (width) => eGui.style.width = width,\n setAriaExpanded: (expanded) => setAttribute(\"aria-expanded\", expanded),\n setUserCompDetails: (details) => this.setUserCompDetails(details),\n getUserCompInstance: () => this.headerGroupComp\n };\n this.ctrl.setComp(compProxy, eGui, this.eResize, this.eHeaderCompWrapper, void 0);\n }\n setUserCompDetails(details) {\n details.newAgStackInstance().then((comp) => this.afterHeaderCompCreated(comp));\n }\n afterHeaderCompCreated(headerGroupComp) {\n const destroyFunc = () => this.destroyBean(headerGroupComp);\n if (!this.isAlive()) {\n destroyFunc();\n return;\n }\n const eGui = this.getGui();\n const eHeaderGroupGui = headerGroupComp.getGui();\n this.eHeaderCompWrapper.appendChild(eHeaderGroupGui);\n this.addDestroyFunc(destroyFunc);\n this.headerGroupComp = headerGroupComp;\n this.ctrl.setDragSource(eGui);\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/cells/floatingFilter/headerFilterCellComp.ts\nvar HeaderFilterCellCompElement = {\n tag: \"div\",\n cls: \"ag-header-cell ag-floating-filter\",\n role: \"gridcell\",\n children: [\n { tag: \"div\", ref: \"eFloatingFilterBody\", role: \"presentation\" },\n {\n tag: \"div\",\n ref: \"eButtonWrapper\",\n cls: \"ag-floating-filter-button ag-hidden\",\n role: \"presentation\",\n children: [\n {\n tag: \"button\",\n ref: \"eButtonShowMainFilter\",\n cls: \"ag-button ag-floating-filter-button-button\",\n attrs: { type: \"button\", tabindex: \"-1\" }\n }\n ]\n }\n ]\n};\nvar HeaderFilterCellComp = class extends AbstractHeaderCellComp {\n constructor(ctrl) {\n super(HeaderFilterCellCompElement, ctrl);\n this.eFloatingFilterBody = RefPlaceholder;\n this.eButtonWrapper = RefPlaceholder;\n this.eButtonShowMainFilter = RefPlaceholder;\n }\n postConstruct() {\n const eGui = this.getGui();\n const compProxy = {\n toggleCss: (cssClassName, on) => this.toggleCss(cssClassName, on),\n setUserStyles: (styles) => _addStylesToElement(eGui, styles),\n addOrRemoveBodyCssClass: (cssClassName, on) => this.eFloatingFilterBody.classList.toggle(cssClassName, on),\n setButtonWrapperDisplayed: (displayed) => _setDisplayed(this.eButtonWrapper, displayed),\n setCompDetails: (compDetails) => this.setCompDetails(compDetails),\n getFloatingFilterComp: () => this.compPromise,\n setWidth: (width) => eGui.style.width = width,\n setMenuIcon: (eIcon) => this.eButtonShowMainFilter.appendChild(eIcon)\n };\n this.ctrl.setComp(compProxy, eGui, this.eButtonShowMainFilter, this.eFloatingFilterBody, void 0);\n }\n setCompDetails(compDetails) {\n if (!compDetails) {\n this.destroyFloatingFilterComp();\n this.compPromise = null;\n return;\n }\n this.compPromise = compDetails.newAgStackInstance();\n this.compPromise.then((comp) => this.afterCompCreated(comp));\n }\n destroy() {\n this.destroyFloatingFilterComp();\n super.destroy();\n }\n destroyFloatingFilterComp() {\n this.floatingFilterComp?.getGui().remove();\n this.floatingFilterComp = this.destroyBean(this.floatingFilterComp);\n }\n afterCompCreated(comp) {\n if (!comp) {\n return;\n }\n if (!this.isAlive()) {\n this.destroyBean(comp);\n return;\n }\n this.destroyFloatingFilterComp();\n this.floatingFilterComp = comp;\n this.eFloatingFilterBody.appendChild(comp.getGui());\n comp.afterGuiAttached?.();\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/row/headerRowComp.ts\nvar HeaderRowComp = class extends Component {\n constructor(ctrl) {\n super({ tag: \"div\", cls: ctrl.headerRowClass, role: \"row\" });\n this.ctrl = ctrl;\n this.headerComps = {};\n }\n postConstruct() {\n const eGui = this.getGui();\n eGui.setAttribute(\"tabindex\", String(this.gos.get(\"tabIndex\")));\n _setAriaRowIndex(this.getGui(), this.ctrl.getAriaRowIndex());\n const compProxy = {\n setHeight: (height) => this.getGui().style.height = height,\n setTop: (top) => this.getGui().style.top = top,\n setHeaderCtrls: (ctrls, forceOrder) => this.setHeaderCtrls(ctrls, forceOrder),\n setWidth: (width) => this.getGui().style.width = width,\n setRowIndex: (rowIndex) => _setAriaRowIndex(this.getGui(), rowIndex)\n };\n this.ctrl.setComp(compProxy, void 0);\n }\n destroy() {\n this.setHeaderCtrls([], false);\n super.destroy();\n }\n setHeaderCtrls(ctrls, forceOrder) {\n if (!this.isAlive()) {\n return;\n }\n const oldComps = this.headerComps;\n this.headerComps = {};\n for (const ctrl of ctrls) {\n const id = ctrl.instanceId;\n let comp = oldComps[id];\n delete oldComps[id];\n if (comp == null) {\n comp = this.createHeaderComp(ctrl);\n this.getGui().appendChild(comp.getGui());\n }\n this.headerComps[id] = comp;\n }\n Object.values(oldComps).forEach((comp) => {\n comp.getGui().remove();\n this.destroyBean(comp);\n });\n if (forceOrder) {\n const comps = Object.values(this.headerComps);\n comps.sort(\n (a, b) => {\n const leftA = a.getCtrl().column.getLeft();\n const leftB = b.getCtrl().column.getLeft();\n return leftA - leftB;\n }\n );\n const elementsInOrder = comps.map((c) => c.getGui());\n _setDomChildOrder(this.getGui(), elementsInOrder);\n }\n }\n createHeaderComp(headerCtrl) {\n let result;\n switch (this.ctrl.type) {\n case \"group\":\n result = new HeaderGroupCellComp(headerCtrl);\n break;\n case \"filter\":\n result = new HeaderFilterCellComp(headerCtrl);\n break;\n default:\n result = new HeaderCellComp(headerCtrl);\n break;\n }\n this.createBean(result);\n result.setParentComponent(this);\n return result;\n }\n};\n\n// packages/ag-grid-community/src/gridBodyComp/centerWidthFeature.ts\nvar CenterWidthFeature = class extends BeanStub {\n constructor(callback, addSpacer = false) {\n super();\n this.callback = callback;\n this.addSpacer = addSpacer;\n }\n postConstruct() {\n const listener = this.setWidth.bind(this);\n this.addManagedPropertyListener(\"domLayout\", listener);\n this.addManagedEventListeners({\n columnContainerWidthChanged: listener,\n displayedColumnsChanged: listener,\n leftPinnedWidthChanged: listener\n });\n if (this.addSpacer) {\n this.addManagedEventListeners({\n rightPinnedWidthChanged: listener,\n scrollVisibilityChanged: listener,\n scrollbarWidthChanged: listener\n });\n }\n this.setWidth();\n }\n setWidth() {\n const printLayout = _isDomLayout(this.gos, \"print\");\n const { visibleCols, scrollVisibleSvc } = this.beans;\n const centerWidth = visibleCols.bodyWidth;\n const leftWidth = visibleCols.getColsLeftWidth();\n const rightWidth = visibleCols.getDisplayedColumnsRightWidth();\n let totalWidth;\n if (printLayout) {\n totalWidth = centerWidth + leftWidth + rightWidth;\n } else {\n totalWidth = centerWidth;\n if (this.addSpacer) {\n const relevantWidth = this.gos.get(\"enableRtl\") ? leftWidth : rightWidth;\n if (relevantWidth === 0 && scrollVisibleSvc.verticalScrollShowing) {\n totalWidth += scrollVisibleSvc.getScrollbarWidth();\n }\n }\n }\n this.callback(totalWidth);\n }\n};\n\n// packages/ag-grid-community/src/components/emptyBean.ts\nvar EmptyBean = class extends BeanStub {\n};\nfunction setupCompBean(ctrl, ctx, compBean) {\n if (compBean) {\n ctrl.addDestroyFunc(() => ctx.destroyBean(compBean));\n }\n return compBean ?? ctrl;\n}\n\n// packages/ag-grid-community/src/rendering/features/setLeftFeature.ts\nvar SetLeftFeature = class extends BeanStub {\n constructor(columnOrGroup, eCell, beans, colsSpanning) {\n super();\n this.columnOrGroup = columnOrGroup;\n this.eCell = eCell;\n this.colsSpanning = colsSpanning;\n this.columnOrGroup = columnOrGroup;\n this.ariaEl = eCell.querySelector(\"[role=columnheader]\") || eCell;\n this.beans = beans;\n }\n setColsSpanning(colsSpanning) {\n this.colsSpanning = colsSpanning;\n this.onLeftChanged();\n }\n getColumnOrGroup() {\n const { beans, colsSpanning } = this;\n if (beans.gos.get(\"enableRtl\") && colsSpanning) {\n return _last(colsSpanning);\n }\n return this.columnOrGroup;\n }\n postConstruct() {\n const onLeftChanged = this.onLeftChanged.bind(this);\n this.addManagedListeners(this.columnOrGroup, { leftChanged: onLeftChanged });\n this.setLeftFirstTime();\n this.addManagedEventListeners({ displayedColumnsWidthChanged: onLeftChanged });\n this.addManagedPropertyListener(\"domLayout\", onLeftChanged);\n }\n setLeftFirstTime() {\n const { gos, colAnimation } = this.beans;\n const suppressMoveAnimation = gos.get(\"suppressColumnMoveAnimation\");\n const oldLeftExists = _exists(this.columnOrGroup.getOldLeft());\n const animateColumnMove = colAnimation?.isActive() && oldLeftExists && !suppressMoveAnimation;\n if (animateColumnMove) {\n this.animateInLeft();\n } else {\n this.onLeftChanged();\n }\n }\n animateInLeft() {\n const colOrGroup = this.getColumnOrGroup();\n const oldActualLeft = this.modifyLeftForPrintLayout(colOrGroup, colOrGroup.getOldLeft());\n const actualLeft = this.modifyLeftForPrintLayout(colOrGroup, colOrGroup.getLeft());\n this.setLeft(oldActualLeft);\n this.actualLeft = actualLeft;\n this.beans.colAnimation.executeNextVMTurn(() => {\n if (this.actualLeft === actualLeft) {\n this.setLeft(actualLeft);\n }\n });\n }\n onLeftChanged() {\n const colOrGroup = this.getColumnOrGroup();\n const left = colOrGroup.getLeft();\n this.actualLeft = this.modifyLeftForPrintLayout(colOrGroup, left);\n this.setLeft(this.actualLeft);\n }\n modifyLeftForPrintLayout(colOrGroup, leftPosition) {\n const { gos, visibleCols } = this.beans;\n const printLayout = _isDomLayout(gos, \"print\");\n if (!printLayout) {\n return leftPosition;\n }\n if (colOrGroup.getPinned() === \"left\") {\n return leftPosition;\n }\n const leftWidth = visibleCols.getColsLeftWidth();\n if (colOrGroup.getPinned() === \"right\") {\n const bodyWidth = visibleCols.bodyWidth;\n return leftWidth + bodyWidth + leftPosition;\n }\n return leftWidth + leftPosition;\n }\n setLeft(value) {\n if (_exists(value)) {\n this.eCell.style.left = `${value}px`;\n }\n if (isColumnGroup(this.columnOrGroup)) {\n const children = this.columnOrGroup.getLeafColumns();\n if (!children.length) {\n return;\n }\n if (children.length > 1) {\n _setAriaColSpan(this.ariaEl, children.length);\n }\n }\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/cells/cssClassApplier.ts\nvar CSS_FIRST_COLUMN = \"ag-column-first\";\nvar CSS_LAST_COLUMN = \"ag-column-last\";\nfunction _getHeaderClassesFromColDef(abstractColDef, gos, column, columnGroup) {\n if (_missing(abstractColDef)) {\n return [];\n }\n return getColumnClassesFromCollDef(abstractColDef.headerClass, abstractColDef, gos, column, columnGroup);\n}\nfunction _getToolPanelClassesFromColDef(abstractColDef, gos, column, columnGroup) {\n if (_missing(abstractColDef)) {\n return [];\n }\n return getColumnClassesFromCollDef(abstractColDef.toolPanelClass, abstractColDef, gos, column, columnGroup);\n}\nfunction refreshFirstAndLastStyles(comp, column, presentedColsService) {\n comp.toggleCss(CSS_FIRST_COLUMN, presentedColsService.isColAtEdge(column, \"first\"));\n comp.toggleCss(CSS_LAST_COLUMN, presentedColsService.isColAtEdge(column, \"last\"));\n}\nfunction getClassParams(abstractColDef, gos, column, columnGroup) {\n return _addGridCommonParams(gos, {\n // bad naming, as colDef here can be a group or a column,\n // however most people won't appreciate the difference,\n // so keeping it as colDef to avoid confusion.\n colDef: abstractColDef,\n column,\n columnGroup\n });\n}\nfunction getColumnClassesFromCollDef(classesOrFunc, abstractColDef, gos, column, columnGroup) {\n if (_missing(classesOrFunc)) {\n return [];\n }\n let classToUse;\n if (typeof classesOrFunc === \"function\") {\n const params = getClassParams(abstractColDef, gos, column, columnGroup);\n classToUse = classesOrFunc(params);\n } else {\n classToUse = classesOrFunc;\n }\n if (typeof classToUse === \"string\") {\n return [classToUse];\n }\n if (Array.isArray(classToUse)) {\n return [...classToUse];\n }\n return [];\n}\n\n// packages/ag-grid-community/src/headerRendering/cells/abstractCell/abstractHeaderCellCtrl.ts\nvar instanceIdSequence2 = 0;\nvar DOM_DATA_KEY_HEADER_CTRL = \"headerCtrl\";\nvar AbstractHeaderCellCtrl = class extends BeanStub {\n constructor(column, rowCtrl) {\n super();\n this.column = column;\n this.rowCtrl = rowCtrl;\n this.resizeToggleTimeout = 0;\n this.resizeMultiplier = 1;\n this.resizeFeature = null;\n this.lastFocusEvent = null;\n this.dragSource = null;\n this.reAttemptToFocus = false;\n this.instanceId = column.getUniqueId() + \"-\" + instanceIdSequence2++;\n }\n postConstruct() {\n const refreshTabIndex = this.refreshTabIndex.bind(this);\n this.addManagedPropertyListeners([\"suppressHeaderFocus\"], refreshTabIndex);\n this.addManagedEventListeners({\n overlayExclusiveChanged: refreshTabIndex\n });\n }\n setComp(comp, eGui, eResize, eHeaderCompWrapper, compBean) {\n eGui.setAttribute(\"col-id\", this.column.colIdSanitised);\n this.wireComp(comp, eGui, eResize, eHeaderCompWrapper, compBean);\n if (this.reAttemptToFocus) {\n this.reAttemptToFocus = false;\n this.focus(this.lastFocusEvent ?? void 0);\n }\n }\n shouldStopEventPropagation(event) {\n const { headerRowIndex, column } = this.beans.focusSvc.focusedHeader;\n const colDef = column.getDefinition();\n const colDefFunc = colDef?.suppressHeaderKeyboardEvent;\n if (!_exists(colDefFunc)) {\n return false;\n }\n const params = _addGridCommonParams(this.gos, {\n colDef,\n column,\n headerRowIndex,\n event\n });\n return !!colDefFunc(params);\n }\n getWrapperHasFocus() {\n const activeEl = _getActiveDomElement(this.beans);\n return activeEl === this.eGui;\n }\n setGui(eGui, compBean) {\n this.eGui = eGui;\n this.addDomData(compBean);\n compBean.addManagedListeners(this.beans.eventSvc, {\n displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this)\n });\n compBean.addManagedElementListeners(this.eGui, {\n focus: this.onGuiFocus.bind(this)\n });\n this.onDisplayedColumnsChanged();\n this.refreshTabIndex();\n }\n refreshHeaderStyles() {\n const colDef = this.column.getDefinition();\n if (!colDef) {\n return;\n }\n const { headerStyle } = colDef;\n let styles;\n if (typeof headerStyle === \"function\") {\n const cellStyleParams = this.getHeaderClassParams();\n styles = headerStyle(cellStyleParams);\n } else {\n styles = headerStyle;\n }\n if (styles) {\n this.comp.setUserStyles(styles);\n }\n }\n onGuiFocus() {\n this.eventSvc.dispatchEvent({\n type: \"headerFocused\",\n column: this.column\n });\n }\n setupAutoHeight(params) {\n const { wrapperElement, checkMeasuringCallback, compBean } = params;\n const { beans } = this;\n const measureHeight = (timesCalled) => {\n if (!this.isAlive() || !compBean.isAlive()) {\n return;\n }\n const { paddingTop, paddingBottom, borderBottomWidth, borderTopWidth } = _getElementSize(this.eGui);\n const extraHeight = paddingTop + paddingBottom + borderBottomWidth + borderTopWidth;\n const wrapperHeight = wrapperElement.offsetHeight;\n const autoHeight = wrapperHeight + extraHeight;\n if (timesCalled < 5) {\n const doc = _getDocument(beans);\n const notYetInDom = !doc?.contains(wrapperElement);\n const possiblyNoContentYet = autoHeight == 0;\n if (notYetInDom || possiblyNoContentYet) {\n _batchCall(() => measureHeight(timesCalled + 1), \"raf\", beans);\n return;\n }\n }\n this.setColHeaderHeight(this.column, autoHeight);\n };\n let isMeasuring = false;\n let stopResizeObserver;\n const checkMeasuring = () => {\n const newValue = this.column.isAutoHeaderHeight();\n if (newValue && !isMeasuring) {\n startMeasuring();\n }\n if (!newValue && isMeasuring) {\n stopMeasuring();\n }\n };\n const startMeasuring = () => {\n isMeasuring = true;\n this.comp.toggleCss(\"ag-header-cell-auto-height\", true);\n measureHeight(0);\n stopResizeObserver = _observeResize(this.beans, wrapperElement, () => measureHeight(0));\n };\n const stopMeasuring = () => {\n isMeasuring = false;\n if (stopResizeObserver) {\n stopResizeObserver();\n }\n this.comp.toggleCss(\"ag-header-cell-auto-height\", false);\n stopResizeObserver = void 0;\n };\n checkMeasuring();\n compBean.addDestroyFunc(() => stopMeasuring());\n compBean.addManagedListeners(this.column, { widthChanged: () => isMeasuring && measureHeight(0) });\n compBean.addManagedEventListeners({\n sortChanged: () => {\n if (isMeasuring) {\n window.setTimeout(() => measureHeight(0));\n }\n }\n });\n if (checkMeasuringCallback) {\n checkMeasuringCallback(checkMeasuring);\n }\n }\n onDisplayedColumnsChanged() {\n const { comp, column, beans, eGui } = this;\n if (!comp || !column || !eGui) {\n return;\n }\n refreshFirstAndLastStyles(comp, column, beans.visibleCols);\n _setAriaColIndex(eGui, beans.visibleCols.getAriaColIndex(column));\n }\n addResizeAndMoveKeyboardListeners(compBean) {\n compBean.addManagedListeners(this.eGui, {\n keydown: this.onGuiKeyDown.bind(this),\n keyup: this.onGuiKeyUp.bind(this)\n });\n }\n refreshTabIndex() {\n const suppressHeaderFocus = _isHeaderFocusSuppressed(this.beans);\n if (this.eGui) {\n _addOrRemoveAttribute(this.eGui, \"tabindex\", suppressHeaderFocus ? null : \"-1\");\n }\n }\n onGuiKeyDown(e) {\n const activeEl = _getActiveDomElement(this.beans);\n const isLeftOrRight = e.key === KeyCode.LEFT || e.key === KeyCode.RIGHT;\n if (this.isResizing) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n if (\n // if elements within the header are focused, we don't process the event\n activeEl !== this.eGui || // if shiftKey, ctrlKey, metaKey and altKey are not pressed, it's cell navigation so we don't process the event\n !e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey\n ) {\n return;\n }\n if (this.isResizing || isLeftOrRight) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n const isCopy = (e.ctrlKey || e.metaKey) && _normaliseQwertyAzerty(e) === KeyCode.C;\n if (isCopy) {\n return this.beans.clipboardSvc?.copyToClipboard();\n }\n if (!isLeftOrRight) {\n return;\n }\n const isLeft = e.key === KeyCode.LEFT !== this.gos.get(\"enableRtl\");\n const direction = isLeft ? \"left\" : \"right\";\n if (e.altKey) {\n this.isResizing = true;\n this.resizeMultiplier += 1;\n const diff = this.getViewportAdjustedResizeDiff(e);\n this.resizeHeader(diff, e.shiftKey);\n this.resizeFeature?.toggleColumnResizing(true);\n } else {\n this.moveHeader(direction);\n }\n }\n moveHeader(hDirection) {\n this.beans.colMoves?.moveHeader(hDirection, this.eGui, this.column, this.rowCtrl.pinned, this);\n }\n getViewportAdjustedResizeDiff(e) {\n const diff = this.getResizeDiff(e);\n const { pinnedCols } = this.beans;\n return pinnedCols ? pinnedCols.getHeaderResizeDiff(diff, this.column) : diff;\n }\n getResizeDiff(e) {\n const { gos, column } = this;\n let isLeft = e.key === KeyCode.LEFT !== gos.get(\"enableRtl\");\n const pinned = column.getPinned();\n const isRtl = gos.get(\"enableRtl\");\n if (pinned) {\n if (isRtl !== (pinned === \"right\")) {\n isLeft = !isLeft;\n }\n }\n return (isLeft ? -1 : 1) * this.resizeMultiplier;\n }\n onGuiKeyUp() {\n if (!this.isResizing) {\n return;\n }\n if (this.resizeToggleTimeout) {\n window.clearTimeout(this.resizeToggleTimeout);\n this.resizeToggleTimeout = 0;\n }\n this.isResizing = false;\n this.resizeMultiplier = 1;\n this.resizeToggleTimeout = window.setTimeout(() => {\n this.resizeFeature?.toggleColumnResizing(false);\n }, 150);\n }\n handleKeyDown(e) {\n const wrapperHasFocus = this.getWrapperHasFocus();\n switch (e.key) {\n case KeyCode.PAGE_DOWN:\n case KeyCode.PAGE_UP:\n case KeyCode.PAGE_HOME:\n case KeyCode.PAGE_END:\n if (wrapperHasFocus) {\n e.preventDefault();\n }\n }\n }\n addDomData(compBean) {\n const key = DOM_DATA_KEY_HEADER_CTRL;\n const { eGui, gos } = this;\n _setDomData(gos, eGui, key, this);\n compBean.addDestroyFunc(() => _setDomData(gos, eGui, key, null));\n }\n focus(event) {\n if (!this.isAlive()) {\n return false;\n }\n const { eGui } = this;\n if (!eGui) {\n this.reAttemptToFocus = true;\n } else {\n this.lastFocusEvent = event || null;\n eGui.focus();\n }\n return true;\n }\n focusThis() {\n this.beans.focusSvc.focusedHeader = { headerRowIndex: this.rowCtrl.rowIndex, column: this.column };\n }\n removeDragSource() {\n if (this.dragSource) {\n this.beans.dragAndDrop?.removeDragSource(this.dragSource);\n this.dragSource = null;\n }\n }\n handleContextMenuMouseEvent(mouseEvent, touchEvent, column) {\n const event = mouseEvent ?? touchEvent;\n const { menuSvc, gos } = this.beans;\n if (gos.get(\"preventDefaultOnContextMenu\")) {\n event.preventDefault();\n }\n if (menuSvc?.isHeaderContextMenuEnabled(column)) {\n menuSvc.showHeaderContextMenu(column, mouseEvent, touchEvent);\n }\n this.dispatchColumnMouseEvent(\"columnHeaderContextMenu\", column);\n }\n dispatchColumnMouseEvent(eventType, column) {\n this.eventSvc.dispatchEvent({\n type: eventType,\n column\n });\n }\n setColHeaderHeight(col, height) {\n if (!col.setAutoHeaderHeight(height)) {\n return;\n }\n const { eventSvc } = this;\n if (col.isColumn) {\n eventSvc.dispatchEvent({\n type: \"columnHeaderHeightChanged\",\n column: col,\n columns: [col],\n source: \"autosizeColumnHeaderHeight\"\n });\n } else {\n eventSvc.dispatchEvent({\n type: \"columnGroupHeaderHeightChanged\",\n columnGroup: col,\n source: \"autosizeColumnGroupHeaderHeight\"\n });\n }\n }\n clearComponent() {\n this.removeDragSource();\n this.resizeFeature = null;\n this.comp = null;\n this.eGui = null;\n }\n destroy() {\n super.destroy();\n this.column = null;\n this.lastFocusEvent = null;\n this.rowCtrl = null;\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/cells/column/headerCellCtrl.ts\nvar HeaderCellCtrl = class extends AbstractHeaderCellCtrl {\n constructor() {\n super(...arguments);\n this.refreshFunctions = {};\n this.userHeaderClasses = /* @__PURE__ */ new Set();\n this.ariaDescriptionProperties = /* @__PURE__ */ new Map();\n }\n wireComp(comp, eGui, eResize, eHeaderCompWrapper, compBeanInput) {\n this.comp = comp;\n const { rowCtrl, column, beans } = this;\n const { colResize, context, colHover, rangeSvc } = beans;\n const compBean = setupCompBean(this, context, compBeanInput);\n this.setGui(eGui, compBean);\n this.updateState();\n this.setupWidth(compBean);\n this.setupMovingCss(compBean);\n this.setupMenuClass(compBean);\n this.setupSortableClass(compBean);\n this.setupWrapTextClass();\n this.refreshSpanHeaderHeight();\n this.setupAutoHeight({\n wrapperElement: eHeaderCompWrapper,\n checkMeasuringCallback: (checkMeasuring) => this.setRefreshFunction(\"measuring\", checkMeasuring),\n compBean\n });\n this.addColumnHoverListener(compBean);\n this.setupFilterClass(compBean);\n this.setupStylesFromColDef();\n this.setupClassesFromColDef();\n this.setupTooltip();\n this.addActiveHeaderMouseListeners(compBean);\n this.setupSelectAll(compBean);\n this.setupUserComp();\n this.refreshAria();\n if (colResize) {\n this.resizeFeature = compBean.createManagedBean(\n colResize.createResizeFeature(rowCtrl.pinned, column, eResize, comp, this)\n );\n } else {\n _setDisplayed(eResize, false);\n }\n colHover?.createHoverFeature(compBean, [column], eGui);\n rangeSvc?.createRangeHighlightFeature(compBean, column, comp);\n compBean.createManagedBean(new SetLeftFeature(column, eGui, beans));\n compBean.createManagedBean(\n new ManagedFocusFeature(eGui, {\n shouldStopEventPropagation: (e) => this.shouldStopEventPropagation(e),\n onTabKeyDown: () => null,\n handleKeyDown: this.handleKeyDown.bind(this),\n onFocusIn: this.onFocusIn.bind(this),\n onFocusOut: this.onFocusOut.bind(this)\n })\n );\n this.addResizeAndMoveKeyboardListeners(compBean);\n compBean.addManagedPropertyListeners(\n [\"suppressMovableColumns\", \"suppressMenuHide\", \"suppressAggFuncInHeader\", \"enableAdvancedFilter\"],\n () => this.refresh()\n );\n compBean.addManagedListeners(column, {\n colDefChanged: () => this.refresh(),\n formulaRefChanged: () => this.refresh(),\n headerHighlightChanged: this.onHeaderHighlightChanged.bind(this)\n });\n const listener = () => this.checkDisplayName();\n compBean.addManagedEventListeners({\n columnValueChanged: listener,\n columnRowGroupChanged: listener,\n columnPivotChanged: listener,\n headerHeightChanged: this.onHeaderHeightChanged.bind(this)\n });\n compBean.addDestroyFunc(() => {\n this.refreshFunctions = {};\n this.selectAllFeature = null;\n this.dragSourceElement = void 0;\n this.userCompDetails = null;\n this.userHeaderClasses.clear();\n this.ariaDescriptionProperties.clear();\n this.clearComponent();\n });\n }\n resizeHeader(delta, shiftKey) {\n this.beans.colResize?.resizeHeader(this.column, delta, shiftKey);\n }\n getHeaderClassParams() {\n const { column, beans } = this;\n const colDef = column.colDef;\n return _addGridCommonParams(beans.gos, {\n colDef,\n column,\n floatingFilter: false\n });\n }\n setupUserComp() {\n const compDetails = this.lookupUserCompDetails();\n if (compDetails) {\n this.setCompDetails(compDetails);\n }\n }\n setCompDetails(compDetails) {\n this.userCompDetails = compDetails;\n this.comp.setUserCompDetails(compDetails);\n }\n lookupUserCompDetails() {\n const params = this.createParams();\n const colDef = this.column.getColDef();\n return _getHeaderCompDetails(this.beans.userCompFactory, colDef, params);\n }\n createParams() {\n const { menuSvc, sortSvc, colFilter, gos } = this.beans;\n const params = _addGridCommonParams(gos, {\n column: this.column,\n displayName: this.displayName,\n enableSorting: this.column.isSortable(),\n enableMenu: this.menuEnabled,\n enableFilterButton: this.openFilterEnabled && !!menuSvc?.isHeaderFilterButtonEnabled(this.column),\n enableFilterIcon: !!colFilter && (!this.openFilterEnabled || _isLegacyMenuEnabled(this.gos)),\n showColumnMenu: (buttonElement, onClosedCallback) => {\n menuSvc?.showColumnMenu({\n column: this.column,\n buttonElement,\n positionBy: \"button\",\n onClosedCallback\n });\n },\n showColumnMenuAfterMouseClick: (mouseEvent, onClosedCallback) => {\n menuSvc?.showColumnMenu({\n column: this.column,\n mouseEvent,\n positionBy: \"mouse\",\n onClosedCallback\n });\n },\n showFilter: (buttonElement) => {\n menuSvc?.showFilterMenu({\n column: this.column,\n buttonElement,\n containerType: \"columnFilter\",\n positionBy: \"button\"\n });\n },\n progressSort: (multiSort) => {\n sortSvc?.progressSort(this.column, !!multiSort, \"uiColumnSorted\");\n },\n setSort: (sort, multiSort) => {\n sortSvc?.setSortForColumn(this.column, _getSortDefFromInput(sort), !!multiSort, \"uiColumnSorted\");\n },\n eGridHeader: this.eGui,\n setTooltip: (value, shouldDisplayTooltip) => {\n gos.assertModuleRegistered(\"Tooltip\", 3);\n this.setupTooltip(value, shouldDisplayTooltip);\n }\n });\n return params;\n }\n setupSelectAll(compBean) {\n const { selectionSvc } = this.beans;\n if (!selectionSvc) {\n return;\n }\n this.selectAllFeature = compBean.createOptionalManagedBean(selectionSvc.createSelectAllFeature(this.column));\n this.selectAllFeature?.setComp(this);\n compBean.addManagedPropertyListener(\"rowSelection\", () => {\n const selectAllFeature = selectionSvc.createSelectAllFeature(this.column);\n if (selectAllFeature && !this.selectAllFeature) {\n this.selectAllFeature = compBean.createManagedBean(selectAllFeature);\n this.selectAllFeature?.setComp(this);\n this.comp.refreshSelectAllGui();\n } else if (this.selectAllFeature && !selectAllFeature) {\n this.comp.removeSelectAllGui();\n this.selectAllFeature = this.destroyBean(this.selectAllFeature);\n }\n });\n }\n getSelectAllGui() {\n return this.selectAllFeature?.getCheckboxGui();\n }\n handleKeyDown(e) {\n super.handleKeyDown(e);\n if (e.key === KeyCode.SPACE) {\n this.selectAllFeature?.onSpaceKeyDown(e);\n } else if (e.key === KeyCode.ENTER) {\n this.onEnterKeyDown(e);\n } else if (e.key === KeyCode.DOWN && e.altKey) {\n this.showMenuOnKeyPress(e, false);\n }\n }\n onEnterKeyDown(e) {\n const { column, gos, sortable, beans } = this;\n let actioned = false;\n if (e.ctrlKey || e.metaKey) {\n actioned = this.showMenuOnKeyPress(e, true);\n }\n if (!actioned) {\n if (!e.altKey && _getEnableColumnSelection(gos)) {\n beans.rangeSvc?.handleColumnSelection(column, e);\n } else if (sortable) {\n beans.sortSvc?.progressSort(column, e.shiftKey, \"uiColumnSorted\");\n }\n }\n }\n showMenuOnKeyPress(e, isFilterShortcut) {\n const headerComp = this.comp.getUserCompInstance();\n if (!isHeaderComp(headerComp)) {\n return false;\n }\n if (headerComp.onMenuKeyboardShortcut(isFilterShortcut)) {\n e.preventDefault();\n return true;\n }\n return false;\n }\n onFocusIn(e) {\n if (!this.eGui.contains(e.relatedTarget)) {\n this.focusThis();\n this.announceAriaDescription();\n }\n if (_isKeyboardMode()) {\n this.setActiveHeader(true);\n }\n }\n onFocusOut(e) {\n if (this.eGui.contains(e.relatedTarget)) {\n return;\n }\n this.setActiveHeader(false);\n }\n setupTooltip(value, shouldDisplayTooltip) {\n this.tooltipFeature = this.beans.tooltipSvc?.setupHeaderTooltip(\n this.tooltipFeature,\n this,\n value,\n shouldDisplayTooltip\n );\n }\n setupStylesFromColDef() {\n this.setRefreshFunction(\"headerStyles\", this.refreshHeaderStyles.bind(this));\n this.refreshHeaderStyles();\n }\n setupClassesFromColDef() {\n const refreshHeaderClasses = () => {\n const colDef = this.column.getColDef();\n const classes = _getHeaderClassesFromColDef(colDef, this.gos, this.column, null);\n const oldClasses = this.userHeaderClasses;\n this.userHeaderClasses = new Set(classes);\n for (const c of classes) {\n if (oldClasses.has(c)) {\n oldClasses.delete(c);\n } else {\n this.comp.toggleCss(c, true);\n }\n }\n for (const c of oldClasses) {\n this.comp.toggleCss(c, false);\n }\n };\n this.setRefreshFunction(\"headerClasses\", refreshHeaderClasses);\n refreshHeaderClasses();\n }\n setDragSource(eSource) {\n this.dragSourceElement = eSource;\n this.removeDragSource();\n if (!eSource || !this.draggable) {\n return;\n }\n this.dragSource = this.beans.colMoves?.setDragSourceForHeader(eSource, this.column, this.displayName) ?? null;\n }\n updateState() {\n const { menuSvc } = this.beans;\n this.menuEnabled = !!menuSvc?.isColumnMenuInHeaderEnabled(this.column);\n this.openFilterEnabled = !!menuSvc?.isFilterMenuInHeaderEnabled(this.column);\n this.sortable = this.column.isSortable();\n this.displayName = this.calculateDisplayName();\n this.draggable = this.workOutDraggable();\n }\n setRefreshFunction(name, func) {\n this.refreshFunctions[name] = func;\n }\n refresh() {\n this.updateState();\n this.refreshHeaderComp();\n this.refreshAria();\n for (const f of Object.values(this.refreshFunctions)) {\n f();\n }\n }\n refreshHeaderComp() {\n const newCompDetails = this.lookupUserCompDetails();\n if (!newCompDetails) {\n return;\n }\n const compInstance = this.comp.getUserCompInstance();\n const attemptRefresh = compInstance != null && this.userCompDetails.componentClass == newCompDetails.componentClass;\n const headerCompRefreshed = attemptRefresh ? this.attemptHeaderCompRefresh(newCompDetails.params) : false;\n if (headerCompRefreshed) {\n this.setDragSource(this.dragSourceElement);\n } else {\n this.setCompDetails(newCompDetails);\n }\n }\n attemptHeaderCompRefresh(params) {\n const headerComp = this.comp.getUserCompInstance();\n if (!headerComp) {\n return false;\n }\n if (!headerComp.refresh) {\n return false;\n }\n const res = headerComp.refresh(params);\n return res;\n }\n calculateDisplayName() {\n return this.beans.colNames.getDisplayNameForColumn(this.column, \"header\", true);\n }\n checkDisplayName() {\n if (this.displayName !== this.calculateDisplayName()) {\n this.refresh();\n }\n }\n workOutDraggable() {\n const colDef = this.column.getColDef();\n const isSuppressMovableColumns = this.gos.get(\"suppressMovableColumns\");\n const colCanMove = !isSuppressMovableColumns && !colDef.suppressMovable && !colDef.lockPosition;\n return !!colCanMove || !!colDef.enableRowGroup || !!colDef.enablePivot;\n }\n setupWidth(compBean) {\n const listener = () => {\n const columnWidth = this.column.getActualWidth();\n this.comp.setWidth(`${columnWidth}px`);\n };\n compBean.addManagedListeners(this.column, { widthChanged: listener });\n listener();\n }\n setupMovingCss(compBean) {\n const listener = () => {\n this.comp.toggleCss(\"ag-header-cell-moving\", this.column.isMoving());\n };\n compBean.addManagedListeners(this.column, { movingChanged: listener });\n listener();\n }\n setupMenuClass(compBean) {\n const listener = () => {\n this.comp?.toggleCss(\"ag-column-menu-visible\", this.column.isMenuVisible());\n };\n compBean.addManagedListeners(this.column, { menuVisibleChanged: listener });\n listener();\n }\n setupSortableClass(compBean) {\n const updateSortableCssClass = () => {\n this.comp.toggleCss(\"ag-header-cell-sortable\", !!this.sortable);\n };\n updateSortableCssClass();\n this.setRefreshFunction(\"updateSortable\", updateSortableCssClass);\n compBean.addManagedEventListeners({ sortChanged: this.refreshAriaSort.bind(this) });\n }\n setupFilterClass(compBean) {\n const listener = () => {\n const isFilterActive = this.column.isFilterActive();\n this.comp.toggleCss(\"ag-header-cell-filtered\", isFilterActive);\n this.refreshAria();\n };\n compBean.addManagedListeners(this.column, { filterActiveChanged: listener });\n listener();\n }\n setupWrapTextClass() {\n const listener = () => {\n const wrapText = !!this.column.getColDef().wrapHeaderText;\n this.comp.toggleCss(\"ag-header-cell-wrap-text\", wrapText);\n };\n listener();\n this.setRefreshFunction(\"wrapText\", listener);\n }\n onHeaderHighlightChanged() {\n const highlighted = this.column.getHighlighted();\n const beforeOn = highlighted === 0 /* Before */;\n const afterOn = highlighted === 1 /* After */;\n this.comp.toggleCss(\"ag-header-highlight-before\", beforeOn);\n this.comp.toggleCss(\"ag-header-highlight-after\", afterOn);\n }\n onDisplayedColumnsChanged() {\n super.onDisplayedColumnsChanged();\n if (!this.isAlive()) {\n return;\n }\n this.onHeaderHeightChanged();\n }\n onHeaderHeightChanged() {\n this.refreshSpanHeaderHeight();\n }\n refreshSpanHeaderHeight() {\n const { eGui, column, comp, beans } = this;\n const groupHeaderHeight = getGroupRowsHeight(this.beans);\n const isZeroGroupHeight = groupHeaderHeight.reduce((total, next) => total + next, 0) === 0;\n comp.toggleCss(\"ag-header-parent-hidden\", isZeroGroupHeight);\n if (!column.isSpanHeaderHeight()) {\n eGui.style.removeProperty(\"top\");\n eGui.style.removeProperty(\"height\");\n comp.toggleCss(\"ag-header-span-height\", false);\n comp.toggleCss(\"ag-header-span-total\", false);\n return;\n }\n const { numberOfParents, isSpanningTotal } = this.column.getColumnGroupPaddingInfo();\n comp.toggleCss(\"ag-header-span-height\", numberOfParents > 0);\n const headerHeight = getColumnHeaderRowHeight(beans);\n if (numberOfParents === 0) {\n comp.toggleCss(\"ag-header-span-total\", false);\n eGui.style.setProperty(\"top\", `0px`);\n eGui.style.setProperty(\"height\", `${headerHeight}px`);\n return;\n }\n comp.toggleCss(\"ag-header-span-total\", isSpanningTotal);\n const indexToStartSpanning = (this.column.getFirstRealParent()?.getLevel() ?? -1) + 1;\n const rowsToSpan = groupHeaderHeight.length - indexToStartSpanning;\n let extraHeight = 0;\n for (let i = 0; i < rowsToSpan; i++) {\n extraHeight += groupHeaderHeight[groupHeaderHeight.length - 1 - i];\n }\n eGui.style.setProperty(\"top\", `${-extraHeight}px`);\n eGui.style.setProperty(\"height\", `${headerHeight + extraHeight}px`);\n }\n refreshAriaSort() {\n let description = null;\n const { beans, column, comp, sortable } = this;\n if (sortable) {\n const translate = this.getLocaleTextFunc();\n const sortDef = beans.sortSvc?.getDisplaySortForColumn(column) ?? null;\n comp.setAriaSort(_getAriaSortState(sortDef));\n description = translate(\"ariaSortableColumn\", \"Press ENTER to sort\");\n } else {\n comp.setAriaSort();\n }\n this.setAriaDescriptionProperty(\"sort\", description);\n }\n refreshAriaMenu() {\n let description = null;\n if (this.menuEnabled) {\n const translate = this.getLocaleTextFunc();\n description = translate(\"ariaMenuColumn\", \"Press ALT DOWN to open column menu\");\n }\n this.setAriaDescriptionProperty(\"menu\", description);\n }\n refreshAriaFilterButton() {\n let description = null;\n const { openFilterEnabled, gos } = this;\n if (openFilterEnabled && !_isLegacyMenuEnabled(gos)) {\n const translate = this.getLocaleTextFunc();\n description = translate(\"ariaFilterColumn\", \"Press CTRL ENTER to open filter\");\n }\n this.setAriaDescriptionProperty(\"filterButton\", description);\n }\n refreshAriaFiltered() {\n let description = null;\n if (this.column.isFilterActive()) {\n const translate = this.getLocaleTextFunc();\n description = translate(\"ariaColumnFiltered\", \"Column Filtered\");\n }\n this.setAriaDescriptionProperty(\"filter\", description);\n }\n refreshAriaCellSelection() {\n let description = null;\n const { gos, column } = this;\n const enableColumnSelection = _getEnableColumnSelection(gos);\n if (enableColumnSelection && !isRowNumberCol(column)) {\n const translate = this.getLocaleTextFunc();\n description = translate(\n \"ariaColumnCellSelection\",\n \"Press Enter to toggle selection for all visible cells in this column\"\n );\n }\n this.setAriaDescriptionProperty(\"cellSelection\", description);\n }\n setAriaDescriptionProperty(property, value) {\n const props = this.ariaDescriptionProperties;\n if (value != null) {\n props.set(property, value);\n } else {\n props.delete(property);\n }\n }\n announceAriaDescription() {\n const { beans, eGui, ariaDescriptionProperties } = this;\n if (!eGui.contains(_getActiveDomElement(beans))) {\n return;\n }\n const ariaDescription = Array.from(ariaDescriptionProperties.keys()).sort((a, b) => a === \"filter\" ? -1 : b.charCodeAt(0) - a.charCodeAt(0)).map((key) => ariaDescriptionProperties.get(key)).join(\". \");\n beans.ariaAnnounce?.announceValue(ariaDescription, \"columnHeader\");\n }\n refreshAria() {\n this.refreshAriaSort();\n this.refreshAriaMenu();\n this.refreshAriaFilterButton();\n this.refreshAriaFiltered();\n this.refreshAriaCellSelection();\n }\n addColumnHoverListener(compBean) {\n this.beans.colHover?.addHeaderColumnHoverListener(compBean, this.comp, this.column);\n }\n addActiveHeaderMouseListeners(compBean) {\n const listener = (e) => this.handleMouseOverChange(e.type === \"mouseenter\");\n const clickListener = () => {\n this.setActiveHeader(true);\n this.dispatchColumnMouseEvent(\"columnHeaderClicked\", this.column);\n };\n const contextMenuListener = (event) => this.handleContextMenuMouseEvent(event, void 0, this.column);\n compBean.addManagedListeners(this.eGui, {\n mouseenter: listener,\n mouseleave: listener,\n click: clickListener,\n contextmenu: contextMenuListener\n });\n }\n handleMouseOverChange(isMouseOver) {\n this.setActiveHeader(isMouseOver);\n this.eventSvc.dispatchEvent({\n type: isMouseOver ? \"columnHeaderMouseOver\" : \"columnHeaderMouseLeave\",\n column: this.column\n });\n }\n setActiveHeader(active) {\n this.comp.toggleCss(\"ag-header-active\", active);\n }\n getAnchorElementForMenu(isFilter) {\n const headerComp = this.comp.getUserCompInstance();\n if (isHeaderComp(headerComp)) {\n return headerComp.getAnchorElementForMenu(isFilter);\n }\n return this.eGui;\n }\n destroy() {\n this.tooltipFeature = this.destroyBean(this.tooltipFeature);\n super.destroy();\n }\n};\nfunction isHeaderComp(headerComp) {\n return typeof headerComp?.getAnchorElementForMenu === \"function\" && typeof headerComp.onMenuKeyboardShortcut === \"function\";\n}\n\n// packages/ag-grid-community/src/headerRendering/row/headerRowCtrl.ts\nvar instanceIdSequence3 = 0;\nvar HeaderRowCtrl = class extends BeanStub {\n constructor(rowIndex, pinned, type) {\n super();\n this.rowIndex = rowIndex;\n this.pinned = pinned;\n this.type = type;\n this.instanceId = instanceIdSequence3++;\n this.comp = null;\n this.allCtrls = [];\n let typeClass = \"ag-header-row-column\";\n if (type === \"group\") {\n typeClass = \"ag-header-row-group\";\n } else if (type === \"filter\") {\n typeClass = \"ag-header-row-filter\";\n }\n this.headerRowClass = `ag-header-row ${typeClass}`;\n }\n setRowIndex(rowIndex) {\n this.rowIndex = rowIndex;\n this.comp?.setRowIndex(this.getAriaRowIndex());\n this.onRowHeightChanged();\n }\n postConstruct() {\n this.isPrintLayout = _isDomLayout(this.gos, \"print\");\n this.isEnsureDomOrder = this.gos.get(\"ensureDomOrder\");\n }\n /** Checks that every header cell that is currently visible has been rendered.\n * Can only be false under some circumstances when using React\n */\n areCellsRendered() {\n if (!this.comp) {\n return false;\n }\n return this.allCtrls.every((ctrl) => ctrl.eGui != null);\n }\n /**\n *\n * @param comp Proxy to the actual component\n * @param initCompState Should the component be initialised with the current state of the controller. Default: true\n */\n setComp(comp, compBean, initCompState = true) {\n this.comp = comp;\n compBean = setupCompBean(this, this.beans.context, compBean);\n if (initCompState) {\n this.setRowIndex(this.rowIndex);\n this.onVirtualColumnsChanged();\n }\n this.setWidth();\n this.addEventListeners(compBean);\n }\n getAriaRowIndex() {\n return this.rowIndex + 1;\n }\n addEventListeners(compBean) {\n const onHeightChanged = this.onRowHeightChanged.bind(this);\n const onDisplayedColumnsChanged = this.onDisplayedColumnsChanged.bind(this);\n compBean.addManagedEventListeners({\n columnResized: this.setWidth.bind(this),\n displayedColumnsChanged: onDisplayedColumnsChanged,\n virtualColumnsChanged: (params) => this.onVirtualColumnsChanged(params.afterScroll),\n columnGroupHeaderHeightChanged: onHeightChanged,\n columnHeaderHeightChanged: onHeightChanged,\n stylesChanged: onHeightChanged,\n advancedFilterEnabledChanged: onHeightChanged\n });\n compBean.addManagedPropertyListener(\"domLayout\", onDisplayedColumnsChanged);\n compBean.addManagedPropertyListener(\"ensureDomOrder\", (e) => this.isEnsureDomOrder = e.currentValue);\n compBean.addManagedPropertyListeners(\n [\n \"headerHeight\",\n \"pivotHeaderHeight\",\n \"groupHeaderHeight\",\n \"pivotGroupHeaderHeight\",\n \"floatingFiltersHeight\"\n ],\n onHeightChanged\n );\n }\n onDisplayedColumnsChanged() {\n this.isPrintLayout = _isDomLayout(this.gos, \"print\");\n this.onVirtualColumnsChanged();\n this.setWidth();\n this.onRowHeightChanged();\n }\n setWidth() {\n if (!this.comp) {\n return;\n }\n const width = this.getWidthForRow();\n this.comp.setWidth(`${width}px`);\n }\n getWidthForRow() {\n const { visibleCols } = this.beans;\n if (this.isPrintLayout) {\n const pinned = this.pinned != null;\n if (pinned) {\n return 0;\n }\n return visibleCols.getContainerWidth(\"right\") + visibleCols.getContainerWidth(\"left\") + visibleCols.getContainerWidth(null);\n }\n return visibleCols.getContainerWidth(this.pinned);\n }\n onRowHeightChanged() {\n if (!this.comp) {\n return;\n }\n const { topOffset, rowHeight } = this.getTopAndHeight();\n this.comp.setTop(topOffset + \"px\");\n this.comp.setHeight(rowHeight + \"px\");\n }\n getTopAndHeight() {\n let topOffset = 0;\n const groupHeadersHeight = getGroupRowsHeight(this.beans);\n for (let i = 0; i < groupHeadersHeight.length; i++) {\n if (i === this.rowIndex && this.type === \"group\") {\n return { topOffset, rowHeight: groupHeadersHeight[i] };\n }\n topOffset += groupHeadersHeight[i];\n }\n const headerHeight = getColumnHeaderRowHeight(this.beans);\n if (this.type === \"column\") {\n return { topOffset, rowHeight: headerHeight };\n }\n topOffset += headerHeight;\n const filterHeight = getFloatingFiltersHeight(this.beans);\n return { topOffset, rowHeight: filterHeight };\n }\n onVirtualColumnsChanged(afterScroll = false) {\n if (!this.comp) {\n return;\n }\n const ctrlsToDisplay = this.getUpdatedHeaderCtrls();\n const forceOrder = this.isEnsureDomOrder || this.isPrintLayout;\n this.comp.setHeaderCtrls(ctrlsToDisplay, forceOrder, afterScroll);\n }\n /**\n * Recycles the header cell ctrls and creates new ones for the columns in the viewport\n * @returns The updated header cell ctrls\n */\n getUpdatedHeaderCtrls() {\n const oldCtrls = this.ctrlsById;\n this.ctrlsById = /* @__PURE__ */ new Map();\n const columns = this.getColumnsInViewport();\n for (const child of columns) {\n this.recycleAndCreateHeaderCtrls(child, this.ctrlsById, oldCtrls);\n }\n const isFocusedAndDisplayed = (ctrl) => {\n const { focusSvc, visibleCols } = this.beans;\n const isFocused = focusSvc.isHeaderWrapperFocused(ctrl);\n if (!isFocused) {\n return false;\n }\n const isDisplayed = visibleCols.isVisible(ctrl.column);\n return isDisplayed;\n };\n if (oldCtrls) {\n for (const [id, oldCtrl] of oldCtrls) {\n const keepCtrl = isFocusedAndDisplayed(oldCtrl);\n if (keepCtrl) {\n this.ctrlsById.set(id, oldCtrl);\n } else {\n this.destroyBean(oldCtrl);\n }\n }\n }\n this.allCtrls = Array.from(this.ctrlsById.values());\n return this.allCtrls;\n }\n /** Get the current header cell ctrls */\n getHeaderCellCtrls() {\n return this.allCtrls;\n }\n recycleAndCreateHeaderCtrls(headerColumn, currCtrls, oldCtrls) {\n if (headerColumn.isEmptyGroup()) {\n return;\n }\n const idOfChild = headerColumn.getUniqueId();\n let headerCtrl;\n if (oldCtrls) {\n headerCtrl = oldCtrls.get(idOfChild);\n oldCtrls.delete(idOfChild);\n }\n const forOldColumn = headerCtrl && headerCtrl.column != headerColumn;\n if (forOldColumn) {\n this.destroyBean(headerCtrl);\n headerCtrl = void 0;\n }\n if (headerCtrl == null) {\n switch (this.type) {\n case \"filter\": {\n headerCtrl = this.createBean(\n this.beans.registry.createDynamicBean(\n \"headerFilterCellCtrl\",\n true,\n headerColumn,\n this\n )\n );\n break;\n }\n case \"group\":\n headerCtrl = this.createBean(\n this.beans.registry.createDynamicBean(\n \"headerGroupCellCtrl\",\n true,\n headerColumn,\n this\n )\n );\n break;\n default:\n headerCtrl = this.createBean(new HeaderCellCtrl(headerColumn, this));\n break;\n }\n }\n currCtrls.set(idOfChild, headerCtrl);\n }\n getColumnsInViewport() {\n if (!this.isPrintLayout) {\n return this.getComponentsToRender();\n }\n if (this.pinned) {\n return [];\n }\n const viewportColumns = [];\n for (const pinned of [\"left\", null, \"right\"]) {\n viewportColumns.push(...this.getComponentsToRender(pinned));\n }\n return viewportColumns;\n }\n getComponentsToRender(pinned = this.pinned) {\n if (this.type === \"group\") {\n return this.beans.colViewport.getHeadersToRender(pinned, this.rowIndex);\n }\n return this.beans.colViewport.getColumnHeadersToRender(pinned);\n }\n focusHeader(column, event) {\n const ctrl = this.allCtrls.find((ctrl2) => ctrl2.column == column);\n if (!ctrl) {\n return false;\n }\n const focused = ctrl.focus(event);\n return focused;\n }\n destroy() {\n this.allCtrls = this.destroyBeans(this.allCtrls);\n this.ctrlsById = void 0;\n this.comp = null;\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/rowContainer/headerRowContainerCtrl.ts\nvar HeaderRowContainerCtrl = class extends BeanStub {\n constructor(pinned) {\n super();\n this.pinned = pinned;\n this.hidden = false;\n this.includeFloatingFilter = false;\n this.groupsRowCtrls = [];\n }\n setComp(comp, eGui) {\n this.comp = comp;\n this.eViewport = eGui;\n const { pinnedCols, ctrlsSvc, colModel, colMoves } = this.beans;\n this.setupCenterWidth();\n pinnedCols?.setupHeaderPinnedWidth(this);\n this.setupDragAndDrop(colMoves, this.eViewport);\n const onDisplayedColsChanged = this.refresh.bind(this, true);\n this.addManagedEventListeners({\n displayedColumnsChanged: onDisplayedColsChanged,\n advancedFilterEnabledChanged: onDisplayedColsChanged\n });\n const headerType = `${typeof this.pinned === \"string\" ? this.pinned : \"center\"}Header`;\n ctrlsSvc.register(headerType, this);\n if (colModel.ready) {\n this.refresh();\n }\n }\n getAllCtrls() {\n const res = [...this.groupsRowCtrls];\n if (this.columnsRowCtrl) {\n res.push(this.columnsRowCtrl);\n }\n if (this.filtersRowCtrl) {\n res.push(this.filtersRowCtrl);\n }\n return res;\n }\n refresh(keepColumns = false) {\n const { focusSvc, filterManager, visibleCols } = this.beans;\n let sequence = 0;\n const focusedHeaderPosition = focusSvc.getFocusHeaderToUseAfterRefresh();\n const refreshColumnGroups = () => {\n const groupRowCount = visibleCols.headerGroupRowCount;\n sequence = groupRowCount;\n if (!keepColumns) {\n this.groupsRowCtrls = this.destroyBeans(this.groupsRowCtrls);\n }\n const currentGroupCount = this.groupsRowCtrls.length;\n if (currentGroupCount === groupRowCount) {\n return;\n }\n if (currentGroupCount > groupRowCount) {\n for (let i = groupRowCount; i < currentGroupCount; i++) {\n this.destroyBean(this.groupsRowCtrls[i]);\n }\n this.groupsRowCtrls.length = groupRowCount;\n return;\n }\n for (let i = currentGroupCount; i < groupRowCount; i++) {\n const ctrl = this.createBean(new HeaderRowCtrl(i, this.pinned, \"group\"));\n this.groupsRowCtrls.push(ctrl);\n }\n };\n const refreshColumns = () => {\n const rowIndex = sequence++;\n if (this.hidden) {\n this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl);\n return;\n }\n if (this.columnsRowCtrl == null || !keepColumns) {\n this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl);\n this.columnsRowCtrl = this.createBean(new HeaderRowCtrl(rowIndex, this.pinned, \"column\"));\n } else if (this.columnsRowCtrl.rowIndex !== rowIndex) {\n this.columnsRowCtrl.setRowIndex(rowIndex);\n }\n };\n const refreshFilters = () => {\n this.includeFloatingFilter = !!filterManager?.hasFloatingFilters() && !this.hidden;\n const destroyPreviousComp = () => {\n this.filtersRowCtrl = this.destroyBean(this.filtersRowCtrl);\n };\n if (!this.includeFloatingFilter) {\n destroyPreviousComp();\n return;\n }\n if (!keepColumns) {\n destroyPreviousComp();\n }\n const rowIndex = sequence++;\n if (this.filtersRowCtrl) {\n const rowIndexMismatch = this.filtersRowCtrl.rowIndex !== rowIndex;\n if (rowIndexMismatch) {\n this.filtersRowCtrl.setRowIndex(rowIndex);\n }\n } else {\n this.filtersRowCtrl = this.createBean(new HeaderRowCtrl(rowIndex, this.pinned, \"filter\"));\n }\n };\n const oldCtrls = this.getAllCtrls();\n refreshColumnGroups();\n refreshColumns();\n refreshFilters();\n const allCtrls = this.getAllCtrls();\n this.comp.setCtrls(allCtrls);\n this.restoreFocusOnHeader(focusSvc, focusedHeaderPosition);\n if (oldCtrls.length !== allCtrls.length) {\n this.beans.eventSvc.dispatchEvent({\n type: \"headerRowsChanged\"\n });\n }\n }\n getHeaderCtrlForColumn(column) {\n const findCtrl = (ctrl) => ctrl?.getHeaderCellCtrls().find((ctrl2) => ctrl2.column === column);\n if (isColumn(column)) {\n return findCtrl(this.columnsRowCtrl);\n }\n if (this.groupsRowCtrls.length === 0) {\n return;\n }\n for (let i = 0; i < this.groupsRowCtrls.length; i++) {\n const ctrl = findCtrl(this.groupsRowCtrls[i]);\n if (ctrl) {\n return ctrl;\n }\n }\n }\n getHtmlElementForColumnHeader(column) {\n return this.getHeaderCtrlForColumn(column)?.eGui ?? null;\n }\n getRowType(rowIndex) {\n return this.getAllCtrls()[rowIndex]?.type;\n }\n focusHeader(rowIndex, column, event) {\n const allCtrls = this.getAllCtrls();\n const ctrl = allCtrls[rowIndex];\n if (!ctrl) {\n return false;\n }\n return ctrl.focusHeader(column, event);\n }\n getGroupRowCount() {\n return this.groupsRowCtrls.length;\n }\n getGroupRowCtrlAtIndex(index) {\n return this.groupsRowCtrls[index];\n }\n getRowCount() {\n return this.groupsRowCtrls.length + (this.columnsRowCtrl ? 1 : 0) + (this.filtersRowCtrl ? 1 : 0);\n }\n setHorizontalScroll(offset) {\n this.comp.setViewportScrollLeft(offset);\n }\n onScrollCallback(fn) {\n this.addManagedElementListeners(this.eViewport, { scroll: fn });\n }\n destroy() {\n this.filtersRowCtrl = this.destroyBean(this.filtersRowCtrl);\n this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl);\n this.groupsRowCtrls = this.destroyBeans(this.groupsRowCtrls);\n super.destroy();\n }\n setupDragAndDrop(colMoves, dropContainer) {\n const bodyDropTarget = colMoves?.createBodyDropTarget(this.pinned, dropContainer);\n if (bodyDropTarget) {\n this.createManagedBean(bodyDropTarget);\n }\n }\n restoreFocusOnHeader(focusSvc, position) {\n if (!position) {\n return;\n }\n const { column } = position;\n if (column.getPinned() != this.pinned) {\n return;\n }\n focusSvc.focusHeaderPosition({ headerPosition: position, scroll: false });\n }\n setupCenterWidth() {\n if (this.pinned != null) {\n return;\n }\n this.createManagedBean(new CenterWidthFeature((width) => this.comp.setCenterWidth(`${width}px`), true));\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/rowContainer/headerRowContainerComp.ts\nvar PinnedLeftElement = { tag: \"div\", cls: \"ag-pinned-left-header\", role: \"rowgroup\" };\nvar PinnedRightElement = { tag: \"div\", cls: \"ag-pinned-right-header\", role: \"rowgroup\" };\nvar CenterElement = {\n tag: \"div\",\n cls: \"ag-header-viewport\",\n role: \"rowgroup\",\n attrs: { tabindex: \"-1\" },\n children: [{ tag: \"div\", ref: \"eCenterContainer\", cls: \"ag-header-container\", role: \"presentation\" }]\n};\nvar HeaderRowContainerComp = class extends Component {\n constructor(pinned) {\n super();\n this.eCenterContainer = RefPlaceholder;\n this.headerRowComps = {};\n this.rowCompsList = [];\n this.pinned = pinned;\n }\n postConstruct() {\n this.selectAndSetTemplate();\n const compProxy = {\n setDisplayed: (displayed) => this.setDisplayed(displayed),\n setCtrls: (ctrls) => this.setCtrls(ctrls),\n // only gets called for center section\n setCenterWidth: (width) => this.eCenterContainer.style.width = width,\n setViewportScrollLeft: (left) => this.getGui().scrollLeft = left,\n // only gets called for pinned sections\n setPinnedContainerWidth: (width) => {\n const eGui = this.getGui();\n eGui.style.width = width;\n eGui.style.maxWidth = width;\n eGui.style.minWidth = width;\n }\n };\n const ctrl = this.createManagedBean(new HeaderRowContainerCtrl(this.pinned));\n ctrl.setComp(compProxy, this.getGui());\n }\n selectAndSetTemplate() {\n const pinnedLeft = this.pinned == \"left\";\n const pinnedRight = this.pinned == \"right\";\n const template = pinnedLeft ? PinnedLeftElement : pinnedRight ? PinnedRightElement : CenterElement;\n this.setTemplate(template);\n this.eRowContainer = this.eCenterContainer !== RefPlaceholder ? this.eCenterContainer : this.getGui();\n }\n destroy() {\n this.setCtrls([]);\n super.destroy();\n }\n destroyRowComp(rowComp) {\n this.destroyBean(rowComp);\n rowComp.getGui().remove();\n }\n setCtrls(ctrls) {\n const oldRowComps = this.headerRowComps;\n this.headerRowComps = {};\n this.rowCompsList = [];\n let prevGui;\n const appendEnsuringDomOrder = (rowComp) => {\n const eGui = rowComp.getGui();\n const notAlreadyIn = eGui.parentElement != this.eRowContainer;\n if (notAlreadyIn) {\n this.eRowContainer.appendChild(eGui);\n }\n if (prevGui) {\n _ensureDomOrder(this.eRowContainer, eGui, prevGui);\n }\n prevGui = eGui;\n };\n for (const ctrl of ctrls) {\n const ctrlId = ctrl.instanceId;\n const existingComp = oldRowComps[ctrlId];\n delete oldRowComps[ctrlId];\n const rowComp = existingComp ? existingComp : this.createBean(new HeaderRowComp(ctrl));\n this.headerRowComps[ctrlId] = rowComp;\n this.rowCompsList.push(rowComp);\n appendEnsuringDomOrder(rowComp);\n }\n for (const c of Object.values(oldRowComps)) {\n this.destroyRowComp(c);\n }\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/gridHeaderComp.ts\nvar GridHeaderElement = { tag: \"div\", cls: \"ag-header\", role: \"presentation\" };\nvar GridHeaderComp = class extends Component {\n constructor() {\n super(GridHeaderElement);\n }\n postConstruct() {\n const compProxy = {\n toggleCss: (cssClassName, on) => this.toggleCss(cssClassName, on),\n setHeightAndMinHeight: (height) => {\n this.getGui().style.height = height;\n this.getGui().style.minHeight = height;\n }\n };\n const ctrl = this.createManagedBean(new GridHeaderCtrl());\n ctrl.setComp(compProxy, this.getGui(), this.getFocusableElement());\n const addContainer = (container) => {\n this.createManagedBean(container);\n this.appendChild(container);\n };\n addContainer(new HeaderRowContainerComp(\"left\"));\n addContainer(new HeaderRowContainerComp(null));\n addContainer(new HeaderRowContainerComp(\"right\"));\n }\n};\nvar GridHeaderSelector = {\n selector: \"AG-HEADER-ROOT\",\n component: GridHeaderComp\n};\n\n// packages/ag-grid-community/src/styling/layoutFeature.ts\nvar LayoutCssClasses = {\n AUTO_HEIGHT: \"ag-layout-auto-height\",\n NORMAL: \"ag-layout-normal\",\n PRINT: \"ag-layout-print\"\n};\nvar LayoutFeature = class extends BeanStub {\n constructor(view) {\n super();\n this.view = view;\n }\n postConstruct() {\n this.addManagedPropertyListener(\"domLayout\", this.updateLayoutClasses.bind(this));\n this.updateLayoutClasses();\n }\n updateLayoutClasses() {\n const domLayout = this.gos.get(\"domLayout\");\n const params = {\n autoHeight: domLayout === \"autoHeight\",\n normal: domLayout === \"normal\",\n print: domLayout === \"print\"\n };\n const cssClass = params.autoHeight ? LayoutCssClasses.AUTO_HEIGHT : params.print ? LayoutCssClasses.PRINT : LayoutCssClasses.NORMAL;\n this.view.updateLayoutClasses(cssClass, params);\n }\n};\n\n// packages/ag-grid-community/src/gridBodyComp/abstractFakeScrollComp.ts\nvar AbstractFakeScrollComp = class extends Component {\n constructor(template, direction) {\n super();\n this.direction = direction;\n this.eViewport = RefPlaceholder;\n this.eContainer = RefPlaceholder;\n this.hideTimeout = 0;\n this.setTemplate(template);\n }\n postConstruct() {\n this.addManagedEventListeners({\n scrollVisibilityChanged: this.onScrollVisibilityChanged.bind(this)\n });\n this.onScrollVisibilityChanged();\n this.toggleCss(\"ag-apple-scrollbar\", _isMacOsUserAgent() || _isIOSUserAgent());\n }\n destroy() {\n super.destroy();\n window.clearTimeout(this.hideTimeout);\n }\n initialiseInvisibleScrollbar() {\n if (this.invisibleScrollbar !== void 0) {\n return;\n }\n this.invisibleScrollbar = _isInvisibleScrollbar();\n if (this.invisibleScrollbar) {\n this.hideAndShowInvisibleScrollAsNeeded();\n this.addActiveListenerToggles();\n }\n }\n addActiveListenerToggles() {\n const eGui = this.getGui();\n const onActivate = () => this.toggleCss(\"ag-scrollbar-active\", true);\n const onDeactivate = () => this.toggleCss(\"ag-scrollbar-active\", false);\n this.addManagedListeners(eGui, {\n mouseenter: onActivate,\n mousedown: onActivate,\n touchstart: onActivate,\n mouseleave: onDeactivate,\n touchend: onDeactivate\n });\n }\n onScrollVisibilityChanged() {\n if (this.invisibleScrollbar === void 0) {\n this.initialiseInvisibleScrollbar();\n }\n _requestAnimationFrame(this.beans, () => this.setScrollVisible());\n }\n hideAndShowInvisibleScrollAsNeeded() {\n this.addManagedEventListeners({\n bodyScroll: (params) => {\n if (params.direction === this.direction) {\n if (this.hideTimeout) {\n window.clearTimeout(this.hideTimeout);\n this.hideTimeout = 0;\n }\n this.toggleCss(\"ag-scrollbar-scrolling\", true);\n }\n },\n bodyScrollEnd: () => {\n this.hideTimeout = window.setTimeout(() => {\n this.toggleCss(\"ag-scrollbar-scrolling\", false);\n this.hideTimeout = 0;\n }, 400);\n }\n });\n }\n attemptSettingScrollPosition(value) {\n const viewport = this.eViewport;\n _waitUntil(\n this,\n () => _isVisible(viewport),\n () => this.setScrollPosition(value),\n 100\n );\n }\n onScrollCallback(fn) {\n this.addManagedElementListeners(this.eViewport, { scroll: fn });\n }\n};\n\n// packages/ag-grid-community/src/gridBodyComp/fakeHScrollComp.ts\nvar FakeHScrollElement = {\n tag: \"div\",\n cls: \"ag-body-horizontal-scroll\",\n attrs: { \"aria-hidden\": \"true\" },\n children: [\n { tag: \"div\", ref: \"eLeftSpacer\", cls: \"ag-horizontal-left-spacer\" },\n {\n tag: \"div\",\n ref: \"eViewport\",\n cls: \"ag-body-horizontal-scroll-viewport\",\n children: [{ tag: \"div\", ref: \"eContainer\", cls: \"ag-body-horizontal-scroll-container\" }]\n },\n { tag: \"div\", ref: \"eRightSpacer\", cls: \"ag-horizontal-right-spacer\" }\n ]\n};\nvar FakeHScrollComp = class extends AbstractFakeScrollComp {\n constructor() {\n super(FakeHScrollElement, \"horizontal\");\n this.eLeftSpacer = RefPlaceholder;\n this.eRightSpacer = RefPlaceholder;\n this.setScrollVisibleDebounce = 0;\n }\n wireBeans(beans) {\n this.visibleCols = beans.visibleCols;\n this.scrollVisibleSvc = beans.scrollVisibleSvc;\n }\n postConstruct() {\n super.postConstruct();\n const spacerWidthsListener = this.setFakeHScrollSpacerWidths.bind(this);\n this.addManagedEventListeners({\n displayedColumnsChanged: spacerWidthsListener,\n displayedColumnsWidthChanged: spacerWidthsListener,\n pinnedRowDataChanged: this.refreshCompBottom.bind(this)\n });\n this.addManagedPropertyListener(\"domLayout\", spacerWidthsListener);\n this.beans.ctrlsSvc.register(\"fakeHScrollComp\", this);\n this.createManagedBean(new CenterWidthFeature((width) => this.eContainer.style.width = `${width}px`));\n this.addManagedPropertyListeners([\"suppressHorizontalScroll\"], this.onScrollVisibilityChanged.bind(this));\n }\n destroy() {\n window.clearTimeout(this.setScrollVisibleDebounce);\n super.destroy();\n }\n initialiseInvisibleScrollbar() {\n if (this.invisibleScrollbar !== void 0) {\n return;\n }\n this.enableRtl = this.gos.get(\"enableRtl\");\n super.initialiseInvisibleScrollbar();\n if (this.invisibleScrollbar) {\n this.refreshCompBottom();\n }\n }\n refreshCompBottom() {\n if (!this.invisibleScrollbar) {\n return;\n }\n const bottomPinnedHeight = this.beans.pinnedRowModel?.getPinnedBottomTotalHeight() ?? 0;\n this.getGui().style.bottom = `${bottomPinnedHeight}px`;\n }\n onScrollVisibilityChanged() {\n super.onScrollVisibilityChanged();\n this.setFakeHScrollSpacerWidths();\n }\n setFakeHScrollSpacerWidths() {\n const vScrollShowing = this.scrollVisibleSvc.verticalScrollShowing;\n let rightSpacing = this.visibleCols.getDisplayedColumnsRightWidth();\n const scrollOnRight = !this.enableRtl && vScrollShowing;\n const scrollbarWidth = this.scrollVisibleSvc.getScrollbarWidth();\n if (scrollOnRight) {\n rightSpacing += scrollbarWidth;\n }\n _setFixedWidth(this.eRightSpacer, rightSpacing);\n this.eRightSpacer.classList.toggle(\"ag-scroller-corner\", rightSpacing <= scrollbarWidth);\n let leftSpacing = this.visibleCols.getColsLeftWidth();\n const scrollOnLeft = this.enableRtl && vScrollShowing;\n if (scrollOnLeft) {\n leftSpacing += scrollbarWidth;\n }\n _setFixedWidth(this.eLeftSpacer, leftSpacing);\n this.eLeftSpacer.classList.toggle(\"ag-scroller-corner\", leftSpacing <= scrollbarWidth);\n }\n setScrollVisible() {\n const hScrollShowing = this.scrollVisibleSvc.horizontalScrollShowing;\n const invisibleScrollbar2 = this.invisibleScrollbar;\n const isSuppressHorizontalScroll = this.gos.get(\"suppressHorizontalScroll\");\n const scrollbarWidth = hScrollShowing ? this.scrollVisibleSvc.getScrollbarWidth() || 0 : 0;\n const adjustedScrollbarWidth = scrollbarWidth === 0 && invisibleScrollbar2 ? 16 : scrollbarWidth;\n const scrollContainerSize = !isSuppressHorizontalScroll ? adjustedScrollbarWidth : 0;\n const apply = () => {\n this.setScrollVisibleDebounce = 0;\n this.toggleCss(\"ag-scrollbar-invisible\", invisibleScrollbar2);\n _setFixedHeight(this.getGui(), scrollContainerSize);\n _setFixedHeight(this.eViewport, scrollContainerSize);\n _setFixedHeight(this.eContainer, scrollContainerSize);\n if (!scrollContainerSize) {\n this.eContainer.style.setProperty(\"min-height\", \"1px\");\n }\n this.setVisible(hScrollShowing, { skipAriaHidden: true });\n };\n window.clearTimeout(this.setScrollVisibleDebounce);\n if (!hScrollShowing) {\n apply();\n } else {\n this.setScrollVisibleDebounce = window.setTimeout(apply, 100);\n }\n }\n getScrollPosition() {\n return _getScrollLeft(this.eViewport, this.enableRtl);\n }\n setScrollPosition(value) {\n if (!_isVisible(this.eViewport)) {\n this.attemptSettingScrollPosition(value);\n }\n _setScrollLeft(this.eViewport, value, this.enableRtl);\n }\n};\nvar FakeHScrollSelector = {\n selector: \"AG-FAKE-HORIZONTAL-SCROLL\",\n component: FakeHScrollComp\n};\n\n// packages/ag-grid-community/src/gridBodyComp/rowContainer/setHeightFeature.ts\nvar SetHeightFeature = class extends BeanStub {\n constructor(eContainer, eViewport) {\n super();\n this.eContainer = eContainer;\n this.eViewport = eViewport;\n }\n postConstruct() {\n this.addManagedEventListeners({\n rowContainerHeightChanged: this.onHeightChanged.bind(this, this.beans.rowContainerHeight)\n });\n }\n onHeightChanged(maxDivHeightScaler) {\n const height = maxDivHeightScaler.uiContainerHeight;\n const heightString = height != null ? `${height}px` : ``;\n this.eContainer.style.height = heightString;\n if (this.eViewport) {\n this.eViewport.style.height = heightString;\n }\n }\n};\n\n// packages/ag-grid-community/src/gridBodyComp/fakeVScrollComp.ts\nvar FakeVScrollElement = {\n tag: \"div\",\n cls: \"ag-body-vertical-scroll\",\n attrs: { \"aria-hidden\": \"true\" },\n children: [\n {\n tag: \"div\",\n ref: \"eViewport\",\n cls: \"ag-body-vertical-scroll-viewport\",\n children: [{ tag: \"div\", ref: \"eContainer\", cls: \"ag-body-vertical-scroll-container\" }]\n }\n ]\n};\nvar FakeVScrollComp = class extends AbstractFakeScrollComp {\n constructor() {\n super(FakeVScrollElement, \"vertical\");\n }\n postConstruct() {\n super.postConstruct();\n this.createManagedBean(new SetHeightFeature(this.eContainer));\n const { ctrlsSvc } = this.beans;\n ctrlsSvc.register(\"fakeVScrollComp\", this);\n this.addManagedEventListeners({\n rowContainerHeightChanged: this.onRowContainerHeightChanged.bind(this, ctrlsSvc)\n });\n }\n setScrollVisible() {\n const { scrollVisibleSvc } = this.beans;\n const vScrollShowing = scrollVisibleSvc.verticalScrollShowing;\n const invisibleScrollbar2 = this.invisibleScrollbar;\n const scrollbarWidth = vScrollShowing ? scrollVisibleSvc.getScrollbarWidth() || 0 : 0;\n const adjustedScrollbarWidth = scrollbarWidth === 0 && invisibleScrollbar2 ? 16 : scrollbarWidth;\n this.toggleCss(\"ag-scrollbar-invisible\", invisibleScrollbar2);\n _setFixedWidth(this.getGui(), adjustedScrollbarWidth);\n _setFixedWidth(this.eViewport, adjustedScrollbarWidth);\n _setFixedWidth(this.eContainer, adjustedScrollbarWidth);\n this.setDisplayed(vScrollShowing, { skipAriaHidden: true });\n }\n onRowContainerHeightChanged(ctrlsSvc) {\n const gridBodyCtrl = ctrlsSvc.getGridBodyCtrl();\n const gridBodyViewportEl = gridBodyCtrl.eBodyViewport;\n const eViewportScrollTop = this.getScrollPosition();\n const gridBodyViewportScrollTop = gridBodyViewportEl.scrollTop;\n if (eViewportScrollTop != gridBodyViewportScrollTop) {\n this.setScrollPosition(gridBodyViewportScrollTop, true);\n }\n }\n getScrollPosition() {\n return this.eViewport.scrollTop;\n }\n setScrollPosition(value, force) {\n if (!force && !_isVisible(this.eViewport)) {\n this.attemptSettingScrollPosition(value);\n }\n this.eViewport.scrollTop = value;\n }\n};\nvar FakeVScrollSelector = {\n selector: \"AG-FAKE-VERTICAL-SCROLL\",\n component: FakeVScrollComp\n};\n\n// packages/ag-grid-community/src/agStack/constants/direction.ts\nvar Direction = /* @__PURE__ */ ((Direction2) => {\n Direction2[Direction2[\"Vertical\"] = 0] = \"Vertical\";\n Direction2[Direction2[\"Horizontal\"] = 1] = \"Horizontal\";\n return Direction2;\n})(Direction || {});\n\n// packages/ag-grid-community/src/gridBodyComp/gridBodyScrollFeature.ts\nvar VIEWPORT = \"Viewport\";\nvar FAKE_V_SCROLLBAR = \"fakeVScrollComp\";\nvar HORIZONTAL_SOURCES = [\n \"fakeHScrollComp\",\n \"centerHeader\",\n \"topCenter\",\n \"bottomCenter\",\n \"stickyTopCenter\",\n \"stickyBottomCenter\"\n];\nvar SCROLL_DEBOUNCE_TIMEOUT = 100;\nvar SCROLL_END_TIMEOUT = 150;\nvar GridBodyScrollFeature = class extends BeanStub {\n constructor(eBodyViewport) {\n super();\n // listeners for when ensureIndexVisible is waiting for SSRM data to load\n this.clearRetryListenerFncs = [];\n this.lastScrollSource = [null, null];\n this.scrollLeft = -1;\n this.nextScrollTop = -1;\n this.scrollTop = -1;\n // Used to provide approximate values of scrollTop and offsetHeight\n // without forcing the browser to recalculate styles.\n this.lastOffsetHeight = -1;\n this.lastScrollTop = -1;\n this.lastIsHorizontalScrollShowing = false;\n this.scrollTimer = 0;\n this.isScrollActive = false;\n this.isVerticalPositionInvalidated = true;\n this.isHorizontalPositionInvalidated = true;\n this.eBodyViewport = eBodyViewport;\n this.resetLastHScrollDebounced = _debounce(\n this,\n () => this.lastScrollSource[1 /* Horizontal */] = null,\n SCROLL_END_TIMEOUT\n );\n this.resetLastVScrollDebounced = _debounce(\n this,\n () => this.lastScrollSource[0 /* Vertical */] = null,\n SCROLL_END_TIMEOUT\n );\n }\n wireBeans(beans) {\n this.ctrlsSvc = beans.ctrlsSvc;\n this.animationFrameSvc = beans.animationFrameSvc;\n this.visibleCols = beans.visibleCols;\n }\n destroy() {\n super.destroy();\n this.clearRetryListenerFncs = [];\n window.clearTimeout(this.scrollTimer);\n }\n postConstruct() {\n this.enableRtl = this.gos.get(\"enableRtl\");\n const invalidateVerticalScroll = this.invalidateVerticalScroll.bind(this);\n const invalidateHorizontalScroll = this.invalidateHorizontalScroll.bind(this);\n this.addManagedEventListeners({\n displayedColumnsWidthChanged: this.onDisplayedColumnsWidthChanged.bind(this),\n bodyHeightChanged: invalidateVerticalScroll,\n // We only invalidate horizontal scrolling when the viewport switches\n // between scrollable and non-scrollable, avoiding unnecessary\n // invalidation on every gridSizeChanged event. If more properties\n // require invalidation, read/write DOM cycles may be needed.\n scrollGapChanged: invalidateHorizontalScroll\n });\n this.addManagedElementListeners(this.eBodyViewport, {\n scroll: invalidateVerticalScroll\n });\n this.ctrlsSvc.whenReady(this, (p) => {\n this.centerRowsCtrl = p.center;\n this.fakeVScrollComp = p.fakeVScrollComp;\n this.fakeHScrollComp = p.fakeHScrollComp;\n this.onDisplayedColumnsWidthChanged();\n this.addScrollListener();\n });\n }\n invalidateHorizontalScroll() {\n this.isHorizontalPositionInvalidated = true;\n }\n invalidateVerticalScroll() {\n this.isVerticalPositionInvalidated = true;\n }\n addScrollListener() {\n this.addHorizontalScrollListeners();\n this.addVerticalScrollListeners();\n }\n addHorizontalScrollListeners() {\n this.addManagedElementListeners(this.centerRowsCtrl.eViewport, {\n scroll: this.onHScroll.bind(this, VIEWPORT)\n });\n for (const source of HORIZONTAL_SOURCES) {\n const scrollPartner = this.ctrlsSvc.get(source);\n this.registerScrollPartner(scrollPartner, this.onHScroll.bind(this, source));\n }\n }\n addVerticalScrollListeners() {\n const isDebounce = this.gos.get(\"debounceVerticalScrollbar\");\n const onVScroll = isDebounce ? _debounce(this, this.onVScroll.bind(this, VIEWPORT), SCROLL_DEBOUNCE_TIMEOUT) : this.onVScroll.bind(this, VIEWPORT);\n const onFakeVScroll = isDebounce ? _debounce(this, this.onVScroll.bind(this, FAKE_V_SCROLLBAR), SCROLL_DEBOUNCE_TIMEOUT) : this.onVScroll.bind(this, FAKE_V_SCROLLBAR);\n this.addManagedElementListeners(this.eBodyViewport, { scroll: onVScroll });\n this.registerScrollPartner(this.fakeVScrollComp, onFakeVScroll);\n }\n registerScrollPartner(comp, callback) {\n comp.onScrollCallback(callback);\n }\n onDisplayedColumnsWidthChanged() {\n if (this.enableRtl) {\n this.horizontallyScrollHeaderCenterAndFloatingCenter();\n }\n }\n horizontallyScrollHeaderCenterAndFloatingCenter(scrollLeft) {\n const notYetInitialised = this.centerRowsCtrl == null;\n if (notYetInitialised) {\n return;\n }\n if (scrollLeft === void 0) {\n scrollLeft = this.centerRowsCtrl.getCenterViewportScrollLeft();\n }\n this.setScrollLeftForAllContainersExceptCurrent(Math.abs(scrollLeft));\n }\n setScrollLeftForAllContainersExceptCurrent(scrollLeft) {\n for (const container of [...HORIZONTAL_SOURCES, VIEWPORT]) {\n if (this.lastScrollSource[1 /* Horizontal */] === container) {\n continue;\n }\n const viewport = this.getViewportForSource(container);\n _setScrollLeft(viewport, scrollLeft, this.enableRtl);\n }\n }\n getViewportForSource(source) {\n if (source === VIEWPORT) {\n return this.centerRowsCtrl.eViewport;\n }\n return this.ctrlsSvc.get(source).eViewport;\n }\n isControllingScroll(source, direction) {\n if (this.lastScrollSource[direction] == null) {\n if (direction === 0 /* Vertical */) {\n this.lastScrollSource[0] = source;\n } else {\n this.lastScrollSource[1] = source;\n }\n return true;\n }\n return this.lastScrollSource[direction] === source;\n }\n onHScroll(source) {\n if (!this.isControllingScroll(source, 1 /* Horizontal */)) {\n return;\n }\n const centerContainerViewport = this.centerRowsCtrl.eViewport;\n const { scrollLeft } = centerContainerViewport;\n if (this.shouldBlockScrollUpdate(1 /* Horizontal */, scrollLeft, true)) {\n return;\n }\n const newScrollLeft = _getScrollLeft(this.getViewportForSource(source), this.enableRtl);\n this.doHorizontalScroll(newScrollLeft);\n this.resetLastHScrollDebounced();\n }\n onVScroll(source) {\n if (!this.isControllingScroll(source, 0 /* Vertical */)) {\n return;\n }\n const requestedScrollTop = source === VIEWPORT ? this.eBodyViewport.scrollTop : this.fakeVScrollComp.getScrollPosition();\n let scrollTop = requestedScrollTop;\n if (this.shouldBlockScrollUpdate(0 /* Vertical */, scrollTop, true)) {\n return;\n }\n if (source === VIEWPORT) {\n this.fakeVScrollComp.setScrollPosition(scrollTop);\n } else {\n this.eBodyViewport.scrollTop = requestedScrollTop;\n scrollTop = this.eBodyViewport.scrollTop;\n this.invalidateVerticalScroll();\n if (scrollTop !== requestedScrollTop) {\n this.fakeVScrollComp.setScrollPosition(scrollTop, true);\n }\n }\n const { animationFrameSvc } = this;\n animationFrameSvc?.setScrollTop(scrollTop);\n this.nextScrollTop = scrollTop;\n if (animationFrameSvc?.active) {\n animationFrameSvc.schedule();\n } else {\n this.scrollGridIfNeeded(true);\n }\n this.resetLastVScrollDebounced();\n }\n doHorizontalScroll(scrollLeft) {\n const fakeScrollLeft = this.fakeHScrollComp.getScrollPosition();\n if (this.scrollLeft === scrollLeft && scrollLeft === fakeScrollLeft) {\n return;\n }\n this.scrollLeft = scrollLeft;\n this.fireScrollEvent(1 /* Horizontal */);\n this.horizontallyScrollHeaderCenterAndFloatingCenter(scrollLeft);\n this.centerRowsCtrl.onHorizontalViewportChanged(true);\n }\n isScrolling() {\n return this.isScrollActive;\n }\n fireScrollEvent(direction) {\n const bodyScrollEvent = {\n type: \"bodyScroll\",\n direction: direction === 1 /* Horizontal */ ? \"horizontal\" : \"vertical\",\n left: this.scrollLeft,\n top: this.scrollTop\n };\n this.isScrollActive = true;\n this.eventSvc.dispatchEvent(bodyScrollEvent);\n window.clearTimeout(this.scrollTimer);\n this.scrollTimer = window.setTimeout(() => {\n this.scrollTimer = 0;\n this.isScrollActive = false;\n this.eventSvc.dispatchEvent({\n ...bodyScrollEvent,\n type: \"bodyScrollEnd\"\n });\n }, SCROLL_END_TIMEOUT);\n }\n shouldBlockScrollUpdate(direction, scrollTo, touchOnly = false) {\n if (touchOnly && !_isIOSUserAgent()) {\n return false;\n }\n if (direction === 0 /* Vertical */) {\n return this.shouldBlockVerticalScroll(scrollTo);\n }\n return this.shouldBlockHorizontalScroll(scrollTo);\n }\n shouldBlockVerticalScroll(scrollTo) {\n const clientHeight = _getInnerHeight(this.eBodyViewport);\n const { scrollHeight } = this.eBodyViewport;\n return !!(scrollTo < 0 || scrollTo + clientHeight > scrollHeight);\n }\n shouldBlockHorizontalScroll(scrollTo) {\n const clientWidth = this.centerRowsCtrl.getCenterWidth();\n const { scrollWidth } = this.centerRowsCtrl.eViewport;\n if (this.enableRtl) {\n if (scrollTo > 0) {\n return true;\n }\n } else if (scrollTo < 0) {\n return true;\n }\n return Math.abs(scrollTo) + clientWidth > scrollWidth;\n }\n redrawRowsAfterScroll() {\n this.fireScrollEvent(0 /* Vertical */);\n }\n // this is to cater for AG-3274, where grid is removed from the dom and then inserted back in again.\n // (which happens with some implementations of tabbing). this can result in horizontal scroll getting\n // reset back to the left, however no scroll event is fired. so we need to get header to also scroll\n // back to the left to be kept in sync.\n // adding and removing the grid from the DOM both resets the scroll position and\n // triggers a resize event, so notify listeners if the scroll position has changed\n checkScrollLeft() {\n const scrollLeft = this.scrollLeft;\n let hasHorizontalScrollersOutOfSync = false;\n for (const source of HORIZONTAL_SOURCES) {\n const viewport = this.getViewportForSource(source);\n if (viewport.scrollLeft !== scrollLeft) {\n hasHorizontalScrollersOutOfSync = true;\n break;\n }\n }\n if (hasHorizontalScrollersOutOfSync) {\n this.onHScroll(VIEWPORT);\n }\n }\n scrollGridIfNeeded(suppressedAnimationFrame = false) {\n const frameNeeded = this.scrollTop != this.nextScrollTop;\n if (frameNeeded) {\n this.scrollTop = this.nextScrollTop;\n if (suppressedAnimationFrame) {\n this.invalidateVerticalScroll();\n }\n this.redrawRowsAfterScroll();\n }\n return frameNeeded;\n }\n // called by scrollHorizontally method and alignedGridsService\n setHorizontalScrollPosition(hScrollPosition, fromAlignedGridsService = false) {\n const minScrollLeft = 0;\n const maxScrollLeft = this.centerRowsCtrl.eViewport.scrollWidth - this.centerRowsCtrl.getCenterWidth();\n if (!fromAlignedGridsService && this.shouldBlockScrollUpdate(1 /* Horizontal */, hScrollPosition)) {\n if (this.enableRtl) {\n hScrollPosition = hScrollPosition > 0 ? 0 : maxScrollLeft;\n } else {\n hScrollPosition = Math.min(Math.max(hScrollPosition, minScrollLeft), maxScrollLeft);\n }\n }\n _setScrollLeft(this.centerRowsCtrl.eViewport, Math.abs(hScrollPosition), this.enableRtl);\n this.doHorizontalScroll(hScrollPosition);\n }\n setVerticalScrollPosition(vScrollPosition) {\n this.invalidateVerticalScroll();\n this.eBodyViewport.scrollTop = vScrollPosition;\n }\n getVScrollPosition() {\n if (!this.isVerticalPositionInvalidated) {\n const { lastOffsetHeight, lastScrollTop } = this;\n return {\n top: lastScrollTop,\n bottom: lastScrollTop + lastOffsetHeight\n };\n }\n this.isVerticalPositionInvalidated = false;\n const { scrollTop, offsetHeight } = this.eBodyViewport;\n this.lastScrollTop = scrollTop;\n this.lastOffsetHeight = offsetHeight;\n return {\n top: scrollTop,\n bottom: scrollTop + offsetHeight\n };\n }\n /** Get an approximate scroll position that returns the last real value read.\n * This is useful for avoiding repeated DOM reads that force the browser to recalculate styles.\n * This can have big performance improvements but may not be 100% accurate so only use if this is acceptable.\n */\n getApproximateVScollPosition() {\n if (this.lastScrollTop >= 0 && this.lastOffsetHeight >= 0) {\n return {\n top: this.scrollTop,\n bottom: this.scrollTop + this.lastOffsetHeight\n };\n }\n return this.getVScrollPosition();\n }\n getHScrollPosition() {\n return this.centerRowsCtrl.getHScrollPosition();\n }\n isHorizontalScrollShowing() {\n if (this.isHorizontalPositionInvalidated) {\n this.lastIsHorizontalScrollShowing = this.centerRowsCtrl.isHorizontalScrollShowing();\n this.isHorizontalPositionInvalidated = false;\n }\n return this.lastIsHorizontalScrollShowing;\n }\n // called by the headerRootComp and moveColumnController\n scrollHorizontally(pixels) {\n const oldScrollPosition = this.centerRowsCtrl.eViewport.scrollLeft;\n this.setHorizontalScrollPosition(oldScrollPosition + pixels);\n return this.centerRowsCtrl.eViewport.scrollLeft - oldScrollPosition;\n }\n // gets called by rowRenderer when new data loaded, as it will want to scroll to the top\n scrollToTop() {\n this.setVerticalScrollPosition(0);\n }\n // Valid values for position are bottom, middle and top\n ensureNodeVisible(comparator, position = null) {\n const { rowModel } = this.beans;\n const rowCount = rowModel.getRowCount();\n let indexToSelect = -1;\n for (let i = 0; i < rowCount; i++) {\n const node = rowModel.getRow(i);\n if (typeof comparator === \"function\") {\n const predicate = comparator;\n if (node && predicate(node)) {\n indexToSelect = i;\n break;\n }\n } else if (comparator === node || comparator === node.data) {\n indexToSelect = i;\n break;\n }\n }\n if (indexToSelect >= 0) {\n this.ensureIndexVisible(indexToSelect, position);\n }\n }\n // Valid values for position are bottom, middle and top\n // position should be {'top','middle','bottom', or undefined/null}.\n // if undefined/null, then the grid will to the minimal amount of scrolling,\n // eg if grid needs to scroll up, it scrolls until row is on top,\n // if grid needs to scroll down, it scrolls until row is on bottom,\n // if row is already in view, grid does not scroll\n ensureIndexVisible(index, position, retry = 0) {\n if (_isDomLayout(this.gos, \"print\")) {\n return;\n }\n const { rowModel } = this.beans;\n const rowCount = rowModel.getRowCount();\n if (typeof index !== \"number\" || index < 0 || index >= rowCount) {\n _warn(88, { index });\n return;\n }\n this.clearRetryListeners();\n const { frameworkOverrides, pageBounds, rowContainerHeight: heightScaler, rowRenderer } = this.beans;\n frameworkOverrides.wrapIncoming(() => {\n const gridBodyCtrl = this.ctrlsSvc.getGridBodyCtrl();\n const rowNode = rowModel.getRow(index);\n let rowGotShiftedDuringOperation;\n let stickyHeightsChanged;\n let attempt = 0;\n this.invalidateVerticalScroll();\n do {\n const { stickyTopHeight, stickyBottomHeight } = gridBodyCtrl;\n const startingRowTop = rowNode.rowTop;\n const startingRowHeight = rowNode.rowHeight;\n const paginationOffset = pageBounds.getPixelOffset();\n const rowTopPixel = rowNode.rowTop - paginationOffset;\n const rowBottomPixel = rowTopPixel + rowNode.rowHeight;\n const scrollPosition = this.getVScrollPosition();\n const heightOffset = heightScaler.divStretchOffset;\n const vScrollTop = scrollPosition.top + heightOffset;\n const vScrollBottom = scrollPosition.bottom + heightOffset;\n const viewportHeight = vScrollBottom - vScrollTop;\n const pxTop = heightScaler.getScrollPositionForPixel(rowTopPixel);\n const pxBottom = heightScaler.getScrollPositionForPixel(rowBottomPixel - viewportHeight);\n const pxMiddle = Math.min((pxTop + pxBottom) / 2, rowTopPixel);\n const rowAboveViewport = vScrollTop + stickyTopHeight > rowTopPixel;\n const rowBelowViewport = vScrollBottom - stickyBottomHeight < rowBottomPixel;\n let newScrollPosition = null;\n if (position === \"top\") {\n newScrollPosition = pxTop - stickyTopHeight;\n } else if (position === \"bottom\") {\n newScrollPosition = pxBottom + stickyBottomHeight;\n } else if (position === \"middle\") {\n newScrollPosition = pxMiddle;\n } else if (rowAboveViewport) {\n newScrollPosition = pxTop - stickyTopHeight;\n } else if (rowBelowViewport) {\n if (pxBottom - pxTop > viewportHeight) {\n newScrollPosition = pxTop - stickyTopHeight;\n } else {\n newScrollPosition = pxBottom + stickyBottomHeight;\n }\n }\n if (newScrollPosition !== null) {\n this.setVerticalScrollPosition(newScrollPosition);\n rowRenderer.redraw({ afterScroll: true });\n }\n rowGotShiftedDuringOperation = startingRowTop !== rowNode.rowTop || startingRowHeight !== rowNode.rowHeight;\n stickyHeightsChanged = stickyTopHeight !== gridBodyCtrl.stickyTopHeight || stickyBottomHeight !== gridBodyCtrl.stickyBottomHeight;\n attempt++;\n } while ((rowGotShiftedDuringOperation || stickyHeightsChanged) && attempt < 10);\n this.animationFrameSvc?.flushAllFrames();\n if (retry < 10 && (rowNode?.stub || !this.beans.rowAutoHeight?.areRowsMeasured())) {\n const scrollTop = this.getVScrollPosition().top;\n this.clearRetryListenerFncs = this.addManagedEventListeners({\n bodyScroll: () => {\n const newScrollTop = this.getVScrollPosition().top;\n if (scrollTop === newScrollTop) {\n return;\n }\n this.clearRetryListeners();\n },\n modelUpdated: () => {\n this.clearRetryListeners();\n if (index >= rowModel.getRowCount()) {\n return;\n }\n this.ensureIndexVisible(index, position, retry + 1);\n }\n });\n }\n });\n }\n clearRetryListeners() {\n for (const callback of this.clearRetryListenerFncs) {\n callback();\n }\n this.clearRetryListenerFncs = [];\n }\n ensureColumnVisible(key, position = \"auto\") {\n const { colModel, frameworkOverrides } = this.beans;\n const column = colModel.getCol(key);\n if (!column) {\n return;\n }\n if (column.isPinned()) {\n return;\n }\n if (!this.visibleCols.isColDisplayed(column)) {\n return;\n }\n const newHorizontalScroll = this.getPositionedHorizontalScroll(column, position);\n frameworkOverrides.wrapIncoming(() => {\n if (newHorizontalScroll !== null) {\n this.centerRowsCtrl.setCenterViewportScrollLeft(newHorizontalScroll);\n }\n this.centerRowsCtrl.onHorizontalViewportChanged();\n this.animationFrameSvc?.flushAllFrames();\n });\n }\n getPositionedHorizontalScroll(column, position) {\n const { columnBeforeStart, columnAfterEnd } = this.isColumnOutsideViewport(column);\n const viewportTooSmallForColumn = this.centerRowsCtrl.getCenterWidth() < column.getActualWidth();\n const viewportWidth = this.centerRowsCtrl.getCenterWidth();\n const isRtl = this.enableRtl;\n let alignColToStart = (isRtl ? columnBeforeStart : columnAfterEnd) || viewportTooSmallForColumn;\n let alignColToEnd = isRtl ? columnAfterEnd : columnBeforeStart;\n if (position !== \"auto\") {\n alignColToStart = position === \"start\";\n alignColToEnd = position === \"end\";\n }\n const isMiddle = position === \"middle\";\n if (alignColToStart || alignColToEnd || isMiddle) {\n const { colLeft, colMiddle, colRight } = this.getColumnBounds(column);\n if (isMiddle) {\n return colMiddle - viewportWidth / 2;\n }\n if (alignColToStart) {\n return isRtl ? colRight : colLeft;\n }\n return isRtl ? colLeft - viewportWidth : colRight - viewportWidth;\n }\n return null;\n }\n isColumnOutsideViewport(column) {\n const { start: viewportStart, end: viewportEnd } = this.getViewportBounds();\n const { colLeft, colRight } = this.getColumnBounds(column);\n const isRtl = this.enableRtl;\n const columnBeforeStart = isRtl ? viewportStart > colRight : viewportEnd < colRight;\n const columnAfterEnd = isRtl ? viewportEnd < colLeft : viewportStart > colLeft;\n return { columnBeforeStart, columnAfterEnd };\n }\n getColumnBounds(column) {\n const isRtl = this.enableRtl;\n const bodyWidth = this.visibleCols.bodyWidth;\n const colWidth = column.getActualWidth();\n const colLeft = column.getLeft();\n const multiplier = isRtl ? -1 : 1;\n const colLeftPixel = isRtl ? bodyWidth - colLeft : colLeft;\n const colRightPixel = colLeftPixel + colWidth * multiplier;\n const colMidPixel = colLeftPixel + colWidth / 2 * multiplier;\n return { colLeft: colLeftPixel, colMiddle: colMidPixel, colRight: colRightPixel };\n }\n getViewportBounds() {\n const viewportWidth = this.centerRowsCtrl.getCenterWidth();\n const scrollPosition = this.centerRowsCtrl.getCenterViewportScrollLeft();\n const viewportStartPixel = scrollPosition;\n const viewportEndPixel = viewportWidth + scrollPosition;\n return { start: viewportStartPixel, end: viewportEndPixel, width: viewportWidth };\n }\n};\n\n// packages/ag-grid-community/src/gridBodyComp/scrollbarVisibilityHelper.ts\nvar AXES = {\n horizontal: {\n overflow: (el) => el.scrollWidth - el.clientWidth,\n scrollSize: (el) => el.scrollWidth,\n clientSize: (el) => el.clientWidth,\n opposite: \"vertical\"\n },\n vertical: {\n overflow: (el) => el.scrollHeight - el.clientHeight,\n scrollSize: (el) => el.scrollHeight,\n clientSize: (el) => el.clientHeight,\n opposite: \"horizontal\"\n }\n};\nfunction _shouldShowHorizontalScroll(horizontalElement, verticalScrollElement, scrollbarWidth = _getScrollbarWidth() || 0, primaryScrollbarElement, oppositeScrollbarElement) {\n return shouldShowScroll(\n horizontalElement,\n verticalScrollElement,\n \"horizontal\",\n scrollbarWidth,\n primaryScrollbarElement,\n oppositeScrollbarElement\n );\n}\nfunction _shouldShowVerticalScroll(verticalElement, horizontalScrollElement, scrollbarWidth = _getScrollbarWidth() || 0, primaryScrollbarElement, oppositeScrollbarElement) {\n return shouldShowScroll(\n verticalElement,\n horizontalScrollElement,\n \"vertical\",\n scrollbarWidth,\n primaryScrollbarElement,\n oppositeScrollbarElement\n );\n}\nfunction shouldShowScroll(primaryElement, oppositeElement, axis, scrollbarWidth, primaryScrollbarElement, oppositeScrollbarElement) {\n const primary = AXES[axis];\n const opposite = AXES[primary.opposite];\n const primaryScrollbarShowing = primaryScrollbarElement ? _isVisible(primaryScrollbarElement) : true;\n const oppositeScrollbarShowing = oppositeScrollbarElement ? _isVisible(oppositeScrollbarElement) : true;\n const primaryOverflow = primary.overflow(primaryElement);\n if (primaryOverflow <= 0) {\n return false;\n }\n if (!oppositeElement || scrollbarWidth === 0) {\n return true;\n }\n const oppositeOverflow = opposite.overflow(oppositeElement);\n if (oppositeOverflow <= 0) {\n return true;\n }\n if (primaryOverflow <= scrollbarWidth) {\n if (primaryScrollbarShowing && oppositeScrollbarShowing && isScrollbarCausedByOppositeAxis({\n candidateOverflow: oppositeOverflow,\n candidateScrollSize: opposite.scrollSize(oppositeElement),\n candidateClientSize: opposite.clientSize(oppositeElement),\n scrollbarWidth\n })) {\n return false;\n }\n const sizeWithoutOppositeScrollbar = primary.clientSize(primaryElement) + scrollbarWidth;\n return primary.scrollSize(primaryElement) <= sizeWithoutOppositeScrollbar;\n }\n return true;\n}\nfunction isScrollbarCausedByOppositeAxis({\n candidateOverflow,\n candidateScrollSize,\n candidateClientSize,\n scrollbarWidth\n}) {\n if (candidateOverflow <= 0 || candidateOverflow > scrollbarWidth) {\n return false;\n }\n const sizeWithoutOppositeScrollbar = candidateClientSize + scrollbarWidth;\n return candidateScrollSize > candidateClientSize && candidateScrollSize <= sizeWithoutOppositeScrollbar;\n}\n\n// packages/ag-grid-community/src/gridBodyComp/viewportSizeFeature.ts\nvar ViewportSizeFeature = class extends BeanStub {\n constructor(centerContainerCtrl) {\n super();\n this.centerContainerCtrl = centerContainerCtrl;\n }\n wireBeans(beans) {\n this.scrollVisibleSvc = beans.scrollVisibleSvc;\n }\n postConstruct() {\n this.beans.ctrlsSvc.whenReady(this, (p) => {\n this.gridBodyCtrl = p.gridBodyCtrl;\n this.listenForResize();\n });\n this.addManagedEventListeners({ scrollbarWidthChanged: this.onScrollbarWidthChanged.bind(this) });\n this.addManagedPropertyListeners([\"alwaysShowHorizontalScroll\", \"alwaysShowVerticalScroll\"], () => {\n this.checkViewportAndScrolls();\n });\n }\n listenForResize() {\n const { beans, centerContainerCtrl, gridBodyCtrl } = this;\n const listener = () => {\n _requestAnimationFrame(beans, () => {\n this.onCenterViewportResized();\n });\n };\n centerContainerCtrl.registerViewportResizeListener(listener);\n gridBodyCtrl.registerBodyViewportResizeListener(listener);\n }\n onScrollbarWidthChanged() {\n this.checkViewportAndScrolls();\n }\n onCenterViewportResized() {\n this.scrollVisibleSvc.updateScrollGap();\n if (this.centerContainerCtrl.isViewportInTheDOMTree()) {\n const { pinnedCols, colFlex } = this.beans;\n pinnedCols?.keepPinnedColumnsNarrowerThanViewport();\n this.checkViewportAndScrolls();\n const newWidth = this.centerContainerCtrl.getCenterWidth();\n if (newWidth !== this.centerWidth) {\n this.centerWidth = newWidth;\n colFlex?.refreshFlexedColumns({\n viewportWidth: this.centerWidth,\n updateBodyWidths: true,\n fireResizedEvent: true\n });\n }\n } else {\n this.bodyHeight = 0;\n }\n }\n // gets called every time the viewport size changes. we use this to check visibility of scrollbars\n // in the grid panel, and also to check size and position of viewport for row and column virtualisation.\n checkViewportAndScrolls() {\n this.updateScrollVisibleService();\n this.checkBodyHeight();\n this.onHorizontalViewportChanged();\n this.gridBodyCtrl.scrollFeature.checkScrollLeft();\n }\n getBodyHeight() {\n return this.bodyHeight;\n }\n checkBodyHeight() {\n const eBodyViewport = this.gridBodyCtrl.eBodyViewport;\n const bodyHeight = _getInnerHeight(eBodyViewport);\n if (this.bodyHeight !== bodyHeight) {\n this.bodyHeight = bodyHeight;\n this.eventSvc.dispatchEvent({\n type: \"bodyHeightChanged\"\n });\n }\n }\n updateScrollVisibleService() {\n this.updateScrollVisibleServiceImpl();\n setTimeout(this.updateScrollVisibleServiceImpl.bind(this), 500);\n }\n updateScrollVisibleServiceImpl() {\n if (!this.isAlive()) {\n return;\n }\n const params = {\n horizontalScrollShowing: this.centerContainerCtrl.isHorizontalScrollShowing(),\n verticalScrollShowing: this.gridBodyCtrl.isVerticalScrollShowing()\n };\n this.scrollVisibleSvc.setScrollsVisible(params);\n }\n // this gets called whenever a change in the viewport, so we can inform column controller it has to work\n // out the virtual columns again. gets called from following locations:\n // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged\n onHorizontalViewportChanged() {\n const { centerContainerCtrl, beans } = this;\n const scrollWidth = centerContainerCtrl.getCenterWidth();\n const scrollPosition = centerContainerCtrl.getViewportScrollLeft();\n beans.colViewport.setScrollPosition(scrollWidth, scrollPosition);\n }\n};\n\n// packages/ag-grid-community/src/agStack/utils/keyboard.ts\nfunction _isEventFromPrintableCharacter(event) {\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return false;\n }\n const printableCharacter = event.key?.length === 1;\n return printableCharacter;\n}\n\n// packages/ag-grid-community/src/rendering/renderUtils.ts\nfunction _suppressCellMouseEvent(gos, column, node, event) {\n const suppressMouseEventHandling = column.getColDef().cellRendererParams?.suppressMouseEventHandling;\n return suppressMouseEvent(gos, column, node, event, suppressMouseEventHandling);\n}\nfunction _suppressFullWidthMouseEvent(gos, cellRendererParams, node, event) {\n const suppressMouseEventHandling = cellRendererParams?.suppressMouseEventHandling;\n return suppressMouseEvent(gos, void 0, node, event, suppressMouseEventHandling);\n}\nfunction suppressMouseEvent(gos, column, node, event, suppressMouseEventHandling) {\n if (!suppressMouseEventHandling) {\n return false;\n }\n return suppressMouseEventHandling(\n _addGridCommonParams(gos, {\n column,\n node,\n event\n })\n );\n}\nfunction _getCtrlForEventTarget(gos, eventTarget, type) {\n let sourceElement = eventTarget;\n while (sourceElement) {\n const renderedComp = _getDomData(gos, sourceElement, type);\n if (renderedComp) {\n return renderedComp;\n }\n sourceElement = sourceElement.parentElement;\n }\n return null;\n}\nvar DOM_DATA_KEY_CELL_CTRL = \"cellCtrl\";\nfunction _getCellCtrlForEventTarget(gos, eventTarget) {\n return _getCtrlForEventTarget(gos, eventTarget, DOM_DATA_KEY_CELL_CTRL);\n}\nvar DOM_DATA_KEY_ROW_CTRL = \"renderedRow\";\nfunction _getRowCtrlForEventTarget(gos, eventTarget) {\n return _getCtrlForEventTarget(gos, eventTarget, DOM_DATA_KEY_ROW_CTRL);\n}\n\n// packages/ag-grid-community/src/utils/keyboardEvent.ts\nfunction _isUserSuppressingKeyboardEvent(gos, keyboardEvent, rowNode, column, editing) {\n const colDefFunc = column ? column.getColDef().suppressKeyboardEvent : void 0;\n if (!colDefFunc) {\n return false;\n }\n const params = _addGridCommonParams(gos, {\n event: keyboardEvent,\n editing,\n column,\n node: rowNode,\n data: rowNode.data,\n colDef: column.getColDef()\n });\n if (colDefFunc) {\n const colDefFuncResult = colDefFunc(params);\n if (colDefFuncResult) {\n return true;\n }\n }\n return false;\n}\n\n// packages/ag-grid-community/src/utils/selection.ts\nfunction _selectAllCells(beans) {\n const { pinnedRowModel, rowModel, rangeSvc, visibleCols } = beans;\n if (!rangeSvc || visibleCols.allCols.length === 0) {\n return;\n }\n const isEmptyPinnedTop = pinnedRowModel?.isEmpty(\"top\") ?? true;\n const isEmptyPinnedBottom = pinnedRowModel?.isEmpty(\"bottom\") ?? true;\n const floatingStart = isEmptyPinnedTop ? null : \"top\";\n let floatingEnd;\n let rowEnd;\n if (isEmptyPinnedBottom) {\n floatingEnd = null;\n rowEnd = rowModel.getRowCount() - 1;\n } else {\n floatingEnd = \"bottom\";\n rowEnd = pinnedRowModel?.getPinnedBottomRowCount() ?? 0 - 1;\n }\n rangeSvc.setCellRange({\n rowStartIndex: 0,\n rowStartPinned: floatingStart,\n rowEndIndex: rowEnd,\n rowEndPinned: floatingEnd\n });\n}\n\n// packages/ag-grid-community/src/gridBodyComp/rowContainer/rowContainerEventsFeature.ts\nvar RowContainerEventsFeature = class extends BeanStub {\n constructor(element) {\n super();\n this.element = element;\n }\n postConstruct() {\n this.addKeyboardListeners();\n this.addMouseListeners();\n this.beans.touchSvc?.mockRowContextMenu(this);\n this.editSvc = this.beans.editSvc;\n }\n addKeyboardListeners() {\n const eventName = \"keydown\";\n const listener = this.processKeyboardEvent.bind(this, eventName);\n this.addManagedElementListeners(this.element, { [eventName]: listener });\n }\n addMouseListeners() {\n let mouseDownEvent = \"mousedown\";\n if (_isEventSupported(\"pointerdown\")) {\n mouseDownEvent = \"pointerdown\";\n } else if (_isEventSupported(\"touchstart\")) {\n mouseDownEvent = \"touchstart\";\n }\n const eventNames = [\"dblclick\", \"contextmenu\", \"mouseover\", \"mouseout\", \"click\", mouseDownEvent];\n for (const eventName of eventNames) {\n const listener = this.processMouseEvent.bind(this, eventName);\n this.addManagedElementListeners(this.element, { [eventName]: listener });\n }\n }\n processMouseEvent(eventName, mouseEvent) {\n if (!_isEventFromThisInstance(this.beans, mouseEvent) || _isStopPropagationForAgGrid(mouseEvent)) {\n return;\n }\n const { cellCtrl, rowCtrl } = this.getControlsForEventTarget(mouseEvent.target);\n if (eventName === \"contextmenu\") {\n if (cellCtrl?.column) {\n cellCtrl.dispatchCellContextMenuEvent(mouseEvent);\n }\n this.beans.contextMenuSvc?.handleContextMenuMouseEvent(mouseEvent, void 0, rowCtrl, cellCtrl);\n } else {\n if (cellCtrl) {\n cellCtrl.onMouseEvent(eventName, mouseEvent);\n }\n if (rowCtrl) {\n rowCtrl.onMouseEvent(eventName, mouseEvent);\n }\n }\n }\n getControlsForEventTarget(target) {\n const { gos } = this;\n return {\n cellCtrl: _getCellCtrlForEventTarget(gos, target),\n rowCtrl: _getRowCtrlForEventTarget(gos, target)\n };\n }\n processKeyboardEvent(eventName, keyboardEvent) {\n const { cellCtrl, rowCtrl } = this.getControlsForEventTarget(keyboardEvent.target);\n if (keyboardEvent.defaultPrevented) {\n return;\n }\n if (cellCtrl) {\n this.processCellKeyboardEvent(cellCtrl, eventName, keyboardEvent);\n } else if (rowCtrl?.isFullWidth()) {\n this.processFullWidthRowKeyboardEvent(rowCtrl, eventName, keyboardEvent);\n }\n }\n processCellKeyboardEvent(cellCtrl, eventName, keyboardEvent) {\n const editing = this.editSvc?.isEditing(cellCtrl, { withOpenEditor: true }) ?? false;\n const gridProcessingAllowed = !_isUserSuppressingKeyboardEvent(\n this.gos,\n keyboardEvent,\n cellCtrl.rowNode,\n cellCtrl.column,\n editing\n );\n if (gridProcessingAllowed) {\n if (eventName === \"keydown\") {\n const wasScrollKey = !editing && this.beans.navigation?.handlePageScrollingKey(keyboardEvent);\n if (!wasScrollKey) {\n cellCtrl.onKeyDown(keyboardEvent);\n }\n this.doGridOperations(keyboardEvent, editing);\n if (_isEventFromPrintableCharacter(keyboardEvent)) {\n cellCtrl.processCharacter(keyboardEvent);\n }\n }\n }\n if (eventName === \"keydown\") {\n this.eventSvc.dispatchEvent(cellCtrl.createEvent(keyboardEvent, \"cellKeyDown\"));\n }\n }\n processFullWidthRowKeyboardEvent(rowCtrl, eventName, keyboardEvent) {\n const { rowNode } = rowCtrl;\n const { focusSvc, navigation } = this.beans;\n const focusedCell = focusSvc.getFocusedCell();\n const column = focusedCell?.column;\n const gridProcessingAllowed = !_isUserSuppressingKeyboardEvent(this.gos, keyboardEvent, rowNode, column, false);\n if (gridProcessingAllowed) {\n const key = keyboardEvent.key;\n if (eventName === \"keydown\") {\n switch (key) {\n case KeyCode.PAGE_HOME:\n case KeyCode.PAGE_END:\n case KeyCode.PAGE_UP:\n case KeyCode.PAGE_DOWN:\n navigation?.handlePageScrollingKey(keyboardEvent, true);\n break;\n case KeyCode.LEFT:\n case KeyCode.RIGHT:\n if (!this.gos.get(\"embedFullWidthRows\")) {\n break;\n }\n case KeyCode.UP:\n case KeyCode.DOWN:\n rowCtrl.onKeyboardNavigate(keyboardEvent);\n break;\n case KeyCode.TAB:\n rowCtrl.onTabKeyDown(keyboardEvent);\n break;\n default:\n }\n }\n }\n if (eventName === \"keydown\") {\n this.eventSvc.dispatchEvent(rowCtrl.createRowEvent(\"cellKeyDown\", keyboardEvent));\n }\n }\n doGridOperations(keyboardEvent, editing) {\n if (!keyboardEvent.ctrlKey && !keyboardEvent.metaKey) {\n return;\n }\n if (editing) {\n return;\n }\n if (!_isEventFromThisInstance(this.beans, keyboardEvent)) {\n return;\n }\n const keyCode = _normaliseQwertyAzerty(keyboardEvent);\n const { clipboardSvc, undoRedo } = this.beans;\n if (keyCode === KeyCode.A) {\n return this.onCtrlAndA(keyboardEvent);\n }\n if (keyCode === KeyCode.C) {\n return this.onCtrlAndC(clipboardSvc, keyboardEvent);\n }\n if (keyCode === KeyCode.D) {\n return this.onCtrlAndD(clipboardSvc, keyboardEvent);\n }\n if (keyCode === KeyCode.V) {\n return this.onCtrlAndV(clipboardSvc, keyboardEvent);\n }\n if (keyCode === KeyCode.X) {\n return this.onCtrlAndX(clipboardSvc, keyboardEvent);\n }\n if (keyCode === KeyCode.Y) {\n return this.onCtrlAndY(undoRedo);\n }\n if (keyCode === KeyCode.Z) {\n return this.onCtrlAndZ(undoRedo, keyboardEvent);\n }\n }\n onCtrlAndA(event) {\n const {\n beans: { rowModel, rangeSvc, selectionSvc },\n gos\n } = this;\n if (rangeSvc && _isCellSelectionEnabled(gos) && !_getCtrlASelectsRows(gos) && rowModel.isRowsToRender()) {\n _selectAllCells(this.beans);\n } else if (selectionSvc) {\n selectionSvc.selectAllRowNodes({ source: \"keyboardSelectAll\", selectAll: _getSelectAll(gos) });\n }\n event.preventDefault();\n }\n onCtrlAndC(clipboardSvc, event) {\n if (!clipboardSvc || this.gos.get(\"enableCellTextSelection\")) {\n return;\n }\n const { cellCtrl } = this.getControlsForEventTarget(event.target);\n if (this.editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {\n return;\n }\n event.preventDefault();\n clipboardSvc.copyToClipboard();\n }\n onCtrlAndX(clipboardSvc, event) {\n if (!clipboardSvc || this.gos.get(\"enableCellTextSelection\") || this.gos.get(\"suppressCutToClipboard\")) {\n return;\n }\n const { cellCtrl } = this.getControlsForEventTarget(event.target);\n if (this.editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {\n return;\n }\n event.preventDefault();\n clipboardSvc.cutToClipboard(void 0, \"ui\");\n }\n onCtrlAndV(clipboardSvc, event) {\n const { cellCtrl } = this.getControlsForEventTarget(event.target);\n if (this.editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {\n return;\n }\n if (clipboardSvc && !this.gos.get(\"suppressClipboardPaste\")) {\n clipboardSvc.pasteFromClipboard();\n }\n }\n onCtrlAndD(clipboardSvc, event) {\n if (clipboardSvc && !this.gos.get(\"suppressClipboardPaste\")) {\n clipboardSvc.copyRangeDown();\n }\n event.preventDefault();\n }\n onCtrlAndZ(undoRedo, event) {\n if (!this.gos.get(\"undoRedoCellEditing\") || !undoRedo) {\n return;\n }\n event.preventDefault();\n if (event.shiftKey) {\n undoRedo.redo(\"ui\");\n } else {\n undoRedo.undo(\"ui\");\n }\n }\n onCtrlAndY(undoRedo) {\n undoRedo?.redo(\"ui\");\n }\n};\n\n// packages/ag-grid-community/src/gridBodyComp/rowContainer/rowContainerCtrl.ts\nvar getTopRowCtrls = (r) => r.topRowCtrls;\nvar getStickyTopRowCtrls = (r) => r.getStickyTopRowCtrls();\nvar getStickyBottomRowCtrls = (r) => r.getStickyBottomRowCtrls();\nvar getBottomRowCtrls = (r) => r.bottomRowCtrls;\nvar getCentreRowCtrls = (r) => r.allRowCtrls;\nvar getSpannedTopRowCtrls = (r) => r.getCtrls(\"top\");\nvar getSpannedCenterRowCtrls = (r) => r.getCtrls(\"center\");\nvar getSpannedBottomRowCtrls = (r) => r.getCtrls(\"bottom\");\nvar ContainerCssClasses = {\n center: {\n type: \"center\",\n name: \"center-cols\",\n getRowCtrls: getCentreRowCtrls,\n getSpannedRowCtrls: getSpannedCenterRowCtrls\n },\n left: {\n type: \"left\",\n name: \"pinned-left-cols\",\n pinnedType: \"left\",\n getRowCtrls: getCentreRowCtrls,\n getSpannedRowCtrls: getSpannedCenterRowCtrls\n },\n right: {\n type: \"right\",\n name: \"pinned-right-cols\",\n pinnedType: \"right\",\n getRowCtrls: getCentreRowCtrls,\n getSpannedRowCtrls: getSpannedCenterRowCtrls\n },\n fullWidth: {\n type: \"fullWidth\",\n name: \"full-width\",\n fullWidth: true,\n getRowCtrls: getCentreRowCtrls\n },\n topCenter: {\n type: \"center\",\n name: \"floating-top\",\n getRowCtrls: getTopRowCtrls,\n getSpannedRowCtrls: getSpannedTopRowCtrls\n },\n topLeft: {\n type: \"left\",\n name: \"pinned-left-floating\",\n container: \"ag-pinned-left-floating-top\",\n pinnedType: \"left\",\n getRowCtrls: getTopRowCtrls,\n getSpannedRowCtrls: getSpannedTopRowCtrls\n },\n topRight: {\n type: \"right\",\n name: \"pinned-right-floating\",\n container: \"ag-pinned-right-floating-top\",\n pinnedType: \"right\",\n getRowCtrls: getTopRowCtrls,\n getSpannedRowCtrls: getSpannedTopRowCtrls\n },\n topFullWidth: {\n type: \"fullWidth\",\n name: \"floating-top-full-width\",\n fullWidth: true,\n getRowCtrls: getTopRowCtrls\n },\n stickyTopCenter: {\n type: \"center\",\n name: \"sticky-top\",\n getRowCtrls: getStickyTopRowCtrls\n },\n stickyTopLeft: {\n type: \"left\",\n name: \"pinned-left-sticky-top\",\n container: \"ag-pinned-left-sticky-top\",\n pinnedType: \"left\",\n getRowCtrls: getStickyTopRowCtrls\n },\n stickyTopRight: {\n type: \"right\",\n name: \"pinned-right-sticky-top\",\n container: \"ag-pinned-right-sticky-top\",\n pinnedType: \"right\",\n getRowCtrls: getStickyTopRowCtrls\n },\n stickyTopFullWidth: {\n type: \"fullWidth\",\n name: \"sticky-top-full-width\",\n fullWidth: true,\n getRowCtrls: getStickyTopRowCtrls\n },\n stickyBottomCenter: {\n type: \"center\",\n name: \"sticky-bottom\",\n getRowCtrls: getStickyBottomRowCtrls\n },\n stickyBottomLeft: {\n type: \"left\",\n name: \"pinned-left-sticky-bottom\",\n container: \"ag-pinned-left-sticky-bottom\",\n pinnedType: \"left\",\n getRowCtrls: getStickyBottomRowCtrls\n },\n stickyBottomRight: {\n type: \"right\",\n name: \"pinned-right-sticky-bottom\",\n container: \"ag-pinned-right-sticky-bottom\",\n pinnedType: \"right\",\n getRowCtrls: getStickyBottomRowCtrls\n },\n stickyBottomFullWidth: {\n type: \"fullWidth\",\n name: \"sticky-bottom-full-width\",\n fullWidth: true,\n getRowCtrls: getStickyBottomRowCtrls\n },\n bottomCenter: {\n type: \"center\",\n name: \"floating-bottom\",\n getRowCtrls: getBottomRowCtrls,\n getSpannedRowCtrls: getSpannedBottomRowCtrls\n },\n bottomLeft: {\n type: \"left\",\n name: \"pinned-left-floating-bottom\",\n container: \"ag-pinned-left-floating-bottom\",\n pinnedType: \"left\",\n getRowCtrls: getBottomRowCtrls,\n getSpannedRowCtrls: getSpannedBottomRowCtrls\n },\n bottomRight: {\n type: \"right\",\n name: \"pinned-right-floating-bottom\",\n container: \"ag-pinned-right-floating-bottom\",\n pinnedType: \"right\",\n getRowCtrls: getBottomRowCtrls,\n getSpannedRowCtrls: getSpannedBottomRowCtrls\n },\n bottomFullWidth: {\n type: \"fullWidth\",\n name: \"floating-bottom-full-width\",\n fullWidth: true,\n getRowCtrls: getBottomRowCtrls\n }\n};\nfunction _getRowViewportClass(name) {\n const options = _getRowContainerOptions(name);\n return `ag-${options.name}-viewport`;\n}\nfunction _getRowContainerClass(name) {\n const options = _getRowContainerOptions(name);\n return options.container ?? `ag-${options.name}-container`;\n}\nfunction _getRowSpanContainerClass(name) {\n const options = _getRowContainerOptions(name);\n return `ag-${options.name}-spanned-cells-container`;\n}\nfunction _getRowContainerOptions(name) {\n return ContainerCssClasses[name];\n}\nvar allTopNoFW = [\"topCenter\", \"topLeft\", \"topRight\"];\nvar allBottomNoFW = [\"bottomCenter\", \"bottomLeft\", \"bottomRight\"];\nvar allMiddleNoFW = [\"center\", \"left\", \"right\"];\nvar allMiddle = [\"center\", \"left\", \"right\", \"fullWidth\"];\nvar allCenter = [\"stickyTopCenter\", \"stickyBottomCenter\", \"center\", \"topCenter\", \"bottomCenter\"];\nvar allLeft = [\"left\", \"bottomLeft\", \"topLeft\", \"stickyTopLeft\", \"stickyBottomLeft\"];\nvar allRight = [\"right\", \"bottomRight\", \"topRight\", \"stickyTopRight\", \"stickyBottomRight\"];\nvar allStickyTopNoFW = [\"stickyTopCenter\", \"stickyTopLeft\", \"stickyTopRight\"];\nvar allStickyBottomNoFW = [\"stickyBottomCenter\", \"stickyBottomLeft\", \"stickyBottomRight\"];\nvar allStickyContainers = [\n ...allStickyTopNoFW,\n \"stickyTopFullWidth\",\n ...allStickyBottomNoFW,\n \"stickyBottomFullWidth\"\n];\nvar allNoFW = [\n ...allTopNoFW,\n ...allBottomNoFW,\n ...allMiddleNoFW,\n ...allStickyTopNoFW,\n ...allStickyBottomNoFW\n];\nvar RowContainerCtrl = class extends BeanStub {\n constructor(name) {\n super();\n this.name = name;\n this.visible = true;\n // Maintaining a constant reference enables optimization in React.\n this.EMPTY_CTRLS = [];\n this.options = _getRowContainerOptions(name);\n }\n postConstruct() {\n this.enableRtl = this.gos.get(\"enableRtl\");\n this.forContainers([\"center\"], () => {\n this.viewportSizeFeature = this.createManagedBean(new ViewportSizeFeature(this));\n this.addManagedEventListeners({\n stickyTopOffsetChanged: this.onStickyTopOffsetChanged.bind(this)\n });\n });\n }\n onStickyTopOffsetChanged(event) {\n this.comp.setOffsetTop(`${event.offset}px`);\n }\n registerWithCtrlsService() {\n if (this.options.fullWidth) {\n return;\n }\n this.beans.ctrlsSvc.register(this.name, this);\n }\n forContainers(names, callback) {\n if (names.indexOf(this.name) >= 0) {\n callback();\n }\n }\n setComp(view, eContainer, eSpannedContainer, eViewport) {\n this.comp = view;\n this.eContainer = eContainer;\n this.eSpannedContainer = eSpannedContainer;\n this.eViewport = eViewport;\n this.createManagedBean(new RowContainerEventsFeature(this.eViewport ?? this.eContainer));\n this.addPreventScrollWhileDragging();\n this.listenOnDomOrder();\n const { pinnedCols, rangeSvc } = this.beans;\n const pinnedWidthChanged = () => this.onPinnedWidthChanged();\n this.forContainers(allLeft, () => {\n this.pinnedWidthFeature = this.createOptionalManagedBean(\n pinnedCols?.createPinnedWidthFeature(true, this.eContainer, this.eSpannedContainer)\n );\n this.addManagedEventListeners({ leftPinnedWidthChanged: pinnedWidthChanged });\n });\n this.forContainers(allRight, () => {\n this.pinnedWidthFeature = this.createOptionalManagedBean(\n pinnedCols?.createPinnedWidthFeature(false, this.eContainer, this.eSpannedContainer)\n );\n this.addManagedEventListeners({ rightPinnedWidthChanged: pinnedWidthChanged });\n });\n this.forContainers(\n allMiddle,\n () => this.createManagedBean(\n new SetHeightFeature(this.eContainer, this.name === \"center\" ? eViewport : void 0)\n )\n );\n if (rangeSvc) {\n this.forContainers(\n allNoFW,\n () => this.createManagedBean(rangeSvc.createDragListenerFeature(this.eContainer))\n );\n }\n this.forContainers(\n allCenter,\n () => this.createManagedBean(new CenterWidthFeature((width) => this.comp.setContainerWidth(`${width}px`)))\n );\n this.visible = this.isContainerVisible();\n this.addListeners();\n this.registerWithCtrlsService();\n }\n onScrollCallback(fn) {\n this.addManagedElementListeners(this.eViewport, { scroll: fn });\n }\n addListeners() {\n const { spannedRowRenderer, gos } = this.beans;\n const onDisplayedColumnsChanged = this.onDisplayedColumnsChanged.bind(this);\n this.addManagedEventListeners({\n displayedColumnsChanged: onDisplayedColumnsChanged,\n displayedColumnsWidthChanged: onDisplayedColumnsChanged,\n displayedRowsChanged: (params) => this.onDisplayedRowsChanged(params.afterScroll)\n });\n onDisplayedColumnsChanged();\n this.onDisplayedRowsChanged();\n if (spannedRowRenderer && this.options.getSpannedRowCtrls && gos.get(\"enableCellSpan\")) {\n this.addManagedListeners(spannedRowRenderer, {\n spannedRowsUpdated: () => {\n const spannedCtrls = this.options.getSpannedRowCtrls(spannedRowRenderer);\n if (!spannedCtrls) {\n return;\n }\n this.comp.setSpannedRowCtrls(spannedCtrls, false);\n }\n });\n }\n }\n listenOnDomOrder() {\n const isStickContainer = allStickyContainers.indexOf(this.name) >= 0;\n if (isStickContainer) {\n this.comp.setDomOrder(true);\n return;\n }\n const listener = () => {\n const isEnsureDomOrder = this.gos.get(\"ensureDomOrder\");\n const isPrintLayout = _isDomLayout(this.gos, \"print\");\n this.comp.setDomOrder(isEnsureDomOrder || isPrintLayout);\n };\n this.addManagedPropertyListener(\"domLayout\", listener);\n listener();\n }\n onDisplayedColumnsChanged() {\n this.forContainers([\"center\"], () => this.onHorizontalViewportChanged());\n }\n // this methods prevents the grid views from being scrolled while the dragService is being used\n // eg. the view should not scroll up and down while dragging rows using the rowDragComp.\n addPreventScrollWhileDragging() {\n const { dragSvc } = this.beans;\n if (!dragSvc) {\n return;\n }\n const preventScroll = (e) => {\n if (dragSvc.dragging) {\n if (e.cancelable) {\n e.preventDefault();\n }\n }\n };\n this.eContainer.addEventListener(\"touchmove\", preventScroll, { passive: false });\n this.addDestroyFunc(() => this.eContainer.removeEventListener(\"touchmove\", preventScroll));\n }\n // this gets called whenever a change in the viewport, so we can inform column controller it has to work\n // out the virtual columns again. gets called from following locations:\n // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged\n onHorizontalViewportChanged(afterScroll = false) {\n const scrollWidth = this.getCenterWidth();\n const scrollPosition = this.getCenterViewportScrollLeft();\n this.beans.colViewport.setScrollPosition(scrollWidth, scrollPosition, afterScroll);\n }\n hasHorizontalScrollGap() {\n return this.eContainer.clientWidth - this.eViewport.clientWidth < 0;\n }\n hasVerticalScrollGap() {\n return this.eContainer.clientHeight - this.eViewport.clientHeight < 0;\n }\n getCenterWidth() {\n return _getInnerWidth(this.eViewport);\n }\n getCenterViewportScrollLeft() {\n return _getScrollLeft(this.eViewport, this.enableRtl);\n }\n registerViewportResizeListener(listener) {\n const unsubscribeFromResize = _observeResize(this.beans, this.eViewport, listener);\n this.addDestroyFunc(() => unsubscribeFromResize());\n }\n isViewportInTheDOMTree() {\n return _isInDOM(this.eViewport);\n }\n getViewportScrollLeft() {\n return _getScrollLeft(this.eViewport, this.enableRtl);\n }\n isHorizontalScrollShowing() {\n const { beans, gos, eViewport } = this;\n const isAlwaysShowHorizontalScroll = gos.get(\"alwaysShowHorizontalScroll\");\n const { ctrlsSvc } = beans;\n const verticalScrollElement = ctrlsSvc.getGridBodyCtrl()?.eBodyViewport;\n const hScrollEl = ctrlsSvc.get(\"fakeHScrollComp\")?.getGui();\n const vScrollEl = ctrlsSvc.get(\"fakeVScrollComp\")?.getGui();\n return isAlwaysShowHorizontalScroll || _shouldShowHorizontalScroll(eViewport, verticalScrollElement, void 0, hScrollEl, vScrollEl);\n }\n setHorizontalScroll(offset) {\n this.comp.setHorizontalScroll(offset);\n }\n getHScrollPosition() {\n const res = {\n left: this.eViewport.scrollLeft,\n right: this.eViewport.scrollLeft + this.eViewport.offsetWidth\n };\n return res;\n }\n setCenterViewportScrollLeft(value) {\n _setScrollLeft(this.eViewport, value, this.enableRtl);\n }\n isContainerVisible() {\n const pinned = this.options.pinnedType != null;\n return !pinned || !!this.pinnedWidthFeature && this.pinnedWidthFeature.getWidth() > 0;\n }\n onPinnedWidthChanged() {\n const visible = this.isContainerVisible();\n if (this.visible != visible) {\n this.visible = visible;\n this.onDisplayedRowsChanged();\n }\n }\n onDisplayedRowsChanged(afterScroll = false) {\n const rows = this.options.getRowCtrls(this.beans.rowRenderer);\n if (!this.visible || rows.length === 0) {\n this.comp.setRowCtrls({ rowCtrls: this.EMPTY_CTRLS });\n return;\n }\n const printLayout = _isDomLayout(this.gos, \"print\");\n const embedFullWidthRows = this.gos.get(\"embedFullWidthRows\");\n const embedFW = embedFullWidthRows || printLayout;\n const rowsThisContainer = rows.filter((rowCtrl) => {\n const fullWidthRow = rowCtrl.isFullWidth();\n const match = this.options.fullWidth ? !embedFW && fullWidthRow : embedFW || !fullWidthRow;\n return match;\n });\n this.comp.setRowCtrls({ rowCtrls: rowsThisContainer, useFlushSync: afterScroll });\n }\n};\n\n// packages/ag-grid-community/src/gridBodyComp/gridBodyCtrl.ts\nvar CSS_CLASS_FORCE_VERTICAL_SCROLL = \"ag-force-vertical-scroll\";\nvar CSS_CLASS_CELL_SELECTABLE = \"ag-selectable\";\nvar CSS_CLASS_COLUMN_MOVING = \"ag-column-moving\";\nvar GridBodyCtrl = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.stickyTopHeight = 0;\n this.stickyBottomHeight = 0;\n }\n wireBeans(beans) {\n this.ctrlsSvc = beans.ctrlsSvc;\n this.colModel = beans.colModel;\n this.scrollVisibleSvc = beans.scrollVisibleSvc;\n this.pinnedRowModel = beans.pinnedRowModel;\n this.filterManager = beans.filterManager;\n this.rowGroupColsSvc = beans.rowGroupColsSvc;\n }\n setComp(comp, eGridBody, eBodyViewport, eTop, eBottom, eStickyTop, eStickyBottom) {\n this.comp = comp;\n this.eGridBody = eGridBody;\n this.eBodyViewport = eBodyViewport;\n this.eTop = eTop;\n this.eBottom = eBottom;\n this.eStickyTop = eStickyTop;\n this.eStickyBottom = eStickyBottom;\n this.eCenterColsViewport = eBodyViewport.querySelector(`.${_getRowViewportClass(\"center\")}`);\n this.eFullWidthContainer = eBodyViewport.querySelector(`.${_getRowContainerClass(\"fullWidth\")}`);\n this.setCellTextSelection(this.gos.get(\"enableCellTextSelection\"));\n this.addManagedPropertyListener(\n \"enableCellTextSelection\",\n (props) => this.setCellTextSelection(props.currentValue)\n );\n this.createManagedBean(new LayoutFeature(this.comp));\n this.scrollFeature = this.createManagedBean(new GridBodyScrollFeature(eBodyViewport));\n this.beans.rowDragSvc?.setupRowDrag(eBodyViewport, this);\n this.setupRowAnimationCssClass();\n this.addEventListeners();\n this.addFocusListeners([eTop, eBodyViewport, eBottom, eStickyTop, eStickyBottom]);\n this.setGridRootRole();\n this.onGridColumnsChanged();\n this.addBodyViewportListener();\n this.setFloatingHeights();\n this.disableBrowserDragging();\n this.addStopEditingWhenGridLosesFocus();\n this.updateScrollingClasses();\n this.filterManager?.setupAdvFilterHeaderComp(eTop);\n this.ctrlsSvc.register(\"gridBodyCtrl\", this);\n }\n addEventListeners() {\n const setFloatingHeights = this.setFloatingHeights.bind(this);\n const setGridRootRole = this.setGridRootRole.bind(this);\n const toggleRowResizeStyle = this.toggleRowResizeStyles.bind(this);\n this.addManagedEventListeners({\n gridColumnsChanged: this.onGridColumnsChanged.bind(this),\n scrollVisibilityChanged: this.onScrollVisibilityChanged.bind(this),\n scrollGapChanged: this.updateScrollingClasses.bind(this),\n pinnedRowDataChanged: setFloatingHeights,\n pinnedHeightChanged: setFloatingHeights,\n pinnedRowsChanged: setFloatingHeights,\n headerHeightChanged: this.setStickyTopOffsetTop.bind(this),\n columnRowGroupChanged: setGridRootRole,\n columnPivotChanged: setGridRootRole,\n rowResizeStarted: toggleRowResizeStyle,\n rowResizeEnded: toggleRowResizeStyle\n });\n this.addManagedPropertyListener(\"treeData\", setGridRootRole);\n }\n toggleRowResizeStyles(params) {\n const isResizingRow = params.type === \"rowResizeStarted\";\n this.eBodyViewport.classList.toggle(\"ag-prevent-animation\", isResizingRow);\n }\n onGridColumnsChanged() {\n const columns = this.beans.colModel.getCols();\n this.comp.setColumnCount(columns.length);\n }\n onScrollVisibilityChanged() {\n const { scrollVisibleSvc } = this;\n const visible = scrollVisibleSvc.verticalScrollShowing;\n this.setVerticalScrollPaddingVisible(visible);\n this.setStickyWidth(visible);\n this.setStickyBottomOffsetBottom();\n const scrollbarWidth = visible ? scrollVisibleSvc.getScrollbarWidth() || 0 : 0;\n const pad = _isInvisibleScrollbar() ? 16 : 0;\n const width = `calc(100% + ${scrollbarWidth + pad}px)`;\n _requestAnimationFrame(this.beans, () => this.comp.setBodyViewportWidth(width));\n this.updateScrollingClasses();\n }\n setGridRootRole() {\n const { rowGroupColsSvc, colModel, gos } = this;\n let isTreeGrid = gos.get(\"treeData\");\n if (!isTreeGrid) {\n const isPivotActive = colModel.isPivotMode();\n const rowGroupColumnLen = !rowGroupColsSvc ? 0 : rowGroupColsSvc.columns.length;\n const columnsNeededForGrouping = isPivotActive ? 2 : 1;\n isTreeGrid = rowGroupColumnLen >= columnsNeededForGrouping;\n }\n this.comp.setGridRootRole(isTreeGrid ? \"treegrid\" : \"grid\");\n }\n addFocusListeners(elements) {\n for (const element of elements) {\n this.addManagedElementListeners(element, {\n focusin: (e) => {\n const { target } = e;\n const isFocusedElementNested = _isElementChildOfClass(target, \"ag-root\", element);\n element.classList.toggle(\"ag-has-focus\", !isFocusedElementNested);\n },\n focusout: (e) => {\n const { target, relatedTarget } = e;\n const gridContainRelatedTarget = element.contains(relatedTarget);\n const isNestedRelatedTarget = _isElementChildOfClass(\n relatedTarget,\n \"ag-root\",\n element\n );\n const isNestedTarget = _isElementChildOfClass(target, \"ag-root\", element);\n if (isNestedTarget) {\n return;\n }\n if (!gridContainRelatedTarget || isNestedRelatedTarget) {\n element.classList.remove(\"ag-has-focus\");\n }\n }\n });\n }\n }\n // used by ColumnAnimationService\n setColumnMovingCss(moving) {\n this.comp.setColumnMovingCss(CSS_CLASS_COLUMN_MOVING, moving);\n }\n setCellTextSelection(selectable = false) {\n this.comp.setCellSelectableCss(CSS_CLASS_CELL_SELECTABLE, selectable);\n }\n updateScrollingClasses() {\n const {\n eGridBody: { classList },\n scrollVisibleSvc\n } = this;\n classList.toggle(\"ag-body-vertical-content-no-gap\", !scrollVisibleSvc.verticalScrollGap);\n classList.toggle(\"ag-body-horizontal-content-no-gap\", !scrollVisibleSvc.horizontalScrollGap);\n }\n // if we do not do this, then the user can select a pic in the grid (eg an image in a custom cell renderer)\n // and then that will start the browser native drag n' drop, which messes up with our own drag and drop.\n disableBrowserDragging() {\n this.addManagedElementListeners(this.eGridBody, {\n dragstart: (event) => {\n if (event.target instanceof HTMLImageElement) {\n event.preventDefault();\n return false;\n }\n }\n });\n }\n addStopEditingWhenGridLosesFocus() {\n this.beans.editSvc?.addStopEditingWhenGridLosesFocus([\n this.eBodyViewport,\n this.eBottom,\n this.eTop,\n this.eStickyTop,\n this.eStickyBottom\n ]);\n }\n updateRowCount() {\n const headerCount = (this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0) + (this.filterManager?.getHeaderRowCount() ?? 0);\n const { rowModel } = this.beans;\n const rowCount = rowModel.isLastRowIndexKnown() ? rowModel.getRowCount() : -1;\n const total = rowCount === -1 ? -1 : headerCount + rowCount;\n this.comp.setRowCount(total);\n }\n registerBodyViewportResizeListener(listener) {\n this.comp.registerBodyViewportResizeListener(listener);\n }\n setVerticalScrollPaddingVisible(visible) {\n const overflowY = visible ? \"scroll\" : \"hidden\";\n this.comp.setPinnedTopBottomOverflowY(overflowY);\n }\n isVerticalScrollShowing() {\n const { gos, comp, ctrlsSvc } = this;\n const show = gos.get(\"alwaysShowVerticalScroll\");\n const cssClass = show ? CSS_CLASS_FORCE_VERTICAL_SCROLL : null;\n const allowVerticalScroll = _isDomLayout(gos, \"normal\");\n comp.setAlwaysVerticalScrollClass(cssClass, show);\n const horizontalScrollElement = ctrlsSvc.get(\"center\")?.eViewport;\n const hScrollEl = ctrlsSvc.get(\"fakeHScrollComp\")?.getGui();\n const vScrollEl = ctrlsSvc.get(\"fakeVScrollComp\")?.getGui();\n return show || allowVerticalScroll && _shouldShowVerticalScroll(this.eBodyViewport, horizontalScrollElement, void 0, vScrollEl, hScrollEl);\n }\n setupRowAnimationCssClass() {\n const { rowContainerHeight, environment } = this.beans;\n let initialSizeMeasurementComplete = environment.sizesMeasured;\n const updateAnimationClass = () => {\n const animateRows = initialSizeMeasurementComplete && _isAnimateRows(this.gos) && !rowContainerHeight.stretching;\n const animateRowsCssClass = animateRows ? \"ag-row-animation\" : \"ag-row-no-animation\";\n this.comp.setRowAnimationCssOnBodyViewport(animateRowsCssClass, animateRows);\n };\n updateAnimationClass();\n this.addManagedEventListeners({ heightScaleChanged: updateAnimationClass });\n this.addManagedPropertyListener(\"animateRows\", updateAnimationClass);\n this.addManagedEventListeners({\n stylesChanged: () => {\n if (!initialSizeMeasurementComplete && environment.sizesMeasured) {\n initialSizeMeasurementComplete = true;\n updateAnimationClass();\n }\n }\n });\n }\n addBodyViewportListener() {\n const {\n eBodyViewport,\n eStickyTop,\n eStickyBottom,\n eTop,\n eBottom,\n beans: { popupSvc, touchSvc }\n } = this;\n const listener = this.onBodyViewportContextMenu.bind(this);\n this.addManagedElementListeners(eBodyViewport, { contextmenu: listener });\n touchSvc?.mockBodyContextMenu(this, listener);\n this.addManagedElementListeners(eBodyViewport, {\n wheel: this.onBodyViewportWheel.bind(this, popupSvc)\n });\n const onStickyWheel = this.onStickyWheel.bind(this);\n for (const container of [eStickyTop, eStickyBottom, eTop, eBottom]) {\n this.addManagedElementListeners(container, { wheel: onStickyWheel });\n }\n const onHorizontalWheel = this.onHorizontalWheel.bind(this);\n for (const container of [\"left\", \"right\", \"topLeft\", \"topRight\", \"bottomLeft\", \"bottomRight\"]) {\n this.addManagedElementListeners(this.ctrlsSvc.get(container).eContainer, {\n wheel: onHorizontalWheel\n });\n }\n this.addFullWidthContainerWheelListener();\n }\n addFullWidthContainerWheelListener() {\n this.addManagedElementListeners(this.eFullWidthContainer, {\n wheel: (e) => this.onFullWidthContainerWheel(e)\n });\n }\n onFullWidthContainerWheel(e) {\n const { deltaX, deltaY, shiftKey } = e;\n const isHorizontalScroll = shiftKey || Math.abs(deltaX) > Math.abs(deltaY);\n if (isHorizontalScroll && _isEventFromThisInstance(this.beans, e)) {\n this.scrollGridBodyToMatchEvent(e);\n }\n }\n onStickyWheel(e) {\n const { deltaY } = e;\n const scrolled = this.scrollVertically(deltaY);\n if (scrolled > 0) {\n e.preventDefault();\n }\n }\n onHorizontalWheel(e) {\n const { deltaX, deltaY, shiftKey } = e;\n const isHorizontalScroll = shiftKey || Math.abs(deltaX) > Math.abs(deltaY);\n if (!isHorizontalScroll) {\n return;\n }\n this.scrollGridBodyToMatchEvent(e);\n }\n scrollGridBodyToMatchEvent(e) {\n const { deltaX, deltaY } = e;\n e.preventDefault();\n this.eCenterColsViewport.scrollBy({ left: deltaX || deltaY });\n }\n onBodyViewportContextMenu(mouseEvent, touch, touchEvent) {\n if (!mouseEvent && !touchEvent) {\n return;\n }\n if (this.gos.get(\"preventDefaultOnContextMenu\")) {\n const event = mouseEvent || touchEvent;\n event.preventDefault();\n }\n const { target } = mouseEvent || touch;\n if (target === this.eBodyViewport || target === this.ctrlsSvc.get(\"center\").eViewport) {\n this.beans.contextMenuSvc?.showContextMenu({\n mouseEvent,\n touchEvent,\n value: null,\n anchorToElement: this.eGridBody,\n source: \"ui\"\n });\n }\n }\n onBodyViewportWheel(popupSvc, e) {\n if (!this.gos.get(\"suppressScrollWhenPopupsAreOpen\")) {\n return;\n }\n if (popupSvc?.hasAnchoredPopup()) {\n e.preventDefault();\n }\n }\n // called by rowDragFeature\n scrollVertically(pixels) {\n const oldScrollPosition = this.eBodyViewport.scrollTop;\n this.scrollFeature.setVerticalScrollPosition(oldScrollPosition + pixels);\n return this.eBodyViewport.scrollTop - oldScrollPosition;\n }\n setFloatingHeights() {\n const {\n pinnedRowModel,\n beans: { environment }\n } = this;\n const floatingTopHeight = pinnedRowModel?.getPinnedTopTotalHeight();\n const floatingBottomHeight = pinnedRowModel?.getPinnedBottomTotalHeight();\n const pinnedBorderWidth = environment.getPinnedRowBorderWidth();\n const rowBorderWidth = environment.getRowBorderWidth();\n const additionalHeight = pinnedBorderWidth - rowBorderWidth;\n const normalisedFloatingTopHeight = !floatingTopHeight ? 0 : additionalHeight + floatingTopHeight;\n const normalisedFloatingBottomHeight = !floatingBottomHeight ? 0 : additionalHeight + floatingBottomHeight;\n this.comp.setTopHeight(normalisedFloatingTopHeight);\n this.comp.setBottomHeight(normalisedFloatingBottomHeight);\n this.comp.setTopInvisible(normalisedFloatingTopHeight <= 0);\n this.comp.setBottomInvisible(normalisedFloatingBottomHeight <= 0);\n this.setStickyTopOffsetTop();\n this.setStickyBottomOffsetBottom();\n }\n setStickyTopHeight(height = 0) {\n this.comp.setStickyTopHeight(`${height}px`);\n this.stickyTopHeight = height;\n }\n setStickyBottomHeight(height = 0) {\n this.comp.setStickyBottomHeight(`${height}px`);\n this.stickyBottomHeight = height;\n }\n setStickyWidth(vScrollVisible) {\n if (!vScrollVisible) {\n this.comp.setStickyTopWidth(\"100%\");\n this.comp.setStickyBottomWidth(\"100%\");\n } else {\n const scrollbarWidth = this.scrollVisibleSvc.getScrollbarWidth();\n this.comp.setStickyTopWidth(`calc(100% - ${scrollbarWidth}px)`);\n this.comp.setStickyBottomWidth(`calc(100% - ${scrollbarWidth}px)`);\n }\n }\n setStickyTopOffsetTop() {\n const headerCtrl = this.ctrlsSvc.get(\"gridHeaderCtrl\");\n const headerHeight = headerCtrl.headerHeight + (this.filterManager?.getHeaderHeight() ?? 0);\n const pinnedTopHeight = this.pinnedRowModel?.getPinnedTopTotalHeight() ?? 0;\n let height = 0;\n if (headerHeight > 0) {\n height += headerHeight;\n }\n if (pinnedTopHeight > 0) {\n height += pinnedTopHeight;\n }\n if (height > 0) {\n height += 1;\n }\n this.comp.setStickyTopTop(`${height}px`);\n }\n setStickyBottomOffsetBottom() {\n const { pinnedRowModel, scrollVisibleSvc, comp } = this;\n const pinnedBottomHeight = pinnedRowModel?.getPinnedBottomTotalHeight() ?? 0;\n const hScrollShowing = scrollVisibleSvc.horizontalScrollShowing;\n const scrollbarWidth = hScrollShowing ? scrollVisibleSvc.getScrollbarWidth() || 0 : 0;\n const height = pinnedBottomHeight + scrollbarWidth;\n comp.setStickyBottomBottom(`${height}px`);\n }\n};\n\n// packages/ag-grid-community/src/utils/element.ts\nfunction _createElement(params) {\n return _createAgElement(params);\n}\n\n// packages/ag-grid-community/src/rendering/cell/cellComp.ts\nvar CellComp = class extends Component {\n constructor(beans, cellCtrl, printLayout, eRow, editingCell) {\n super();\n this.cellCtrl = cellCtrl;\n this.rowResizerElement = null;\n // every time we go into edit mode, or back again, this gets incremented.\n // it's the components way of dealing with the async nature of framework components,\n // so if a framework component takes a while to be created, we know if the object\n // is still relevant when creating is finished. eg we could click edit / un-edit 20\n // times before the first React edit component comes back - we should discard\n // the first 19.\n this.rendererVersion = 0;\n this.editorVersion = 0;\n this.beans = beans;\n this.gos = beans.gos;\n this.column = cellCtrl.column;\n this.rowNode = cellCtrl.rowNode;\n this.eRow = eRow;\n const cellDiv = _createElement({\n tag: \"div\",\n role: cellCtrl.getCellAriaRole(),\n attrs: {\n \"comp-id\": `${this.getCompId()}`,\n \"col-id\": cellCtrl.column.colIdSanitised\n }\n });\n this.eCell = cellDiv;\n let wrapperDiv;\n if (cellCtrl.isCellSpanning()) {\n wrapperDiv = _createElement({\n tag: \"div\",\n cls: \"ag-spanned-cell-wrapper\",\n role: \"presentation\"\n });\n wrapperDiv.appendChild(cellDiv);\n this.setTemplateFromElement(wrapperDiv);\n } else {\n this.setTemplateFromElement(cellDiv);\n }\n this.cellCssManager = new CssClassManager(() => cellDiv);\n this.forceWrapper = cellCtrl.isForceWrapper();\n this.refreshWrapper(false);\n const compProxy = {\n toggleCss: (cssClassName, on) => this.cellCssManager.toggleCss(cssClassName, on),\n setUserStyles: (styles) => _addStylesToElement(cellDiv, styles),\n getFocusableElement: () => cellDiv,\n setIncludeSelection: (include) => this.includeSelection = include,\n setIncludeRowDrag: (include) => this.includeRowDrag = include,\n setIncludeDndSource: (include) => this.includeDndSource = include,\n setRowResizerElement: (element) => this.setRowResizerElement(element),\n setRenderDetails: (compDetails, valueToDisplay, force) => this.setRenderDetails(compDetails, valueToDisplay, force),\n setEditDetails: (compDetails, popup, position) => this.setEditDetails(compDetails, popup, position),\n getCellEditor: () => this.cellEditor || null,\n getCellRenderer: () => this.cellRenderer || null,\n getParentOfValue: () => this.getParentOfValue(),\n refreshEditStyles: (editing, isPopup) => this.refreshEditStyles(editing, isPopup)\n };\n cellCtrl.setComp(compProxy, cellDiv, wrapperDiv, this.eCellWrapper, printLayout, editingCell, void 0);\n }\n getParentOfValue() {\n return this.eCellValue ?? this.eCellWrapper ?? this.eCell;\n }\n setRowResizerElement(element) {\n if (this.rowResizerElement) {\n _removeFromParent(this.rowResizerElement);\n }\n this.rowResizerElement = element;\n if (element) {\n this.eCell.appendChild(element);\n }\n }\n setRenderDetails(compDetails, valueToDisplay, forceNewCellRendererInstance) {\n const isInlineEditing = this.cellEditor && !this.cellEditorPopupWrapper;\n if (isInlineEditing) {\n return;\n }\n this.firstRender = this.firstRender == null;\n const controlWrapperChanged = this.refreshWrapper(false);\n this.refreshEditStyles(false);\n if (compDetails) {\n const neverRefresh = forceNewCellRendererInstance || controlWrapperChanged;\n const cellRendererRefreshSuccessful = neverRefresh ? false : this.refreshCellRenderer(compDetails);\n if (!cellRendererRefreshSuccessful) {\n this.destroyRenderer();\n this.createCellRendererInstance(compDetails);\n }\n } else {\n this.destroyRenderer();\n this.insertValueWithoutCellRenderer(valueToDisplay);\n }\n this.rowDraggingComp?.refreshVisibility();\n if (this.rowResizerElement && !this.rowResizerElement.parentElement) {\n this.eCell.appendChild(this.rowResizerElement);\n }\n }\n setEditDetails(compDetails, popup, position) {\n if (compDetails) {\n this.createCellEditorInstance(compDetails, popup, position);\n } else {\n this.destroyEditor();\n }\n }\n removeControls() {\n const context = this.beans.context;\n this.checkboxSelectionComp = context.destroyBean(this.checkboxSelectionComp);\n this.dndSourceComp = context.destroyBean(this.dndSourceComp);\n this.rowDraggingComp = context.destroyBean(this.rowDraggingComp);\n }\n // returns true if wrapper was changed\n refreshWrapper(editing) {\n const providingControls = this.includeRowDrag || this.includeDndSource || this.includeSelection;\n const usingWrapper = providingControls || this.forceWrapper;\n const putWrapperIn = usingWrapper && this.eCellWrapper == null;\n if (putWrapperIn) {\n this.eCellWrapper = _createElement({ tag: \"div\", cls: \"ag-cell-wrapper\", role: \"presentation\" });\n this.eCell.appendChild(this.eCellWrapper);\n }\n const takeWrapperOut = !usingWrapper && this.eCellWrapper != null;\n if (takeWrapperOut) {\n _removeFromParent(this.eCellWrapper);\n this.eCellWrapper = void 0;\n }\n this.cellCssManager.toggleCss(\"ag-cell-value\", !usingWrapper);\n const usingCellValue = !editing && usingWrapper;\n const putCellValueIn = usingCellValue && this.eCellValue == null;\n if (putCellValueIn) {\n const cls = this.cellCtrl.getCellValueClass();\n this.eCellValue = _createElement({ tag: \"span\", cls, role: \"presentation\" });\n this.eCellWrapper.appendChild(this.eCellValue);\n }\n const takeCellValueOut = !usingCellValue && this.eCellValue != null;\n if (takeCellValueOut) {\n _removeFromParent(this.eCellValue);\n this.eCellValue = void 0;\n }\n const templateChanged = putWrapperIn || takeWrapperOut || putCellValueIn || takeCellValueOut;\n if (templateChanged) {\n this.removeControls();\n }\n if (!editing && providingControls) {\n this.addControls();\n }\n return templateChanged;\n }\n addControls() {\n const { cellCtrl, eCellWrapper, eCellValue, includeRowDrag, includeDndSource, includeSelection } = this;\n const insertBefore = (comp) => {\n if (comp) {\n eCellWrapper.insertBefore(comp.getGui(), eCellValue);\n }\n };\n if (includeRowDrag && this.rowDraggingComp == null) {\n this.rowDraggingComp = cellCtrl.createRowDragComp();\n insertBefore(this.rowDraggingComp);\n }\n if (includeDndSource && this.dndSourceComp == null) {\n this.dndSourceComp = cellCtrl.createDndSource();\n insertBefore(this.dndSourceComp);\n }\n if (includeSelection && this.checkboxSelectionComp == null) {\n this.checkboxSelectionComp = cellCtrl.createSelectionCheckbox();\n insertBefore(this.checkboxSelectionComp);\n }\n }\n createCellEditorInstance(compDetails, popup, position) {\n const versionCopy = this.editorVersion;\n const cellEditorPromise = compDetails.newAgStackInstance();\n const { params } = compDetails;\n cellEditorPromise.then((c) => this.afterCellEditorCreated(versionCopy, c, params, popup, position));\n const cellEditorAsync = _missing(this.cellEditor);\n if (cellEditorAsync && params.cellStartedEdit) {\n this.cellCtrl.focusCell(true);\n }\n }\n insertValueWithoutCellRenderer(valueToDisplay) {\n const eParent = this.getParentOfValue();\n _clearElement(eParent);\n const escapedValue = _toString(valueToDisplay);\n if (escapedValue != null) {\n eParent.textContent = escapedValue;\n }\n }\n destroyRenderer() {\n const { context } = this.beans;\n this.cellRenderer = context.destroyBean(this.cellRenderer);\n _removeFromParent(this.cellRendererGui);\n this.cellRendererGui = null;\n this.rendererVersion++;\n }\n destroyEditor() {\n const { context } = this.beans;\n const recoverFocus = this.cellEditorPopupWrapper?.getGui().contains(_getActiveDomElement(this.beans)) || this.cellCtrl.hasBrowserFocus();\n if (recoverFocus) {\n this.eCell.focus({ preventScroll: true });\n }\n this.hideEditorPopup?.();\n this.hideEditorPopup = void 0;\n this.cellEditor = context.destroyBean(this.cellEditor);\n this.cellEditorPopupWrapper = context.destroyBean(this.cellEditorPopupWrapper);\n _removeFromParent(this.cellEditorGui);\n this.cellCtrl.disableEditorTooltipFeature();\n this.cellEditorGui = null;\n this.editorVersion++;\n }\n refreshCellRenderer(compClassAndParams) {\n if (this.cellRenderer?.refresh == null) {\n return false;\n }\n if (this.cellRendererClass !== compClassAndParams.componentClass) {\n return false;\n }\n const result = this.cellRenderer.refresh(compClassAndParams.params);\n return result === true || result === void 0;\n }\n createCellRendererInstance(compDetails) {\n const displayComponentVersionCopy = this.rendererVersion;\n const createCellRendererFunc = (details) => (_) => {\n const staleTask = this.rendererVersion !== displayComponentVersionCopy || !this.isAlive();\n if (staleTask) {\n return;\n }\n const componentPromise = details.newAgStackInstance();\n const callback = this.afterCellRendererCreated.bind(\n this,\n displayComponentVersionCopy,\n details.componentClass\n );\n componentPromise?.then(callback);\n };\n const { animationFrameSvc } = this.beans;\n let createTask;\n if (animationFrameSvc?.active && this.firstRender) {\n createTask = (details, isDeferred = false) => {\n animationFrameSvc.createTask(\n createCellRendererFunc(details),\n this.rowNode.rowIndex,\n \"p2\",\n details.componentFromFramework,\n isDeferred\n );\n };\n } else {\n createTask = (details) => createCellRendererFunc(details)();\n }\n if (compDetails.params?.deferRender && !this.cellCtrl.rowNode.group) {\n const { loadingComp, onReady } = this.cellCtrl.getDeferLoadingCellRenderer();\n if (loadingComp) {\n createTask(loadingComp);\n onReady.then(() => createTask(compDetails, true));\n }\n } else {\n createTask(compDetails);\n }\n }\n afterCellRendererCreated(cellRendererVersion, cellRendererClass, cellRenderer) {\n const staleTask = !this.isAlive() || cellRendererVersion !== this.rendererVersion;\n if (staleTask) {\n this.beans.context.destroyBean(cellRenderer);\n return;\n }\n this.cellRenderer = cellRenderer;\n this.cellRendererClass = cellRendererClass;\n const cellGui = cellRenderer.getGui();\n this.cellRendererGui = cellGui;\n if (cellGui != null) {\n const eParent = this.getParentOfValue();\n _clearElement(eParent);\n eParent.appendChild(cellGui);\n }\n }\n afterCellEditorCreated(requestVersion, cellEditor, params, popup, position) {\n const staleComp = requestVersion !== this.editorVersion;\n const { context } = this.beans;\n if (staleComp) {\n context.destroyBean(cellEditor);\n return;\n }\n const editingCancelledByUserComp = cellEditor.isCancelBeforeStart?.();\n if (editingCancelledByUserComp) {\n context.destroyBean(cellEditor);\n this.cellCtrl.stopEditing(true);\n return;\n }\n if (!cellEditor.getGui) {\n _warn(97, { colId: this.column.getId() });\n context.destroyBean(cellEditor);\n return;\n }\n this.cellEditor = cellEditor;\n this.cellEditorGui = cellEditor.getGui();\n const cellEditorInPopup = popup || cellEditor.isPopup?.();\n if (cellEditorInPopup) {\n this.addPopupCellEditor(params, position);\n } else {\n this.addInCellEditor();\n }\n this.refreshEditStyles(true, cellEditorInPopup);\n cellEditor.afterGuiAttached?.();\n this.cellCtrl.enableEditorTooltipFeature(cellEditor);\n this.cellCtrl.cellEditorAttached();\n }\n refreshEditStyles(editing, isPopup) {\n const { cellCssManager } = this;\n cellCssManager.toggleCss(\"ag-cell-inline-editing\", editing && !isPopup);\n cellCssManager.toggleCss(\"ag-cell-popup-editing\", editing && !!isPopup);\n cellCssManager.toggleCss(\"ag-cell-not-inline-editing\", !editing || !!isPopup);\n }\n addInCellEditor() {\n const { eCell } = this;\n if (eCell.contains(_getActiveDomElement(this.beans))) {\n eCell.focus();\n }\n this.destroyRenderer();\n this.refreshWrapper(true);\n _clearElement(this.getParentOfValue());\n if (this.cellEditorGui) {\n const eParent = this.getParentOfValue();\n eParent.appendChild(this.cellEditorGui);\n }\n }\n addPopupCellEditor(params, position) {\n const { gos, context, popupSvc, editSvc } = this.beans;\n if (gos.get(\"editType\") === \"fullRow\") {\n _warn(98);\n }\n const cellEditorPopupWrapper = this.cellEditorPopupWrapper = context.createBean(\n editSvc.createPopupEditorWrapper(params)\n );\n const { cellEditor, cellEditorGui, eCell, rowNode, column, cellCtrl } = this;\n const ePopupGui = cellEditorPopupWrapper.getGui();\n if (cellEditorGui) {\n ePopupGui.appendChild(cellEditorGui);\n }\n const useModelPopup = gos.get(\"stopEditingWhenCellsLoseFocus\");\n const positionToUse = position != null ? position : cellEditor.getPopupPosition?.() ?? \"over\";\n const isRtl = gos.get(\"enableRtl\");\n const positionParams = {\n ePopup: ePopupGui,\n additionalParams: {\n column,\n rowNode\n },\n type: \"popupCellEditor\",\n eventSource: eCell,\n position: positionToUse,\n alignSide: isRtl ? \"right\" : \"left\",\n keepWithinBounds: true\n };\n const positionCallback = popupSvc.positionPopupByComponent.bind(popupSvc, positionParams);\n const addPopupRes = popupSvc.addPopup({\n modal: useModelPopup,\n eChild: ePopupGui,\n closeOnEsc: true,\n closedCallback: (e) => {\n cellCtrl.onPopupEditorClosed(e);\n },\n anchorToElement: eCell,\n positionCallback,\n ariaOwns: eCell\n });\n if (addPopupRes) {\n this.hideEditorPopup = addPopupRes.hideFunc;\n }\n }\n detach() {\n this.getGui().remove();\n }\n // if the row is also getting destroyed, then we don't need to remove from dom,\n // as the row will also get removed, so no need to take out the cells from the row\n // if the row is going (removing is an expensive operation, so only need to remove\n // the top part)\n //\n // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons.\n destroy() {\n this.destroyRenderer();\n this.destroyEditor();\n this.removeControls();\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/rendering/row/rowComp.ts\nvar RowComp = class extends Component {\n constructor(ctrl, beans, containerType) {\n super();\n this.cellComps = /* @__PURE__ */ new Map();\n this.beans = beans;\n this.rowCtrl = ctrl;\n const rowDiv = _createElement({ tag: \"div\", role: \"row\", attrs: { \"comp-id\": `${this.getCompId()}` } });\n this.setInitialStyle(rowDiv, containerType);\n this.setTemplateFromElement(rowDiv);\n const style = rowDiv.style;\n this.domOrder = this.rowCtrl.getDomOrder();\n const compProxy = {\n setDomOrder: (domOrder) => this.domOrder = domOrder,\n setCellCtrls: (cellCtrls) => this.setCellCtrls(cellCtrls),\n showFullWidth: (compDetails) => this.showFullWidth(compDetails),\n getFullWidthCellRenderer: () => this.fullWidthCellRenderer,\n getFullWidthCellRendererParams: () => this.fullWidthCellRendererParams,\n toggleCss: (name, on) => this.toggleCss(name, on),\n setUserStyles: (styles) => _addStylesToElement(rowDiv, styles),\n setTop: (top) => style.top = top,\n setTransform: (transform) => style.transform = transform,\n setRowIndex: (rowIndex) => rowDiv.setAttribute(\"row-index\", rowIndex),\n setRowId: (rowId) => rowDiv.setAttribute(\"row-id\", rowId),\n setRowBusinessKey: (businessKey) => rowDiv.setAttribute(\"row-business-key\", businessKey),\n refreshFullWidth: (getUpdatedParams) => {\n const params = getUpdatedParams();\n this.fullWidthCellRendererParams = params;\n return this.fullWidthCellRenderer?.refresh?.(params) ?? false;\n }\n };\n ctrl.setComp(compProxy, this.getGui(), containerType, void 0);\n this.addDestroyFunc(() => {\n ctrl.unsetComp(containerType);\n });\n }\n setInitialStyle(container, containerType) {\n const transform = this.rowCtrl.getInitialTransform(containerType);\n if (transform) {\n container.style.setProperty(\"transform\", transform);\n } else {\n const top = this.rowCtrl.getInitialRowTop(containerType);\n if (top) {\n container.style.setProperty(\"top\", top);\n }\n }\n }\n showFullWidth(compDetails) {\n const callback = (cellRenderer) => {\n if (this.isAlive()) {\n const eGui = cellRenderer.getGui();\n this.getGui().appendChild(eGui);\n this.rowCtrl.setupDetailRowAutoHeight(eGui);\n this.setFullWidthRowComp(cellRenderer, compDetails.params);\n } else {\n this.beans.context.destroyBean(cellRenderer);\n }\n };\n const res = compDetails.newAgStackInstance();\n res.then(callback);\n }\n setCellCtrls(cellCtrls) {\n const cellsToRemove = new Map(this.cellComps);\n for (const cellCtrl of cellCtrls) {\n const key = cellCtrl.instanceId;\n if (!this.cellComps.has(key)) {\n this.newCellComp(cellCtrl);\n } else {\n cellsToRemove.delete(key);\n }\n }\n this.destroyCells(cellsToRemove);\n this.ensureDomOrder(cellCtrls);\n }\n ensureDomOrder(cellCtrls) {\n if (!this.domOrder) {\n return;\n }\n const elementsInOrder = [];\n for (const cellCtrl of cellCtrls) {\n const cellComp = this.cellComps.get(cellCtrl.instanceId);\n if (cellComp) {\n elementsInOrder.push(cellComp.getGui());\n }\n }\n _setDomChildOrder(this.getGui(), elementsInOrder);\n }\n newCellComp(cellCtrl) {\n const editing = this.beans.editSvc?.isEditing(cellCtrl, { withOpenEditor: true }) ?? false;\n const cellComp = new CellComp(this.beans, cellCtrl, this.rowCtrl.printLayout, this.getGui(), editing);\n this.cellComps.set(cellCtrl.instanceId, cellComp);\n this.getGui().appendChild(cellComp.getGui());\n }\n destroy() {\n super.destroy();\n this.destroyCells(this.cellComps);\n }\n setFullWidthRowComp(fullWidthRowComponent, params) {\n this.fullWidthCellRenderer = fullWidthRowComponent;\n this.fullWidthCellRendererParams = params;\n this.addDestroyFunc(() => {\n this.fullWidthCellRenderer = this.beans.context.destroyBean(this.fullWidthCellRenderer);\n this.fullWidthCellRendererParams = void 0;\n });\n }\n destroyCells(cellComps) {\n for (const cellComp of cellComps.values()) {\n if (!cellComp) {\n continue;\n }\n const instanceId = cellComp.cellCtrl.instanceId;\n if (this.cellComps.get(instanceId) !== cellComp) {\n continue;\n }\n cellComp.detach();\n cellComp.destroy();\n this.cellComps.delete(instanceId);\n }\n }\n};\n\n// packages/ag-grid-community/src/gridBodyComp/rowContainer/rowContainerComp.ts\nfunction getElementParams(name, options, beans) {\n const isCellSpanning = !!beans.gos.get(\"enableCellSpan\") && !!options.getSpannedRowCtrls;\n const eContainerElement = {\n tag: \"div\",\n ref: \"eContainer\",\n cls: _getRowContainerClass(name),\n role: \"rowgroup\"\n };\n if (options.type === \"center\" || isCellSpanning) {\n const eSpannedContainerElement = {\n tag: \"div\",\n ref: \"eSpannedContainer\",\n cls: `ag-spanning-container ${_getRowSpanContainerClass(name)}`,\n role: \"presentation\"\n };\n eContainerElement.role = \"presentation\";\n return {\n tag: \"div\",\n ref: \"eViewport\",\n cls: `ag-viewport ${_getRowViewportClass(name)}`,\n role: \"rowgroup\",\n children: [eContainerElement, isCellSpanning ? eSpannedContainerElement : null]\n };\n }\n return eContainerElement;\n}\nvar RowContainerComp = class extends Component {\n constructor(params) {\n super();\n this.eViewport = RefPlaceholder;\n this.eContainer = RefPlaceholder;\n this.eSpannedContainer = RefPlaceholder;\n this.rowCompsNoSpan = {};\n this.rowCompsWithSpan = {};\n this.name = params?.name;\n this.options = _getRowContainerOptions(this.name);\n }\n postConstruct() {\n this.setTemplate(getElementParams(this.name, this.options, this.beans));\n const compProxy = {\n setHorizontalScroll: (offset) => this.eViewport.scrollLeft = offset,\n setViewportHeight: (height) => this.eViewport.style.height = height,\n setRowCtrls: ({ rowCtrls }) => this.setRowCtrls(rowCtrls),\n setSpannedRowCtrls: (rowCtrls) => this.setRowCtrls(rowCtrls, true),\n setDomOrder: (domOrder) => {\n this.domOrder = domOrder;\n },\n setContainerWidth: (width) => {\n this.eContainer.style.width = width;\n if (this.eSpannedContainer) {\n this.eSpannedContainer.style.width = width;\n }\n },\n setOffsetTop: (offset) => {\n const top = `translateY(${offset})`;\n this.eContainer.style.transform = top;\n if (this.eSpannedContainer) {\n this.eSpannedContainer.style.transform = top;\n }\n }\n };\n const ctrl = this.createManagedBean(new RowContainerCtrl(this.name));\n ctrl.setComp(compProxy, this.eContainer, this.eSpannedContainer, this.eViewport);\n }\n destroy() {\n this.setRowCtrls([]);\n this.setRowCtrls([], true);\n super.destroy();\n this.lastPlacedElement = null;\n }\n setRowCtrls(rowCtrls, spanContainer) {\n const { beans, options } = this;\n const container = spanContainer ? this.eSpannedContainer : this.eContainer;\n const oldRows = spanContainer ? { ...this.rowCompsWithSpan } : { ...this.rowCompsNoSpan };\n const newComps = {};\n if (spanContainer) {\n this.rowCompsWithSpan = newComps;\n } else {\n this.rowCompsNoSpan = newComps;\n }\n this.lastPlacedElement = null;\n const orderedRows = [];\n for (const rowCtrl of rowCtrls) {\n const instanceId = rowCtrl.instanceId;\n const existingRowComp = oldRows[instanceId];\n let rowComp;\n if (existingRowComp) {\n rowComp = existingRowComp;\n delete oldRows[instanceId];\n } else {\n if (!rowCtrl.rowNode.displayed) {\n continue;\n }\n rowComp = new RowComp(rowCtrl, beans, options.type);\n }\n newComps[instanceId] = rowComp;\n orderedRows.push([rowComp, !existingRowComp]);\n }\n this.removeOldRows(Object.values(oldRows));\n this.addRowNodes(orderedRows, container);\n }\n addRowNodes(rows, container) {\n const { domOrder } = this;\n for (const [rowComp, isNew] of rows) {\n const eGui = rowComp.getGui();\n if (!domOrder) {\n if (isNew) {\n container.appendChild(eGui);\n }\n } else {\n this.ensureDomOrder(eGui, container);\n }\n }\n }\n removeOldRows(rowComps) {\n for (const oldRowComp of rowComps) {\n oldRowComp.getGui().remove();\n oldRowComp.destroy();\n }\n }\n ensureDomOrder(eRow, container) {\n _ensureDomOrder(container, eRow, this.lastPlacedElement);\n this.lastPlacedElement = eRow;\n }\n};\nvar RowContainerSelector = {\n selector: \"AG-ROW-CONTAINER\",\n component: RowContainerComp\n};\n\n// packages/ag-grid-community/src/gridBodyComp/gridBodyComp.ts\nfunction makeRowContainers(paramsMap, names) {\n return names.map((name) => {\n const refName = `e${name[0].toUpperCase() + name.substring(1)}RowContainer`;\n paramsMap[refName] = { name };\n return {\n tag: \"ag-row-container\",\n ref: refName,\n attrs: { name }\n };\n });\n}\nfunction getGridBodyTemplate(includeOverlay) {\n const paramsMap = {};\n const elementParams = {\n tag: \"div\",\n ref: \"eGridRoot\",\n cls: \"ag-root ag-unselectable\",\n children: [\n { tag: \"ag-header-root\" },\n {\n tag: \"div\",\n ref: \"eTop\",\n cls: \"ag-floating-top\",\n role: \"presentation\",\n children: makeRowContainers(paramsMap, [\"topLeft\", \"topCenter\", \"topRight\", \"topFullWidth\"])\n },\n {\n tag: \"div\",\n ref: \"eBody\",\n cls: \"ag-body\",\n role: \"presentation\",\n children: [\n {\n tag: \"div\",\n ref: \"eBodyViewport\",\n cls: \"ag-body-viewport\",\n role: \"presentation\",\n children: makeRowContainers(paramsMap, [\"left\", \"center\", \"right\", \"fullWidth\"])\n },\n { tag: \"ag-fake-vertical-scroll\" }\n ]\n },\n {\n tag: \"div\",\n ref: \"eStickyTop\",\n cls: \"ag-sticky-top\",\n role: \"presentation\",\n children: makeRowContainers(paramsMap, [\n \"stickyTopLeft\",\n \"stickyTopCenter\",\n \"stickyTopRight\",\n \"stickyTopFullWidth\"\n ])\n },\n {\n tag: \"div\",\n ref: \"eStickyBottom\",\n cls: \"ag-sticky-bottom\",\n role: \"presentation\",\n children: makeRowContainers(paramsMap, [\n \"stickyBottomLeft\",\n \"stickyBottomCenter\",\n \"stickyBottomRight\",\n \"stickyBottomFullWidth\"\n ])\n },\n {\n tag: \"div\",\n ref: \"eBottom\",\n cls: \"ag-floating-bottom\",\n role: \"presentation\",\n children: makeRowContainers(paramsMap, [\n \"bottomLeft\",\n \"bottomCenter\",\n \"bottomRight\",\n \"bottomFullWidth\"\n ])\n },\n { tag: \"ag-fake-horizontal-scroll\" },\n includeOverlay ? { tag: \"ag-overlay-wrapper\" } : null\n ]\n };\n return { paramsMap, elementParams };\n}\nvar GridBodyComp = class extends Component {\n constructor() {\n super(...arguments);\n this.eGridRoot = RefPlaceholder;\n this.eBodyViewport = RefPlaceholder;\n this.eStickyTop = RefPlaceholder;\n this.eStickyBottom = RefPlaceholder;\n this.eTop = RefPlaceholder;\n this.eBottom = RefPlaceholder;\n this.eBody = RefPlaceholder;\n }\n postConstruct() {\n const { overlays, rangeSvc } = this.beans;\n const overlaySelector = overlays?.getOverlayWrapperSelector();\n const { paramsMap, elementParams } = getGridBodyTemplate(!!overlaySelector);\n this.setTemplate(\n elementParams,\n [\n ...overlaySelector ? [overlaySelector] : [],\n FakeHScrollSelector,\n FakeVScrollSelector,\n GridHeaderSelector,\n RowContainerSelector\n ],\n paramsMap\n );\n const setHeight = (height, element) => {\n const heightString = `${height}px`;\n element.style.minHeight = heightString;\n element.style.height = heightString;\n };\n const compProxy = {\n setRowAnimationCssOnBodyViewport: (cssClass, animate) => this.setRowAnimationCssOnBodyViewport(cssClass, animate),\n setColumnCount: (count) => _setAriaColCount(this.getGui(), count),\n setRowCount: (count) => _setAriaRowCount(this.getGui(), count),\n setTopHeight: (height) => setHeight(height, this.eTop),\n setBottomHeight: (height) => setHeight(height, this.eBottom),\n setTopInvisible: (invisible) => this.eTop.classList.toggle(\"ag-invisible\", invisible),\n setBottomInvisible: (invisible) => this.eBottom.classList.toggle(\"ag-invisible\", invisible),\n setStickyTopHeight: (height) => this.eStickyTop.style.height = height,\n setStickyTopTop: (top) => this.eStickyTop.style.top = top,\n setStickyTopWidth: (width) => this.eStickyTop.style.width = width,\n setStickyBottomHeight: (height) => {\n this.eStickyBottom.style.height = height;\n this.eStickyBottom.classList.toggle(\"ag-invisible\", height === \"0px\");\n },\n setStickyBottomBottom: (bottom) => this.eStickyBottom.style.bottom = bottom,\n setStickyBottomWidth: (width) => this.eStickyBottom.style.width = width,\n setColumnMovingCss: (cssClass, flag) => this.toggleCss(cssClass, flag),\n updateLayoutClasses: (cssClass, params) => {\n const classLists = [this.eBodyViewport.classList, this.eBody.classList];\n for (const classList of classLists) {\n classList.toggle(LayoutCssClasses.AUTO_HEIGHT, params.autoHeight);\n classList.toggle(LayoutCssClasses.NORMAL, params.normal);\n classList.toggle(LayoutCssClasses.PRINT, params.print);\n }\n this.toggleCss(LayoutCssClasses.AUTO_HEIGHT, params.autoHeight);\n this.toggleCss(LayoutCssClasses.NORMAL, params.normal);\n this.toggleCss(LayoutCssClasses.PRINT, params.print);\n },\n setAlwaysVerticalScrollClass: (cssClass, on) => this.eBodyViewport.classList.toggle(CSS_CLASS_FORCE_VERTICAL_SCROLL, on),\n registerBodyViewportResizeListener: (listener) => {\n const unsubscribeFromResize = _observeResize(this.beans, this.eBodyViewport, listener);\n this.addDestroyFunc(() => unsubscribeFromResize());\n },\n setPinnedTopBottomOverflowY: (overflow) => this.eTop.style.overflowY = this.eBottom.style.overflowY = overflow,\n setCellSelectableCss: (cssClass, selectable) => {\n for (const ct of [this.eTop, this.eBodyViewport, this.eBottom]) {\n ct.classList.toggle(cssClass, selectable);\n }\n },\n setBodyViewportWidth: (width) => this.eBodyViewport.style.width = width,\n setGridRootRole: (role) => _setAriaRole(this.eGridRoot, role)\n };\n this.ctrl = this.createManagedBean(new GridBodyCtrl());\n this.ctrl.setComp(\n compProxy,\n this.getGui(),\n this.eBodyViewport,\n this.eTop,\n this.eBottom,\n this.eStickyTop,\n this.eStickyBottom\n );\n if (rangeSvc && _isCellSelectionEnabled(this.gos) || _isMultiRowSelection(this.gos)) {\n _setAriaMultiSelectable(this.getGui(), true);\n }\n }\n setRowAnimationCssOnBodyViewport(cssClass, animateRows) {\n const bodyViewportClassList = this.eBodyViewport.classList;\n bodyViewportClassList.toggle(\"ag-row-animation\", animateRows);\n bodyViewportClassList.toggle(\"ag-row-no-animation\", !animateRows);\n }\n getFocusableContainerName() {\n return \"gridBody\";\n }\n};\nvar GridBodySelector = {\n selector: \"AG-GRID-BODY\",\n component: GridBodyComp\n};\n\n// packages/ag-grid-community/src/agStack/focus/tabGuardCtrl.ts\nvar TabGuardClassNames = {\n TAB_GUARD: \"ag-tab-guard\",\n TAB_GUARD_TOP: \"ag-tab-guard-top\",\n TAB_GUARD_BOTTOM: \"ag-tab-guard-bottom\"\n};\nvar AgTabGuardCtrl = class extends AgBeanStub {\n constructor(params, stopPropagationCallbacks) {\n super();\n this.stopPropagationCallbacks = stopPropagationCallbacks;\n this.skipTabGuardFocus = false;\n this.forcingFocusOut = false;\n // Used when `isFocusableContainer` enabled\n this.allowFocus = false;\n const {\n comp,\n eTopGuard,\n eBottomGuard,\n focusTrapActive,\n forceFocusOutWhenTabGuardsAreEmpty,\n isFocusableContainer,\n focusInnerElement,\n onFocusIn,\n onFocusOut,\n shouldStopEventPropagation,\n onTabKeyDown,\n handleKeyDown,\n isEmpty,\n eFocusableElement\n } = params;\n this.comp = comp;\n this.eTopGuard = eTopGuard;\n this.eBottomGuard = eBottomGuard;\n this.providedFocusInnerElement = focusInnerElement;\n this.eFocusableElement = eFocusableElement;\n this.focusTrapActive = !!focusTrapActive;\n this.forceFocusOutWhenTabGuardsAreEmpty = !!forceFocusOutWhenTabGuardsAreEmpty;\n this.isFocusableContainer = !!isFocusableContainer;\n this.providedFocusIn = onFocusIn;\n this.providedFocusOut = onFocusOut;\n this.providedShouldStopEventPropagation = shouldStopEventPropagation;\n this.providedOnTabKeyDown = onTabKeyDown;\n this.providedHandleKeyDown = handleKeyDown;\n this.providedIsEmpty = isEmpty;\n }\n postConstruct() {\n this.createManagedBean(\n new AgManagedFocusFeature(this.eFocusableElement, this.stopPropagationCallbacks, {\n shouldStopEventPropagation: () => this.shouldStopEventPropagation(),\n onTabKeyDown: (e) => this.onTabKeyDown(e),\n handleKeyDown: (e) => this.handleKeyDown(e),\n onFocusIn: (e) => this.onFocusIn(e),\n onFocusOut: (e) => this.onFocusOut(e)\n })\n );\n this.activateTabGuards();\n for (const guard of [this.eTopGuard, this.eBottomGuard]) {\n this.addManagedElementListeners(guard, { focus: this.onFocus.bind(this) });\n }\n }\n handleKeyDown(e) {\n if (this.providedHandleKeyDown) {\n this.providedHandleKeyDown(e);\n }\n }\n tabGuardsAreActive() {\n return !!this.eTopGuard && this.eTopGuard.hasAttribute(\"tabIndex\");\n }\n shouldStopEventPropagation() {\n if (this.providedShouldStopEventPropagation) {\n return this.providedShouldStopEventPropagation();\n }\n return false;\n }\n activateTabGuards() {\n if (this.forcingFocusOut) {\n return;\n }\n const tabIndex = this.gos.get(\"tabIndex\");\n this.comp.setTabIndex(tabIndex.toString());\n }\n deactivateTabGuards() {\n this.comp.setTabIndex();\n }\n onFocus(e) {\n if (this.isFocusableContainer && !this.eFocusableElement.contains(e.relatedTarget)) {\n if (!this.allowFocus) {\n this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard);\n return;\n }\n }\n if (this.skipTabGuardFocus) {\n this.skipTabGuardFocus = false;\n return;\n }\n if (this.forceFocusOutWhenTabGuardsAreEmpty) {\n const isEmpty = this.providedIsEmpty ? this.providedIsEmpty() : _findFocusableElements(this.eFocusableElement, \".ag-tab-guard\").length === 0;\n if (isEmpty) {\n this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard);\n return;\n }\n }\n if (this.isFocusableContainer && this.eFocusableElement.contains(e.relatedTarget)) {\n return;\n }\n const fromBottom = e.target === this.eBottomGuard;\n const hasFocusedInnerElement = this.providedFocusInnerElement ? this.providedFocusInnerElement(fromBottom) : this.focusInnerElement(fromBottom);\n if (!hasFocusedInnerElement && this.forceFocusOutWhenTabGuardsAreEmpty) {\n this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard);\n }\n }\n findNextElementOutsideAndFocus(up) {\n const eDocument = _getDocument(this.beans);\n const focusableEls = _findFocusableElements(eDocument.body, null, true);\n const index = focusableEls.indexOf(up ? this.eTopGuard : this.eBottomGuard);\n if (index === -1) {\n return;\n }\n let start;\n let end;\n if (up) {\n start = 0;\n end = index;\n } else {\n start = index + 1;\n end = focusableEls.length;\n }\n const focusableRange = focusableEls.slice(start, end);\n const targetTabIndex = this.gos.get(\"tabIndex\");\n focusableRange.sort((a, b) => {\n const indexA = Number.parseInt(a.getAttribute(\"tabindex\") || \"0\");\n const indexB = Number.parseInt(b.getAttribute(\"tabindex\") || \"0\");\n if (indexB === targetTabIndex) {\n return 1;\n }\n if (indexA === targetTabIndex) {\n return -1;\n }\n if (indexA === 0) {\n return 1;\n }\n if (indexB === 0) {\n return -1;\n }\n return indexA - indexB;\n });\n focusableRange[up ? focusableRange.length - 1 : 0]?.focus();\n }\n onFocusIn(e) {\n if (this.focusTrapActive || this.forcingFocusOut) {\n return;\n }\n if (this.providedFocusIn) {\n this.providedFocusIn(e);\n }\n if (!this.isFocusableContainer) {\n this.deactivateTabGuards();\n }\n }\n onFocusOut(e) {\n if (this.focusTrapActive) {\n return;\n }\n if (this.providedFocusOut) {\n this.providedFocusOut(e);\n }\n if (!this.eFocusableElement.contains(e.relatedTarget)) {\n this.activateTabGuards();\n }\n }\n onTabKeyDown(e) {\n if (this.providedOnTabKeyDown) {\n this.providedOnTabKeyDown(e);\n return;\n }\n if (this.focusTrapActive) {\n return;\n }\n if (e.defaultPrevented) {\n return;\n }\n const tabGuardsAreActive = this.tabGuardsAreActive();\n if (tabGuardsAreActive) {\n this.deactivateTabGuards();\n }\n const nextRoot = this.getNextFocusableElement(e.shiftKey);\n if (tabGuardsAreActive) {\n setTimeout(() => this.activateTabGuards(), 0);\n }\n if (!nextRoot) {\n return;\n }\n nextRoot.focus();\n e.preventDefault();\n }\n focusInnerElement(fromBottom = false) {\n const focusable = _findFocusableElements(this.eFocusableElement);\n if (this.tabGuardsAreActive()) {\n focusable.splice(0, 1);\n focusable.splice(-1, 1);\n }\n if (!focusable.length) {\n return false;\n }\n focusable[fromBottom ? focusable.length - 1 : 0].focus({ preventScroll: true });\n return true;\n }\n getNextFocusableElement(backwards) {\n return _findNextFocusableElement(this.beans, this.eFocusableElement, false, backwards);\n }\n forceFocusOutOfContainer(up = false) {\n if (this.forcingFocusOut) {\n return;\n }\n const tabGuardToFocus = up ? this.eTopGuard : this.eBottomGuard;\n this.activateTabGuards();\n this.skipTabGuardFocus = true;\n this.forcingFocusOut = true;\n tabGuardToFocus.focus();\n window.setTimeout(() => {\n this.forcingFocusOut = false;\n this.activateTabGuards();\n });\n }\n isTabGuard(element, bottom) {\n return element === this.eTopGuard && !bottom || element === this.eBottomGuard && (bottom ?? true);\n }\n setAllowFocus(allowFocus) {\n this.allowFocus = allowFocus;\n }\n};\n\n// packages/ag-grid-community/src/agStack/focus/agTabGuardFeature.ts\nvar AgTabGuardFeature = class extends AgBeanStub {\n constructor(comp, stopPropagationCallbacks) {\n super();\n this.comp = comp;\n this.stopPropagationCallbacks = stopPropagationCallbacks;\n }\n initialiseTabGuard(params) {\n this.eTopGuard = this.createTabGuard(\"top\");\n this.eBottomGuard = this.createTabGuard(\"bottom\");\n this.eFocusableElement = this.comp.getFocusableElement();\n const { eTopGuard, eBottomGuard, eFocusableElement, stopPropagationCallbacks } = this;\n const tabGuards = [eTopGuard, eBottomGuard];\n const compProxy = {\n setTabIndex: (tabIndex) => {\n for (const tabGuard of tabGuards) {\n if (tabIndex == null) {\n tabGuard.removeAttribute(\"tabindex\");\n } else {\n tabGuard.setAttribute(\"tabindex\", tabIndex);\n }\n }\n }\n };\n this.addTabGuards(eTopGuard, eBottomGuard);\n const {\n focusTrapActive = false,\n onFocusIn,\n onFocusOut,\n focusInnerElement,\n handleKeyDown,\n onTabKeyDown,\n shouldStopEventPropagation,\n isEmpty,\n forceFocusOutWhenTabGuardsAreEmpty,\n isFocusableContainer\n } = params;\n this.tabGuardCtrl = this.createManagedBean(\n new AgTabGuardCtrl(\n {\n comp: compProxy,\n focusTrapActive,\n eTopGuard,\n eBottomGuard,\n eFocusableElement,\n onFocusIn,\n onFocusOut,\n focusInnerElement,\n handleKeyDown,\n onTabKeyDown,\n shouldStopEventPropagation,\n isEmpty,\n forceFocusOutWhenTabGuardsAreEmpty,\n isFocusableContainer\n },\n stopPropagationCallbacks\n )\n );\n }\n getTabGuardCtrl() {\n return this.tabGuardCtrl;\n }\n createTabGuard(side) {\n const tabGuard = _getDocument(this.beans).createElement(\"div\");\n const cls = side === \"top\" ? TabGuardClassNames.TAB_GUARD_TOP : TabGuardClassNames.TAB_GUARD_BOTTOM;\n tabGuard.classList.add(TabGuardClassNames.TAB_GUARD, cls);\n _setAriaRole(tabGuard, \"presentation\");\n return tabGuard;\n }\n addTabGuards(topTabGuard, bottomTabGuard) {\n const eFocusableElement = this.eFocusableElement;\n eFocusableElement.prepend(topTabGuard);\n eFocusableElement.append(bottomTabGuard);\n }\n removeAllChildrenExceptTabGuards() {\n const tabGuards = [this.eTopGuard, this.eBottomGuard];\n _clearElement(this.comp.getFocusableElement());\n this.addTabGuards(...tabGuards);\n }\n forceFocusOutOfContainer(up = false) {\n this.tabGuardCtrl.forceFocusOutOfContainer(up);\n }\n appendChild(appendChild, newChild, container) {\n if (!_isNodeOrElement(newChild)) {\n newChild = newChild.getGui();\n }\n const { eBottomGuard: bottomTabGuard } = this;\n if (bottomTabGuard) {\n bottomTabGuard.before(newChild);\n } else {\n appendChild(newChild, container);\n }\n }\n destroy() {\n const { eTopGuard, eBottomGuard } = this;\n _removeFromParent(eTopGuard);\n _removeFromParent(eBottomGuard);\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/agStack/focus/agTabGuardComp.ts\nvar AgTabGuardComp = class extends AgComponentStub {\n initialiseTabGuard(params, stopPropagationCallbacks) {\n this.tabGuardFeature = this.createManagedBean(new AgTabGuardFeature(this, stopPropagationCallbacks));\n this.tabGuardFeature.initialiseTabGuard(params);\n }\n forceFocusOutOfContainer(up = false) {\n this.tabGuardFeature.forceFocusOutOfContainer(up);\n }\n appendChild(newChild, container) {\n this.tabGuardFeature.appendChild(super.appendChild.bind(this), newChild, container);\n }\n};\n\n// packages/ag-grid-community/src/widgets/tabGuardComp.ts\nvar TabGuardComp = class extends AgTabGuardComp {\n initialiseTabGuard(params) {\n super.initialiseTabGuard(params, STOP_PROPAGATION_CALLBACKS);\n }\n};\n\n// packages/ag-grid-community/src/gridComp/gridCtrl.ts\nvar focusContainer = (comp, up) => {\n return _runWithContainerFocusAllowed(comp, () => _focusInto(comp.getGui(), up, false, true));\n};\nvar getGridContainerName = (container) => {\n return container?.getFocusableContainerName() ?? \"external\";\n};\nvar getDefaultTabToNextGridContainerTargetName = (target) => {\n if (target == null) {\n return \"external\";\n }\n return typeof target === \"string\" ? target : \"gridBody\";\n};\nvar GridCtrl = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.additionalFocusableContainers = /* @__PURE__ */ new Set();\n }\n setComp(view, eGridDiv, eGui) {\n this.view = view;\n this.eGridHostDiv = eGridDiv;\n this.eGui = eGui;\n this.eGui.setAttribute(\"grid-id\", this.beans.context.getId());\n const { dragAndDrop, ctrlsSvc } = this.beans;\n dragAndDrop?.registerGridDropTarget(() => this.eGui, this);\n this.createManagedBean(new LayoutFeature(this.view));\n this.view.setRtlClass(this.gos.get(\"enableRtl\") ? \"ag-rtl\" : \"ag-ltr\");\n const unsubscribeFromResize = _observeResize(this.beans, this.eGridHostDiv, this.onGridSizeChanged.bind(this));\n this.addDestroyFunc(() => unsubscribeFromResize());\n ctrlsSvc.register(\"gridCtrl\", this);\n }\n isDetailGrid() {\n const el = _findTabbableParent(this.getGui());\n return el?.getAttribute(\"row-id\")?.startsWith(\"detail\") || false;\n }\n getOptionalSelectors() {\n const beans = this.beans;\n return {\n paginationSelector: beans.pagination?.getPaginationSelector(),\n gridHeaderDropZonesSelector: beans.registry?.getSelector(\"AG-GRID-HEADER-DROP-ZONES\"),\n sideBarSelector: beans.sideBar?.getSelector(),\n statusBarSelector: beans.registry?.getSelector(\"AG-STATUS-BAR\"),\n watermarkSelector: beans.licenseManager?.getWatermarkSelector()\n };\n }\n onGridSizeChanged() {\n this.eventSvc.dispatchEvent({\n type: \"gridSizeChanged\",\n clientWidth: this.eGridHostDiv.clientWidth,\n clientHeight: this.eGridHostDiv.clientHeight\n });\n }\n destroyGridUi() {\n this.view.destroyGridUi();\n }\n getGui() {\n return this.eGui;\n }\n setResizeCursor(direction) {\n const { view } = this;\n if (direction === false) {\n view.setCursor(null);\n } else {\n view.setCursor(direction === 1 /* Horizontal */ ? \"ew-resize\" : \"ns-resize\");\n }\n }\n disableUserSelect(on) {\n this.view.setUserSelect(on ? \"none\" : null);\n }\n focusNextInnerContainer(backwards) {\n const focusableContainers = this.getFocusableContainers();\n const { indexWithFocus, nextIndex } = this.getNextFocusableIndex(focusableContainers, backwards);\n const resolvedNextIndex = indexWithFocus === -1 ? backwards ? focusableContainers.length - 1 : 0 : nextIndex;\n const {\n gos,\n beans: { focusSvc, navigation }\n } = this;\n const userCallbackFunction = gos.getCallback(\"tabToNextGridContainer\");\n if (userCallbackFunction) {\n const defaultTarget = focusSvc.getDefaultTabToNextGridContainerTarget({\n backwards,\n focusableContainers,\n nextIndex: resolvedNextIndex\n });\n const nextContainerName = getGridContainerName(focusableContainers[resolvedNextIndex]);\n const nextContainer = defaultTarget == null && nextContainerName === \"gridBody\" ? \"gridBody\" : getDefaultTabToNextGridContainerTargetName(defaultTarget);\n const userResult = userCallbackFunction({\n backwards,\n previousContainer: getGridContainerName(focusableContainers[indexWithFocus]),\n nextContainer,\n defaultTarget\n });\n if (userResult !== void 0) {\n if (typeof userResult === \"boolean\") {\n return userResult;\n }\n if (typeof userResult === \"string\") {\n if (userResult === \"gridBody\") {\n return this.focusGridBodyDefault(backwards) || void 0;\n }\n const targetContainer = focusableContainers.find(\n (container) => container.getFocusableContainerName() === userResult\n );\n if (!targetContainer) {\n _consoleWarn(`tabToNextGridContainer - ${userResult} container not found`);\n return void 0;\n }\n return focusContainer(targetContainer, backwards) ? true : void 0;\n }\n if (isHeaderPosition(userResult)) {\n return focusSvc.focusHeaderPosition({ headerPosition: userResult }) || void 0;\n }\n navigation?.ensureCellVisible(userResult);\n focusSvc.setFocusedCell({ ...userResult, forceBrowserFocus: true });\n return focusSvc.isCellFocused(userResult) || void 0;\n }\n }\n return this.focusNextInnerContainerDefault({\n backwards,\n focusableContainers,\n indexWithFocus,\n nextIndex: resolvedNextIndex\n }) || void 0;\n }\n focusInnerElement(fromBottom) {\n const {\n gos,\n beans,\n beans: { focusSvc, visibleCols }\n } = this;\n const userCallbackFunction = gos.getCallback(\"focusGridInnerElement\");\n if (userCallbackFunction?.({ fromBottom: !!fromBottom })) {\n return true;\n }\n const focusableContainers = this.getFocusableContainers();\n if (fromBottom) {\n if (this.focusNextInnerContainerDefault({\n backwards: true,\n focusableContainers,\n indexWithFocus: focusableContainers.length,\n nextIndex: focusableContainers.length - 1\n })) {\n return true;\n }\n return focusSvc.focusGridView({ column: _last(visibleCols.allCols), backwards: true });\n }\n const allColumns = visibleCols.allCols;\n if (gos.get(\"headerHeight\") === 0 || _isHeaderFocusSuppressed(beans)) {\n if (focusSvc.focusGridView({ column: allColumns[0], backwards: fromBottom })) {\n return true;\n }\n for (let i = 1; i < focusableContainers.length; i++) {\n if (_focusInto(focusableContainers[i].getGui(), fromBottom)) {\n return true;\n }\n }\n return false;\n }\n return focusSvc.focusFirstHeader();\n }\n forceFocusOutOfContainer(up = false) {\n this.view.forceFocusOutOfContainer(up);\n }\n isFocusInsideGridBody() {\n const focusableContainers = this.getFocusableContainers();\n const { indexWithFocus } = this.getNextFocusableIndex(focusableContainers);\n return focusableContainers[indexWithFocus]?.getFocusableContainerName() === \"gridBody\";\n }\n addFocusableContainer(container) {\n this.additionalFocusableContainers.add(container);\n }\n removeFocusableContainer(container) {\n this.additionalFocusableContainers.delete(container);\n }\n allowFocusForNextCoreContainer(up) {\n const coreContainers = this.view.getFocusableContainers();\n const { indexWithFocus, nextIndex } = this.getNextFocusableIndex(coreContainers, up);\n if (!this.focusNextInnerContainerDefault({\n backwards: !!up,\n focusableContainers: coreContainers,\n indexWithFocus,\n nextIndex\n })) {\n this.forceFocusOutOfContainer(up);\n }\n }\n isFocusable() {\n const beans = this.beans;\n return !_isCellFocusSuppressed(beans) || !_isHeaderFocusSuppressed(beans) || !!beans.sideBar?.comp?.isDisplayed();\n }\n getNextFocusableIndex(focusableContainers, backwards) {\n const activeEl = _getActiveDomElement(this.beans);\n const indexWithFocus = focusableContainers.findIndex((container) => container.getGui().contains(activeEl));\n return { indexWithFocus, nextIndex: indexWithFocus + (backwards ? -1 : 1) };\n }\n focusGridBodyDefault(backwards) {\n const {\n gos,\n beans,\n beans: {\n focusSvc,\n visibleCols: { allCols }\n }\n } = this;\n if (backwards) {\n return focusSvc.focusGridView({ column: _last(allCols), backwards: true });\n }\n if (gos.get(\"headerHeight\") === 0 || _isHeaderFocusSuppressed(beans)) {\n return focusSvc.focusGridView({ column: allCols[0] });\n }\n return focusSvc.focusFirstHeader();\n }\n focusNextInnerContainerDefault(params) {\n const { backwards, focusableContainers, indexWithFocus } = params;\n const step = backwards ? -1 : 1;\n for (let index = params.nextIndex; index >= 0 && index < focusableContainers.length; index += step) {\n const container = focusableContainers[index];\n const containerName = container.getFocusableContainerName();\n if (containerName === \"gridBody\") {\n const enteringGridBody = indexWithFocus === -1 || (backwards ? indexWithFocus > index : indexWithFocus < index);\n if (enteringGridBody) {\n if (this.focusGridBodyDefault(backwards)) {\n return true;\n }\n continue;\n }\n }\n if (focusContainer(container, backwards)) {\n return true;\n }\n }\n return false;\n }\n getFocusableContainers() {\n return [...this.view.getFocusableContainers(), ...this.additionalFocusableContainers];\n }\n destroy() {\n this.additionalFocusableContainers.clear();\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/gridComp/gridComp.ts\nvar GridComp = class extends TabGuardComp {\n constructor(eGridDiv) {\n super();\n this.gridBody = RefPlaceholder;\n this.gridHeaderDropZones = RefPlaceholder;\n this.sideBar = RefPlaceholder;\n this.statusBar = RefPlaceholder;\n this.pagination = RefPlaceholder;\n this.rootWrapperBody = RefPlaceholder;\n this.eGridDiv = eGridDiv;\n }\n postConstruct() {\n const compProxy = {\n destroyGridUi: () => this.destroyBean(this),\n setRtlClass: (cssClass) => this.addCss(cssClass),\n forceFocusOutOfContainer: this.forceFocusOutOfContainer.bind(this),\n updateLayoutClasses: this.updateLayoutClasses.bind(this),\n getFocusableContainers: this.getFocusableContainers.bind(this),\n setUserSelect: (value) => {\n this.getGui().style.userSelect = value != null ? value : \"\";\n this.getGui().style.webkitUserSelect = value != null ? value : \"\";\n },\n setCursor: (value) => {\n this.getGui().style.cursor = value != null ? value : \"\";\n }\n };\n const ctrl = this.createManagedBean(new GridCtrl());\n const comps = ctrl.getOptionalSelectors();\n const template = this.createTemplate(comps);\n const requiredComps = [GridBodySelector, ...Object.values(comps).filter((c) => !!c)];\n this.setTemplate(template, requiredComps);\n ctrl.setComp(compProxy, this.eGridDiv, this.getGui());\n this.insertGridIntoDom();\n this.initialiseTabGuard({\n // we want to override the default behaviour to do nothing for onTabKeyDown\n onTabKeyDown: () => void 0,\n focusInnerElement: (fromBottom) => ctrl.focusInnerElement(fromBottom),\n forceFocusOutWhenTabGuardsAreEmpty: true,\n isEmpty: () => !ctrl.isFocusable()\n });\n }\n insertGridIntoDom() {\n const eGui = this.getGui();\n this.eGridDiv.appendChild(eGui);\n this.addDestroyFunc(() => {\n eGui.remove();\n _logIfDebug(this.gos, \"Grid removed from DOM\");\n });\n }\n updateLayoutClasses(cssClass, params) {\n const eRootWrapperBodyClassList = this.rootWrapperBody.classList;\n const { AUTO_HEIGHT, NORMAL, PRINT } = LayoutCssClasses;\n const { autoHeight, normal, print } = params;\n eRootWrapperBodyClassList.toggle(AUTO_HEIGHT, autoHeight);\n eRootWrapperBodyClassList.toggle(NORMAL, normal);\n eRootWrapperBodyClassList.toggle(PRINT, print);\n this.toggleCss(AUTO_HEIGHT, autoHeight);\n this.toggleCss(NORMAL, normal);\n this.toggleCss(PRINT, print);\n }\n createTemplate(params) {\n const dropZones = params.gridHeaderDropZonesSelector ? { tag: \"ag-grid-header-drop-zones\", ref: \"gridHeaderDropZones\" } : null;\n const sideBar = params.sideBarSelector ? {\n tag: \"ag-side-bar\",\n ref: \"sideBar\"\n } : null;\n const statusBar = params.statusBarSelector ? { tag: \"ag-status-bar\", ref: \"statusBar\" } : null;\n const watermark = params.watermarkSelector ? { tag: \"ag-watermark\" } : null;\n const pagination = params.paginationSelector ? { tag: \"ag-pagination\", ref: \"pagination\" } : null;\n return {\n tag: \"div\",\n cls: \"ag-root-wrapper\",\n role: \"presentation\",\n children: [\n dropZones,\n {\n tag: \"div\",\n ref: \"rootWrapperBody\",\n cls: \"ag-root-wrapper-body\",\n role: \"presentation\",\n children: [{ tag: \"ag-grid-body\", ref: \"gridBody\" }, sideBar]\n },\n statusBar,\n pagination,\n watermark\n ]\n };\n }\n getFocusableElement() {\n return this.rootWrapperBody;\n }\n forceFocusOutOfContainer(up = false) {\n if (!up && this.pagination?.isDisplayed()) {\n this.pagination.forceFocusOutOfContainer(up);\n return;\n }\n super.forceFocusOutOfContainer(up);\n }\n getFocusableContainers() {\n const focusableContainers = [\n ...this.gridHeaderDropZones?.getFocusableContainers?.() ?? [],\n this.gridBody\n ];\n for (const comp of [this.sideBar, this.statusBar, this.pagination]) {\n if (comp) {\n focusableContainers.push(comp);\n }\n }\n return focusableContainers.filter((el) => _isVisible(el.getGui()));\n }\n};\n\n// packages/ag-grid-community/src/api/gridApiFunctions.ts\nvar mod = (moduleName, input) => {\n for (const key of Object.keys(input)) {\n input[key] = moduleName;\n }\n return input;\n};\nvar gridApiFunctionsMap = {\n dispatchEvent: \"CommunityCore\",\n // this is always registered\n ...mod(\"CommunityCore\", {\n destroy: 0,\n getGridId: 0,\n getGridOption: 0,\n isDestroyed: 0,\n setGridOption: 0,\n updateGridOptions: 0,\n isModuleRegistered: 0\n }),\n ...mod(\"GridState\", {\n getState: 0,\n setState: 0\n }),\n ...mod(\"SharedRowSelection\", {\n setNodesSelected: 0,\n selectAll: 0,\n deselectAll: 0,\n selectAllFiltered: 0,\n deselectAllFiltered: 0,\n selectAllOnCurrentPage: 0,\n deselectAllOnCurrentPage: 0,\n getSelectedNodes: 0,\n getSelectedRows: 0\n }),\n ...mod(\"RowApi\", {\n redrawRows: 0,\n setRowNodeExpanded: 0,\n getRowNode: 0,\n addRenderedRowListener: 0,\n getRenderedNodes: 0,\n forEachNode: 0,\n getFirstDisplayedRowIndex: 0,\n getLastDisplayedRowIndex: 0,\n getDisplayedRowAtIndex: 0,\n getDisplayedRowCount: 0\n }),\n ...mod(\"ScrollApi\", {\n getVerticalPixelRange: 0,\n getHorizontalPixelRange: 0,\n ensureColumnVisible: 0,\n ensureIndexVisible: 0,\n ensureNodeVisible: 0\n }),\n ...mod(\"KeyboardNavigation\", {\n getFocusedCell: 0,\n clearFocusedCell: 0,\n setFocusedCell: 0,\n tabToNextCell: 0,\n tabToPreviousCell: 0,\n setFocusedHeader: 0\n }),\n ...mod(\"EventApi\", {\n addEventListener: 0,\n addGlobalListener: 0,\n removeEventListener: 0,\n removeGlobalListener: 0\n }),\n ...mod(\"ValueCache\", {\n expireValueCache: 0\n }),\n ...mod(\"CellApi\", {\n getCellValue: 0\n }),\n ...mod(\"SharedMenu\", {\n showColumnMenu: 0,\n hidePopupMenu: 0\n }),\n ...mod(\"Sort\", {\n onSortChanged: 0\n }),\n ...mod(\"PinnedRow\", {\n getPinnedTopRowCount: 0,\n getPinnedBottomRowCount: 0,\n getPinnedTopRow: 0,\n getPinnedBottomRow: 0,\n forEachPinnedRow: 0\n }),\n ...mod(\"Overlay\", {\n showLoadingOverlay: 0,\n showNoRowsOverlay: 0,\n hideOverlay: 0\n }),\n ...mod(\"RenderApi\", {\n setGridAriaProperty: 0,\n refreshCells: 0,\n refreshHeader: 0,\n isAnimationFrameQueueEmpty: 0,\n flushAllAnimationFrames: 0,\n getSizesForCurrentTheme: 0,\n getCellRendererInstances: 0\n }),\n ...mod(\"HighlightChanges\", {\n flashCells: 0\n }),\n ...mod(\"RowDrag\", {\n addRowDropZone: 0,\n removeRowDropZone: 0,\n getRowDropZoneParams: 0,\n getRowDropPositionIndicator: 0,\n setRowDropPositionIndicator: 0\n }),\n ...mod(\"ColumnApi\", {\n getColumnDefs: 0,\n getColumnDef: 0,\n getDisplayNameForColumn: 0,\n getColumn: 0,\n getColumns: 0,\n applyColumnState: 0,\n getColumnState: 0,\n resetColumnState: 0,\n isPinning: 0,\n isPinningLeft: 0,\n isPinningRight: 0,\n getDisplayedColAfter: 0,\n getDisplayedColBefore: 0,\n setColumnsVisible: 0,\n setColumnsPinned: 0,\n getAllGridColumns: 0,\n getDisplayedLeftColumns: 0,\n getDisplayedCenterColumns: 0,\n getDisplayedRightColumns: 0,\n getAllDisplayedColumns: 0,\n getAllDisplayedVirtualColumns: 0\n }),\n ...mod(\"ColumnAutoSize\", {\n sizeColumnsToFit: 0,\n autoSizeColumns: 0,\n autoSizeAllColumns: 0\n }),\n ...mod(\"ColumnGroup\", {\n setColumnGroupOpened: 0,\n getColumnGroup: 0,\n getProvidedColumnGroup: 0,\n getDisplayNameForColumnGroup: 0,\n getColumnGroupState: 0,\n setColumnGroupState: 0,\n resetColumnGroupState: 0,\n getLeftDisplayedColumnGroups: 0,\n getCenterDisplayedColumnGroups: 0,\n getRightDisplayedColumnGroups: 0,\n getAllDisplayedColumnGroups: 0\n }),\n ...mod(\"ColumnMove\", {\n moveColumnByIndex: 0,\n moveColumns: 0\n }),\n ...mod(\"ColumnResize\", {\n setColumnWidths: 0\n }),\n ...mod(\"ColumnHover\", {\n isColumnHovered: 0\n }),\n ...mod(\"EditCore\", {\n getCellEditorInstances: 0,\n getEditingCells: 0,\n getEditRowValues: 0,\n stopEditing: 0,\n startEditingCell: 0,\n isEditing: 0,\n validateEdit: 0\n }),\n ...mod(\"BatchEdit\", {\n startBatchEdit: 0,\n cancelBatchEdit: 0,\n commitBatchEdit: 0,\n isBatchEditing: 0\n }),\n ...mod(\"UndoRedoEdit\", {\n undoCellEditing: 0,\n redoCellEditing: 0,\n getCurrentUndoSize: 0,\n getCurrentRedoSize: 0\n }),\n ...mod(\"FilterCore\", {\n isAnyFilterPresent: 0,\n onFilterChanged: 0\n }),\n ...mod(\"ColumnFilter\", {\n isColumnFilterPresent: 0,\n getColumnFilterInstance: 0,\n destroyFilter: 0,\n setFilterModel: 0,\n getFilterModel: 0,\n getColumnFilterModel: 0,\n setColumnFilterModel: 0,\n showColumnFilter: 0,\n hideColumnFilter: 0,\n getColumnFilterHandler: 0,\n doFilterAction: 0\n }),\n ...mod(\"QuickFilter\", {\n isQuickFilterPresent: 0,\n getQuickFilter: 0,\n resetQuickFilter: 0\n }),\n ...mod(\"Find\", {\n findGetActiveMatch: 0,\n findGetTotalMatches: 0,\n findGoTo: 0,\n findNext: 0,\n findPrevious: 0,\n findGetNumMatches: 0,\n findGetParts: 0,\n findClearActive: 0,\n findRefresh: 0\n }),\n ...mod(\"Pagination\", {\n paginationIsLastPageFound: 0,\n paginationGetPageSize: 0,\n paginationGetCurrentPage: 0,\n paginationGetTotalPages: 0,\n paginationGetRowCount: 0,\n paginationGoToNextPage: 0,\n paginationGoToPreviousPage: 0,\n paginationGoToFirstPage: 0,\n paginationGoToLastPage: 0,\n paginationGoToPage: 0\n }),\n ...mod(\"CsrmSsrmSharedApi\", {\n expandAll: 0,\n collapseAll: 0,\n resetRowGroupExpansion: 0\n }),\n ...mod(\"SsrmInfiniteSharedApi\", {\n setRowCount: 0,\n getCacheBlockState: 0,\n isLastRowIndexKnown: 0\n }),\n ...mod(\"ClientSideRowModelApi\", {\n onGroupExpandedOrCollapsed: 0,\n refreshClientSideRowModel: 0,\n isRowDataEmpty: 0,\n forEachLeafNode: 0,\n forEachNodeAfterFilter: 0,\n forEachNodeAfterFilterAndSort: 0,\n applyTransaction: 0,\n applyTransactionAsync: 0,\n flushAsyncTransactions: 0,\n getBestCostNodeSelection: 0,\n onRowHeightChanged: 0,\n resetRowHeights: 0\n }),\n ...mod(\"CsvExport\", {\n getDataAsCsv: 0,\n exportDataAsCsv: 0\n }),\n ...mod(\"InfiniteRowModel\", {\n refreshInfiniteCache: 0,\n purgeInfiniteCache: 0,\n getInfiniteRowCount: 0\n }),\n ...mod(\"AdvancedFilter\", {\n getAdvancedFilterModel: 0,\n setAdvancedFilterModel: 0,\n showAdvancedFilterBuilder: 0,\n hideAdvancedFilterBuilder: 0\n }),\n ...mod(\"IntegratedCharts\", {\n getChartModels: 0,\n getChartRef: 0,\n getChartImageDataURL: 0,\n downloadChart: 0,\n openChartToolPanel: 0,\n closeChartToolPanel: 0,\n createRangeChart: 0,\n createPivotChart: 0,\n createCrossFilterChart: 0,\n updateChart: 0,\n restoreChart: 0\n }),\n ...mod(\"Clipboard\", {\n copyToClipboard: 0,\n cutToClipboard: 0,\n copySelectedRowsToClipboard: 0,\n copySelectedRangeToClipboard: 0,\n copySelectedRangeDown: 0,\n pasteFromClipboard: 0\n }),\n ...mod(\"ExcelExport\", {\n getDataAsExcel: 0,\n exportDataAsExcel: 0,\n getSheetDataForExcel: 0,\n getMultipleSheetsAsExcel: 0,\n exportMultipleSheetsAsExcel: 0\n }),\n ...mod(\"SharedMasterDetail\", {\n addDetailGridInfo: 0,\n removeDetailGridInfo: 0,\n getDetailGridInfo: 0,\n forEachDetailGridInfo: 0\n }),\n ...mod(\"ContextMenu\", {\n showContextMenu: 0\n }),\n ...mod(\"ColumnMenu\", {\n showColumnChooser: 0,\n hideColumnChooser: 0\n }),\n ...mod(\"CellSelection\", {\n getCellRanges: 0,\n addCellRange: 0,\n clearRangeSelection: 0,\n clearCellSelection: 0\n }),\n ...mod(\"SharedRowGrouping\", {\n setRowGroupColumns: 0,\n removeRowGroupColumns: 0,\n addRowGroupColumns: 0,\n getRowGroupColumns: 0,\n moveRowGroupColumn: 0\n }),\n ...mod(\"SharedAggregation\", {\n addAggFuncs: 0,\n clearAggFuncs: 0,\n setColumnAggFunc: 0\n }),\n ...mod(\"SharedPivot\", {\n isPivotMode: 0,\n getPivotResultColumn: 0,\n setValueColumns: 0,\n getValueColumns: 0,\n removeValueColumns: 0,\n addValueColumns: 0,\n setPivotColumns: 0,\n removePivotColumns: 0,\n addPivotColumns: 0,\n getPivotColumns: 0,\n setPivotResultColumns: 0,\n getPivotResultColumns: 0\n }),\n ...mod(\"ServerSideRowModelApi\", {\n getServerSideSelectionState: 0,\n setServerSideSelectionState: 0,\n applyServerSideTransaction: 0,\n applyServerSideTransactionAsync: 0,\n applyServerSideRowData: 0,\n retryServerSideLoads: 0,\n flushServerSideAsyncTransactions: 0,\n refreshServerSide: 0,\n getServerSideGroupLevelState: 0,\n onRowHeightChanged: 0,\n resetRowHeights: 0\n }),\n ...mod(\"SideBar\", {\n isSideBarVisible: 0,\n setSideBarVisible: 0,\n setSideBarPosition: 0,\n openToolPanel: 0,\n closeToolPanel: 0,\n getOpenedToolPanel: 0,\n refreshToolPanel: 0,\n isToolPanelShowing: 0,\n getToolPanelInstance: 0,\n getSideBar: 0\n }),\n ...mod(\"StatusBar\", {\n getStatusPanel: 0\n }),\n ...mod(\"AiToolkit\", {\n getStructuredSchema: 0\n })\n};\n\n// packages/ag-grid-community/src/api/apiFunctionService.ts\nvar defaultFns = {\n isDestroyed: () => true,\n destroy() {\n },\n preConstruct() {\n },\n postConstruct() {\n },\n preWireBeans() {\n },\n wireBeans() {\n }\n};\nvar dispatchEvent = (beans, event) => beans.eventSvc.dispatchEvent(event);\nvar GridApiClass = class {\n};\nReflect.defineProperty(GridApiClass, \"name\", { value: \"GridApi\" });\nvar ApiFunctionService = class extends BeanStub {\n constructor() {\n super();\n this.beanName = \"apiFunctionSvc\";\n this.api = new GridApiClass();\n this.fns = {\n ...defaultFns,\n // dispatchEvent is used by frameworks, also used by aligned grids to identify a grid api instance\n dispatchEvent\n };\n this.preDestroyLink = \"\";\n const { api } = this;\n for (const key of Object.keys(gridApiFunctionsMap)) {\n api[key] = this.makeApi(key)[key];\n }\n }\n postConstruct() {\n this.preDestroyLink = this.beans.frameworkOverrides.getDocLink(\"grid-lifecycle/#grid-pre-destroyed\");\n }\n addFunction(functionName, func) {\n const { fns, beans } = this;\n if (fns !== defaultFns) {\n fns[functionName] = beans?.validation?.validateApiFunction(functionName, func) ?? func;\n }\n }\n makeApi(apiName) {\n return {\n [apiName]: (...args) => {\n const {\n beans,\n fns: { [apiName]: fn }\n } = this;\n return fn ? fn(beans, ...args) : this.apiNotFound(apiName);\n }\n };\n }\n apiNotFound(fnName) {\n const { beans, gos, preDestroyLink } = this;\n if (!beans) {\n _warn(26, { fnName, preDestroyLink });\n } else {\n const module = gridApiFunctionsMap[fnName];\n if (gos.assertModuleRegistered(module, `api.${fnName}`)) {\n _warn(27, { fnName, module });\n }\n }\n }\n destroy() {\n super.destroy();\n this.fns = defaultFns;\n this.beans = null;\n }\n};\n\n// packages/ag-grid-community/src/api/coreApi.ts\nfunction getGridId(beans) {\n return beans.context.getId();\n}\nfunction destroy(beans) {\n beans.gridDestroySvc.destroy();\n}\nfunction isDestroyed(beans) {\n return beans.gridDestroySvc.destroyCalled;\n}\nfunction getGridOption(beans, key) {\n return beans.gos.get(key);\n}\nfunction setGridOption(beans, key, value) {\n updateGridOptions(beans, { [key]: value });\n}\nfunction updateGridOptions(beans, options) {\n beans.gos.updateGridOptions({ options });\n}\nfunction isModuleRegistered(beans, moduleName) {\n const withoutSuffix = moduleName.replace(/Module$/, \"\");\n return beans.gos.isModuleRegistered(withoutSuffix);\n}\n\n// packages/ag-grid-community/src/utils/icon.ts\nfunction _createIcon(iconName, beans, column) {\n const iconContents = _createIconNoSpan(iconName, beans, column);\n if (iconContents) {\n const { className } = iconContents;\n if (typeof className === \"string\" && className.includes(\"ag-icon\") || typeof className === \"object\" && className[\"ag-icon\"]) {\n return iconContents;\n }\n }\n const eResult = _createElement({ tag: \"span\" });\n eResult.appendChild(iconContents);\n return eResult;\n}\nfunction _createIconNoSpan(iconName, beans, column) {\n let userProvidedIcon = null;\n if (iconName === \"smallDown\") {\n _warn(262);\n } else if (iconName === \"smallLeft\") {\n _warn(263);\n } else if (iconName === \"smallRight\") {\n _warn(264);\n }\n const icons = column?.getColDef().icons;\n if (icons) {\n userProvidedIcon = icons[iconName];\n }\n if (beans.gos && !userProvidedIcon) {\n const optionsIcons = beans.gos.get(\"icons\");\n if (optionsIcons) {\n userProvidedIcon = optionsIcons[iconName];\n }\n }\n if (userProvidedIcon) {\n let rendererResult;\n if (typeof userProvidedIcon === \"function\") {\n rendererResult = userProvidedIcon();\n } else if (typeof userProvidedIcon === \"string\") {\n rendererResult = userProvidedIcon;\n } else {\n _warn(38, { iconName });\n return void 0;\n }\n if (typeof rendererResult === \"string\") {\n return _loadTemplate(rendererResult);\n }\n if (_isNodeOrElement(rendererResult)) {\n return rendererResult;\n }\n _warn(133, { iconName });\n return void 0;\n } else {\n const iconValue = beans.registry.getIcon(iconName);\n if (!iconValue) {\n beans.validation?.validateIcon(iconName);\n }\n return _createElement({\n tag: \"span\",\n cls: `ag-icon ag-icon-${iconValue ?? iconName}`,\n role: \"presentation\",\n attrs: { unselectable: \"on\" }\n });\n }\n}\n\n// packages/ag-grid-community/src/rendering/dndSourceComp.ts\nvar DndSourceElement = { tag: \"div\", cls: \"ag-drag-handle ag-row-drag\", attrs: { draggable: \"true\" } };\nvar DndSourceComp = class extends Component {\n constructor(rowNode, column, eCell) {\n super(DndSourceElement);\n this.rowNode = rowNode;\n this.column = column;\n this.eCell = eCell;\n }\n postConstruct() {\n const eGui = this.getGui();\n eGui.appendChild(_createIconNoSpan(\"rowDrag\", this.beans, null));\n this.addGuiEventListener(\"mousedown\", (e) => {\n e.stopPropagation();\n });\n this.addDragSource();\n this.checkVisibility();\n }\n addDragSource() {\n this.addGuiEventListener(\"dragstart\", this.onDragStart.bind(this));\n }\n onDragStart(dragEvent) {\n const { rowNode, column, eCell, gos } = this;\n const providedOnRowDrag = column.getColDef().dndSourceOnRowDrag;\n const dataTransfer = dragEvent.dataTransfer;\n dataTransfer.setDragImage(eCell, 0, 0);\n if (providedOnRowDrag) {\n const params = _addGridCommonParams(gos, {\n rowNode,\n dragEvent\n });\n providedOnRowDrag(params);\n } else {\n try {\n const jsonData = JSON.stringify(rowNode.data);\n dataTransfer.setData(\"application/json\", jsonData);\n dataTransfer.setData(\"text/plain\", jsonData);\n } catch (e) {\n }\n }\n }\n checkVisibility() {\n const visible = this.column.isDndSource(this.rowNode);\n this.setDisplayed(visible);\n }\n};\n\n// packages/ag-grid-community/src/dragAndDrop/dragAndDropImageComponent.css\nvar dragAndDropImageComponent_default = \".ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}.ag-dnd-ghost-not-allowed{border:var(--ag-drag-and-drop-image-not-allowed-border)}\";\n\n// packages/ag-grid-community/src/dragAndDrop/dragAndDropImageComponent.ts\nvar DragAndDropElement = {\n tag: \"div\",\n children: [\n {\n tag: \"div\",\n ref: \"eGhost\",\n cls: \"ag-dnd-ghost ag-unselectable\",\n children: [\n { tag: \"span\", ref: \"eIcon\", cls: \"ag-dnd-ghost-icon ag-shake-left-to-right\" },\n { tag: \"div\", ref: \"eLabel\", cls: \"ag-dnd-ghost-label\" }\n ]\n }\n ]\n};\nvar DragAndDropImageComponent2 = class extends Component {\n constructor() {\n super();\n this.dragSource = null;\n this.eIcon = RefPlaceholder;\n this.eLabel = RefPlaceholder;\n this.eGhost = RefPlaceholder;\n this.registerCSS(dragAndDropImageComponent_default);\n }\n postConstruct() {\n const create = (iconName) => _createIcon(iconName, this.beans, null);\n this.dropIconMap = {\n pinned: create(\"columnMovePin\"),\n hide: create(\"columnMoveHide\"),\n move: create(\"columnMoveMove\"),\n left: create(\"columnMoveLeft\"),\n right: create(\"columnMoveRight\"),\n group: create(\"columnMoveGroup\"),\n aggregate: create(\"columnMoveValue\"),\n pivot: create(\"columnMovePivot\"),\n notAllowed: create(\"dropNotAllowed\")\n };\n }\n init(params) {\n this.dragSource = params.dragSource;\n this.setTemplate(DragAndDropElement);\n this.beans.environment.applyThemeClasses(this.eGhost);\n }\n destroy() {\n this.dragSource = null;\n super.destroy();\n }\n setIcon(iconName, shake) {\n const { eGhost, eIcon, dragSource, dropIconMap, gos } = this;\n _clearElement(eIcon);\n let eIconChild = null;\n if (!iconName) {\n iconName = dragSource?.getDefaultIconName ? dragSource.getDefaultIconName() : \"notAllowed\";\n }\n eIconChild = dropIconMap[iconName];\n eGhost.classList.toggle(\"ag-dnd-ghost-not-allowed\", iconName === \"notAllowed\");\n eIcon.classList.toggle(\"ag-shake-left-to-right\", shake);\n if (eIconChild === dropIconMap[\"hide\"] && gos.get(\"suppressDragLeaveHidesColumns\")) {\n return;\n }\n if (eIconChild) {\n eIcon.appendChild(eIconChild);\n }\n }\n setLabel(label) {\n this.eLabel.textContent = label;\n }\n};\n\n// packages/ag-grid-community/src/dragAndDrop/dragApi.ts\nfunction addRowDropZone(beans, params) {\n beans.rowDragSvc?.rowDragFeature?.addRowDropZone(params);\n}\nfunction removeRowDropZone(beans, params) {\n const activeDropTarget = beans.dragAndDrop?.findExternalZone(params.getContainer());\n if (activeDropTarget) {\n beans.dragAndDrop?.removeDropTarget(activeDropTarget);\n }\n}\nfunction getRowDropZoneParams(beans, events) {\n return beans.rowDragSvc?.rowDragFeature?.getRowDropZone(events);\n}\nfunction getRowDropPositionIndicator(beans) {\n const rowDropHighlightSvc = beans.rowDropHighlightSvc;\n return rowDropHighlightSvc ? { row: rowDropHighlightSvc.row, dropIndicatorPosition: rowDropHighlightSvc.position } : { row: null, dropIndicatorPosition: \"none\" };\n}\nfunction setRowDropPositionIndicator(beans, params) {\n const rowDropHighlightSvc = beans.rowDropHighlightSvc;\n if (!rowDropHighlightSvc) {\n return;\n }\n const rowNode = params?.row;\n let position = params?.dropIndicatorPosition;\n if (position !== \"above\" && position !== \"below\" && position !== \"inside\") {\n position = \"none\";\n }\n const rowIndex = rowNode?.rowIndex;\n if (rowIndex === null || rowIndex === void 0 || position === \"none\") {\n rowDropHighlightSvc.clear();\n } else {\n rowDropHighlightSvc.set(rowNode, position);\n }\n}\n\n// packages/ag-grid-community/src/agStack/events/pointerCapture.ts\nvar tryPointerCapture = (eElement, pointerId) => {\n if (pointerId != null && eElement?.setPointerCapture) {\n try {\n eElement.setPointerCapture(pointerId);\n return eElement.hasPointerCapture(pointerId);\n } catch {\n }\n }\n return false;\n};\nvar capturePointer = (eElement, mouseEvent) => {\n if (typeof PointerEvent === \"undefined\" || !(mouseEvent instanceof PointerEvent)) {\n return null;\n }\n const pointerId = mouseEvent.pointerId;\n if (!tryPointerCapture(eElement, pointerId)) {\n return null;\n }\n const capture = {\n eElement,\n pointerId,\n onLost(pointerEvent) {\n pointerLostHandler(capture, pointerEvent);\n }\n };\n eElement.addEventListener(\"lostpointercapture\", capture.onLost);\n return capture;\n};\nvar releasePointerCapture = (capture) => {\n if (!capture) {\n return;\n }\n removeLostHandler(capture);\n const { eElement, pointerId } = capture;\n if (!eElement) {\n return;\n }\n try {\n eElement.releasePointerCapture(pointerId);\n } catch {\n }\n capture.eElement = null;\n};\nvar removeLostHandler = (capture) => {\n const { eElement, onLost } = capture;\n if (eElement && onLost) {\n eElement.removeEventListener(\"lostpointercapture\", onLost);\n capture.onLost = null;\n }\n};\nvar pointerLostHandler = (capture, pointerEvent) => {\n removeLostHandler(capture);\n const { eElement, pointerId } = capture;\n if (eElement && pointerEvent.pointerId === pointerId) {\n tryPointerCapture(eElement, pointerId);\n }\n};\n\n// packages/ag-grid-community/src/agStack/core/baseDragService.ts\nvar activePointerDrags;\nvar handledDragEvents;\nvar PASSIVE_TRUE = { passive: true };\nvar PASSIVE_FALSE = { passive: false };\nvar addHandledDragEvent = (event) => {\n if (!handledDragEvents) {\n handledDragEvents = /* @__PURE__ */ new WeakSet();\n } else if (handledDragEvents.has(event)) {\n return false;\n }\n handledDragEvents.add(event);\n return true;\n};\nvar BaseDragService = class extends AgBeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"dragSvc\";\n this.dragging = false;\n this.drag = null;\n this.dragSources = [];\n }\n get startTarget() {\n return this.drag?.start.target ?? null;\n }\n /** True if there is at least one active pointer drag in any BaseDragService instance in the page */\n isPointer() {\n return !!activePointerDrags?.has(_getRootNode(this.beans));\n }\n hasPointerCapture() {\n const capture = this.drag?.pointerCapture;\n return !!(capture && this.beans.eRootDiv.hasPointerCapture?.(capture.pointerId));\n }\n destroy() {\n if (this.drag) {\n this.cancelDrag();\n }\n const dragSources = this.dragSources;\n for (const entry of dragSources) {\n destroyDragSourceEntry(entry);\n }\n dragSources.length = 0;\n super.destroy();\n }\n removeDragSource(params) {\n const dragSources = this.dragSources;\n for (let i = 0, len = dragSources.length; i < len; ++i) {\n const entry = dragSources[i];\n if (entry.params === params) {\n dragSources.splice(i, 1);\n destroyDragSourceEntry(entry);\n break;\n }\n }\n }\n addDragSource(params) {\n if (!this.isAlive()) {\n return;\n }\n const { eElement, includeTouch } = params;\n const handlers = [];\n let oldTouchAction;\n if (includeTouch) {\n const style = eElement.style;\n if (style) {\n oldTouchAction = style.touchAction;\n style.touchAction = \"none\";\n }\n }\n const dragSource = { handlers, params, oldTouchAction };\n this.dragSources.push(dragSource);\n const pointerDownListener = (event) => this.onPointerDown(params, event);\n const mouseListener = (event) => this.onMouseDown(params, event);\n addTempEventHandlers(\n handlers,\n [eElement, \"pointerdown\", pointerDownListener, PASSIVE_FALSE],\n [eElement, \"mousedown\", mouseListener]\n );\n const suppressTouch = this.gos.get(\"suppressTouch\");\n if (includeTouch && !suppressTouch) {\n const touchListener = (touchEvent) => this.onTouchStart(params, touchEvent);\n addTempEventHandlers(handlers, [eElement, \"touchstart\", touchListener, PASSIVE_FALSE]);\n }\n }\n cancelDrag(eElement) {\n const drag = this.drag;\n eElement ?? (eElement = drag?.eElement);\n if (eElement) {\n this.eventSvc.dispatchEvent({ type: \"dragCancelled\", target: eElement });\n }\n drag?.params.onDragCancel?.();\n this.destroyDrag();\n }\n shouldPreventMouseEvent(mouseEvent) {\n const type = mouseEvent.type;\n const isMouseMove = type === \"mousemove\" || type === \"pointermove\";\n return isMouseMove && mouseEvent.cancelable && _isEventFromThisInstance(this.beans, mouseEvent) && !_isFocusableFormField(getEventTargetElement(mouseEvent));\n }\n initDrag(drag, ...handlers) {\n this.drag = drag;\n const beans = this.beans;\n const onScroll = (event) => this.onScroll(event);\n const keydownEvent = (ev) => this.onKeyDown(ev);\n const rootEl = _getRootNode(beans);\n const eDocument = _getDocument(beans);\n addTempEventHandlers(\n drag.handlers,\n [rootEl, \"contextmenu\", preventEventDefault],\n [rootEl, \"keydown\", keydownEvent],\n [eDocument, \"scroll\", onScroll, { capture: true }],\n [eDocument.defaultView || window, \"scroll\", onScroll],\n ...handlers\n );\n }\n destroyDrag() {\n this.dragging = false;\n const drag = this.drag;\n if (drag) {\n const rootEl = drag.rootEl;\n if (activePointerDrags?.get(rootEl) === drag) {\n activePointerDrags.delete(rootEl);\n }\n this.drag = null;\n releasePointerCapture(drag.pointerCapture);\n clearTempEventHandlers(drag.handlers);\n }\n }\n // Pointer Events path (preferred when supported)\n onPointerDown(params, pointerEvent) {\n if (this.isPointer()) {\n return;\n }\n const beans = this.beans;\n if (handledDragEvents?.has(pointerEvent)) {\n return;\n }\n const pointerType = pointerEvent.pointerType;\n if (pointerType === \"touch\") {\n if (beans.gos.get(\"suppressTouch\") || !params.includeTouch) {\n return;\n }\n if (params.stopPropagationForTouch) {\n pointerEvent.stopPropagation();\n }\n if (_isFocusableFormField(getEventTargetElement(pointerEvent))) {\n return;\n }\n }\n if (!pointerEvent.isPrimary) {\n return;\n }\n if (pointerType === \"mouse\" && pointerEvent.button !== 0) {\n return;\n }\n this.destroyDrag();\n const rootEl = _getRootNode(beans);\n const eElement = params.eElement;\n const pointerId = pointerEvent.pointerId;\n const pointerDrag = new Dragging(rootEl, params, pointerEvent, pointerId);\n activePointerDrags ?? (activePointerDrags = /* @__PURE__ */ new WeakMap());\n activePointerDrags.set(rootEl, pointerDrag);\n const onPointerMove = (ev) => {\n if (ev.pointerId === pointerId) {\n this.onMouseOrPointerMove(ev);\n }\n };\n const onUp = (ev) => {\n if (ev.pointerId === pointerId) {\n this.onMouseOrPointerUp(ev);\n }\n };\n const onCancel = (ev) => {\n if (ev.pointerId === pointerId && addHandledDragEvent(ev)) {\n this.cancelDrag();\n }\n };\n const dragPreventEventDefault = (e) => this.draggingPreventDefault(e);\n this.initDrag(\n pointerDrag,\n [rootEl, \"pointerup\", onUp],\n [rootEl, \"pointercancel\", onCancel],\n [rootEl, \"pointermove\", onPointerMove, PASSIVE_FALSE],\n [rootEl, \"touchmove\", dragPreventEventDefault, PASSIVE_FALSE],\n [eElement, \"mousemove\", dragPreventEventDefault, PASSIVE_FALSE]\n );\n if (params.dragStartPixels === 0) {\n this.onMouseOrPointerMove(pointerEvent);\n } else {\n addHandledDragEvent(pointerEvent);\n }\n }\n // gets called whenever mouse down on any drag source\n onTouchStart(params, touchEvent) {\n const suppressTouch = this.gos.get(\"suppressTouch\");\n if (suppressTouch || !params.includeTouch) {\n return;\n }\n if (!addHandledDragEvent(touchEvent)) {\n return;\n }\n if (_isFocusableFormField(getEventTargetElement(touchEvent))) {\n return;\n }\n if (params.stopPropagationForTouch) {\n touchEvent.stopPropagation();\n }\n if (this.isPointer()) {\n if (this.dragging) {\n preventEventDefault(touchEvent);\n }\n return;\n }\n this.destroyDrag();\n const beans = this.beans;\n const rootEl = _getRootNode(beans);\n const touchDrag = new Dragging(rootEl, params, touchEvent.touches[0]);\n const touchMoveEvent = (e) => this.onTouchMove(e);\n const touchEndEvent = (e) => this.onTouchUp(e);\n const touchCancelEvent = (e) => this.onTouchCancel(e);\n const dragPreventEventDefault = (e) => this.draggingPreventDefault(e);\n const rootNode = _getRootNode(beans);\n const target = touchEvent.target ?? params.eElement;\n this.initDrag(\n touchDrag,\n [target, \"touchmove\", touchMoveEvent, PASSIVE_TRUE],\n [target, \"touchend\", touchEndEvent, PASSIVE_TRUE],\n [target, \"touchcancel\", touchCancelEvent, PASSIVE_TRUE],\n [rootNode, \"touchmove\", dragPreventEventDefault, PASSIVE_FALSE],\n [rootNode, \"touchend\", touchEndEvent, PASSIVE_FALSE],\n [rootNode, \"touchcancel\", touchCancelEvent, PASSIVE_FALSE]\n );\n if (params.dragStartPixels === 0) {\n this.onMove(touchDrag.start);\n }\n }\n /** preventEventDefault on the event while dragging only and if the event is cancellable */\n draggingPreventDefault(e) {\n if (this.dragging) {\n preventEventDefault(e);\n }\n }\n // gets called whenever mouse down on any drag source\n onMouseDown(params, mouseEvent) {\n if (mouseEvent.button !== 0) {\n return;\n }\n if (handledDragEvents?.has(mouseEvent)) {\n return;\n }\n if (this.isPointer()) {\n return;\n }\n const beans = this.beans;\n this.destroyDrag();\n const mouseDrag = new Dragging(_getRootNode(beans), params, mouseEvent);\n const mouseMoveEvent = (event) => this.onMouseOrPointerMove(event);\n const mouseUpEvent = (event) => this.onMouseOrPointerUp(event);\n const target = _getRootNode(beans);\n this.initDrag(mouseDrag, [target, \"mousemove\", mouseMoveEvent], [target, \"mouseup\", mouseUpEvent]);\n if (params.dragStartPixels === 0) {\n this.onMouseOrPointerMove(mouseEvent);\n } else {\n addHandledDragEvent(mouseEvent);\n }\n }\n onScroll(event) {\n if (!addHandledDragEvent(event)) {\n return;\n }\n const drag = this.drag;\n const lastDrag = drag?.lastDrag;\n if (lastDrag && this.dragging) {\n drag.params?.onDragging?.(lastDrag);\n }\n }\n /** only gets called after a mouse down - as this is only added after mouseDown and is removed when mouseUp happens */\n onMouseOrPointerMove(mouseEvent) {\n if (!addHandledDragEvent(mouseEvent)) {\n return;\n }\n if (_isBrowserSafari()) {\n _getDocument(this.beans).getSelection()?.removeAllRanges();\n }\n if (this.shouldPreventMouseEvent(mouseEvent)) {\n preventEventDefault(mouseEvent);\n }\n this.onMove(mouseEvent);\n }\n onTouchCancel(touchEvent) {\n const drag = this.drag;\n if (!drag || !addHandledDragEvent(touchEvent)) {\n return;\n }\n if (!_getFirstActiveTouch(drag.start, touchEvent.changedTouches)) {\n return;\n }\n this.cancelDrag();\n }\n onTouchMove(touchEvent) {\n const drag = this.drag;\n if (!drag || !addHandledDragEvent(touchEvent)) {\n return;\n }\n const touch = _getFirstActiveTouch(drag.start, touchEvent.touches);\n if (touch) {\n this.onMove(touch);\n this.draggingPreventDefault(touchEvent);\n }\n }\n onMove(currentEvent) {\n const drag = this.drag;\n if (!drag) {\n return;\n }\n drag.lastDrag = currentEvent;\n const dragSource = drag.params;\n if (!this.dragging) {\n const start = drag.start;\n const dragStartPixels = dragSource.dragStartPixels;\n const requiredPixelDiff = dragStartPixels ?? 4;\n if (_areEventsNear(currentEvent, start, requiredPixelDiff)) {\n return;\n }\n this.dragging = true;\n if (dragSource.capturePointer) {\n drag.pointerCapture = capturePointer(this.beans.eRootDiv, currentEvent);\n }\n this.eventSvc.dispatchEvent({\n type: \"dragStarted\",\n target: dragSource.eElement\n });\n dragSource.onDragStart?.(start);\n if (this.drag !== drag) {\n return;\n }\n dragSource.onDragging?.(start);\n if (this.drag !== drag) {\n return;\n }\n }\n dragSource.onDragging?.(currentEvent);\n }\n onTouchUp(touchEvent) {\n const drag = this.drag;\n if (drag && addHandledDragEvent(touchEvent)) {\n this.onUp(_getFirstActiveTouch(drag.start, touchEvent.changedTouches));\n }\n }\n onMouseOrPointerUp(mouseEvent) {\n if (addHandledDragEvent(mouseEvent)) {\n this.onUp(mouseEvent);\n }\n }\n onUp(eventOrTouch) {\n const drag = this.drag;\n if (!drag) {\n return;\n }\n if (!eventOrTouch) {\n eventOrTouch = drag.lastDrag;\n }\n if (eventOrTouch && this.dragging) {\n this.dragging = false;\n drag.params.onDragStop?.(eventOrTouch);\n this.eventSvc.dispatchEvent({\n type: \"dragStopped\",\n target: drag.params.eElement\n });\n }\n this.destroyDrag();\n }\n // shared keydown handler to cancel current drag with ESC\n onKeyDown(event) {\n if (event.key === KeyCode.ESCAPE) {\n this.cancelDrag();\n }\n }\n};\nvar destroyDragSourceEntry = (dragSource) => {\n clearTempEventHandlers(dragSource.handlers);\n const oldTouchAction = dragSource.oldTouchAction;\n if (oldTouchAction != null) {\n const style = dragSource.params.eElement.style;\n if (style) {\n style.touchAction = oldTouchAction;\n }\n }\n};\nvar Dragging = class {\n constructor(rootEl, params, start, pointerId = null) {\n this.rootEl = rootEl;\n this.params = params;\n this.start = start;\n this.pointerId = pointerId;\n this.handlers = [];\n this.lastDrag = null;\n this.pointerCapture = null;\n this.eElement = params.eElement;\n }\n};\nvar getEventTargetElement = (event) => {\n const target = event.target;\n return target instanceof Element ? target : null;\n};\n\n// packages/ag-grid-community/src/dragAndDrop/dragService.ts\nvar DragService = class extends BaseDragService {\n shouldPreventMouseEvent(mouseEvent) {\n const isEnableCellTextSelect = this.gos.get(\"enableCellTextSelection\");\n return isEnableCellTextSelect && super.shouldPreventMouseEvent(mouseEvent);\n }\n};\n\n// packages/ag-grid-community/src/dragAndDrop/horizontalResizeService.ts\nvar HorizontalResizeService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"horizontalResizeSvc\";\n }\n addResizeBar(params) {\n const dragSource = {\n dragStartPixels: params.dragStartPixels || 0,\n eElement: params.eResizeBar,\n onDragStart: this.onDragStart.bind(this, params),\n onDragStop: this.onDragStop.bind(this, params),\n onDragging: this.onDragging.bind(this, params),\n onDragCancel: this.onDragStop.bind(this, params),\n includeTouch: true,\n stopPropagationForTouch: true\n };\n const { dragSvc } = this.beans;\n dragSvc.addDragSource(dragSource);\n const finishedWithResizeFunc = () => dragSvc.removeDragSource(dragSource);\n return finishedWithResizeFunc;\n }\n onDragStart(params, mouseEvent) {\n this.dragStartX = mouseEvent.clientX;\n this.setResizeIcons();\n const shiftKey = mouseEvent instanceof MouseEvent && mouseEvent.shiftKey === true;\n params.onResizeStart(shiftKey);\n }\n setResizeIcons() {\n const ctrl = this.beans.ctrlsSvc.get(\"gridCtrl\");\n ctrl.setResizeCursor(1 /* Horizontal */);\n ctrl.disableUserSelect(true);\n }\n onDragStop(params) {\n params.onResizeEnd(this.resizeAmount);\n this.resetIcons();\n }\n resetIcons() {\n const ctrl = this.beans.ctrlsSvc.get(\"gridCtrl\");\n ctrl.setResizeCursor(false);\n ctrl.disableUserSelect(false);\n }\n onDragging(params, mouseEvent) {\n this.resizeAmount = mouseEvent.clientX - this.dragStartX;\n params.onResizing(this.resizeAmount);\n }\n};\n\n// packages/ag-grid-community/src/dragAndDrop/rowDragComp.ts\nvar RowDragElement = {\n tag: \"div\",\n cls: \"ag-drag-handle ag-row-drag\",\n attrs: { \"aria-hidden\": \"true\" }\n};\nvar SKIP_ARIA_HIDDEN = { skipAriaHidden: true };\nvar RowDragComp = class extends Component {\n constructor(cellValueFn, rowNode, column, customGui, dragStartPixels, alwaysVisible = false) {\n super();\n this.cellValueFn = cellValueFn;\n this.rowNode = rowNode;\n this.column = column;\n this.customGui = customGui;\n this.dragStartPixels = dragStartPixels;\n this.alwaysVisible = alwaysVisible;\n this.dragSource = null;\n this.disabled = false;\n }\n isCustomGui() {\n return this.customGui != null;\n }\n postConstruct() {\n const { beans, customGui } = this;\n if (customGui) {\n this.setDragElement(customGui, this.dragStartPixels);\n } else {\n this.setTemplate(RowDragElement);\n this.getGui().appendChild(_createIconNoSpan(\"rowDrag\", beans, null));\n this.addDragSource();\n }\n if (!this.alwaysVisible) {\n this.initCellDrag();\n }\n }\n initCellDrag() {\n const { beans, rowNode } = this;\n const refreshVisibility = this.refreshVisibility.bind(this);\n this.addManagedListeners(beans.eventSvc, {\n rowDragVisibilityChanged: refreshVisibility\n });\n this.addManagedListeners(rowNode, {\n dataChanged: refreshVisibility,\n cellChanged: refreshVisibility\n });\n this.refreshVisibility();\n }\n setDragElement(dragElement, dragStartPixels) {\n this.setTemplateFromElement(dragElement, void 0, void 0, true);\n this.addDragSource(dragStartPixels);\n }\n refreshVisibility() {\n if (this.alwaysVisible) {\n return;\n }\n const { beans, column, rowNode } = this;\n const { gos, dragAndDrop, rowDragSvc } = beans;\n const visibility = rowDragSvc?.visibility;\n const hide = visibility === \"suppress\" || visibility === \"hidden\" && !dragAndDrop?.hasExternalDropZones();\n let displayed = !hide;\n let visible = displayed;\n if (displayed && !this.isCustomGui() && column) {\n const rowDragProp = column.getColDef().rowDrag;\n if (rowDragProp === false) {\n displayed = false;\n } else {\n const shownSometimes = typeof rowDragProp === \"function\";\n visible = column.isRowDrag(rowNode);\n displayed = shownSometimes || visible;\n }\n }\n if (displayed && visible && rowNode.footer && gos.get(\"rowDragManaged\")) {\n visible = false;\n displayed = true;\n }\n visible && (visible = displayed);\n if (!displayed) {\n this.setDisplayed(displayed, SKIP_ARIA_HIDDEN);\n }\n if (!visible) {\n this.setVisible(visible, SKIP_ARIA_HIDDEN);\n }\n this.setDisabled(!visible || visibility === \"disabled\" && !dragAndDrop?.hasExternalDropZones());\n if (displayed) {\n this.setDisplayed(displayed, SKIP_ARIA_HIDDEN);\n }\n if (visible) {\n this.setVisible(visible, SKIP_ARIA_HIDDEN);\n }\n }\n setDisabled(disabled) {\n if (disabled !== this.disabled) {\n this.disabled = disabled;\n this.getGui()?.classList?.toggle(\"ag-drag-handle-disabled\", disabled);\n }\n }\n getSelectedNodes() {\n const rowNode = this.rowNode;\n const isRowDragMultiRow = this.gos.get(\"rowDragMultiRow\");\n if (!isRowDragMultiRow) {\n return [rowNode];\n }\n const selection = this.beans.selectionSvc?.getSelectedNodes() ?? [];\n return selection.indexOf(rowNode) !== -1 ? selection : [rowNode];\n }\n getDragItem() {\n const { column, rowNode } = this;\n return {\n rowNode,\n rowNodes: this.getSelectedNodes(),\n columns: column ? [column] : void 0,\n defaultTextValue: this.cellValueFn()\n };\n }\n addDragSource(dragStartPixels = 4) {\n if (this.dragSource) {\n this.removeDragSource();\n }\n if (this.gos.get(\"rowDragManaged\") && this.rowNode.footer) {\n return;\n }\n const eGui = this.getGui();\n if (this.gos.get(\"enableCellTextSelection\")) {\n this.removeMouseDownListener();\n const listeners = _isEventSupported(\"pointerdown\") ? { pointerdown: preventEventDefault } : { mousedown: preventEventDefault };\n this.mouseDownListener = this.addManagedElementListeners(eGui, listeners)[0];\n }\n const translate = this.getLocaleTextFunc();\n this.dragSource = {\n type: 2 /* RowDrag */,\n eElement: eGui,\n dragItemName: (draggingEvent) => this.getDragItemName(draggingEvent, translate),\n getDragItem: () => this.getDragItem(),\n dragStartPixels,\n dragSourceDomDataKey: this.gos.getDomDataKey()\n };\n this.beans.dragAndDrop.addDragSource(this.dragSource, true);\n }\n getDragItemName(draggingEvent, translate) {\n const dragItem = draggingEvent?.dragItem || this.getDragItem();\n const dragItemCount = (draggingEvent?.dropTarget?.rows.length ?? dragItem.rowNodes?.length) || 1;\n const rowDragTextGetter = this.column?.getColDef()?.rowDragText ?? this.gos.get(\"rowDragText\");\n if (rowDragTextGetter) {\n return rowDragTextGetter(dragItem, dragItemCount);\n }\n if (dragItemCount !== 1) {\n return `${dragItemCount} ${translate(\"rowDragRows\", \"rows\")}`;\n }\n const value = this.cellValueFn();\n if (value) {\n return value;\n }\n return `1 ${translate(\"rowDragRow\", \"rows\")}`;\n }\n destroy() {\n this.removeDragSource();\n this.removeMouseDownListener();\n super.destroy();\n }\n removeDragSource() {\n if (!this.dragSource) {\n return;\n }\n this.beans.dragAndDrop.removeDragSource(this.dragSource);\n this.dragSource = null;\n }\n removeMouseDownListener() {\n if (!this.mouseDownListener) {\n return;\n }\n this.mouseDownListener();\n this.mouseDownListener = void 0;\n }\n};\n\n// packages/ag-grid-community/src/agStack/rendering/autoScrollService.ts\nvar AutoScrollService = class {\n constructor(params) {\n this.tickingInterval = null;\n this.onScrollCallback = null;\n this.scrollContainer = params.scrollContainer;\n this.scrollHorizontally = params.scrollAxis.includes(\"x\");\n this.scrollVertically = params.scrollAxis.includes(\"y\");\n this.scrollByTick = params.scrollByTick ?? 20;\n if (params.onScrollCallback) {\n this.onScrollCallback = params.onScrollCallback;\n }\n if (this.scrollVertically) {\n this.getVerticalPosition = params.getVerticalPosition;\n this.setVerticalPosition = params.setVerticalPosition;\n }\n if (this.scrollHorizontally) {\n this.getHorizontalPosition = params.getHorizontalPosition;\n this.setHorizontalPosition = params.setHorizontalPosition;\n }\n this.shouldSkipVerticalScroll = params.shouldSkipVerticalScroll || (() => false);\n this.shouldSkipHorizontalScroll = params.shouldSkipHorizontalScroll || (() => false);\n }\n /** True while auto-scrolling */\n get scrolling() {\n return this.tickingInterval !== null;\n }\n check(mouseEvent, forceSkipVerticalScroll = false) {\n const skipVerticalScroll = !this.scrollVertically || forceSkipVerticalScroll || this.shouldSkipVerticalScroll();\n const skipHorizontalScroll = !this.scrollHorizontally || this.shouldSkipHorizontalScroll();\n if (skipVerticalScroll && skipHorizontalScroll) {\n return;\n }\n const rect = this.scrollContainer.getBoundingClientRect();\n const scrollTick = this.scrollByTick;\n this.tickLeft = !skipHorizontalScroll && mouseEvent.clientX < rect.left + scrollTick;\n this.tickRight = !skipHorizontalScroll && mouseEvent.clientX > rect.right - scrollTick;\n this.tickUp = !skipVerticalScroll && mouseEvent.clientY < rect.top + scrollTick;\n this.tickDown = !skipVerticalScroll && mouseEvent.clientY > rect.bottom - scrollTick;\n if (this.tickLeft || this.tickRight || this.tickUp || this.tickDown) {\n this.ensureTickingStarted();\n } else {\n this.ensureCleared();\n }\n }\n ensureTickingStarted() {\n if (this.tickingInterval === null) {\n this.tickingInterval = window.setInterval(this.doTick.bind(this), 100);\n this.tickCount = 0;\n }\n }\n doTick() {\n this.tickCount++;\n const tickAmount = this.tickCount > 20 ? 200 : this.tickCount > 10 ? 80 : 40;\n if (this.scrollVertically) {\n const vScrollPosition = this.getVerticalPosition();\n if (this.tickUp) {\n this.setVerticalPosition(vScrollPosition - tickAmount);\n }\n if (this.tickDown) {\n this.setVerticalPosition(vScrollPosition + tickAmount);\n }\n }\n if (this.scrollHorizontally) {\n const hScrollPosition = this.getHorizontalPosition();\n if (this.tickLeft) {\n this.setHorizontalPosition(hScrollPosition - tickAmount);\n }\n if (this.tickRight) {\n this.setHorizontalPosition(hScrollPosition + tickAmount);\n }\n }\n if (this.onScrollCallback) {\n this.onScrollCallback();\n }\n }\n ensureCleared() {\n if (this.tickingInterval) {\n window.clearInterval(this.tickingInterval);\n this.tickingInterval = null;\n }\n }\n};\n\n// packages/ag-grid-community/src/clientSideRowModel/changedRowNodes.ts\nvar ChangedRowNodes = class {\n constructor() {\n this.reordered = false;\n this.removals = [];\n this.updates = /* @__PURE__ */ new Set();\n this.adds = /* @__PURE__ */ new Set();\n }\n};\n\n// packages/ag-grid-community/src/clientSideRowModel/clientSideRowModelUtils.ts\nvar _csrmFirstLeaf = (node) => {\n let childrenAfterGroup = node.childrenAfterGroup;\n while (childrenAfterGroup?.length) {\n const child = childrenAfterGroup[0];\n if (child.sourceRowIndex >= 0) {\n return child;\n }\n childrenAfterGroup = child.childrenAfterGroup;\n }\n};\nvar _csrmReorderAllLeafs = (allLeafs, leafsToMove, target, above) => {\n if (!leafsToMove.size || !allLeafs) {\n return false;\n }\n let orderChanged = false;\n const allLeafsLen = allLeafs.length ?? 0;\n let targetPositionIdx = -1;\n if (target) {\n targetPositionIdx = target.sourceRowIndex;\n target = targetPositionIdx < 0 ? _csrmFirstLeaf(target) : null;\n if (target) {\n targetPositionIdx = target.sourceRowIndex;\n }\n }\n if (targetPositionIdx < 0 || targetPositionIdx >= allLeafsLen) {\n targetPositionIdx = allLeafsLen;\n } else if (!above) {\n ++targetPositionIdx;\n }\n let firstAffectedLeafIdx = targetPositionIdx;\n let lastAffectedLeafIndex = Math.min(targetPositionIdx, allLeafsLen - 1);\n for (const row of leafsToMove) {\n const sourceRowIndex = row.sourceRowIndex;\n if (sourceRowIndex < firstAffectedLeafIdx) {\n firstAffectedLeafIdx = sourceRowIndex;\n }\n if (sourceRowIndex > lastAffectedLeafIndex) {\n lastAffectedLeafIndex = sourceRowIndex;\n }\n }\n let writeIdxLeft = firstAffectedLeafIdx;\n for (let readIdx = firstAffectedLeafIdx; readIdx < targetPositionIdx; ++readIdx) {\n const row = allLeafs[readIdx];\n if (leafsToMove.has(row)) {\n continue;\n }\n if (row.sourceRowIndex !== writeIdxLeft) {\n row.sourceRowIndex = writeIdxLeft;\n allLeafs[writeIdxLeft] = row;\n orderChanged = true;\n }\n ++writeIdxLeft;\n }\n let writeIdxRight = lastAffectedLeafIndex;\n for (let readIdx = lastAffectedLeafIndex; readIdx >= targetPositionIdx; --readIdx) {\n const row = allLeafs[readIdx];\n if (leafsToMove.has(row)) {\n continue;\n }\n if (row.sourceRowIndex !== writeIdxRight) {\n row.sourceRowIndex = writeIdxRight;\n allLeafs[writeIdxRight] = row;\n orderChanged = true;\n }\n --writeIdxRight;\n }\n for (const row of leafsToMove) {\n if (row.sourceRowIndex !== writeIdxLeft) {\n row.sourceRowIndex = writeIdxLeft;\n allLeafs[writeIdxLeft] = row;\n orderChanged = true;\n }\n ++writeIdxLeft;\n }\n return orderChanged;\n};\n\n// packages/ag-grid-community/src/gridBodyComp/mouseEventUtils.ts\nfunction _getCellPositionForEvent(gos, event) {\n return _getCellCtrlForEventTarget(gos, event.target)?.getFocusedCellPosition() ?? null;\n}\nfunction _getNormalisedMousePosition(beans, event) {\n const gridPanelHasScrolls = _isDomLayout(beans.gos, \"normal\");\n const e = event;\n let x;\n let y;\n if (e.clientX != null || e.clientY != null) {\n x = e.clientX;\n y = e.clientY;\n } else {\n x = e.x;\n y = e.y;\n }\n const { pageFirstPixel } = beans.pageBounds.getCurrentPagePixelRange();\n y += pageFirstPixel;\n if (gridPanelHasScrolls) {\n const scrollFeature = beans.ctrlsSvc.getScrollFeature();\n const vRange = scrollFeature.getVScrollPosition();\n const hRange = scrollFeature.getHScrollPosition();\n x += hRange.left;\n y += vRange.top;\n }\n return { x, y };\n}\n\n// packages/ag-grid-community/src/dragAndDrop/rowDragFeature.ts\nvar POINTER_INSIDE_THRESHOLD = 0.25;\nvar RowDragFeature = class extends BeanStub {\n constructor(eContainer) {\n super();\n this.eContainer = eContainer;\n this.lastDraggingEvent = null;\n this.autoScroll = null;\n this.autoScrollChanged = false;\n this.autoScrollChanging = false;\n this.autoScrollOldV = null;\n }\n postConstruct() {\n const beans = this.beans;\n beans.ctrlsSvc.whenReady(this, (p) => {\n const getScrollY = () => p.gridBodyCtrl.scrollFeature.getVScrollPosition().top;\n const autoScroll = new AutoScrollService({\n scrollContainer: p.gridBodyCtrl.eBodyViewport,\n scrollAxis: \"y\",\n getVerticalPosition: getScrollY,\n setVerticalPosition: (position) => p.gridBodyCtrl.scrollFeature.setVerticalScrollPosition(position),\n onScrollCallback: () => {\n const newVScroll = getScrollY();\n if (this.autoScrollOldV !== newVScroll) {\n this.autoScrollOldV = newVScroll;\n this.autoScrollChanging = true;\n return;\n }\n const changed = this.autoScrollChanging;\n this.autoScrollChanged = changed;\n this.autoScrollChanging = false;\n if (changed) {\n beans.dragAndDrop?.nudge();\n this.autoScrollChanged = false;\n }\n }\n });\n this.autoScroll = autoScroll;\n this.clearAutoScroll();\n });\n }\n destroy() {\n super.destroy();\n this.clearAutoScroll();\n this.autoScroll = null;\n this.lastDraggingEvent = null;\n this.eContainer = null;\n }\n getContainer() {\n return this.eContainer;\n }\n isInterestedIn(type) {\n return type === 2 /* RowDrag */;\n }\n getIconName(draggingEvent) {\n if (draggingEvent?.dropTarget?.allowed === false) {\n return \"notAllowed\";\n }\n if (this.beans.rowDragSvc.visibility !== \"visible\") {\n return \"notAllowed\";\n }\n return \"move\";\n }\n getRowNodes(draggingEvent) {\n if (!this.isFromThisGrid(draggingEvent)) {\n return draggingEvent.dragItem.rowNodes || [];\n }\n const currentNode = draggingEvent.dragItem.rowNode;\n if (this.gos.get(\"rowDragMultiRow\")) {\n const selectedNodes = this.beans.selectionSvc?.getSelectedNodes();\n if (selectedNodes && selectedNodes.indexOf(currentNode) >= 0) {\n return selectedNodes.slice().sort(compareRowIndex);\n }\n }\n return [currentNode];\n }\n onDragEnter(draggingEvent) {\n this.dragging(draggingEvent, true);\n }\n onDragging(draggingEvent) {\n this.dragging(draggingEvent, false);\n }\n dragging(draggingEvent, enter) {\n const { lastDraggingEvent, beans } = this;\n if (enter) {\n const rowNodes = this.getRowNodes(draggingEvent);\n draggingEvent.dragItem.rowNodes = rowNodes;\n setRowNodesDragging(rowNodes, true);\n }\n this.lastDraggingEvent = draggingEvent;\n const fromNudge = draggingEvent.fromNudge;\n const rowsDrop = this.makeRowsDrop(lastDraggingEvent, draggingEvent, fromNudge, false);\n beans.rowDropHighlightSvc?.fromDrag(draggingEvent);\n if (enter) {\n this.dispatchGridEvent(\"rowDragEnter\", draggingEvent);\n }\n this.dispatchGridEvent(\"rowDragMove\", draggingEvent);\n const autoScroll = this.autoScroll;\n if (rowsDrop?.rowDragManaged && rowsDrop.moved && rowsDrop.allowed && rowsDrop.sameGrid && !rowsDrop.suppressMoveWhenRowDragging && // Avoid flickering by only dropping while auto-scrolling is not happening\n (!fromNudge && !autoScroll?.scrolling || this.autoScrollChanged)) {\n this.dropRows(rowsDrop);\n }\n autoScroll?.check(draggingEvent.event);\n }\n isFromThisGrid(draggingEvent) {\n return draggingEvent.dragSource.dragSourceDomDataKey === this.gos.getDomDataKey();\n }\n makeRowsDrop(lastDraggingEvent, draggingEvent, fromNudge, dropping) {\n const { beans, gos } = this;\n const rowsDrop = this.newRowsDrop(draggingEvent, dropping);\n const rowModel = beans.rowModel;\n draggingEvent.dropTarget = rowsDrop;\n draggingEvent.changed = false;\n if (!rowsDrop) {\n return null;\n }\n let { sameGrid, rootNode, source, target } = rowsDrop;\n target ?? (target = rowModel.getRow(rowModel.getRowCount() - 1) ?? null);\n const groupEditSvc = this.beans.groupEditSvc;\n const canSetParent = !!groupEditSvc?.canSetParent(rowsDrop);\n let newParent = null;\n if (target?.footer) {\n const found = _prevOrNextDisplayedRow(rowModel, -1, target) ?? _prevOrNextDisplayedRow(rowModel, 1, target);\n if (canSetParent) {\n newParent = target.sibling ?? rootNode;\n }\n target = found ?? null;\n }\n if (target?.detail) {\n target = target.parent;\n }\n rowsDrop.moved && (rowsDrop.moved = source !== target);\n let yDelta = 0.5;\n if (target) {\n if (sameGrid && rowsDrop.moved && (newParent || !canSetParent)) {\n yDelta = source.rowIndex > target.rowIndex ? -0.5 : 0.5;\n } else {\n yDelta = (rowsDrop.y - target.rowTop - target.rowHeight / 2) / target.rowHeight || 0;\n }\n }\n if (!canSetParent && sameGrid && target && rowsDrop.moved && _isClientSideRowModel(gos)) {\n const newTarget = deltaDraggingTarget(rowModel, rowsDrop);\n if (newTarget) {\n yDelta = source.rowIndex > newTarget.rowIndex ? -0.5 : 0.5;\n target = newTarget;\n rowsDrop.moved && (rowsDrop.moved = source !== target);\n }\n }\n rowsDrop.target = target;\n rowsDrop.newParent = newParent;\n rowsDrop.pointerPos = computePointerPos(target, rowsDrop.y);\n rowsDrop.yDelta = yDelta;\n groupEditSvc?.fixRowsDrop(rowsDrop, canSetParent, fromNudge, yDelta);\n this.validateRowsDrop(rowsDrop, canSetParent, dropping);\n draggingEvent.changed || (draggingEvent.changed = rowsDropChanged(lastDraggingEvent?.dropTarget, rowsDrop));\n return rowsDrop;\n }\n newRowsDrop(draggingEvent, dropping) {\n const { beans, gos } = this;\n const rootNode = beans.rowModel.rootNode;\n const rowDragManaged = _isClientSideRowModel(gos) ? gos.get(\"rowDragManaged\") : false;\n const suppressMoveWhenRowDragging = gos.get(\"suppressMoveWhenRowDragging\");\n const sameGrid = this.isFromThisGrid(draggingEvent);\n let { rowNode: source, rowNodes: rows } = draggingEvent.dragItem;\n rows || (rows = source ? [source] : []);\n source || (source = rows[0]);\n if (!source || !rootNode) {\n return null;\n }\n const withinGrid = this.beans.dragAndDrop.isDropZoneWithinThisGrid(draggingEvent);\n let allowed = true;\n if (rowDragManaged && (!rows.length || beans.rowDragSvc.visibility !== \"visible\" || (suppressMoveWhenRowDragging || !sameGrid) && !withinGrid)) {\n allowed = false;\n }\n const y = _getNormalisedMousePosition(beans, draggingEvent).y;\n const overNode = this.getOverNode(y);\n return {\n api: beans.gridApi,\n context: beans.gridOptions.context,\n draggingEvent,\n rowDragManaged,\n suppressMoveWhenRowDragging,\n sameGrid,\n withinGrid,\n treeData: false,\n rootNode,\n moved: source !== overNode,\n y,\n overNode,\n overIndex: overNode?.rowIndex ?? -1,\n pointerPos: \"none\",\n position: \"none\",\n source,\n target: overNode ?? null,\n newParent: null,\n rows,\n allowed,\n highlight: !dropping && rowDragManaged && suppressMoveWhenRowDragging && (withinGrid || !sameGrid),\n yDelta: 0,\n inside: false,\n droppedManaged: false\n };\n }\n validateRowsDrop(rowsDrop, canSetParent, dropping) {\n const { source, target, yDelta, inside, moved, rowDragManaged, suppressMoveWhenRowDragging } = rowsDrop;\n rowsDrop.moved && (rowsDrop.moved = source !== target);\n const { position, fallbackPosition } = this.computeDropPosition(moved, inside, yDelta);\n rowsDrop.position = position;\n if (!canSetParent) {\n rowsDrop.newParent = null;\n }\n this.enforceSuppressMoveWhenRowDragging(rowsDrop, suppressMoveWhenRowDragging, \"initial\");\n const isRowValidDropPosition = (!rowDragManaged || rowsDrop.allowed) && this.gos.get(\"isRowValidDropPosition\");\n if (isRowValidDropPosition) {\n this.applyDropValidator(rowsDrop, canSetParent, dropping, rowDragManaged, isRowValidDropPosition);\n }\n if (rowDragManaged) {\n rowsDrop.rows = this.filterRows(rowsDrop);\n }\n this.beans.groupEditSvc?.clearNewSameParent(rowsDrop, canSetParent);\n this.enforceSuppressMoveWhenRowDragging(rowsDrop, suppressMoveWhenRowDragging, \"final\");\n if (rowsDrop.position === \"inside\" && (!rowsDrop.allowed || !rowsDrop.newParent)) {\n rowsDrop.position = fallbackPosition;\n }\n }\n computeDropPosition(moved, inside, yDelta) {\n const fallbackPosition = yDelta < 0 ? \"above\" : \"below\";\n if (!moved) {\n return { position: \"none\", fallbackPosition };\n }\n return { position: inside ? \"inside\" : fallbackPosition, fallbackPosition };\n }\n enforceSuppressMoveWhenRowDragging(rowsDrop, suppress, stage) {\n if (!suppress) {\n return;\n }\n if (stage === \"initial\") {\n if (!rowsDrop.moved) {\n rowsDrop.allowed = false;\n }\n return;\n }\n if (!rowsDrop.rows.length || rowsDrop.position === \"none\") {\n rowsDrop.allowed = false;\n }\n }\n applyDropValidator(rowsDrop, canSetParent, dropping, rowDragManaged, validator) {\n this.beans.groupEditSvc?.clearNewSameParent(rowsDrop, canSetParent);\n const result = validator(rowsDrop);\n if (!result) {\n rowsDrop.allowed = false;\n return;\n }\n if (typeof result !== \"object\") {\n return;\n }\n if (result.rows !== void 0) {\n rowsDrop.rows = result.rows ?? [];\n }\n if (canSetParent && result.newParent !== void 0) {\n rowsDrop.newParent = result.newParent;\n }\n if (result.target !== void 0) {\n rowsDrop.target = result.target;\n }\n if (result.position) {\n rowsDrop.position = result.position;\n }\n if (result.allowed !== void 0) {\n rowsDrop.allowed = result.allowed;\n } else if (!rowDragManaged) {\n rowsDrop.allowed = true;\n }\n const draggingEvent = rowsDrop.draggingEvent;\n if (result.changed && draggingEvent) {\n draggingEvent.changed = true;\n }\n if (!dropping && result.highlight !== void 0) {\n rowsDrop.highlight = result.highlight;\n }\n }\n addRowDropZone(params) {\n if (!params.getContainer()) {\n _warn(55);\n return;\n }\n const dragAndDrop = this.beans.dragAndDrop;\n if (dragAndDrop.findExternalZone(params.getContainer())) {\n _warn(56);\n return;\n }\n const processedParams = params.fromGrid ? params : {\n getContainer: params.getContainer,\n onDragEnter: params.onDragEnter && ((e) => params.onDragEnter(this.rowDragEvent(\"rowDragEnter\", e))),\n onDragLeave: params.onDragLeave && ((e) => params.onDragLeave(this.rowDragEvent(\"rowDragLeave\", e))),\n onDragging: params.onDragging && ((e) => params.onDragging(this.rowDragEvent(\"rowDragMove\", e))),\n onDragStop: params.onDragStop && ((e) => params.onDragStop(this.rowDragEvent(\"rowDragEnd\", e))),\n onDragCancel: params.onDragCancel && ((e) => params.onDragCancel(this.rowDragEvent(\"rowDragCancel\", e)))\n };\n const dropTarget = {\n isInterestedIn: (type) => type === 2 /* RowDrag */,\n getIconName: () => \"move\",\n external: true,\n ...processedParams\n };\n dragAndDrop.addDropTarget(dropTarget);\n this.addDestroyFunc(() => dragAndDrop.removeDropTarget(dropTarget));\n }\n getRowDropZone(events) {\n const result = {\n getContainer: this.getContainer.bind(this),\n onDragEnter: (e) => {\n this.onDragEnter(e);\n events?.onDragEnter?.(this.rowDragEvent(\"rowDragEnter\", e));\n },\n onDragLeave: (e) => {\n this.onDragLeave(e);\n events?.onDragLeave?.(this.rowDragEvent(\"rowDragLeave\", e));\n },\n onDragging: (e) => {\n this.onDragging(e);\n events?.onDragging?.(this.rowDragEvent(\"rowDragMove\", e));\n },\n onDragStop: (e) => {\n this.onDragStop(e);\n events?.onDragStop?.(this.rowDragEvent(\"rowDragEnd\", e));\n },\n onDragCancel: (e) => {\n this.onDragCancel(e);\n events?.onDragCancel?.(this.rowDragEvent(\"rowDragCancel\", e));\n },\n fromGrid: true\n };\n return result;\n }\n getOverNode(y) {\n const { pageBounds, rowModel } = this.beans;\n const mouseIsPastLastRow = y > pageBounds.getCurrentPagePixelRange().pageLastPixel;\n const overIndex = mouseIsPastLastRow ? -1 : rowModel.getRowIndexAtPixel(y);\n return overIndex >= 0 ? rowModel.getRow(overIndex) : void 0;\n }\n rowDragEvent(type, draggingEvent) {\n const beans = this.beans;\n const { dragItem, dropTarget: rowsDrop, event, vDirection } = draggingEvent;\n const withRowsDrop = rowsDrop?.rootNode === beans.rowModel.rootNode;\n const y = withRowsDrop ? rowsDrop.y : _getNormalisedMousePosition(beans, draggingEvent).y;\n const overNode = withRowsDrop ? rowsDrop.overNode : this.getOverNode(y);\n const overIndex = withRowsDrop ? rowsDrop.overIndex : overNode?.rowIndex ?? -1;\n return {\n api: beans.gridApi,\n context: beans.gridOptions.context,\n type,\n event,\n node: dragItem.rowNode,\n nodes: dragItem.rowNodes,\n overIndex,\n overNode,\n y,\n vDirection,\n rowsDrop\n };\n }\n dispatchGridEvent(type, draggingEvent) {\n const event = this.rowDragEvent(type, draggingEvent);\n this.eventSvc.dispatchEvent(event);\n }\n onDragLeave(draggingEvent) {\n this.dispatchGridEvent(\"rowDragLeave\", draggingEvent);\n this.stopDragging(draggingEvent, false);\n }\n onDragStop(draggingEvent) {\n const previousRowsDrop = this.lastDraggingEvent?.dropTarget ?? null;\n const rowsDrop = this.makeRowsDrop(this.lastDraggingEvent, draggingEvent, false, true);\n this.dispatchGridEvent(\"rowDragEnd\", draggingEvent);\n if (rowsDrop?.allowed && rowsDrop.rowDragManaged && (!previousRowsDrop?.droppedManaged || rowsDropChanged(previousRowsDrop, rowsDrop))) {\n this.dropRows(rowsDrop);\n }\n this.stopDragging(draggingEvent, true);\n }\n onDragCancel(draggingEvent) {\n this.dispatchGridEvent(\"rowDragCancel\", draggingEvent);\n this.stopDragging(draggingEvent, true);\n }\n stopDragging(draggingEvent, final) {\n this.clearAutoScroll();\n this.beans.groupEditSvc?.stopDragging(final);\n this.beans.rowDropHighlightSvc?.fromDrag(null);\n setRowNodesDragging(draggingEvent.dragItem.rowNodes, false);\n this.lastDraggingEvent = null;\n }\n clearAutoScroll() {\n this.autoScroll?.ensureCleared();\n this.autoScrollChanged = false;\n this.autoScrollChanging = false;\n this.autoScrollOldV = null;\n }\n /** Drag and drop. Returns false if at least a row was moved, otherwise true */\n dropRows(rowsDrop) {\n rowsDrop.droppedManaged = true;\n return rowsDrop.sameGrid ? this.csrmMoveRows(rowsDrop) : this.csrmAddRows(rowsDrop);\n }\n csrmAddRows({ position, target, rows }) {\n const getRowIdFunc = _getRowIdCallback(this.gos);\n const clientSideRowModel = this.beans.rowModel;\n const add = rows.filter(\n ({ data, rowPinned }) => !clientSideRowModel.getRowNode(getRowIdFunc?.({ data, level: 0, rowPinned }) ?? data.id)\n ).map(({ data }) => data);\n if (add.length === 0) {\n return false;\n }\n let addIndex;\n if (target) {\n const leaf = target.sourceRowIndex >= 0 ? target : _csrmFirstLeaf(target);\n if (leaf) {\n addIndex = leaf.sourceRowIndex + (position === \"above\" ? 0 : 1);\n }\n }\n clientSideRowModel.updateRowData({ add, addIndex });\n return true;\n }\n filterRows(rowsDrop) {\n const { groupEditSvc } = this.beans;\n const { rows, sameGrid } = rowsDrop;\n let filtered;\n for (let i = 0, len = rows.length; i < len; ++i) {\n let valid = true;\n const row = rows[i];\n if (!row || row.footer || sameGrid && row.destroyed && !row.group || !this.csrmGetLeaf(row)) {\n valid = false;\n }\n if (valid && groupEditSvc && !groupEditSvc.canDropRow(row, rowsDrop)) {\n valid = false;\n }\n if (valid) {\n filtered?.push(row);\n } else {\n filtered ?? (filtered = rows.slice(0, i));\n }\n }\n return filtered ?? rows;\n }\n csrmMoveRows(rowsDrop) {\n const groupEditSvc = this.beans.groupEditSvc;\n if (groupEditSvc?.isGroupingDrop(rowsDrop)) {\n return groupEditSvc.dropGroupEdit(rowsDrop);\n }\n return this.csrmMoveRowsReorder(rowsDrop);\n }\n csrmMoveRowsReorder({ position, target, rows, newParent, rootNode }) {\n let changed = false;\n const leafs = /* @__PURE__ */ new Set();\n for (const row of rows) {\n if (newParent && row.parent !== newParent) {\n row.treeParent = newParent;\n changed = true;\n }\n const leafRow = this.csrmGetLeaf(row);\n if (leafRow) {\n leafs.add(leafRow);\n }\n }\n if (!changed && leafs.size === 0) {\n return false;\n }\n const focusSvc = this.beans.focusSvc;\n const cellPosition = focusSvc.getFocusedCell();\n const cellCtrl = cellPosition && _getCellByPosition(this.beans, cellPosition);\n if (leafs.size && _csrmReorderAllLeafs(rootNode._leafs, leafs, target, position === \"above\")) {\n changed = true;\n }\n if (!changed) {\n return false;\n }\n const clientSideRowModel = this.beans.rowModel;\n const changedRowNodes = new ChangedRowNodes();\n changedRowNodes.reordered = true;\n clientSideRowModel.refreshModel({\n step: \"group\",\n keepRenderedRows: true,\n animate: !this.gos.get(\"suppressAnimationFrame\"),\n changedRowNodes\n });\n if (cellCtrl) {\n cellCtrl.focusCell();\n } else {\n focusSvc.clearFocusedCell();\n }\n return true;\n }\n csrmGetLeaf(row) {\n if (row.sourceRowIndex >= 0) {\n return row.destroyed ? void 0 : row;\n }\n const groupEditSvc = this.beans.groupEditSvc;\n if (groupEditSvc) {\n return groupEditSvc.csrmFirstLeaf(row);\n }\n return _csrmFirstLeaf(row);\n }\n};\nvar rowsDropChanged = (a, b) => a !== b && (!a || a.sameGrid !== b.sameGrid || a.allowed !== b.allowed || a.position !== b.position || a.target !== b.target || a.source !== b.source || a.newParent !== b.newParent || !_areEqual(a.rows, b.rows));\nvar compareRowIndex = ({ rowIndex: a }, { rowIndex: b }) => a !== null && b !== null ? a - b : 0;\nvar setRowNodesDragging = (rowNodes, dragging) => {\n for (let i = 0, len = rowNodes?.length || 0; i < len; ++i) {\n const rowNode = rowNodes[i];\n if (rowNode.dragging !== dragging) {\n rowNode.dragging = dragging;\n rowNode.dispatchRowEvent(\"draggingChanged\");\n }\n }\n};\nvar deltaDraggingTarget = (rowModel, rowsDrop) => {\n let bestTarget = null;\n let current = rowsDrop.target;\n if (current && rowsDrop.rows.indexOf(current) < 0) {\n return null;\n }\n const source = rowsDrop.source;\n if (!current || !source) {\n return null;\n }\n let count = current.rowIndex - source.rowIndex;\n const increment = count < 0 ? -1 : 1;\n count = rowsDrop.suppressMoveWhenRowDragging ? Math.abs(count) : 1;\n const rowsSet = new Set(rowsDrop.rows);\n do {\n const candidate = _prevOrNextDisplayedRow(rowModel, increment, current);\n if (!candidate) {\n break;\n }\n if (!rowsSet.has(candidate)) {\n bestTarget = candidate;\n --count;\n }\n current = candidate;\n } while (count > 0);\n return bestTarget;\n};\nvar computePointerPos = (overNode, pointerY) => {\n const rowTop = overNode?.rowTop;\n const rowHeight = overNode?.rowHeight ?? 0;\n if (rowTop == null || !rowHeight || rowHeight <= 0) {\n return \"none\";\n }\n const offset = pointerY - rowTop;\n const thresholdPx = rowHeight * POINTER_INSIDE_THRESHOLD;\n if (offset <= thresholdPx) {\n return \"above\";\n }\n if (offset >= rowHeight - thresholdPx) {\n return \"below\";\n }\n return \"inside\";\n};\n\n// packages/ag-grid-community/src/dragAndDrop/rowDragService.ts\nvar RowDragService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"rowDragSvc\";\n this.rowDragFeature = null;\n this.visibility = \"suppress\";\n }\n setupRowDrag(element, ctrl) {\n const rowDragFeature = ctrl.createManagedBean(new RowDragFeature(element));\n const dragAndDrop = this.beans.dragAndDrop;\n dragAndDrop.addDropTarget(rowDragFeature);\n ctrl.addDestroyFunc(() => dragAndDrop.removeDropTarget(rowDragFeature));\n this.rowDragFeature = rowDragFeature;\n const refreshVisibility = () => this.refreshVisibility();\n this.addManagedPropertyListeners(\n [\"rowDragManaged\", \"suppressRowDrag\", \"refreshAfterGroupEdit\"],\n refreshVisibility\n );\n this.addManagedEventListeners({\n newColumnsLoaded: refreshVisibility,\n columnRowGroupChanged: refreshVisibility,\n columnPivotModeChanged: refreshVisibility,\n sortChanged: refreshVisibility,\n filterChanged: refreshVisibility\n });\n this.visibility = this.computeVisibility();\n }\n createRowDragComp(cellValueFn, rowNode, column, customGui, dragStartPixels, alwaysVisible) {\n return new RowDragComp(cellValueFn, rowNode, column, customGui, dragStartPixels, alwaysVisible);\n }\n createRowDragCompForRow(rowNode, element) {\n if (_isCellSelectionEnabled(this.gos)) {\n return void 0;\n }\n const translate = this.getLocaleTextFunc();\n return this.createRowDragComp(\n () => `1 ${translate(\"rowDragRow\", \"row\")}`,\n rowNode,\n void 0,\n element,\n void 0,\n true\n );\n }\n createRowDragCompForCell(rowNode, column, cellValueFn, element, dragStartPixels, alwaysVisible) {\n const gos = this.gos;\n if (gos.get(\"rowDragManaged\")) {\n if (!_isClientSideRowModel(gos) || gos.get(\"pagination\")) {\n return void 0;\n }\n }\n const rowDragComp = this.createRowDragComp(\n cellValueFn,\n rowNode,\n column,\n element,\n dragStartPixels,\n alwaysVisible\n );\n return rowDragComp;\n }\n cancelRowDrag() {\n if (this.rowDragFeature?.lastDraggingEvent) {\n this.beans.dragSvc?.cancelDrag();\n }\n }\n computeVisibility() {\n const beans = this.beans;\n const gos = beans.gos;\n if (gos.get(\"suppressRowDrag\")) {\n return \"suppress\";\n }\n const rowDragManaged = gos.get(\"rowDragManaged\");\n if (!rowDragManaged) {\n return \"visible\";\n }\n const pivoting = beans.colModel.isPivotMode();\n if ((pivoting || beans.rowGroupColsSvc?.columns?.length) && !gos.get(\"refreshAfterGroupEdit\")) {\n return \"hidden\";\n }\n if (pivoting) {\n return \"disabled\";\n }\n if (beans.filterManager?.isAnyFilterPresent()) {\n return \"disabled\";\n }\n if (beans.sortSvc?.isSortActive()) {\n return \"disabled\";\n }\n return \"visible\";\n }\n refreshVisibility() {\n const previousVisibility = this.visibility;\n const newVisibility = this.computeVisibility();\n if (previousVisibility !== newVisibility) {\n this.visibility = newVisibility;\n this.eventSvc?.dispatchEvent({ type: \"rowDragVisibilityChanged\" });\n }\n }\n};\n\n// packages/ag-grid-community/src/dragAndDrop/rowDropHighlightService.ts\nvar RowDropHighlightService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"rowDropHighlightSvc\";\n this.uiLevel = 0;\n this.dragging = false;\n this.row = null;\n this.position = \"none\";\n }\n postConstruct() {\n this.addManagedEventListeners({\n modelUpdated: this.onModelUpdated.bind(this)\n });\n }\n onModelUpdated() {\n const row = this.row;\n const oldDragging = this.dragging;\n if (!row || row?.rowIndex === null || this.position === \"none\") {\n this.clear();\n } else {\n this.set(row, this.position);\n }\n this.dragging = oldDragging;\n }\n destroy() {\n this.clear();\n super.destroy();\n }\n clear() {\n const last = this.row;\n this.dragging = false;\n if (last) {\n this.uiLevel = 0;\n this.position = \"none\";\n this.row = null;\n last.dispatchRowEvent(\"rowHighlightChanged\");\n }\n }\n set(row, dropIndicatorPosition) {\n const nodeChanged = row !== this.row;\n const uiLevel = row.uiLevel;\n const highlightChanged = dropIndicatorPosition !== this.position;\n const uiLevelChanged = uiLevel !== this.uiLevel;\n this.dragging = false;\n if (nodeChanged || highlightChanged || uiLevelChanged) {\n if (nodeChanged) {\n this.clear();\n }\n this.uiLevel = uiLevel;\n this.position = dropIndicatorPosition;\n this.row = row;\n row.dispatchRowEvent(\"rowHighlightChanged\");\n }\n }\n fromDrag(draggingEvent) {\n const rowsDrop = draggingEvent?.dropTarget;\n if (rowsDrop) {\n const { highlight, target, position } = rowsDrop;\n if (highlight && target && position !== \"none\") {\n this.set(target, position);\n this.dragging = true;\n return;\n }\n }\n if (this.dragging) {\n this.clear();\n }\n }\n};\n\n// packages/ag-grid-community/src/dragAndDrop/dragModule.ts\nvar DragModule = {\n moduleName: \"Drag\",\n version: VERSION,\n beans: [DragService]\n};\nvar DragAndDropModule = {\n moduleName: \"DragAndDrop\",\n version: VERSION,\n dynamicBeans: {\n dndSourceComp: DndSourceComp\n },\n icons: {\n // drag handle used to pick up draggable rows\n rowDrag: \"grip\"\n }\n};\nvar SharedDragAndDropModule = {\n moduleName: \"SharedDragAndDrop\",\n version: VERSION,\n beans: [DragAndDropService],\n dependsOn: [DragModule],\n userComponents: {\n agDragAndDropImage: DragAndDropImageComponent2\n },\n icons: {\n // shown on drag and drop image component icon while dragging column to the side of the grid to pin\n columnMovePin: \"pin\",\n // shown on drag and drop image component icon while dragging over part of the page that is not a drop zone\n columnMoveHide: \"eye-slash\",\n // shown on drag and drop image component icon while dragging columns to reorder\n columnMoveMove: \"arrows\",\n // animating icon shown when dragging a column to the right of the grid causes horizontal scrolling\n columnMoveLeft: \"left\",\n // animating icon shown when dragging a column to the left of the grid causes horizontal scrolling\n columnMoveRight: \"right\",\n // shown on drag and drop image component icon while dragging over Row Groups drop zone\n columnMoveGroup: \"group\",\n // shown on drag and drop image component icon while dragging over Values drop zone\n columnMoveValue: \"aggregation\",\n // shown on drag and drop image component icon while dragging over pivot drop zone\n columnMovePivot: \"pivot\",\n // shown on drag and drop image component icon while dragging over drop zone that doesn't support it, e.g.\n // string column over aggregation drop zone\n dropNotAllowed: \"not-allowed\",\n // drag handle used to pick up draggable rows\n rowDrag: \"grip\"\n }\n};\nvar RowDragModule = {\n moduleName: \"RowDrag\",\n version: VERSION,\n beans: [RowDropHighlightService, RowDragService],\n apiFunctions: {\n addRowDropZone,\n removeRowDropZone,\n getRowDropZoneParams,\n getRowDropPositionIndicator,\n setRowDropPositionIndicator\n },\n dependsOn: [SharedDragAndDropModule]\n};\nvar HorizontalResizeModule = {\n moduleName: \"HorizontalResize\",\n version: VERSION,\n beans: [HorizontalResizeService],\n dependsOn: [DragModule]\n};\n\n// packages/ag-grid-community/src/columnMove/column-moving.css\nvar column_moving_default = \":where(.ag-ltr) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:left .2s}.ag-header-group-cell{transition:left .2s,width .2s}}:where(.ag-rtl) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:right .2s}.ag-header-group-cell{transition:right .2s,width .2s}}\";\n\n// packages/ag-grid-community/src/columnMove/columnAnimationService.ts\nvar ColumnAnimationService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colAnimation\";\n this.executeNextFuncs = [];\n this.executeLaterFuncs = [];\n this.active = false;\n // activeNext starts with active but it is reset earlier after the nextFuncs are cleared\n // to prevent calls made to executeNextVMTurn from queuing functions after executeNextFuncs has already been flushed,\n this.activeNext = false;\n this.suppressAnimation = false;\n this.animationThreadCount = 0;\n }\n postConstruct() {\n this.beans.ctrlsSvc.whenReady(this, (p) => this.gridBodyCtrl = p.gridBodyCtrl);\n }\n isActive() {\n return this.active && !this.suppressAnimation;\n }\n setSuppressAnimation(suppress) {\n this.suppressAnimation = suppress;\n }\n start() {\n if (this.active) {\n return;\n }\n const { gos } = this;\n if (gos.get(\"suppressColumnMoveAnimation\")) {\n return;\n }\n if (gos.get(\"enableRtl\")) {\n return;\n }\n this.ensureAnimationCssClassPresent();\n this.active = true;\n this.activeNext = true;\n }\n finish() {\n if (!this.active) {\n return;\n }\n this.flush(\n () => this.activeNext = false,\n () => this.active = false\n );\n }\n executeNextVMTurn(func) {\n if (this.activeNext) {\n this.executeNextFuncs.push(func);\n } else {\n func();\n }\n }\n executeLaterVMTurn(func) {\n if (this.active) {\n this.executeLaterFuncs.push(func);\n } else {\n func();\n }\n }\n ensureAnimationCssClassPresent() {\n this.animationThreadCount++;\n const animationThreadCountCopy = this.animationThreadCount;\n const { gridBodyCtrl } = this;\n gridBodyCtrl.setColumnMovingCss(true);\n this.executeLaterFuncs.push(() => {\n if (this.animationThreadCount === animationThreadCountCopy) {\n gridBodyCtrl.setColumnMovingCss(false);\n }\n });\n }\n flush(callbackNext, callbackLater) {\n const { executeNextFuncs, executeLaterFuncs } = this;\n if (executeNextFuncs.length === 0 && executeLaterFuncs.length === 0) {\n callbackNext();\n callbackLater();\n return;\n }\n const runFuncs = (queue) => {\n while (queue.length) {\n const func = queue.pop();\n if (func) {\n func();\n }\n }\n };\n this.beans.frameworkOverrides.wrapIncoming(() => {\n window.setTimeout(() => {\n callbackNext();\n runFuncs(executeNextFuncs);\n }, 0);\n window.setTimeout(() => {\n callbackLater();\n runFuncs(executeLaterFuncs);\n }, 200);\n });\n }\n};\n\n// packages/ag-grid-community/src/columnMove/columnMoveApi.ts\nfunction moveColumnByIndex(beans, fromIndex, toIndex) {\n beans.colMoves?.moveColumnByIndex(fromIndex, toIndex, \"api\");\n}\nfunction moveColumns(beans, columnsToMoveKeys, toIndex) {\n beans.colMoves?.moveColumns(columnsToMoveKeys, toIndex, \"api\");\n}\n\n// packages/ag-grid-community/src/columnMove/columnDrag/bodyDropPivotTarget.ts\nvar BodyDropPivotTarget = class extends BeanStub {\n constructor(pinned) {\n super();\n this.pinned = pinned;\n this.columnsToAggregate = [];\n this.columnsToGroup = [];\n this.columnsToPivot = [];\n }\n /** Callback for when drag enters */\n onDragEnter(draggingEvent) {\n this.clearColumnsList();\n if (this.gos.get(\"functionsReadOnly\")) {\n return;\n }\n const dragColumns = draggingEvent.dragItem.columns;\n if (!dragColumns) {\n return;\n }\n for (const column of dragColumns) {\n if (!column.isPrimary()) {\n continue;\n }\n if (column.isAnyFunctionActive()) {\n continue;\n }\n if (column.isAllowValue()) {\n this.columnsToAggregate.push(column);\n } else if (column.isAllowRowGroup()) {\n this.columnsToGroup.push(column);\n } else if (column.isAllowPivot()) {\n this.columnsToPivot.push(column);\n }\n }\n }\n getIconName() {\n const totalColumns = this.columnsToAggregate.length + this.columnsToGroup.length + this.columnsToPivot.length;\n if (totalColumns > 0) {\n return this.pinned ? \"pinned\" : \"move\";\n }\n return null;\n }\n /** Callback for when drag leaves */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDragLeave(draggingEvent) {\n this.clearColumnsList();\n }\n clearColumnsList() {\n this.columnsToAggregate.length = 0;\n this.columnsToGroup.length = 0;\n this.columnsToPivot.length = 0;\n }\n /** Callback for when dragging */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDragging(draggingEvent) {\n }\n /** Callback for when drag stops */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDragStop(draggingEvent) {\n const { valueColsSvc, rowGroupColsSvc, pivotColsSvc } = this.beans;\n if (this.columnsToAggregate.length > 0) {\n valueColsSvc?.addColumns(this.columnsToAggregate, \"toolPanelDragAndDrop\");\n }\n if (this.columnsToGroup.length > 0) {\n rowGroupColsSvc?.addColumns(this.columnsToGroup, \"toolPanelDragAndDrop\");\n }\n if (this.columnsToPivot.length > 0) {\n pivotColsSvc?.addColumns(this.columnsToPivot, \"toolPanelDragAndDrop\");\n }\n }\n onDragCancel() {\n this.clearColumnsList();\n }\n};\n\n// packages/ag-grid-community/src/columnMove/internalColumnMoveUtils.ts\nfunction sortColsLikeCols(colsList, cols) {\n if (!cols || cols.length <= 1) {\n return;\n }\n const notAllColsPresent = cols.filter((c) => colsList.indexOf(c) < 0).length > 0;\n if (notAllColsPresent) {\n return;\n }\n cols.sort((a, b) => {\n const indexA = colsList.indexOf(a);\n const indexB = colsList.indexOf(b);\n return indexA - indexB;\n });\n}\nfunction getColsToMove(allMovingColumns) {\n const newCols = [...allMovingColumns];\n for (const col of allMovingColumns) {\n let movingGroup = null;\n let parent = col.getParent();\n while (parent != null && parent.getDisplayedLeafColumns().length === 1) {\n movingGroup = parent;\n parent = parent.getParent();\n }\n if (movingGroup != null) {\n const isMarryChildren = !!movingGroup.getColGroupDef()?.marryChildren;\n const columnsToMove = isMarryChildren ? (\n // when marry children is true, we also have to move hidden\n // columns within the group, so grab them from the `providedColumnGroup`\n movingGroup.getProvidedColumnGroup().getLeafColumns()\n ) : movingGroup.getLeafColumns();\n for (const newCol of columnsToMove) {\n if (!newCols.includes(newCol)) {\n newCols.push(newCol);\n }\n }\n }\n }\n return newCols;\n}\nfunction getLowestFragMove(validMoves, allMovingColumnsOrdered, colMoves, visibleCols) {\n const displayedCols = visibleCols.allCols;\n let lowestFragMove = null;\n let targetOrder = null;\n for (let i = 0; i < validMoves.length; i++) {\n const move = validMoves[i];\n const order = colMoves.getProposedColumnOrder(allMovingColumnsOrdered, move);\n if (!colMoves.doesOrderPassRules(order)) {\n continue;\n }\n const displayedOrder = order.filter((col) => displayedCols.includes(col));\n if (targetOrder === null) {\n targetOrder = displayedOrder;\n } else if (!_areEqual(displayedOrder, targetOrder)) {\n break;\n }\n const fragCount = groupFragCount(order);\n if (lowestFragMove === null || fragCount < lowestFragMove.fragCount) {\n lowestFragMove = { move, fragCount };\n }\n }\n return lowestFragMove;\n}\nfunction getBestColumnMoveIndexFromXPosition(params) {\n const { isFromHeader, fromLeft, xPosition, fromEnter, fakeEvent, pinned, gos, colModel, colMoves, visibleCols } = params;\n let { allMovingColumns } = params;\n if (isFromHeader) {\n allMovingColumns = getColsToMove(allMovingColumns);\n }\n const allMovingColumnsOrdered = allMovingColumns.slice();\n sortColsLikeCols(colModel.getCols(), allMovingColumnsOrdered);\n const validMoves = calculateValidMoves({\n movingCols: allMovingColumnsOrdered,\n draggingRight: fromLeft,\n xPosition,\n pinned,\n gos,\n colModel,\n visibleCols\n });\n const oldIndex = calculateOldIndex(allMovingColumnsOrdered, colModel);\n if (validMoves.length === 0) {\n return;\n }\n const firstValidMove = validMoves[0];\n const constrainDirection = oldIndex !== null && (isFromHeader || !fromEnter);\n if (constrainDirection && !fakeEvent) {\n if (!fromLeft && firstValidMove >= oldIndex) {\n return;\n }\n if (fromLeft && firstValidMove <= oldIndex) {\n return;\n }\n }\n const lowestFragMove = getLowestFragMove(validMoves, allMovingColumnsOrdered, colMoves, visibleCols);\n if (!lowestFragMove) {\n return;\n }\n const toIndex = lowestFragMove.move;\n if (toIndex > colModel.getCols().length - allMovingColumnsOrdered.length) {\n return;\n }\n return { columns: allMovingColumnsOrdered, toIndex };\n}\nfunction attemptMoveColumns(params) {\n const { columns, toIndex } = getBestColumnMoveIndexFromXPosition(params) || {};\n const { finished, colMoves } = params;\n if (!columns || toIndex == null) {\n return null;\n }\n colMoves.moveColumns(columns, toIndex, \"uiColumnMoved\", finished);\n return finished ? null : { columns, toIndex };\n}\nfunction calculateOldIndex(movingCols, colModel) {\n const gridCols = colModel.getCols();\n const indexes = movingCols.map((col) => gridCols.indexOf(col)).sort((a, b) => a - b);\n const firstIndex = indexes[0];\n const lastIndex = _last(indexes);\n const spread = lastIndex - firstIndex;\n const gapsExist = spread !== indexes.length - 1;\n return gapsExist ? null : firstIndex;\n}\nfunction groupFragCount(columns) {\n function parents(col) {\n const result = [];\n let parent = col.getOriginalParent();\n while (parent != null) {\n result.push(parent);\n parent = parent.getOriginalParent();\n }\n return result;\n }\n let count = 0;\n for (let i = 0; i < columns.length - 1; i++) {\n let a = parents(columns[i]);\n let b = parents(columns[i + 1]);\n [a, b] = a.length > b.length ? [a, b] : [b, a];\n for (const parent of a) {\n if (b.indexOf(parent) === -1) {\n count++;\n }\n }\n }\n return count;\n}\nfunction getDisplayedColumns(visibleCols, type) {\n switch (type) {\n case \"left\":\n return visibleCols.leftCols;\n case \"right\":\n return visibleCols.rightCols;\n default:\n return visibleCols.centerCols;\n }\n}\nfunction calculateValidMoves(params) {\n const { movingCols, draggingRight, xPosition, pinned, gos, colModel, visibleCols } = params;\n const isMoveBlocked = gos.get(\"suppressMovableColumns\") || movingCols.some((col) => col.getColDef().suppressMovable);\n if (isMoveBlocked) {\n return [];\n }\n const allDisplayedCols = getDisplayedColumns(visibleCols, pinned);\n const allGridCols = colModel.getCols();\n const movingDisplayedCols = allDisplayedCols.filter((col) => movingCols.includes(col));\n const otherDisplayedCols = allDisplayedCols.filter((col) => !movingCols.includes(col));\n const otherGridCols = allGridCols.filter((col) => !movingCols.includes(col));\n let displayIndex = 0;\n let availableWidth = xPosition;\n if (draggingRight) {\n let widthOfMovingDisplayedCols = 0;\n for (const col of movingDisplayedCols) {\n widthOfMovingDisplayedCols += col.getActualWidth();\n }\n availableWidth -= widthOfMovingDisplayedCols;\n }\n if (availableWidth > 0) {\n for (let i = 0; i < otherDisplayedCols.length; i++) {\n const col = otherDisplayedCols[i];\n availableWidth -= col.getActualWidth();\n if (availableWidth < 0) {\n break;\n }\n displayIndex++;\n }\n if (draggingRight) {\n displayIndex++;\n }\n }\n let firstValidMove;\n if (displayIndex > 0) {\n const leftColumn = otherDisplayedCols[displayIndex - 1];\n firstValidMove = otherGridCols.indexOf(leftColumn) + 1;\n } else {\n firstValidMove = otherGridCols.indexOf(otherDisplayedCols[0]);\n if (firstValidMove === -1) {\n firstValidMove = 0;\n }\n }\n const validMoves = [firstValidMove];\n const numberComparator = (a, b) => a - b;\n if (draggingRight) {\n let pointer = firstValidMove + 1;\n const lastIndex = allGridCols.length - 1;\n while (pointer <= lastIndex) {\n validMoves.push(pointer);\n pointer++;\n }\n validMoves.sort(numberComparator);\n } else {\n let pointer = firstValidMove;\n const lastIndex = allGridCols.length - 1;\n let displacedCol = allGridCols[pointer];\n while (pointer <= lastIndex && allDisplayedCols.indexOf(displacedCol) < 0) {\n pointer++;\n validMoves.push(pointer);\n displacedCol = allGridCols[pointer];\n }\n pointer = firstValidMove - 1;\n const firstDisplayIndex = 0;\n while (pointer >= firstDisplayIndex) {\n validMoves.push(pointer);\n pointer--;\n }\n validMoves.sort(numberComparator).reverse();\n }\n return validMoves;\n}\nfunction normaliseX(params) {\n const { pinned, fromKeyboard, gos, ctrlsSvc, useHeaderRow, skipScrollPadding } = params;\n let eViewport = ctrlsSvc.getHeaderRowContainerCtrl(pinned)?.eViewport;\n let { x } = params;\n if (!eViewport) {\n return 0;\n }\n if (fromKeyboard) {\n x -= eViewport.getBoundingClientRect().left;\n }\n if (gos.get(\"enableRtl\")) {\n if (useHeaderRow) {\n eViewport = eViewport.querySelector(\".ag-header-row\");\n }\n x = eViewport.clientWidth - x;\n }\n if (pinned == null && !skipScrollPadding) {\n x += ctrlsSvc.get(\"center\").getCenterViewportScrollLeft();\n }\n return x;\n}\nfunction setColumnsMoving(columns, isMoving) {\n for (const column of columns) {\n column.moving = isMoving;\n column.dispatchColEvent(\"movingChanged\", \"uiColumnMoved\");\n }\n}\n\n// packages/ag-grid-community/src/columnMove/columnDrag/moveColumnFeature.ts\nvar MOVE_FAIL_THRESHOLD = 7;\nvar SCROLL_MOVE_WIDTH = 100;\nvar SCROLL_GAP_NEEDED_BEFORE_MOVE = SCROLL_MOVE_WIDTH / 2;\nvar SCROLL_ACCELERATION_RATE = 5;\nvar SCROLL_TIME_INTERVAL = 100;\nvar MoveColumnFeature = class extends BeanStub {\n constructor(pinned) {\n super();\n this.pinned = pinned;\n this.needToMoveLeft = false;\n this.needToMoveRight = false;\n this.lastMovedInfo = null;\n this.isCenterContainer = !_exists(pinned);\n }\n postConstruct() {\n this.beans.ctrlsSvc.whenReady(this, (p) => {\n this.gridBodyCon = p.gridBodyCtrl;\n });\n }\n getIconName() {\n const { pinned, lastDraggingEvent } = this;\n const { dragItem } = lastDraggingEvent || {};\n const columns = dragItem?.columns ?? [];\n for (const col of columns) {\n const colPinned = col.getPinned();\n if (col.getColDef().lockPinned) {\n if (colPinned == pinned) {\n return \"move\";\n }\n continue;\n }\n const initialPinnedState = dragItem?.containerType;\n if (initialPinnedState === pinned || !pinned) {\n return \"move\";\n }\n if (pinned && (!colPinned || initialPinnedState !== pinned)) {\n return \"pinned\";\n }\n }\n return \"notAllowed\";\n }\n onDragEnter(draggingEvent) {\n const dragItem = draggingEvent.dragItem;\n const columns = dragItem.columns;\n const dragCameFromToolPanel = draggingEvent.dragSource.type === 0 /* ToolPanel */;\n if (dragCameFromToolPanel) {\n this.setColumnsVisible(columns, true, \"uiColumnDragged\");\n } else {\n const visibleState = dragItem.visibleState;\n const visibleColumns = (columns || []).filter(\n (column) => visibleState[column.getId()] && !column.isVisible()\n );\n this.setColumnsVisible(visibleColumns, true, \"uiColumnDragged\");\n }\n if (!this.gos.get(\"suppressMoveWhenColumnDragging\")) {\n this.attemptToPinColumns(columns, this.pinned);\n }\n this.onDragging(draggingEvent, true, true);\n }\n onDragging(draggingEvent = this.lastDraggingEvent, fromEnter = false, fakeEvent = false, finished = false) {\n const { gos, ctrlsSvc } = this.beans;\n const isSuppressMoveWhenDragging = gos.get(\"suppressMoveWhenColumnDragging\");\n if (finished && !isSuppressMoveWhenDragging) {\n this.finishColumnMoving();\n return;\n }\n this.lastDraggingEvent = draggingEvent;\n if (!draggingEvent || !finished && _missing(draggingEvent.hDirection)) {\n return;\n }\n const mouseX = normaliseX({\n x: draggingEvent.x,\n pinned: this.pinned,\n gos,\n ctrlsSvc\n });\n if (!fromEnter) {\n this.checkCenterForScrolling(mouseX);\n }\n if (isSuppressMoveWhenDragging) {\n this.handleColumnDragWhileSuppressingMovement(draggingEvent, fromEnter, fakeEvent, mouseX, finished);\n } else {\n this.handleColumnDragWhileAllowingMovement(draggingEvent, fromEnter, fakeEvent, mouseX, finished);\n }\n }\n onDragLeave() {\n this.ensureIntervalCleared();\n this.clearHighlighted();\n this.updateDragItemContainerType();\n this.lastMovedInfo = null;\n }\n onDragStop() {\n this.onDragging(this.lastDraggingEvent, false, true, true);\n this.ensureIntervalCleared();\n this.lastMovedInfo = null;\n }\n onDragCancel() {\n this.clearHighlighted();\n this.ensureIntervalCleared();\n this.lastMovedInfo = null;\n }\n setColumnsVisible(columns, visible, source) {\n if (!columns?.length) {\n return;\n }\n const allowedCols = columns.filter((c) => !c.getColDef().lockVisible);\n if (!allowedCols.length) {\n return;\n }\n this.beans.colModel.setColsVisible(allowedCols, visible, source);\n }\n finishColumnMoving() {\n this.clearHighlighted();\n const lastMovedInfo = this.lastMovedInfo;\n if (!lastMovedInfo) {\n return;\n }\n const { columns, toIndex } = lastMovedInfo;\n this.beans.colMoves.moveColumns(columns, toIndex, \"uiColumnMoved\", true);\n }\n updateDragItemContainerType() {\n const { lastDraggingEvent } = this;\n if (this.gos.get(\"suppressMoveWhenColumnDragging\") || !lastDraggingEvent) {\n return;\n }\n const dragItem = lastDraggingEvent.dragItem;\n if (!dragItem) {\n return;\n }\n dragItem.containerType = this.pinned;\n }\n handleColumnDragWhileSuppressingMovement(draggingEvent, fromEnter, fakeEvent, mouseX, finished) {\n const allMovingColumns = this.getAllMovingColumns(draggingEvent, true);\n if (finished) {\n const isAttemptingToPin = this.isAttemptingToPin(allMovingColumns);\n if (isAttemptingToPin) {\n this.attemptToPinColumns(allMovingColumns, void 0, true);\n }\n const { fromLeft, xPosition } = this.getNormalisedXPositionInfo(allMovingColumns, isAttemptingToPin) || {};\n if (fromLeft == null || xPosition == null) {\n this.finishColumnMoving();\n return;\n }\n this.moveColumnsAfterHighlight({\n allMovingColumns,\n xPosition,\n fromEnter,\n fakeEvent,\n fromLeft\n });\n } else {\n if (!this.beans.dragAndDrop.isDropZoneWithinThisGrid(draggingEvent)) {\n return;\n }\n this.highlightHoveredColumn(allMovingColumns, mouseX);\n }\n }\n handleColumnDragWhileAllowingMovement(draggingEvent, fromEnter, fakeEvent, mouseX, finished) {\n const allMovingColumns = this.getAllMovingColumns(draggingEvent);\n const fromLeft = this.normaliseDirection(draggingEvent.hDirection) === \"right\";\n const isFromHeader = draggingEvent.dragSource.type === 1 /* HeaderCell */;\n const params = this.getMoveColumnParams({\n allMovingColumns,\n isFromHeader,\n xPosition: mouseX,\n fromLeft,\n fromEnter,\n fakeEvent\n });\n const lastMovedInfo = attemptMoveColumns({ ...params, finished });\n if (lastMovedInfo) {\n this.lastMovedInfo = lastMovedInfo;\n }\n }\n getAllMovingColumns(draggingEvent, useSplit = false) {\n const dragItem = draggingEvent.dragSource.getDragItem();\n let columns = null;\n if (useSplit) {\n columns = dragItem.columnsInSplit;\n if (!columns) {\n columns = dragItem.columns;\n }\n } else {\n columns = dragItem.columns;\n }\n const conditionCallback = (col) => col.getColDef().lockPinned ? col.getPinned() == this.pinned : true;\n if (!columns) {\n return [];\n }\n return columns.filter(conditionCallback);\n }\n getMoveColumnParams(params) {\n const { allMovingColumns, isFromHeader, xPosition, fromLeft, fromEnter, fakeEvent } = params;\n const { gos, colModel, colMoves, visibleCols } = this.beans;\n return {\n allMovingColumns,\n isFromHeader,\n fromLeft,\n xPosition,\n pinned: this.pinned,\n fromEnter,\n fakeEvent,\n gos,\n colModel,\n colMoves,\n visibleCols\n };\n }\n highlightHoveredColumn(movingColumns, mouseX) {\n const { gos, colModel } = this.beans;\n const isRtl = gos.get(\"enableRtl\");\n const consideredColumns = colModel.getCols().filter((col) => col.isVisible() && col.getPinned() === this.pinned);\n let start = null;\n let width = null;\n let targetColumn = null;\n for (const col of consideredColumns) {\n width = col.getActualWidth();\n start = this.getNormalisedColumnLeft(col, 0, isRtl);\n if (start != null) {\n const end = start + width;\n if (start <= mouseX && end >= mouseX) {\n targetColumn = col;\n break;\n }\n }\n start = null;\n width = null;\n }\n if (!targetColumn) {\n for (let i = consideredColumns.length - 1; i >= 0; i--) {\n const currentColumn = consideredColumns[i];\n const parent = consideredColumns[i].getParent();\n if (!parent) {\n targetColumn = currentColumn;\n break;\n }\n const leafDisplayedCols = parent?.getDisplayedLeafColumns();\n if (leafDisplayedCols.length) {\n targetColumn = _last(leafDisplayedCols);\n break;\n }\n }\n if (!targetColumn) {\n return;\n }\n start = this.getNormalisedColumnLeft(targetColumn, 0, isRtl);\n width = targetColumn.getActualWidth();\n } else if (movingColumns.indexOf(targetColumn) !== -1) {\n targetColumn = null;\n }\n if (targetColumn == null || start == null || width == null) {\n if (this.lastHighlightedColumn?.column !== targetColumn) {\n this.clearHighlighted();\n }\n return;\n }\n let position;\n if (mouseX - start < width / 2) {\n const targetIndex = consideredColumns.indexOf(targetColumn);\n if (targetIndex === 0) {\n position = 0 /* Before */;\n } else {\n position = 1 /* After */;\n targetColumn = consideredColumns[targetIndex - 1];\n }\n } else {\n position = 1 /* After */;\n }\n if (this.lastHighlightedColumn?.column !== targetColumn || this.lastHighlightedColumn?.position !== position) {\n this.clearHighlighted();\n }\n setColumnHighlighted(targetColumn, position);\n this.lastHighlightedColumn = { column: targetColumn, position };\n }\n getNormalisedXPositionInfo(allMovingColumns, isAttemptingToPin) {\n const { gos, visibleCols } = this.beans;\n const isRtl = gos.get(\"enableRtl\");\n const { firstMovingCol, column, position } = this.getColumnMoveAndTargetInfo(\n allMovingColumns,\n isAttemptingToPin,\n isRtl\n );\n if (!firstMovingCol || !column || position == null) {\n return;\n }\n const visibleColumns = visibleCols.allCols;\n const movingColIndex = visibleColumns.indexOf(firstMovingCol);\n const targetIndex = visibleColumns.indexOf(column);\n const isBefore = position === 0 /* Before */;\n const fromLeft = movingColIndex < targetIndex || movingColIndex === targetIndex && !isBefore;\n let diff = 0;\n if (isBefore) {\n if (fromLeft) {\n diff -= 1;\n }\n } else if (!fromLeft) {\n diff += 1;\n }\n if (targetIndex + diff === movingColIndex) {\n return;\n }\n const targetColumn = visibleColumns[targetIndex + diff];\n if (!targetColumn) {\n return;\n }\n const xPosition = this.getNormalisedColumnLeft(targetColumn, 20, isRtl);\n return { fromLeft, xPosition };\n }\n getColumnMoveAndTargetInfo(allMovingColumns, isAttemptingToPin, isRtl) {\n const lastHighlightedColumn = this.lastHighlightedColumn || {};\n const { firstMovingCol, lastMovingCol } = findFirstAndLastMovingColumns(allMovingColumns);\n if (!firstMovingCol || !lastMovingCol || lastHighlightedColumn.column || !isAttemptingToPin) {\n return {\n firstMovingCol,\n ...lastHighlightedColumn\n };\n }\n const pinned = this.getPinDirection();\n const isLeft = pinned === \"left\";\n return {\n firstMovingCol,\n position: isLeft ? 1 /* After */ : 0 /* Before */,\n column: isLeft !== isRtl ? firstMovingCol : lastMovingCol\n };\n }\n normaliseDirection(hDirection) {\n if (this.gos.get(\"enableRtl\")) {\n switch (hDirection) {\n case \"left\":\n return \"right\";\n case \"right\":\n return \"left\";\n }\n }\n return hDirection;\n }\n getNormalisedColumnLeft(col, padding, isRtl) {\n const { gos, ctrlsSvc } = this.beans;\n const left = col.getLeft();\n if (left == null) {\n return null;\n }\n const width = col.getActualWidth();\n return normaliseX({\n x: isRtl ? left + width - padding : left + padding,\n pinned: col.getPinned(),\n useHeaderRow: isRtl,\n skipScrollPadding: true,\n gos,\n ctrlsSvc\n });\n }\n isAttemptingToPin(columns) {\n const isMovingHorizontally = this.needToMoveLeft || this.needToMoveRight;\n const isFailedMoreThanThreshold = this.failedMoveAttempts > MOVE_FAIL_THRESHOLD;\n return isMovingHorizontally && isFailedMoreThanThreshold || columns.some((col) => col.getPinned() !== this.pinned);\n }\n moveColumnsAfterHighlight(params) {\n const { allMovingColumns, xPosition, fromEnter, fakeEvent, fromLeft } = params;\n const columnMoveParams = this.getMoveColumnParams({\n allMovingColumns,\n isFromHeader: true,\n xPosition,\n fromLeft,\n fromEnter,\n fakeEvent\n });\n const { columns, toIndex } = getBestColumnMoveIndexFromXPosition(columnMoveParams) || {};\n if (columns && toIndex != null) {\n this.lastMovedInfo = {\n columns,\n toIndex\n };\n }\n this.finishColumnMoving();\n }\n clearHighlighted() {\n const { lastHighlightedColumn } = this;\n if (!lastHighlightedColumn) {\n return;\n }\n setColumnHighlighted(lastHighlightedColumn.column, null);\n this.lastHighlightedColumn = null;\n }\n checkCenterForScrolling(xAdjustedForScroll) {\n if (!this.isCenterContainer) {\n return;\n }\n const centerCtrl = this.beans.ctrlsSvc.get(\"center\");\n const firstVisiblePixel = centerCtrl.getCenterViewportScrollLeft();\n const lastVisiblePixel = firstVisiblePixel + centerCtrl.getCenterWidth();\n let needToMoveRight;\n let needToMoveLeft;\n if (this.gos.get(\"enableRtl\")) {\n needToMoveRight = xAdjustedForScroll < firstVisiblePixel + SCROLL_GAP_NEEDED_BEFORE_MOVE;\n needToMoveLeft = xAdjustedForScroll > lastVisiblePixel - SCROLL_GAP_NEEDED_BEFORE_MOVE;\n } else {\n needToMoveLeft = xAdjustedForScroll < firstVisiblePixel + SCROLL_GAP_NEEDED_BEFORE_MOVE;\n needToMoveRight = xAdjustedForScroll > lastVisiblePixel - SCROLL_GAP_NEEDED_BEFORE_MOVE;\n }\n this.needToMoveRight = needToMoveRight;\n this.needToMoveLeft = needToMoveLeft;\n if (needToMoveLeft || needToMoveRight) {\n this.ensureIntervalStarted();\n } else {\n this.ensureIntervalCleared();\n }\n }\n ensureIntervalStarted() {\n if (this.movingIntervalId) {\n return;\n }\n this.intervalCount = 0;\n this.failedMoveAttempts = 0;\n this.movingIntervalId = window.setInterval(this.moveInterval.bind(this), SCROLL_TIME_INTERVAL);\n this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft ? \"left\" : \"right\", true);\n }\n ensureIntervalCleared() {\n if (!this.movingIntervalId) {\n return;\n }\n window.clearInterval(this.movingIntervalId);\n this.movingIntervalId = null;\n this.failedMoveAttempts = 0;\n this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName());\n }\n moveInterval() {\n let pixelsToMove;\n this.intervalCount++;\n pixelsToMove = 10 + this.intervalCount * SCROLL_ACCELERATION_RATE;\n if (pixelsToMove > SCROLL_MOVE_WIDTH) {\n pixelsToMove = SCROLL_MOVE_WIDTH;\n }\n let pixelsMoved = null;\n const scrollFeature = this.gridBodyCon.scrollFeature;\n if (this.needToMoveLeft) {\n pixelsMoved = scrollFeature.scrollHorizontally(-pixelsToMove);\n } else if (this.needToMoveRight) {\n pixelsMoved = scrollFeature.scrollHorizontally(pixelsToMove);\n }\n if (pixelsMoved !== 0) {\n this.onDragging(this.lastDraggingEvent);\n this.failedMoveAttempts = 0;\n } else {\n this.failedMoveAttempts++;\n const { pinnedCols, dragAndDrop, gos } = this.beans;\n if (this.failedMoveAttempts <= MOVE_FAIL_THRESHOLD + 1 || !pinnedCols) {\n return;\n }\n dragAndDrop.setDragImageCompIcon(\"pinned\");\n if (!gos.get(\"suppressMoveWhenColumnDragging\")) {\n const columns = this.lastDraggingEvent?.dragItem.columns;\n this.attemptToPinColumns(columns, void 0, true);\n }\n }\n }\n getPinDirection() {\n if (this.needToMoveLeft || this.pinned === \"left\") {\n return \"left\";\n }\n if (this.needToMoveRight || this.pinned === \"right\") {\n return \"right\";\n }\n }\n attemptToPinColumns(columns, pinned, fromMoving = false) {\n const allowedCols = (columns || []).filter((c) => !c.getColDef().lockPinned);\n if (!allowedCols.length) {\n return 0;\n }\n if (fromMoving) {\n pinned = this.getPinDirection();\n }\n const { pinnedCols, dragAndDrop } = this.beans;\n pinnedCols?.setColsPinned(allowedCols, pinned, \"uiColumnDragged\");\n if (fromMoving) {\n dragAndDrop.nudge();\n }\n return allowedCols.length;\n }\n destroy() {\n super.destroy();\n this.lastDraggingEvent = null;\n this.clearHighlighted();\n this.lastMovedInfo = null;\n }\n};\nfunction setColumnHighlighted(column, highlighted) {\n if (column.highlighted === highlighted) {\n return;\n }\n column.highlighted = highlighted;\n column.dispatchColEvent(\"headerHighlightChanged\", \"uiColumnMoved\");\n}\nfunction findFirstAndLastMovingColumns(allMovingColumns) {\n const moveLen = allMovingColumns.length;\n let firstMovingCol;\n let lastMovingCol;\n for (let i = 0; i < moveLen; i++) {\n if (!firstMovingCol) {\n const leftCol = allMovingColumns[i];\n if (leftCol.getLeft() != null) {\n firstMovingCol = leftCol;\n }\n }\n if (!lastMovingCol) {\n const rightCol = allMovingColumns[moveLen - 1 - i];\n if (rightCol.getLeft() != null) {\n lastMovingCol = rightCol;\n }\n }\n if (firstMovingCol && lastMovingCol) {\n break;\n }\n }\n return { firstMovingCol, lastMovingCol };\n}\n\n// packages/ag-grid-community/src/columnMove/columnDrag/bodyDropTarget.ts\nvar BodyDropTarget = class extends BeanStub {\n constructor(pinned, eContainer) {\n super();\n this.pinned = pinned;\n this.eContainer = eContainer;\n }\n postConstruct() {\n const { ctrlsSvc, dragAndDrop } = this.beans;\n const pinned = this.pinned;\n ctrlsSvc.whenReady(this, (p) => {\n let eSecondaryContainers;\n const eBodyViewport = p.gridBodyCtrl.eBodyViewport;\n switch (pinned) {\n case \"left\":\n eSecondaryContainers = [\n [eBodyViewport, p.left.eContainer],\n [p.bottomLeft.eContainer],\n [p.topLeft.eContainer]\n ];\n break;\n case \"right\":\n eSecondaryContainers = [\n [eBodyViewport, p.right.eContainer],\n [p.bottomRight.eContainer],\n [p.topRight.eContainer]\n ];\n break;\n default:\n eSecondaryContainers = [\n [eBodyViewport, p.center.eViewport],\n [p.bottomCenter.eViewport],\n [p.topCenter.eViewport]\n ];\n break;\n }\n this.eSecondaryContainers = eSecondaryContainers;\n });\n this.moveColumnFeature = this.createManagedBean(new MoveColumnFeature(pinned));\n this.bodyDropPivotTarget = this.createManagedBean(new BodyDropPivotTarget(pinned));\n dragAndDrop.addDropTarget(this);\n this.addDestroyFunc(() => dragAndDrop.removeDropTarget(this));\n }\n isInterestedIn(type) {\n return type === 1 /* HeaderCell */ || type === 0 /* ToolPanel */ && this.gos.get(\"allowDragFromColumnsToolPanel\");\n }\n getSecondaryContainers() {\n return this.eSecondaryContainers;\n }\n getContainer() {\n return this.eContainer;\n }\n getIconName() {\n return this.currentDropListener.getIconName();\n }\n // we want to use the bodyPivotTarget if the user is dragging columns in from the toolPanel\n // and we are in pivot mode, as it has to logic to set pivot/value/group on the columns when\n // dropped into the grid's body.\n isDropColumnInPivotMode(draggingEvent) {\n return this.beans.colModel.isPivotMode() && draggingEvent.dragSource.type === 0 /* ToolPanel */;\n }\n onDragEnter(draggingEvent) {\n this.currentDropListener = this.isDropColumnInPivotMode(draggingEvent) ? this.bodyDropPivotTarget : this.moveColumnFeature;\n this.currentDropListener.onDragEnter(draggingEvent);\n }\n onDragLeave(params) {\n this.currentDropListener.onDragLeave(params);\n }\n onDragging(params) {\n this.currentDropListener.onDragging(params);\n }\n onDragStop(params) {\n this.currentDropListener.onDragStop(params);\n }\n onDragCancel() {\n this.currentDropListener.onDragCancel();\n }\n};\n\n// packages/ag-grid-community/src/columnMove/columnMoveUtils.ts\nfunction placeLockedColumns(cols, gos) {\n const left = [];\n const normal = [];\n const right = [];\n cols.forEach((col) => {\n const position = col.getColDef().lockPosition;\n if (position === \"right\") {\n right.push(col);\n } else if (position === \"left\" || position === true) {\n left.push(col);\n } else {\n normal.push(col);\n }\n });\n const isRtl = gos.get(\"enableRtl\");\n if (isRtl) {\n return [...right, ...normal, ...left];\n }\n return [...left, ...normal, ...right];\n}\nfunction doesMovePassMarryChildren(allColumnsCopy, gridBalancedTree) {\n let rulePassed = true;\n depthFirstOriginalTreeSearch(null, gridBalancedTree, (child) => {\n if (!isProvidedColumnGroup(child)) {\n return;\n }\n const columnGroup = child;\n const colGroupDef = columnGroup.getColGroupDef();\n const marryChildren = colGroupDef?.marryChildren;\n if (!marryChildren) {\n return;\n }\n const newIndexes = [];\n for (const col of columnGroup.getLeafColumns()) {\n const newColIndex = allColumnsCopy.indexOf(col);\n newIndexes.push(newColIndex);\n }\n const maxIndex = Math.max.apply(Math, newIndexes);\n const minIndex = Math.min.apply(Math, newIndexes);\n const spread = maxIndex - minIndex;\n const maxSpread = columnGroup.getLeafColumns().length - 1;\n if (spread > maxSpread) {\n rulePassed = false;\n }\n });\n return rulePassed;\n}\n\n// packages/ag-grid-community/src/columnMove/columnMoveService.ts\nvar ColumnMoveService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colMoves\";\n }\n moveColumnByIndex(fromIndex, toIndex, source) {\n const gridColumns = this.beans.colModel.getCols();\n if (!gridColumns) {\n return;\n }\n const column = gridColumns[fromIndex];\n this.moveColumns([column], toIndex, source);\n }\n moveColumns(columnsToMoveKeys, toIndex, source, finished = true) {\n const { colModel, colAnimation, visibleCols, eventSvc } = this.beans;\n const gridColumns = colModel.getCols();\n if (!gridColumns) {\n return;\n }\n if (toIndex > gridColumns.length - columnsToMoveKeys.length) {\n _warn(30, { toIndex });\n return;\n }\n colAnimation?.start();\n const movedColumns = colModel.getColsForKeys(columnsToMoveKeys);\n if (this.doesMovePassRules(movedColumns, toIndex)) {\n _moveInArray(colModel.getCols(), movedColumns, toIndex);\n visibleCols.refresh(source);\n eventSvc.dispatchEvent({\n type: \"columnMoved\",\n columns: movedColumns,\n column: movedColumns.length === 1 ? movedColumns[0] : null,\n toIndex,\n finished,\n source\n });\n }\n colAnimation?.finish();\n }\n doesMovePassRules(columnsToMove, toIndex) {\n const proposedColumnOrder = this.getProposedColumnOrder(columnsToMove, toIndex);\n return this.doesOrderPassRules(proposedColumnOrder);\n }\n doesOrderPassRules(gridOrder) {\n const { colModel, gos } = this.beans;\n if (!doesMovePassMarryChildren(gridOrder, colModel.getColTree())) {\n return false;\n }\n const doesMovePassLockedPositions = (proposedColumnOrder) => {\n const lockPositionToPlacement = (position) => {\n if (!position) {\n return 0 /* NONE */;\n }\n return position === \"left\" || position === true ? -1 /* LEFT */ : 1 /* RIGHT */;\n };\n const isRtl = gos.get(\"enableRtl\");\n let lastPlacement = isRtl ? 1 /* RIGHT */ : -1 /* LEFT */;\n let rulePassed = true;\n for (const col of proposedColumnOrder) {\n const placement = lockPositionToPlacement(col.getColDef().lockPosition);\n if (isRtl) {\n if (placement > lastPlacement) {\n rulePassed = false;\n }\n } else if (placement < lastPlacement) {\n rulePassed = false;\n }\n lastPlacement = placement;\n }\n return rulePassed;\n };\n if (!doesMovePassLockedPositions(gridOrder)) {\n return false;\n }\n return true;\n }\n getProposedColumnOrder(columnsToMove, toIndex) {\n const gridColumns = this.beans.colModel.getCols();\n const proposedColumnOrder = gridColumns.slice();\n _moveInArray(proposedColumnOrder, columnsToMove, toIndex);\n return proposedColumnOrder;\n }\n createBodyDropTarget(pinned, dropContainer) {\n return new BodyDropTarget(pinned, dropContainer);\n }\n moveHeader(hDirection, eGui, column, pinned, bean) {\n const { ctrlsSvc, gos, colModel, visibleCols, focusSvc } = this.beans;\n const rect = eGui.getBoundingClientRect();\n const left = rect.left;\n const isGroup = isColumnGroup(column);\n const width = isGroup ? rect.width : column.getActualWidth();\n const isLeft = hDirection === \"left\" !== gos.get(\"enableRtl\");\n const xPosition = normaliseX({\n x: isLeft ? left - 20 : left + width + 20,\n pinned,\n fromKeyboard: true,\n gos,\n ctrlsSvc\n });\n const headerPosition = focusSvc.focusedHeader;\n attemptMoveColumns({\n allMovingColumns: isGroup ? column.getLeafColumns() : [column],\n isFromHeader: true,\n fromLeft: hDirection === \"right\",\n xPosition,\n pinned,\n fromEnter: false,\n fakeEvent: false,\n gos,\n colModel,\n colMoves: this,\n visibleCols,\n finished: true\n });\n let targetColumn;\n if (isGroup) {\n const displayedLeafColumns = column.getDisplayedLeafColumns();\n targetColumn = isLeft ? displayedLeafColumns[0] : _last(displayedLeafColumns);\n } else {\n targetColumn = column;\n }\n ctrlsSvc.getScrollFeature().ensureColumnVisible(targetColumn, \"auto\");\n if ((!bean.isAlive() || gos.get(\"ensureDomOrder\")) && headerPosition) {\n let restoreFocusColumn;\n if (isGroup) {\n const groupId = column.getGroupId();\n const leafCols = column.getLeafColumns();\n if (!leafCols.length) {\n return;\n }\n const parent = leafCols[0].getParent();\n if (!parent) {\n return;\n }\n restoreFocusColumn = findGroupWidthId(parent, groupId);\n } else {\n restoreFocusColumn = column;\n }\n if (restoreFocusColumn) {\n focusSvc.focusHeaderPosition({\n headerPosition: {\n ...headerPosition,\n column: restoreFocusColumn\n }\n });\n }\n }\n }\n setDragSourceForHeader(eSource, column, displayName) {\n const { gos, colModel, dragAndDrop, visibleCols } = this.beans;\n let hideColumnOnExit = !gos.get(\"suppressDragLeaveHidesColumns\");\n const isGroup = isColumnGroup(column);\n const columns = isGroup ? column.getProvidedColumnGroup().getLeafColumns() : [column];\n const getDragItem = isGroup ? () => createDragItemForGroup(column, visibleCols.allCols) : () => createDragItem(column);\n const dragSource = {\n type: 1 /* HeaderCell */,\n eElement: eSource,\n getDefaultIconName: () => hideColumnOnExit ? \"hide\" : \"notAllowed\",\n getDragItem,\n dragItemName: displayName,\n onDragStarted: () => {\n hideColumnOnExit = !gos.get(\"suppressDragLeaveHidesColumns\");\n setColumnsMoving(columns, true);\n },\n onDragStopped: () => setColumnsMoving(columns, false),\n onDragCancelled: () => setColumnsMoving(columns, false),\n onGridEnter: (dragItem) => {\n if (hideColumnOnExit) {\n const { columns: columns2 = [], visibleState } = dragItem ?? {};\n const hasVisibleState = isGroup ? (col) => !visibleState || visibleState[col.getColId()] : () => true;\n const unlockedColumns = columns2.filter(\n (col) => !col.getColDef().lockVisible && hasVisibleState(col)\n );\n colModel.setColsVisible(unlockedColumns, true, \"uiColumnMoved\");\n }\n },\n onGridExit: (dragItem) => {\n if (hideColumnOnExit) {\n const unlockedColumns = dragItem?.columns?.filter((col) => !col.getColDef().lockVisible) || [];\n colModel.setColsVisible(unlockedColumns, false, \"uiColumnMoved\");\n }\n }\n };\n dragAndDrop.addDragSource(dragSource, true);\n return dragSource;\n }\n};\nfunction findGroupWidthId(columnGroup, id) {\n while (columnGroup) {\n if (columnGroup.getGroupId() === id) {\n return columnGroup;\n }\n columnGroup = columnGroup.getParent();\n }\n return void 0;\n}\nfunction createDragItem(column) {\n const visibleState = {};\n visibleState[column.getId()] = column.isVisible();\n return {\n columns: [column],\n visibleState,\n containerType: column.pinned\n };\n}\nfunction createDragItemForGroup(columnGroup, allCols) {\n const allColumnsOriginalOrder = columnGroup.getProvidedColumnGroup().getLeafColumns();\n const visibleState = {};\n for (const column of allColumnsOriginalOrder) {\n visibleState[column.getId()] = column.isVisible();\n }\n const allColumnsCurrentOrder = [];\n for (const column of allCols) {\n if (allColumnsOriginalOrder.indexOf(column) >= 0) {\n allColumnsCurrentOrder.push(column);\n _removeFromArray(allColumnsOriginalOrder, column);\n }\n }\n for (const column of allColumnsOriginalOrder) {\n allColumnsCurrentOrder.push(column);\n }\n const columnsInSplit = [];\n const columnGroupColumns = columnGroup.getLeafColumns();\n for (const col of allColumnsCurrentOrder) {\n if (columnGroupColumns.indexOf(col) !== -1) {\n columnsInSplit.push(col);\n }\n }\n return {\n columns: allColumnsCurrentOrder,\n columnsInSplit,\n visibleState,\n containerType: columnsInSplit[0]?.pinned\n };\n}\n\n// packages/ag-grid-community/src/columnMove/columnMoveModule.ts\nvar ColumnMoveModule = {\n moduleName: \"ColumnMove\",\n version: VERSION,\n beans: [ColumnMoveService, ColumnAnimationService],\n apiFunctions: {\n moveColumnByIndex,\n moveColumns\n },\n dependsOn: [SharedDragAndDropModule],\n css: [column_moving_default]\n};\n\n// packages/ag-grid-community/src/rendering/autoWidthCalculator.ts\nvar AutoWidthCalculator = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"autoWidthCalc\";\n }\n postConstruct() {\n this.beans.ctrlsSvc.whenReady(this, (p) => {\n this.centerRowContainerCtrl = p.center;\n });\n }\n // this is the trick: we create a dummy container and clone all the cells\n // into the dummy, then check the dummy's width. then destroy the dummy\n // as we don't need it any more.\n // drawback: only the cells visible on the screen are considered\n getPreferredWidthForColumn(column, skipHeader) {\n const eHeaderCell = this.getHeaderCellForColumn(column);\n if (!eHeaderCell) {\n return -1;\n }\n const elements = this.beans.rowRenderer.getAllCellsNotSpanningForColumn(column);\n if (!skipHeader) {\n elements.push(eHeaderCell);\n }\n return this.getPreferredWidthForElements(elements);\n }\n getPreferredWidthForColumnGroup(columnGroup) {\n const eHeaderCell = this.getHeaderCellForColumn(columnGroup);\n if (!eHeaderCell) {\n return -1;\n }\n return this.getPreferredWidthForElements([eHeaderCell]);\n }\n getPreferredWidthForElements(elements, extraPadding) {\n const eDummyContainer = document.createElement(\"form\");\n eDummyContainer.style.position = \"fixed\";\n const eBodyContainer = this.centerRowContainerCtrl.eContainer;\n for (const el of elements) {\n this.cloneItemIntoDummy(el, eDummyContainer);\n }\n eBodyContainer.appendChild(eDummyContainer);\n const dummyContainerWidth = Math.ceil(eDummyContainer.getBoundingClientRect().width);\n eDummyContainer.remove();\n extraPadding = extraPadding ?? this.gos.get(\"autoSizePadding\");\n return dummyContainerWidth + extraPadding;\n }\n getHeaderCellForColumn(column) {\n let element = null;\n for (const container of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()) {\n const res = container.getHtmlElementForColumnHeader(column);\n if (res != null) {\n element = res;\n }\n }\n return element;\n }\n cloneItemIntoDummy(eCell, eDummyContainer) {\n const eCellClone = eCell.cloneNode(true);\n eCellClone.style.width = \"\";\n eCellClone.style.position = \"static\";\n eCellClone.style.left = \"\";\n const eCloneParent = document.createElement(\"div\");\n const eCloneParentClassList = eCloneParent.classList;\n const isHeader = [\"ag-header-cell\", \"ag-header-group-cell\"].some((cls) => eCellClone.classList.contains(cls));\n if (isHeader) {\n eCloneParentClassList.add(\"ag-header\", \"ag-header-row\");\n eCloneParent.style.position = \"static\";\n } else {\n eCloneParentClassList.add(\"ag-row\");\n }\n let pointer = eCell.parentElement;\n while (pointer) {\n const isRow = [\"ag-header-row\", \"ag-row\"].some((cls) => pointer.classList.contains(cls));\n if (isRow) {\n for (let i = 0; i < pointer.classList.length; i++) {\n const item = pointer.classList[i];\n if (item != \"ag-row-position-absolute\") {\n eCloneParentClassList.add(item);\n }\n }\n break;\n }\n pointer = pointer.parentElement;\n }\n eCloneParent.appendChild(eCellClone);\n eDummyContainer.appendChild(eCloneParent);\n }\n};\n\n// packages/ag-grid-community/src/rendering/autoWidthModule.ts\nvar AutoWidthModule = {\n moduleName: \"AutoWidth\",\n version: VERSION,\n beans: [AutoWidthCalculator]\n};\n\n// packages/ag-grid-community/src/columnResize/columnResizeApi.ts\nfunction setColumnWidths(beans, columnWidths, finished = true, source = \"api\") {\n beans.colResize?.setColumnWidths(columnWidths, false, finished, source);\n}\n\n// packages/ag-grid-community/src/columns/columnEventUtils.ts\nfunction getCommonValue(cols, valueGetter) {\n if (!cols || cols.length == 0) {\n return void 0;\n }\n const firstValue = valueGetter(cols[0]);\n for (let i = 1; i < cols.length; i++) {\n if (firstValue !== valueGetter(cols[i])) {\n return void 0;\n }\n }\n return firstValue;\n}\nfunction dispatchColumnPinnedEvent(eventSvc, changedColumns, source) {\n if (!changedColumns.length) {\n return;\n }\n const column = changedColumns.length === 1 ? changedColumns[0] : null;\n const pinned = getCommonValue(changedColumns, (col) => col.getPinned());\n eventSvc.dispatchEvent({\n type: \"columnPinned\",\n // mistake in typing, 'undefined' should be allowed, as 'null' means 'not pinned'\n pinned: pinned != null ? pinned : null,\n columns: changedColumns,\n column,\n source\n });\n}\nfunction dispatchColumnVisibleEvent(eventSvc, changedColumns, source) {\n if (!changedColumns.length) {\n return;\n }\n const column = changedColumns.length === 1 ? changedColumns[0] : null;\n const visible = getCommonValue(changedColumns, (col) => col.isVisible());\n eventSvc.dispatchEvent({\n type: \"columnVisible\",\n visible,\n columns: changedColumns,\n column,\n source\n });\n}\nfunction dispatchColumnChangedEvent(eventSvc, type, columns, source) {\n eventSvc.dispatchEvent({\n type,\n columns,\n column: columns && columns.length == 1 ? columns[0] : null,\n source\n });\n}\nfunction dispatchColumnResizedEvent(eventSvc, columns, finished, source, flexColumns = null) {\n if (columns?.length) {\n eventSvc.dispatchEvent({\n type: \"columnResized\",\n columns,\n column: columns.length === 1 ? columns[0] : null,\n flexColumns,\n finished,\n source\n });\n }\n}\n\n// packages/ag-grid-community/src/columnResize/groupResizeFeature.ts\nvar GroupResizeFeature = class extends BeanStub {\n constructor(comp, eResize, pinned, columnGroup) {\n super();\n this.comp = comp;\n this.eResize = eResize;\n this.pinned = pinned;\n this.columnGroup = columnGroup;\n }\n postConstruct() {\n if (!this.columnGroup.isResizable()) {\n this.comp.setResizableDisplayed(false);\n return;\n }\n const { horizontalResizeSvc, gos, colAutosize } = this.beans;\n const finishedWithResizeFunc = horizontalResizeSvc.addResizeBar({\n eResizeBar: this.eResize,\n onResizeStart: this.onResizeStart.bind(this),\n onResizing: this.onResizing.bind(this, false),\n onResizeEnd: this.onResizing.bind(this, true)\n });\n this.addDestroyFunc(finishedWithResizeFunc);\n if (!gos.get(\"suppressAutoSize\") && colAutosize) {\n this.addDestroyFunc(\n colAutosize.addColumnGroupResize(\n this.eResize,\n this.columnGroup,\n () => this.resizeLeafColumnsToFit(\"uiColumnResized\")\n )\n );\n }\n }\n onResizeStart(shiftKey) {\n const {\n columnsToResize,\n resizeStartWidth,\n resizeRatios,\n groupAfterColumns,\n groupAfterStartWidth,\n groupAfterRatios\n } = this.getInitialValues(shiftKey);\n this.resizeCols = columnsToResize;\n this.resizeStartWidth = resizeStartWidth;\n this.resizeRatios = resizeRatios;\n this.resizeTakeFromCols = groupAfterColumns;\n this.resizeTakeFromStartWidth = groupAfterStartWidth;\n this.resizeTakeFromRatios = groupAfterRatios;\n this.toggleColumnResizing(true);\n }\n onResizing(finished, resizeAmount, source = \"uiColumnResized\") {\n const resizeAmountNormalised = this.normaliseDragChange(resizeAmount);\n const width = this.resizeStartWidth + resizeAmountNormalised;\n this.resizeColumnsFromLocalValues(width, source, finished);\n }\n getInitialValues(shiftKey) {\n const getInitialSizeOfColumns = (columns) => columns.reduce((totalWidth, column) => totalWidth + column.getActualWidth(), 0);\n const getSizeRatiosOfColumns = (columns, initialSizeOfColumns) => columns.map((column) => column.getActualWidth() / initialSizeOfColumns);\n const columnsToResize = this.getColumnsToResize();\n const resizeStartWidth = getInitialSizeOfColumns(columnsToResize);\n const resizeRatios = getSizeRatiosOfColumns(columnsToResize, resizeStartWidth);\n const columnSizeAndRatios = {\n columnsToResize,\n resizeStartWidth,\n resizeRatios\n };\n let groupAfter = null;\n if (shiftKey) {\n groupAfter = this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup, \"After\") ?? null;\n }\n if (groupAfter) {\n const takeFromLeafCols = groupAfter.getDisplayedLeafColumns();\n const groupAfterColumns = columnSizeAndRatios.groupAfterColumns = takeFromLeafCols.filter(\n (col) => col.isResizable()\n );\n const groupAfterStartWidth = columnSizeAndRatios.groupAfterStartWidth = getInitialSizeOfColumns(groupAfterColumns);\n columnSizeAndRatios.groupAfterRatios = getSizeRatiosOfColumns(groupAfterColumns, groupAfterStartWidth);\n } else {\n columnSizeAndRatios.groupAfterColumns = void 0;\n columnSizeAndRatios.groupAfterStartWidth = void 0;\n columnSizeAndRatios.groupAfterRatios = void 0;\n }\n return columnSizeAndRatios;\n }\n resizeLeafColumnsToFit(source) {\n const preferredSize = this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup);\n const initialValues = this.getInitialValues();\n if (preferredSize > initialValues.resizeStartWidth) {\n this.resizeColumns(initialValues, preferredSize, source, true);\n }\n }\n resizeColumnsFromLocalValues(totalWidth, source, finished = true) {\n if (!this.resizeCols || !this.resizeRatios) {\n return;\n }\n const initialValues = {\n columnsToResize: this.resizeCols,\n resizeStartWidth: this.resizeStartWidth,\n resizeRatios: this.resizeRatios,\n groupAfterColumns: this.resizeTakeFromCols,\n groupAfterStartWidth: this.resizeTakeFromStartWidth,\n groupAfterRatios: this.resizeTakeFromRatios\n };\n this.resizeColumns(initialValues, totalWidth, source, finished);\n }\n resizeColumns(initialValues, totalWidth, source, finished = true) {\n const {\n columnsToResize,\n resizeStartWidth,\n resizeRatios,\n groupAfterColumns,\n groupAfterStartWidth,\n groupAfterRatios\n } = initialValues;\n const resizeSets = [];\n resizeSets.push({\n columns: columnsToResize,\n ratios: resizeRatios,\n width: totalWidth\n });\n if (groupAfterColumns) {\n const diff = totalWidth - resizeStartWidth;\n resizeSets.push({\n columns: groupAfterColumns,\n ratios: groupAfterRatios,\n width: groupAfterStartWidth - diff\n });\n }\n this.beans.colResize?.resizeColumnSets({\n resizeSets,\n finished,\n source\n });\n if (finished) {\n this.toggleColumnResizing(false);\n }\n }\n toggleColumnResizing(resizing) {\n this.comp.toggleCss(\"ag-column-resizing\", resizing);\n }\n getColumnsToResize() {\n const leafCols = this.columnGroup.getDisplayedLeafColumns();\n return leafCols.filter((col) => col.isResizable());\n }\n // optionally inverts the drag, depending on pinned and RTL\n // note - this method is duplicated in RenderedHeaderCell - should refactor out?\n normaliseDragChange(dragChange) {\n let result = dragChange;\n if (this.gos.get(\"enableRtl\")) {\n if (this.pinned !== \"left\") {\n result *= -1;\n }\n } else if (this.pinned === \"right\") {\n result *= -1;\n }\n return result;\n }\n destroy() {\n super.destroy();\n this.resizeCols = void 0;\n this.resizeRatios = void 0;\n this.resizeTakeFromCols = void 0;\n this.resizeTakeFromRatios = void 0;\n }\n};\n\n// packages/ag-grid-community/src/columnResize/resizeFeature.ts\nvar ResizeFeature = class extends BeanStub {\n constructor(pinned, column, eResize, comp, ctrl) {\n super();\n this.pinned = pinned;\n this.column = column;\n this.eResize = eResize;\n this.comp = comp;\n this.ctrl = ctrl;\n }\n postConstruct() {\n const destroyResizeFuncs = [];\n let canResize;\n let canAutosize;\n const addResize = () => {\n _setDisplayed(this.eResize, canResize);\n if (!canResize) {\n return;\n }\n const { horizontalResizeSvc, colAutosize } = this.beans;\n const finishedWithResizeFunc = horizontalResizeSvc.addResizeBar({\n eResizeBar: this.eResize,\n onResizeStart: this.onResizeStart.bind(this),\n onResizing: this.onResizing.bind(this, false),\n onResizeEnd: this.onResizing.bind(this, true)\n });\n destroyResizeFuncs.push(finishedWithResizeFunc);\n if (canAutosize && colAutosize) {\n destroyResizeFuncs.push(colAutosize.addColumnAutosizeListeners(this.eResize, this.column));\n }\n };\n const removeResize = () => {\n for (const f of destroyResizeFuncs) {\n f();\n }\n destroyResizeFuncs.length = 0;\n };\n const refresh = () => {\n const resize = this.column.isResizable();\n const autoSize = !this.gos.get(\"suppressAutoSize\") && !this.column.getColDef().suppressAutoSize;\n const propertyChange = resize !== canResize || autoSize !== canAutosize;\n if (propertyChange) {\n canResize = resize;\n canAutosize = autoSize;\n removeResize();\n addResize();\n }\n };\n refresh();\n this.addDestroyFunc(removeResize);\n this.ctrl.setRefreshFunction(\"resize\", refresh);\n }\n onResizing(finished, resizeAmount) {\n const { column: key, lastResizeAmount, resizeStartWidth, beans } = this;\n const resizeAmountNormalised = this.normaliseResizeAmount(resizeAmount);\n const newWidth = resizeStartWidth + resizeAmountNormalised;\n const columnWidths = [{ key, newWidth }];\n const { pinnedCols, ctrlsSvc, colResize } = beans;\n if (this.column.getPinned()) {\n const leftWidth = pinnedCols?.leftWidth ?? 0;\n const rightWidth = pinnedCols?.rightWidth ?? 0;\n const bodyWidth = _getInnerWidth(ctrlsSvc.getGridBodyCtrl().eBodyViewport) - 50;\n if (leftWidth + rightWidth + (resizeAmountNormalised - lastResizeAmount) > bodyWidth) {\n return;\n }\n }\n this.lastResizeAmount = resizeAmountNormalised;\n colResize?.setColumnWidths(columnWidths, this.resizeWithShiftKey, finished, \"uiColumnResized\");\n if (finished) {\n this.toggleColumnResizing(false);\n }\n }\n onResizeStart(shiftKey) {\n this.resizeStartWidth = this.column.getActualWidth();\n this.lastResizeAmount = 0;\n this.resizeWithShiftKey = shiftKey;\n this.toggleColumnResizing(true);\n }\n toggleColumnResizing(resizing) {\n this.column.resizing = resizing;\n this.comp.toggleCss(\"ag-column-resizing\", resizing);\n }\n // optionally inverts the drag, depending on pinned and RTL\n // note - this method is duplicated in RenderedHeaderGroupCell - should refactor out?\n normaliseResizeAmount(dragChange) {\n let result = dragChange;\n const notPinningLeft = this.pinned !== \"left\";\n const pinningRight = this.pinned === \"right\";\n if (this.gos.get(\"enableRtl\")) {\n if (notPinningLeft) {\n result *= -1;\n }\n } else if (pinningRight) {\n result *= -1;\n }\n return result;\n }\n};\n\n// packages/ag-grid-community/src/columnResize/columnResizeService.ts\nvar ColumnResizeService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colResize\";\n }\n setColumnWidths(columnWidths, shiftKey, finished, source) {\n const sets = [];\n const { colModel, gos, visibleCols } = this.beans;\n for (const columnWidth of columnWidths) {\n const col = colModel.getColDefCol(columnWidth.key) || colModel.getCol(columnWidth.key);\n if (!col) {\n continue;\n }\n sets.push({\n width: columnWidth.newWidth,\n ratios: [1],\n columns: [col]\n });\n const defaultIsShift = gos.get(\"colResizeDefault\") === \"shift\";\n if (defaultIsShift) {\n shiftKey = !shiftKey;\n }\n if (shiftKey) {\n const otherCol = visibleCols.getColAfter(col);\n if (!otherCol) {\n continue;\n }\n const widthDiff = col.getActualWidth() - columnWidth.newWidth;\n const otherColWidth = otherCol.getActualWidth() + widthDiff;\n sets.push({\n width: otherColWidth,\n ratios: [1],\n columns: [otherCol]\n });\n }\n }\n if (sets.length === 0) {\n return;\n }\n this.resizeColumnSets({\n resizeSets: sets,\n finished,\n source\n });\n }\n // method takes sets of columns and resizes them. either all sets will be resized, or nothing\n // be resized. this is used for example when user tries to resize a group and holds shift key,\n // then both the current group (grows), and the adjacent group (shrinks), will get resized,\n // so that's two sets for this method.\n resizeColumnSets(params) {\n const { resizeSets, finished, source } = params;\n const passMinMaxCheck = !resizeSets || resizeSets.every((columnResizeSet) => checkMinAndMaxWidthsForSet(columnResizeSet));\n if (!passMinMaxCheck) {\n if (finished) {\n const columns = resizeSets && resizeSets.length > 0 ? resizeSets[0].columns : null;\n dispatchColumnResizedEvent(this.eventSvc, columns, finished, source);\n }\n return;\n }\n const changedCols = [];\n const allResizedCols = [];\n for (const set of resizeSets) {\n const { width, columns, ratios } = set;\n const newWidths = {};\n const finishedCols = {};\n for (const col of columns) {\n allResizedCols.push(col);\n }\n let finishedColsGrew = true;\n let loopCount = 0;\n while (finishedColsGrew) {\n loopCount++;\n if (loopCount > 1e3) {\n _error(31);\n break;\n }\n finishedColsGrew = false;\n const subsetCols = [];\n let subsetRatioTotal = 0;\n let pixelsToDistribute = width;\n columns.forEach((col, index) => {\n const thisColFinished = finishedCols[col.getId()];\n if (thisColFinished) {\n pixelsToDistribute -= newWidths[col.getId()];\n } else {\n subsetCols.push(col);\n const ratioThisCol = ratios[index];\n subsetRatioTotal += ratioThisCol;\n }\n });\n const ratioScale = 1 / subsetRatioTotal;\n subsetCols.forEach((col, index) => {\n const lastCol = index === subsetCols.length - 1;\n let colNewWidth;\n if (lastCol) {\n colNewWidth = pixelsToDistribute;\n } else {\n colNewWidth = Math.round(ratios[index] * width * ratioScale);\n pixelsToDistribute -= colNewWidth;\n }\n const minWidth = col.getMinWidth();\n const maxWidth = col.getMaxWidth();\n if (colNewWidth < minWidth) {\n colNewWidth = minWidth;\n finishedCols[col.getId()] = true;\n finishedColsGrew = true;\n } else if (maxWidth > 0 && colNewWidth > maxWidth) {\n colNewWidth = maxWidth;\n finishedCols[col.getId()] = true;\n finishedColsGrew = true;\n }\n newWidths[col.getId()] = colNewWidth;\n });\n }\n for (const col of columns) {\n const newWidth = newWidths[col.getId()];\n const actualWidth = col.getActualWidth();\n if (actualWidth !== newWidth) {\n col.setActualWidth(newWidth, source);\n changedCols.push(col);\n }\n }\n }\n const atLeastOneColChanged = changedCols.length > 0;\n let flexedCols = [];\n if (atLeastOneColChanged) {\n const { colFlex, visibleCols, colViewport } = this.beans;\n flexedCols = colFlex?.refreshFlexedColumns({\n resizingCols: allResizedCols,\n skipSetLeft: true\n }) ?? [];\n visibleCols.setLeftValues(source);\n visibleCols.updateBodyWidths();\n colViewport.checkViewportColumns();\n }\n const colsForEvent = allResizedCols.concat(flexedCols);\n if (atLeastOneColChanged || finished) {\n dispatchColumnResizedEvent(this.eventSvc, colsForEvent, finished, source, flexedCols);\n }\n }\n resizeHeader(column, delta, shiftKey) {\n if (!column.isResizable()) {\n return;\n }\n const actualWidth = column.getActualWidth();\n const minWidth = column.getMinWidth();\n const maxWidth = column.getMaxWidth();\n const newWidth = Math.min(Math.max(actualWidth + delta, minWidth), maxWidth);\n this.setColumnWidths([{ key: column, newWidth }], shiftKey, true, \"uiColumnResized\");\n }\n createResizeFeature(pinned, column, eResize, comp, ctrl) {\n return new ResizeFeature(pinned, column, eResize, comp, ctrl);\n }\n createGroupResizeFeature(comp, eResize, pinned, columnGroup) {\n return new GroupResizeFeature(comp, eResize, pinned, columnGroup);\n }\n};\nfunction checkMinAndMaxWidthsForSet(columnResizeSet) {\n const { columns, width } = columnResizeSet;\n let minWidthAccumulated = 0;\n let maxWidthAccumulated = 0;\n let maxWidthActive = true;\n for (const col of columns) {\n const minWidth = col.getMinWidth();\n minWidthAccumulated += minWidth || 0;\n const maxWidth = col.getMaxWidth();\n if (maxWidth > 0) {\n maxWidthAccumulated += maxWidth;\n } else {\n maxWidthActive = false;\n }\n }\n const minWidthPasses = width >= minWidthAccumulated;\n const maxWidthPasses = !maxWidthActive || width <= maxWidthAccumulated;\n return minWidthPasses && maxWidthPasses;\n}\n\n// packages/ag-grid-community/src/columnResize/columnResizeModule.ts\nvar ColumnResizeModule = {\n moduleName: \"ColumnResize\",\n version: VERSION,\n beans: [ColumnResizeService],\n apiFunctions: {\n setColumnWidths\n },\n dependsOn: [HorizontalResizeModule, AutoWidthModule]\n};\n\n// packages/ag-grid-community/src/headerRendering/cells/columnGroup/groupWidthFeature.ts\nvar GroupWidthFeature = class extends BeanStub {\n constructor(comp, columnGroup) {\n super();\n // the children can change, we keep destroy functions related to listening to the children here\n this.removeChildListenersFuncs = [];\n this.columnGroup = columnGroup;\n this.comp = comp;\n }\n postConstruct() {\n this.addListenersToChildrenColumns();\n this.addManagedListeners(this.columnGroup, {\n displayedChildrenChanged: this.onDisplayedChildrenChanged.bind(this)\n });\n this.onWidthChanged();\n this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this));\n }\n addListenersToChildrenColumns() {\n this.removeListenersOnChildrenColumns();\n const widthChangedListener = this.onWidthChanged.bind(this);\n for (const column of this.columnGroup.getLeafColumns()) {\n column.__addEventListener(\"widthChanged\", widthChangedListener);\n column.__addEventListener(\"visibleChanged\", widthChangedListener);\n this.removeChildListenersFuncs.push(() => {\n column.__removeEventListener(\"widthChanged\", widthChangedListener);\n column.__removeEventListener(\"visibleChanged\", widthChangedListener);\n });\n }\n }\n removeListenersOnChildrenColumns() {\n for (const func of this.removeChildListenersFuncs) {\n func();\n }\n this.removeChildListenersFuncs = [];\n }\n onDisplayedChildrenChanged() {\n this.addListenersToChildrenColumns();\n this.onWidthChanged();\n }\n onWidthChanged() {\n const columnWidth = this.columnGroup.getActualWidth();\n this.comp.setWidth(`${columnWidth}px`);\n this.comp.toggleCss(\"ag-hidden\", columnWidth === 0);\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/cells/columnGroup/headerGroupCellCtrl.ts\nvar HeaderGroupCellCtrl = class extends AbstractHeaderCellCtrl {\n constructor() {\n super(...arguments);\n this.onSuppressColMoveChange = () => {\n if (!this.isAlive() || this.isSuppressMoving()) {\n this.removeDragSource();\n } else if (!this.dragSource) {\n this.setDragSource(this.eGui);\n }\n };\n }\n wireComp(comp, eGui, eResize, eHeaderCompWrapper, compBean) {\n const { column, beans } = this;\n const { context, colNames, colHover, rangeSvc, colResize } = beans;\n this.comp = comp;\n compBean = setupCompBean(this, context, compBean);\n this.setGui(eGui, compBean);\n this.displayName = colNames.getDisplayNameForColumnGroup(column, \"header\");\n this.refreshHeaderStyles();\n this.addClasses();\n this.setupMovingCss(compBean);\n this.setupExpandable(compBean);\n this.setupTooltip();\n this.refreshAnnouncement();\n this.setupAutoHeight({\n wrapperElement: eHeaderCompWrapper,\n compBean\n });\n this.setupUserComp();\n this.addHeaderMouseListeners(compBean, eHeaderCompWrapper);\n this.addManagedPropertyListener(\"groupHeaderHeight\", this.refreshMaxHeaderHeight.bind(this));\n this.refreshMaxHeaderHeight();\n const pinned = this.rowCtrl.pinned;\n const leafCols = column.getProvidedColumnGroup().getLeafColumns();\n colHover?.createHoverFeature(compBean, leafCols, eGui);\n rangeSvc?.createRangeHighlightFeature(compBean, column, comp);\n compBean.createManagedBean(new SetLeftFeature(column, eGui, beans));\n compBean.createManagedBean(new GroupWidthFeature(comp, column));\n if (colResize) {\n this.resizeFeature = compBean.createManagedBean(\n colResize.createGroupResizeFeature(comp, eResize, pinned, column)\n );\n } else {\n comp.setResizableDisplayed(false);\n }\n compBean.createManagedBean(\n new ManagedFocusFeature(eGui, {\n shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this),\n onTabKeyDown: () => void 0,\n handleKeyDown: this.handleKeyDown.bind(this),\n onFocusIn: this.onFocusIn.bind(this)\n })\n );\n this.addHighlightListeners(compBean, leafCols);\n this.addManagedEventListeners({\n cellSelectionChanged: () => this.refreshAnnouncement()\n });\n compBean.addManagedPropertyListener(\"suppressMovableColumns\", this.onSuppressColMoveChange);\n this.addResizeAndMoveKeyboardListeners(compBean);\n compBean.addDestroyFunc(() => this.clearComponent());\n }\n getHeaderClassParams() {\n const { column, beans } = this;\n const colDef = column.getDefinition();\n return _addGridCommonParams(beans.gos, {\n colDef,\n columnGroup: column,\n floatingFilter: false\n });\n }\n refreshMaxHeaderHeight() {\n const { gos, comp } = this;\n const groupHeaderHeight = gos.get(\"groupHeaderHeight\");\n if (groupHeaderHeight != null) {\n if (groupHeaderHeight === 0) {\n comp.setHeaderWrapperHidden(true);\n } else {\n comp.setHeaderWrapperMaxHeight(groupHeaderHeight);\n }\n } else {\n comp.setHeaderWrapperHidden(false);\n comp.setHeaderWrapperMaxHeight(null);\n }\n }\n addHighlightListeners(compBean, columns) {\n if (!this.beans.gos.get(\"suppressMoveWhenColumnDragging\")) {\n return;\n }\n for (const column of columns) {\n compBean.addManagedListeners(column, {\n headerHighlightChanged: this.onLeafColumnHighlightChanged.bind(this, column)\n });\n }\n }\n onLeafColumnHighlightChanged(column) {\n const displayedColumns = this.column.getDisplayedLeafColumns();\n const isFirst = displayedColumns[0] === column;\n const isLast = _last(displayedColumns) === column;\n if (!isFirst && !isLast) {\n return;\n }\n const highlighted = column.getHighlighted();\n const isColumnMoveAtThisLevel = !!this.rowCtrl.getHeaderCellCtrls().find((ctrl) => {\n return ctrl.column.isMoving();\n });\n let beforeOn = false;\n let afterOn = false;\n if (isColumnMoveAtThisLevel) {\n const isRtl = this.beans.gos.get(\"enableRtl\");\n const isHighlightAfter = highlighted === 1 /* After */;\n const isHighlightBefore = highlighted === 0 /* Before */;\n if (isFirst) {\n if (isRtl) {\n afterOn = isHighlightAfter;\n } else {\n beforeOn = isHighlightBefore;\n }\n }\n if (isLast) {\n if (isRtl) {\n beforeOn = isHighlightBefore;\n } else {\n afterOn = isHighlightAfter;\n }\n }\n }\n this.comp.toggleCss(\"ag-header-highlight-before\", beforeOn);\n this.comp.toggleCss(\"ag-header-highlight-after\", afterOn);\n }\n resizeHeader(delta, shiftKey) {\n const { resizeFeature } = this;\n if (!resizeFeature) {\n return;\n }\n const initialValues = resizeFeature.getInitialValues(shiftKey);\n resizeFeature.resizeColumns(initialValues, initialValues.resizeStartWidth + delta, \"uiColumnResized\", true);\n }\n resizeLeafColumnsToFit(source) {\n this.resizeFeature?.resizeLeafColumnsToFit(source);\n }\n setupUserComp() {\n const { colGroupSvc, userCompFactory, gos, enterpriseMenuFactory } = this.beans;\n const columnGroup = this.column;\n const providedColumnGroup = columnGroup.getProvidedColumnGroup();\n const params = _addGridCommonParams(gos, {\n displayName: this.displayName,\n columnGroup,\n setExpanded: (expanded) => {\n colGroupSvc.setColumnGroupOpened(providedColumnGroup, expanded, \"gridInitializing\");\n },\n setTooltip: (value, shouldDisplayTooltip) => {\n gos.assertModuleRegistered(\"Tooltip\", 3);\n this.setupTooltip(value, shouldDisplayTooltip);\n },\n showColumnMenu: (buttonElement, onClosedCallback) => enterpriseMenuFactory?.showMenuAfterButtonClick(\n providedColumnGroup,\n buttonElement,\n \"columnMenu\",\n onClosedCallback\n ),\n showColumnMenuAfterMouseClick: (mouseEvent, onClosedCallback) => enterpriseMenuFactory?.showMenuAfterMouseEvent(\n providedColumnGroup,\n mouseEvent,\n \"columnMenu\",\n onClosedCallback\n ),\n eGridHeader: this.eGui\n });\n const compDetails = _getHeaderGroupCompDetails(userCompFactory, params);\n if (compDetails) {\n this.comp.setUserCompDetails(compDetails);\n }\n }\n addHeaderMouseListeners(compBean, eHeaderCompWrapper) {\n const {\n column,\n comp,\n beans: { rangeSvc },\n gos\n } = this;\n const listener = (e) => this.handleMouseOverChange(e.type === \"mouseenter\");\n const clickListener = () => this.dispatchColumnMouseEvent(\"columnHeaderClicked\", column.getProvidedColumnGroup());\n const contextMenuListener = (event) => this.handleContextMenuMouseEvent(event, void 0, column.getProvidedColumnGroup());\n compBean.addManagedListeners(this.eGui, {\n mouseenter: listener,\n mouseleave: listener,\n click: clickListener,\n contextmenu: contextMenuListener\n });\n comp.toggleCss(\"ag-header-group-cell-selectable\", _getEnableColumnSelection(gos));\n const mouseListener = rangeSvc?.createHeaderGroupCellMouseListenerFeature(this.column, eHeaderCompWrapper);\n if (mouseListener) {\n this.createManagedBean(mouseListener);\n }\n }\n handleMouseOverChange(isMouseOver) {\n this.eventSvc.dispatchEvent({\n type: isMouseOver ? \"columnHeaderMouseOver\" : \"columnHeaderMouseLeave\",\n column: this.column.getProvidedColumnGroup()\n });\n }\n setupTooltip(value, shouldDisplayTooltip) {\n this.tooltipFeature = this.beans.tooltipSvc?.setupHeaderGroupTooltip(\n this.tooltipFeature,\n this,\n value,\n shouldDisplayTooltip\n );\n }\n setupExpandable(compBean) {\n const providedColGroup = this.column.getProvidedColumnGroup();\n this.refreshExpanded();\n const listener = this.refreshExpanded.bind(this);\n compBean.addManagedListeners(providedColGroup, {\n expandedChanged: listener,\n expandableChanged: listener\n });\n }\n refreshExpanded() {\n const { column } = this;\n this.expandable = column.isExpandable();\n const expanded = column.isExpanded();\n if (this.expandable) {\n this.comp.setAriaExpanded(expanded ? \"true\" : \"false\");\n } else {\n this.comp.setAriaExpanded(void 0);\n }\n this.refreshHeaderStyles();\n }\n addClasses() {\n const { column } = this;\n const colGroupDef = column.getColGroupDef();\n const classes = _getHeaderClassesFromColDef(colGroupDef, this.gos, null, column);\n if (column.isPadding()) {\n classes.push(\"ag-header-group-cell-no-group\");\n const leafCols = column.getLeafColumns();\n if (leafCols.every((col) => col.isSpanHeaderHeight())) {\n classes.push(\"ag-header-span-height\");\n }\n } else {\n classes.push(\"ag-header-group-cell-with-group\");\n if (colGroupDef?.wrapHeaderText) {\n classes.push(\"ag-header-cell-wrap-text\");\n }\n }\n for (const c of classes) {\n this.comp.toggleCss(c, true);\n }\n }\n setupMovingCss(compBean) {\n const { column } = this;\n const providedColumnGroup = column.getProvidedColumnGroup();\n const leafColumns = providedColumnGroup.getLeafColumns();\n const listener = () => this.comp.toggleCss(\"ag-header-cell-moving\", column.isMoving());\n for (const col of leafColumns) {\n compBean.addManagedListeners(col, { movingChanged: listener });\n }\n listener();\n }\n onFocusIn(e) {\n if (!this.eGui.contains(e.relatedTarget)) {\n this.focusThis();\n this.announceAriaDescription();\n }\n }\n handleKeyDown(e) {\n super.handleKeyDown(e);\n const wrapperHasFocus = this.getWrapperHasFocus();\n if (!wrapperHasFocus) {\n return;\n }\n const { column, expandable, gos, beans } = this;\n const enableColumnSelection = _getEnableColumnSelection(gos);\n if (e.key != KeyCode.ENTER) {\n return;\n }\n if (enableColumnSelection && !e.altKey) {\n beans.rangeSvc?.handleColumnSelection(column, e);\n } else if (expandable) {\n const newExpandedValue = !column.isExpanded();\n beans.colGroupSvc.setColumnGroupOpened(\n column.getProvidedColumnGroup(),\n newExpandedValue,\n \"uiColumnExpanded\"\n );\n }\n }\n refreshAnnouncement() {\n let description;\n const { gos } = this;\n const enableColumnSelection = _getEnableColumnSelection(gos);\n if (enableColumnSelection) {\n const translate = this.getLocaleTextFunc();\n description = translate(\n \"ariaColumnGroupCellSelection\",\n \"Press Enter to toggle selection for all visible cells in this column group\"\n );\n }\n this.ariaAnnouncement = description;\n }\n announceAriaDescription() {\n const { beans, eGui, ariaAnnouncement } = this;\n if (!ariaAnnouncement || !eGui.contains(_getActiveDomElement(beans))) {\n return;\n }\n beans.ariaAnnounce?.announceValue(ariaAnnouncement, \"columnHeader\");\n }\n // unlike columns, this will only get called once, as we don't react on props on column groups\n // (we will always destroy and recreate this comp if something changes)\n setDragSource(eHeaderGroup) {\n if (!this.isAlive() || this.isSuppressMoving()) {\n return;\n }\n this.removeDragSource();\n if (!eHeaderGroup) {\n return;\n }\n this.dragSource = this.beans.colMoves?.setDragSourceForHeader(eHeaderGroup, this.column, this.displayName) ?? null;\n }\n isSuppressMoving() {\n return this.gos.get(\"suppressMovableColumns\") || this.column.getLeafColumns().some((column) => column.getColDef().suppressMovable || column.getColDef().lockPosition);\n }\n destroy() {\n this.tooltipFeature = this.destroyBean(this.tooltipFeature);\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/columns/columnGroups/columnGroupApi.ts\nfunction setColumnGroupOpened(beans, group, newValue) {\n beans.colGroupSvc?.setColumnGroupOpened(group, newValue, \"api\");\n}\nfunction getColumnGroup(beans, name, instanceId) {\n return beans.colGroupSvc?.getColumnGroup(name, instanceId) ?? null;\n}\nfunction getProvidedColumnGroup(beans, name) {\n return beans.colGroupSvc?.getProvidedColGroup(name) ?? null;\n}\nfunction getDisplayNameForColumnGroup(beans, columnGroup, location) {\n return beans.colNames.getDisplayNameForColumnGroup(columnGroup, location) || \"\";\n}\nfunction getColumnGroupState(beans) {\n return beans.colGroupSvc?.getColumnGroupState() ?? [];\n}\nfunction setColumnGroupState(beans, stateItems) {\n beans.colGroupSvc?.setColumnGroupState(stateItems, \"api\");\n}\nfunction resetColumnGroupState(beans) {\n beans.colGroupSvc?.resetColumnGroupState(\"api\");\n}\nfunction getLeftDisplayedColumnGroups(beans) {\n return beans.visibleCols.treeLeft;\n}\nfunction getCenterDisplayedColumnGroups(beans) {\n return beans.visibleCols.treeCenter;\n}\nfunction getRightDisplayedColumnGroups(beans) {\n return beans.visibleCols.treeRight;\n}\nfunction getAllDisplayedColumnGroups(beans) {\n return beans.visibleCols.getAllTrees();\n}\n\n// packages/ag-grid-community/src/columns/groupInstanceIdCreator.ts\nvar GroupInstanceIdCreator = class {\n constructor() {\n // this map contains keys to numbers, so we remember what the last call was\n this.existingIds = {};\n }\n getInstanceIdForKey(key) {\n const lastResult = this.existingIds[key];\n let result;\n if (typeof lastResult !== \"number\") {\n result = 0;\n } else {\n result = lastResult + 1;\n }\n this.existingIds[key] = result;\n return result;\n }\n};\n\n// packages/ag-grid-community/src/columns/visibleColsService.ts\nfunction _removeAllFromUnorderedArray(array, toRemove) {\n for (let i = 0; i < toRemove.length; i++) {\n const index = array.indexOf(toRemove[i]);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.pop();\n }\n }\n}\nvar VisibleColsService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"visibleCols\";\n // for fast lookup, to see if a column or group is still visible\n this.colsAndGroupsMap = {};\n // leave level columns of the displayed trees\n this.leftCols = [];\n this.rightCols = [];\n this.centerCols = [];\n // all three lists above combined\n this.allCols = [];\n this.headerGroupRowCount = 0;\n // used by:\n // + angularGrid -> for setting body width\n // + rowController -> setting main row widths (when inserting and resizing)\n // need to cache this\n this.bodyWidth = 0;\n this.leftWidth = 0;\n this.rightWidth = 0;\n this.isBodyWidthDirty = true;\n }\n refresh(source, skipTreeBuild = false) {\n const { colFlex, colModel, colGroupSvc, colViewport, selectionColSvc } = this.beans;\n if (!skipTreeBuild) {\n this.buildTrees(colModel, colGroupSvc);\n }\n colGroupSvc?.updateOpenClosedVisibility();\n this.leftCols = pickDisplayedCols(this.treeLeft);\n this.centerCols = pickDisplayedCols(this.treeCenter);\n this.rightCols = pickDisplayedCols(this.treeRight);\n selectionColSvc?.refreshVisibility(this.leftCols, this.centerCols, this.rightCols);\n this.joinColsAriaOrder(colModel);\n this.joinCols();\n this.headerGroupRowCount = this.getHeaderRowCount();\n this.setLeftValues(source);\n this.autoHeightCols = this.allCols.filter((col) => col.isAutoHeight());\n colFlex?.refreshFlexedColumns();\n this.updateBodyWidths();\n this.setFirstRightAndLastLeftPinned(colModel, this.leftCols, this.rightCols, source);\n colViewport.checkViewportColumns(false);\n this.eventSvc.dispatchEvent({\n type: \"displayedColumnsChanged\",\n source\n });\n }\n getHeaderRowCount() {\n if (!this.gos.get(\"hidePaddedHeaderRows\")) {\n return this.beans.colModel.cols.treeDepth;\n }\n let headerGroupRowCount = 0;\n for (const col of this.allCols) {\n let parent = col.getParent();\n while (parent) {\n if (!parent.isPadding()) {\n const level = parent.getProvidedColumnGroup().getLevel() + 1;\n if (level > headerGroupRowCount) {\n headerGroupRowCount = level;\n }\n break;\n }\n parent = parent.getParent();\n }\n }\n return headerGroupRowCount;\n }\n // after setColumnWidth or updateGroupsAndPresentedCols\n updateBodyWidths() {\n const newBodyWidth = getWidthOfColsInList(this.centerCols);\n const newLeftWidth = getWidthOfColsInList(this.leftCols);\n const newRightWidth = getWidthOfColsInList(this.rightCols);\n this.isBodyWidthDirty = this.bodyWidth !== newBodyWidth;\n const atLeastOneChanged = this.bodyWidth !== newBodyWidth || this.leftWidth !== newLeftWidth || this.rightWidth !== newRightWidth;\n if (atLeastOneChanged) {\n this.bodyWidth = newBodyWidth;\n this.leftWidth = newLeftWidth;\n this.rightWidth = newRightWidth;\n this.eventSvc.dispatchEvent({\n type: \"columnContainerWidthChanged\"\n });\n this.eventSvc.dispatchEvent({\n type: \"displayedColumnsWidthChanged\"\n });\n }\n }\n // sets the left pixel position of each column\n setLeftValues(source) {\n this.setLeftValuesOfCols(source);\n this.setLeftValuesOfGroups();\n }\n setFirstRightAndLastLeftPinned(colModel, leftCols, rightCols, source) {\n let lastLeft;\n let firstRight;\n if (this.gos.get(\"enableRtl\")) {\n lastLeft = leftCols ? leftCols[0] : null;\n firstRight = rightCols ? _last(rightCols) : null;\n } else {\n lastLeft = leftCols ? _last(leftCols) : null;\n firstRight = rightCols ? rightCols[0] : null;\n }\n for (const col of colModel.getCols()) {\n col.setLastLeftPinned(col === lastLeft, source);\n col.setFirstRightPinned(col === firstRight, source);\n }\n }\n buildTrees(colModel, columnGroupSvc) {\n const cols = colModel.getColsToShow();\n const leftCols = cols.filter((col) => col.getPinned() == \"left\");\n const rightCols = cols.filter((col) => col.getPinned() == \"right\");\n const centerCols = cols.filter((col) => col.getPinned() != \"left\" && col.getPinned() != \"right\");\n const idCreator = new GroupInstanceIdCreator();\n const createGroups = (params) => {\n return columnGroupSvc ? columnGroupSvc.createColumnGroups(params) : params.columns;\n };\n this.treeLeft = createGroups({\n columns: leftCols,\n idCreator,\n pinned: \"left\",\n oldDisplayedGroups: this.treeLeft\n });\n this.treeRight = createGroups({\n columns: rightCols,\n idCreator,\n pinned: \"right\",\n oldDisplayedGroups: this.treeRight\n });\n this.treeCenter = createGroups({\n columns: centerCols,\n idCreator,\n pinned: null,\n oldDisplayedGroups: this.treeCenter\n });\n this.updateColsAndGroupsMap();\n }\n clear() {\n this.leftCols = [];\n this.rightCols = [];\n this.centerCols = [];\n this.allCols = [];\n this.ariaOrderColumns = [];\n }\n joinColsAriaOrder(colModel) {\n const allColumns = colModel.getCols();\n const pinnedLeft = [];\n const center = [];\n const pinnedRight = [];\n for (const col of allColumns) {\n const pinned = col.getPinned();\n if (!pinned) {\n center.push(col);\n } else if (pinned === true || pinned === \"left\") {\n pinnedLeft.push(col);\n } else {\n pinnedRight.push(col);\n }\n }\n this.ariaOrderColumns = pinnedLeft.concat(center).concat(pinnedRight);\n }\n getAriaColIndex(colOrGroup) {\n let col;\n if (isColumnGroup(colOrGroup)) {\n col = colOrGroup.getLeafColumns()[0];\n } else {\n col = colOrGroup;\n }\n return this.ariaOrderColumns.indexOf(col) + 1;\n }\n setLeftValuesOfGroups() {\n for (const columns of [this.treeLeft, this.treeRight, this.treeCenter]) {\n for (const column of columns) {\n if (isColumnGroup(column)) {\n const columnGroup = column;\n columnGroup.checkLeft();\n }\n }\n }\n }\n setLeftValuesOfCols(source) {\n const { colModel } = this.beans;\n const primaryCols = colModel.getColDefCols();\n if (!primaryCols) {\n return;\n }\n const allColumns = colModel.getCols().slice(0);\n const doingRtl = this.gos.get(\"enableRtl\");\n for (const columns of [this.leftCols, this.rightCols, this.centerCols]) {\n if (doingRtl) {\n let left = getWidthOfColsInList(columns);\n for (const column of columns) {\n left -= column.getActualWidth();\n column.setLeft(left, source);\n }\n } else {\n let left = 0;\n for (const column of columns) {\n column.setLeft(left, source);\n left += column.getActualWidth();\n }\n }\n _removeAllFromUnorderedArray(allColumns, columns);\n }\n for (const column of allColumns) {\n column.setLeft(null, source);\n }\n }\n joinCols() {\n if (this.gos.get(\"enableRtl\")) {\n this.allCols = this.rightCols.concat(this.centerCols).concat(this.leftCols);\n } else {\n this.allCols = this.leftCols.concat(this.centerCols).concat(this.rightCols);\n }\n }\n getAllTrees() {\n if (this.treeLeft && this.treeRight && this.treeCenter) {\n return this.treeLeft.concat(this.treeCenter).concat(this.treeRight);\n }\n return null;\n }\n // gridPanel -> ensureColumnVisible\n isColDisplayed(column) {\n return this.allCols.indexOf(column) >= 0;\n }\n getLeftColsForRow(rowNode) {\n const {\n leftCols,\n beans: { colModel }\n } = this;\n const colSpanActive = colModel.colSpanActive;\n if (!colSpanActive) {\n return leftCols;\n }\n return this.getColsForRow(rowNode, leftCols);\n }\n getRightColsForRow(rowNode) {\n const {\n rightCols,\n beans: { colModel }\n } = this;\n const colSpanActive = colModel.colSpanActive;\n if (!colSpanActive) {\n return rightCols;\n }\n return this.getColsForRow(rowNode, rightCols);\n }\n getColsForRow(rowNode, displayedColumns, filterCallback, emptySpaceBeforeColumn) {\n const result = [];\n let lastConsideredCol = null;\n for (let i = 0; i < displayedColumns.length; i++) {\n const col = displayedColumns[i];\n const maxAllowedColSpan = displayedColumns.length - i;\n const colSpan = Math.min(col.getColSpan(rowNode), maxAllowedColSpan);\n const columnsToCheckFilter = [col];\n if (colSpan > 1) {\n const colsToRemove = colSpan - 1;\n for (let j = 1; j <= colsToRemove; j++) {\n columnsToCheckFilter.push(displayedColumns[i + j]);\n }\n i += colsToRemove;\n }\n let filterPasses;\n if (filterCallback) {\n filterPasses = false;\n for (const colForFilter of columnsToCheckFilter) {\n if (filterCallback(colForFilter)) {\n filterPasses = true;\n }\n }\n } else {\n filterPasses = true;\n }\n if (filterPasses) {\n if (result.length === 0 && lastConsideredCol) {\n const gapBeforeColumn = emptySpaceBeforeColumn ? emptySpaceBeforeColumn(col) : false;\n if (gapBeforeColumn) {\n result.push(lastConsideredCol);\n }\n }\n result.push(col);\n }\n lastConsideredCol = col;\n }\n return result;\n }\n getContainerWidth(pinned) {\n switch (pinned) {\n case \"left\":\n return this.leftWidth;\n case \"right\":\n return this.rightWidth;\n default:\n return this.bodyWidth;\n }\n }\n getColBefore(col) {\n const allDisplayedColumns = this.allCols;\n const oldIndex = allDisplayedColumns.indexOf(col);\n if (oldIndex > 0) {\n return allDisplayedColumns[oldIndex - 1];\n }\n return null;\n }\n isPinningLeft() {\n return this.leftCols.length > 0;\n }\n isPinningRight() {\n return this.rightCols.length > 0;\n }\n updateColsAndGroupsMap() {\n this.colsAndGroupsMap = {};\n const func = (child) => {\n this.colsAndGroupsMap[child.getUniqueId()] = child;\n };\n depthFirstAllColumnTreeSearch(this.treeCenter, false, func);\n depthFirstAllColumnTreeSearch(this.treeLeft, false, func);\n depthFirstAllColumnTreeSearch(this.treeRight, false, func);\n }\n isVisible(item) {\n const fromMap = this.colsAndGroupsMap[item.getUniqueId()];\n return fromMap === item;\n }\n getFirstColumn() {\n const isRtl = this.gos.get(\"enableRtl\");\n const queryOrder = [\"leftCols\", \"centerCols\", \"rightCols\"];\n if (isRtl) {\n queryOrder.reverse();\n }\n for (let i = 0; i < queryOrder.length; i++) {\n const container = this[queryOrder[i]];\n if (container.length) {\n return isRtl ? _last(container) : container[0];\n }\n }\n return null;\n }\n // used by:\n // + rowRenderer -> for navigation\n getColAfter(col) {\n const allDisplayedColumns = this.allCols;\n const oldIndex = allDisplayedColumns.indexOf(col);\n if (oldIndex < allDisplayedColumns.length - 1) {\n return allDisplayedColumns[oldIndex + 1];\n }\n return null;\n }\n // used by:\n // + angularGrid -> setting pinned body width\n // note: this should be cached\n getColsLeftWidth() {\n return getWidthOfColsInList(this.leftCols);\n }\n // note: this should be cached\n getDisplayedColumnsRightWidth() {\n return getWidthOfColsInList(this.rightCols);\n }\n isColAtEdge(col, edge) {\n const allColumns = this.allCols;\n if (!allColumns.length) {\n return false;\n }\n const isFirst = edge === \"first\";\n let columnToCompare;\n if (isColumnGroup(col)) {\n const leafColumns = col.getDisplayedLeafColumns();\n if (!leafColumns.length) {\n return false;\n }\n columnToCompare = isFirst ? leafColumns[0] : _last(leafColumns);\n } else {\n columnToCompare = col;\n }\n return (isFirst ? allColumns[0] : _last(allColumns)) === columnToCompare;\n }\n};\nfunction depthFirstAllColumnTreeSearch(tree, useDisplayedChildren, callback) {\n if (!tree) {\n return;\n }\n for (let i = 0; i < tree.length; i++) {\n const child = tree[i];\n if (isColumnGroup(child)) {\n const childTree = useDisplayedChildren ? child.getDisplayedChildren() : child.getChildren();\n depthFirstAllColumnTreeSearch(childTree, useDisplayedChildren, callback);\n }\n callback(child);\n }\n}\nfunction pickDisplayedCols(tree) {\n const res = [];\n depthFirstAllColumnTreeSearch(tree, true, (child) => {\n if (isColumn(child)) {\n res.push(child);\n }\n });\n return res;\n}\n\n// packages/ag-grid-community/src/columns/columnGroups/columnGroupService.ts\nvar ColumnGroupService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colGroupSvc\";\n }\n getColumnGroupState() {\n const columnGroupState = [];\n const gridBalancedTree = this.beans.colModel.getColTree();\n depthFirstOriginalTreeSearch(null, gridBalancedTree, (node) => {\n if (isProvidedColumnGroup(node)) {\n columnGroupState.push({\n groupId: node.getGroupId(),\n open: node.isExpanded()\n });\n }\n });\n return columnGroupState;\n }\n resetColumnGroupState(source) {\n const primaryColumnTree = this.beans.colModel.getColDefColTree();\n if (!primaryColumnTree) {\n return;\n }\n const stateItems = [];\n depthFirstOriginalTreeSearch(null, primaryColumnTree, (child) => {\n if (isProvidedColumnGroup(child)) {\n const colGroupDef = child.getColGroupDef();\n const groupState = {\n groupId: child.getGroupId(),\n open: !colGroupDef ? void 0 : colGroupDef.openByDefault\n };\n stateItems.push(groupState);\n }\n });\n this.setColumnGroupState(stateItems, source);\n }\n setColumnGroupState(stateItems, source) {\n const { colModel, colAnimation, visibleCols, eventSvc } = this.beans;\n const gridBalancedTree = colModel.getColTree();\n if (!gridBalancedTree.length) {\n return;\n }\n colAnimation?.start();\n const impactedGroups = [];\n for (const stateItem of stateItems) {\n const groupKey = stateItem.groupId;\n const newValue = stateItem.open;\n const providedColumnGroup = this.getProvidedColGroup(groupKey);\n if (!providedColumnGroup) {\n continue;\n }\n if (providedColumnGroup.isExpanded() === newValue) {\n continue;\n }\n providedColumnGroup.setExpanded(newValue);\n impactedGroups.push(providedColumnGroup);\n }\n visibleCols.refresh(source, true);\n if (impactedGroups.length) {\n eventSvc.dispatchEvent({\n type: \"columnGroupOpened\",\n columnGroup: impactedGroups.length === 1 ? impactedGroups[0] : void 0,\n columnGroups: impactedGroups\n });\n }\n colAnimation?.finish();\n }\n // called by headerRenderer - when a header is opened or closed\n setColumnGroupOpened(key, newValue, source) {\n let keyAsString;\n if (isProvidedColumnGroup(key)) {\n keyAsString = key.getId();\n } else {\n keyAsString = key || \"\";\n }\n this.setColumnGroupState([{ groupId: keyAsString, open: newValue }], source);\n }\n getProvidedColGroup(key) {\n let res = null;\n depthFirstOriginalTreeSearch(null, this.beans.colModel.getColTree(), (node) => {\n if (isProvidedColumnGroup(node)) {\n if (node.getId() === key) {\n res = node;\n }\n }\n });\n return res;\n }\n getGroupAtDirection(columnGroup, direction) {\n const requiredLevel = columnGroup.getProvidedColumnGroup().getLevel() + columnGroup.getPaddingLevel();\n const colGroupLeafColumns = columnGroup.getDisplayedLeafColumns();\n const col = direction === \"After\" ? _last(colGroupLeafColumns) : colGroupLeafColumns[0];\n const getDisplayColMethod = `getCol${direction}`;\n while (true) {\n const column = this.beans.visibleCols[getDisplayColMethod](col);\n if (!column) {\n return null;\n }\n const groupPointer = this.getColGroupAtLevel(column, requiredLevel);\n if (groupPointer !== columnGroup) {\n return groupPointer;\n }\n }\n }\n getColGroupAtLevel(column, level) {\n let groupPointer = column.getParent();\n let originalGroupLevel;\n let groupPointerLevel;\n while (true) {\n const groupPointerProvidedColumnGroup = groupPointer.getProvidedColumnGroup();\n originalGroupLevel = groupPointerProvidedColumnGroup.getLevel();\n groupPointerLevel = groupPointer.getPaddingLevel();\n if (originalGroupLevel + groupPointerLevel <= level) {\n break;\n }\n groupPointer = groupPointer.getParent();\n }\n return groupPointer;\n }\n updateOpenClosedVisibility() {\n const allColumnGroups = this.beans.visibleCols.getAllTrees();\n depthFirstAllColumnTreeSearch(allColumnGroups, false, (child) => {\n if (isColumnGroup(child)) {\n child.calculateDisplayedColumns();\n }\n });\n }\n // returns the group with matching colId and instanceId. If instanceId is missing,\n // matches only on the colId.\n getColumnGroup(colId, partId) {\n if (!colId) {\n return null;\n }\n if (isColumnGroup(colId)) {\n return colId;\n }\n const allColumnGroups = this.beans.visibleCols.getAllTrees();\n const checkPartId = typeof partId === \"number\";\n let result = null;\n depthFirstAllColumnTreeSearch(allColumnGroups, false, (child) => {\n if (isColumnGroup(child)) {\n const columnGroup = child;\n let matched;\n if (checkPartId) {\n matched = colId === columnGroup.getGroupId() && partId === columnGroup.getPartId();\n } else {\n matched = colId === columnGroup.getGroupId();\n }\n if (matched) {\n result = columnGroup;\n }\n }\n });\n return result;\n }\n createColumnGroups(params) {\n const { columns, idCreator, pinned, oldDisplayedGroups, isStandaloneStructure } = params;\n const oldColumnsMapped = this.mapOldGroupsById(oldDisplayedGroups);\n const topLevelResultCols = [];\n let groupsOrColsAtCurrentLevel = columns;\n while (groupsOrColsAtCurrentLevel.length) {\n const currentlyIterating = groupsOrColsAtCurrentLevel;\n groupsOrColsAtCurrentLevel = [];\n let lastGroupedColIdx = 0;\n const createGroupToIndex = (to) => {\n const from = lastGroupedColIdx;\n lastGroupedColIdx = to;\n const previousNode = currentlyIterating[from];\n const previousNodeProvided = isColumnGroup(previousNode) ? previousNode.getProvidedColumnGroup() : previousNode;\n const previousNodeParent = previousNodeProvided.getOriginalParent();\n if (previousNodeParent == null) {\n for (let i = from; i < to; i++) {\n topLevelResultCols.push(currentlyIterating[i]);\n }\n return;\n }\n const newGroup = this.createColumnGroup(\n previousNodeParent,\n idCreator,\n oldColumnsMapped,\n pinned,\n isStandaloneStructure\n );\n for (let i = from; i < to; i++) {\n newGroup.addChild(currentlyIterating[i]);\n }\n groupsOrColsAtCurrentLevel.push(newGroup);\n };\n for (let i = 1; i < currentlyIterating.length; i++) {\n const thisNode = currentlyIterating[i];\n const thisNodeProvided = isColumnGroup(thisNode) ? thisNode.getProvidedColumnGroup() : thisNode;\n const thisNodeParent = thisNodeProvided.getOriginalParent();\n const previousNode = currentlyIterating[lastGroupedColIdx];\n const previousNodeProvided = isColumnGroup(previousNode) ? previousNode.getProvidedColumnGroup() : previousNode;\n const previousNodeParent = previousNodeProvided.getOriginalParent();\n if (thisNodeParent !== previousNodeParent) {\n createGroupToIndex(i);\n }\n }\n if (lastGroupedColIdx < currentlyIterating.length) {\n createGroupToIndex(currentlyIterating.length);\n }\n }\n if (!isStandaloneStructure) {\n this.setupParentsIntoCols(topLevelResultCols, null);\n }\n return topLevelResultCols;\n }\n createProvidedColumnGroup(primaryColumns, colGroupDef, level, existingColumns, columnKeyCreator, existingGroups, source) {\n const groupId = columnKeyCreator.getUniqueKey(colGroupDef.groupId || null, null);\n const colGroupDefMerged = createMergedColGroupDef(this.beans, colGroupDef, groupId);\n const providedGroup = new AgProvidedColumnGroup(colGroupDefMerged, groupId, false, level);\n this.createBean(providedGroup);\n const existingGroupAndIndex = this.findExistingGroup(colGroupDef, existingGroups);\n if (existingGroupAndIndex) {\n existingGroups.splice(existingGroupAndIndex.idx, 1);\n }\n const existingGroup = existingGroupAndIndex?.group;\n if (existingGroup) {\n providedGroup.setExpanded(existingGroup.isExpanded());\n }\n const children = _recursivelyCreateColumns(\n this.beans,\n colGroupDefMerged.children,\n level + 1,\n primaryColumns,\n existingColumns,\n columnKeyCreator,\n existingGroups,\n source\n );\n providedGroup.setChildren(children);\n return providedGroup;\n }\n balanceColumnTree(unbalancedTree, currentDepth, columnDepth, columnKeyCreator) {\n const result = [];\n for (let i = 0; i < unbalancedTree.length; i++) {\n const child = unbalancedTree[i];\n if (isProvidedColumnGroup(child)) {\n const originalGroup = child;\n const newChildren = this.balanceColumnTree(\n originalGroup.getChildren(),\n currentDepth + 1,\n columnDepth,\n columnKeyCreator\n );\n originalGroup.setChildren(newChildren);\n result.push(originalGroup);\n } else {\n let firstPaddedGroup;\n let currentPaddedGroup;\n for (let j = currentDepth; j < columnDepth; j++) {\n const newColId = columnKeyCreator.getUniqueKey(null, null);\n const colGroupDefMerged = createMergedColGroupDef(this.beans, null, newColId);\n const paddedGroup = new AgProvidedColumnGroup(colGroupDefMerged, newColId, true, j);\n this.createBean(paddedGroup);\n if (currentPaddedGroup) {\n currentPaddedGroup.setChildren([paddedGroup]);\n }\n currentPaddedGroup = paddedGroup;\n if (!firstPaddedGroup) {\n firstPaddedGroup = currentPaddedGroup;\n }\n }\n if (firstPaddedGroup && currentPaddedGroup) {\n result.push(firstPaddedGroup);\n const hasGroups = unbalancedTree.some((leaf) => isProvidedColumnGroup(leaf));\n if (hasGroups) {\n currentPaddedGroup.setChildren([child]);\n continue;\n } else {\n currentPaddedGroup.setChildren(unbalancedTree);\n break;\n }\n }\n result.push(child);\n }\n }\n return result;\n }\n findDepth(balancedColumnTree) {\n let depth = 0;\n let pointer = balancedColumnTree;\n while (pointer?.[0] && isProvidedColumnGroup(pointer[0])) {\n depth++;\n pointer = pointer[0].getChildren();\n }\n return depth;\n }\n findMaxDepth(treeChildren, depth) {\n let maxDepthThisLevel = depth;\n for (let i = 0; i < treeChildren.length; i++) {\n const abstractColumn = treeChildren[i];\n if (isProvidedColumnGroup(abstractColumn)) {\n const originalGroup = abstractColumn;\n const newDepth = this.findMaxDepth(originalGroup.getChildren(), depth + 1);\n if (maxDepthThisLevel < newDepth) {\n maxDepthThisLevel = newDepth;\n }\n }\n }\n return maxDepthThisLevel;\n }\n /**\n * Inserts dummy group columns in the hierarchy above auto-generated columns\n * in order to ensure auto-generated columns are leaf nodes (and therefore are\n * displayed correctly)\n */\n balanceTreeForAutoCols(autoCols, depth) {\n const tree = [];\n for (const col of autoCols) {\n let nextChild = col;\n for (let i = depth - 1; i >= 0; i--) {\n const autoGroup = new AgProvidedColumnGroup(null, `FAKE_PATH_${col.getId()}_${i}`, true, i);\n this.createBean(autoGroup);\n autoGroup.setChildren([nextChild]);\n nextChild.originalParent = autoGroup;\n nextChild = autoGroup;\n }\n if (depth === 0) {\n col.originalParent = null;\n }\n tree.push(nextChild);\n }\n return tree;\n }\n findExistingGroup(newGroupDef, existingGroups) {\n const newHasId = newGroupDef.groupId != null;\n if (!newHasId) {\n return void 0;\n }\n for (let i = 0; i < existingGroups.length; i++) {\n const existingGroup = existingGroups[i];\n const existingDef = existingGroup.getColGroupDef();\n if (!existingDef) {\n continue;\n }\n if (existingGroup.getId() === newGroupDef.groupId) {\n return { idx: i, group: existingGroup };\n }\n }\n return void 0;\n }\n createColumnGroup(providedGroup, groupInstanceIdCreator, oldColumnsMapped, pinned, isStandaloneStructure) {\n const groupId = providedGroup.getGroupId();\n const instanceId = groupInstanceIdCreator.getInstanceIdForKey(groupId);\n const uniqueId = createUniqueColumnGroupId(groupId, instanceId);\n let columnGroup = oldColumnsMapped[uniqueId];\n if (columnGroup && columnGroup.getProvidedColumnGroup() !== providedGroup) {\n columnGroup = null;\n }\n if (_exists(columnGroup)) {\n columnGroup.reset();\n } else {\n columnGroup = new AgColumnGroup(providedGroup, groupId, instanceId, pinned);\n if (!isStandaloneStructure) {\n this.createBean(columnGroup);\n }\n }\n return columnGroup;\n }\n // returns back a 2d map of ColumnGroup as follows: groupId -> instanceId -> ColumnGroup\n mapOldGroupsById(displayedGroups) {\n const result = {};\n const recursive = (columnsOrGroups) => {\n for (const columnOrGroup of columnsOrGroups) {\n if (isColumnGroup(columnOrGroup)) {\n const columnGroup = columnOrGroup;\n result[columnOrGroup.getUniqueId()] = columnGroup;\n recursive(columnGroup.getChildren());\n }\n }\n };\n if (displayedGroups) {\n recursive(displayedGroups);\n }\n return result;\n }\n setupParentsIntoCols(columnsOrGroups, parent) {\n for (const columnsOrGroup of columnsOrGroups ?? []) {\n if (columnsOrGroup.parent !== parent) {\n this.beans.colViewport.colsWithinViewportHash = \"\";\n }\n columnsOrGroup.parent = parent;\n if (isColumnGroup(columnsOrGroup)) {\n const columnGroup = columnsOrGroup;\n this.setupParentsIntoCols(columnGroup.getChildren(), columnGroup);\n }\n }\n }\n};\n\n// packages/ag-grid-community/src/columns/columnGroups/columnGroupModule.ts\nvar ColumnGroupModule = {\n moduleName: \"ColumnGroup\",\n version: VERSION,\n dynamicBeans: { headerGroupCellCtrl: HeaderGroupCellCtrl },\n beans: [ColumnGroupService],\n apiFunctions: {\n getAllDisplayedColumnGroups,\n getCenterDisplayedColumnGroups,\n getColumnGroup,\n getColumnGroupState,\n getDisplayNameForColumnGroup,\n getLeftDisplayedColumnGroups,\n getProvidedColumnGroup,\n getRightDisplayedColumnGroups,\n resetColumnGroupState,\n setColumnGroupOpened,\n setColumnGroupState\n }\n};\n\n// packages/ag-grid-community/src/columns/columnStateUtils.ts\nfunction _applyColumnState(beans, params, source) {\n const {\n colModel,\n rowGroupColsSvc,\n pivotColsSvc,\n autoColSvc,\n selectionColSvc,\n colAnimation,\n visibleCols,\n pivotResultCols,\n environment,\n valueColsSvc,\n eventSvc,\n gos\n } = beans;\n const providedCols = colModel.getColDefCols() ?? [];\n const selectionCols = selectionColSvc?.getColumns();\n if (!providedCols.length && !selectionCols?.length) {\n return false;\n }\n if (params?.state && !params.state.forEach) {\n _warn(32);\n return false;\n }\n const syncColumnWithStateItem = (column, stateItem, rowGroupIndexes, pivotIndexes, autoCol) => {\n if (!column) {\n return;\n }\n const getValue = getValueFactory(stateItem, params.defaultState);\n const flex = getValue(\"flex\").value1;\n const maybeSortDirection = getValue(\"sort\").value1;\n const maybeSortType = getValue(\"sortType\").value1;\n const isSortUpdate = _isSortDirectionValid(maybeSortDirection) || _isSortTypeValid(maybeSortType);\n const type = _normalizeSortType(maybeSortType);\n const direction = _normalizeSortDirection(maybeSortDirection);\n const newSortDef = isSortUpdate ? { type, direction } : void 0;\n updateSomeColumnState(\n beans,\n column,\n getValue(\"hide\").value1,\n newSortDef,\n getValue(\"sortIndex\").value1,\n getValue(\"pinned\").value1,\n flex,\n source\n );\n if (flex == null) {\n const width = getValue(\"width\").value1;\n if (width != null) {\n const minColWidth = column.getColDef().minWidth ?? environment.getDefaultColumnMinWidth();\n if (minColWidth != null && width >= minColWidth) {\n column.setActualWidth(width, source);\n }\n }\n }\n if (autoCol || !column.isPrimary()) {\n return;\n }\n valueColsSvc?.syncColumnWithState(column, source, getValue);\n rowGroupColsSvc?.syncColumnWithState(column, source, getValue, rowGroupIndexes);\n pivotColsSvc?.syncColumnWithState(column, source, getValue, pivotIndexes);\n };\n const applyStates = (states, existingColumns, getById2) => {\n const dispatchEventsFunc = _compareColumnStatesAndDispatchEvents(beans, source);\n const columnsWithNoState = existingColumns.slice();\n const rowGroupIndexes = {};\n const pivotIndexes = {};\n const autoColStates = [];\n const selectionColStates = [];\n const unmatchedAndAutoStates2 = [];\n let unmatchedCount2 = 0;\n const previousRowGroupCols = rowGroupColsSvc?.columns.slice() ?? [];\n const previousPivotCols = pivotColsSvc?.columns.slice() ?? [];\n for (const state of states) {\n const colId = state.colId;\n const isAutoGroupColumn = colId.startsWith(GROUP_AUTO_COLUMN_ID);\n if (isAutoGroupColumn) {\n autoColStates.push(state);\n unmatchedAndAutoStates2.push(state);\n continue;\n }\n if (isColumnSelectionCol(colId)) {\n selectionColStates.push(state);\n unmatchedAndAutoStates2.push(state);\n continue;\n }\n const column = getById2(colId);\n if (!column) {\n unmatchedAndAutoStates2.push(state);\n unmatchedCount2 += 1;\n } else {\n syncColumnWithStateItem(column, state, rowGroupIndexes, pivotIndexes, false);\n _removeFromArray(columnsWithNoState, column);\n }\n }\n const applyDefaultsFunc = (col) => syncColumnWithStateItem(col, null, rowGroupIndexes, pivotIndexes, false);\n columnsWithNoState.forEach(applyDefaultsFunc);\n rowGroupColsSvc?.sortColumns(comparatorByIndex.bind(rowGroupColsSvc, rowGroupIndexes, previousRowGroupCols));\n pivotColsSvc?.sortColumns(comparatorByIndex.bind(pivotColsSvc, pivotIndexes, previousPivotCols));\n colModel.refreshCols(false, source);\n const syncColStates = (getCol, colStates, columns = []) => {\n for (const stateItem of colStates) {\n const col = getCol(stateItem.colId);\n _removeFromArray(columns, col);\n syncColumnWithStateItem(col, stateItem, null, null, true);\n }\n columns.forEach(applyDefaultsFunc);\n };\n syncColStates(\n (colId) => autoColSvc?.getColumn(colId) ?? null,\n autoColStates,\n autoColSvc?.getColumns()?.slice()\n );\n syncColStates(\n (colId) => selectionColSvc?.getColumn(colId) ?? null,\n selectionColStates,\n selectionColSvc?.getColumns()?.slice()\n );\n orderLiveColsLikeState(params, colModel, gos);\n visibleCols.refresh(source);\n eventSvc.dispatchEvent({\n type: \"columnEverythingChanged\",\n source\n });\n dispatchEventsFunc();\n return { unmatchedAndAutoStates: unmatchedAndAutoStates2, unmatchedCount: unmatchedCount2 };\n };\n colAnimation?.start();\n let { unmatchedAndAutoStates, unmatchedCount } = applyStates(\n params.state || [],\n providedCols,\n (id) => colModel.getColDefCol(id)\n );\n if (unmatchedAndAutoStates.length > 0 || _exists(params.defaultState)) {\n const pivotResultColsList = pivotResultCols?.getPivotResultCols()?.list ?? [];\n unmatchedCount = applyStates(\n unmatchedAndAutoStates,\n pivotResultColsList,\n (id) => pivotResultCols?.getPivotResultCol(id) ?? null\n ).unmatchedCount;\n }\n colAnimation?.finish();\n return unmatchedCount === 0;\n}\nfunction _resetColumnState(beans, source) {\n const { colModel, autoColSvc, selectionColSvc, eventSvc, gos } = beans;\n const primaryCols = colModel.getColDefCols();\n if (!primaryCols?.length) {\n return;\n }\n const primaryColumnTree = colModel.getColDefColTree();\n const primaryColumns = _getColumnsFromTree(primaryColumnTree);\n const columnStates = [];\n let letRowGroupIndex = 1e3;\n let letPivotIndex = 1e3;\n const addColState = (col) => {\n const stateItem = getColumnStateFromColDef(col);\n if (_missing(stateItem.rowGroupIndex) && stateItem.rowGroup) {\n stateItem.rowGroupIndex = letRowGroupIndex++;\n }\n if (_missing(stateItem.pivotIndex) && stateItem.pivot) {\n stateItem.pivotIndex = letPivotIndex++;\n }\n columnStates.push(stateItem);\n };\n autoColSvc?.getColumns()?.forEach(addColState);\n selectionColSvc?.getColumns()?.forEach(addColState);\n primaryColumns?.forEach(addColState);\n _applyColumnState(beans, { state: columnStates }, source);\n const autoCols = autoColSvc?.getColumns() ?? [];\n const selectionCols = selectionColSvc?.getColumns() ?? [];\n const orderedCols = [...selectionCols, ...autoCols, ...primaryCols];\n const orderedColState = orderedCols.map((col) => ({ colId: col.colId }));\n _applyColumnState(beans, { state: orderedColState, applyOrder: true }, source);\n eventSvc.dispatchEvent(_addGridCommonParams(gos, { type: \"columnsReset\", source }));\n}\nfunction _compareColumnStatesAndDispatchEvents(beans, source) {\n const { rowGroupColsSvc, pivotColsSvc, valueColsSvc, colModel, sortSvc, eventSvc } = beans;\n const startState = {\n rowGroupColumns: rowGroupColsSvc?.columns.slice() ?? [],\n pivotColumns: pivotColsSvc?.columns.slice() ?? [],\n valueColumns: valueColsSvc?.columns.slice() ?? []\n };\n const columnStateBefore = _getColumnState(beans);\n const columnStateBeforeMap = {};\n for (const col of columnStateBefore) {\n columnStateBeforeMap[col.colId] = col;\n }\n return () => {\n const dispatchWhenListsDifferent = (eventType, colsBefore, colsAfter, idMapper) => {\n const beforeList = colsBefore.map(idMapper);\n const afterList = colsAfter.map(idMapper);\n const unchanged = _areEqual(beforeList, afterList);\n if (unchanged) {\n return;\n }\n const changes = new Set(colsBefore);\n for (const id of colsAfter) {\n if (!changes.delete(id)) {\n changes.add(id);\n }\n }\n const changesArr = [...changes];\n eventSvc.dispatchEvent({\n type: eventType,\n columns: changesArr,\n column: changesArr.length === 1 ? changesArr[0] : null,\n source\n });\n };\n const getChangedColumns = (changedPredicate) => {\n const changedColumns2 = [];\n colModel.forAllCols((column) => {\n const colStateBefore = columnStateBeforeMap[column.getColId()];\n if (colStateBefore && changedPredicate(colStateBefore, column)) {\n changedColumns2.push(column);\n }\n });\n return changedColumns2;\n };\n const columnIdMapper = (c) => c.getColId();\n dispatchWhenListsDifferent(\n \"columnRowGroupChanged\",\n startState.rowGroupColumns,\n rowGroupColsSvc?.columns ?? [],\n columnIdMapper\n );\n dispatchWhenListsDifferent(\n \"columnPivotChanged\",\n startState.pivotColumns,\n pivotColsSvc?.columns ?? [],\n columnIdMapper\n );\n const valueChangePredicate = (cs, c) => {\n const oldActive = cs.aggFunc != null;\n const activeChanged = oldActive != c.isValueActive();\n const aggFuncChanged = oldActive && cs.aggFunc != c.getAggFunc();\n return activeChanged || aggFuncChanged;\n };\n const changedValues = getChangedColumns(valueChangePredicate);\n if (changedValues.length > 0) {\n dispatchColumnChangedEvent(eventSvc, \"columnValueChanged\", changedValues, source);\n }\n const resizeChangePredicate = (cs, c) => cs.width != c.getActualWidth();\n dispatchColumnResizedEvent(eventSvc, getChangedColumns(resizeChangePredicate), true, source);\n const pinnedChangePredicate = (cs, c) => cs.pinned != c.getPinned();\n dispatchColumnPinnedEvent(eventSvc, getChangedColumns(pinnedChangePredicate), source);\n const visibilityChangePredicate = (cs, c) => cs.hide == c.isVisible();\n dispatchColumnVisibleEvent(eventSvc, getChangedColumns(visibilityChangePredicate), source);\n const sortChangePredicate = (cs, c) => !_areSortDefsEqual(c.getSortDef(), {\n type: _normalizeSortType(cs.sortType),\n direction: _normalizeSortDirection(cs.sort)\n }) || cs.sortIndex != c.getSortIndex();\n const changedColumns = getChangedColumns(sortChangePredicate);\n if (changedColumns.length > 0) {\n sortSvc?.dispatchSortChangedEvents(source, changedColumns);\n }\n const colStateAfter = _getColumnState(beans);\n normaliseColumnMovedEventForColumnState(columnStateBefore, colStateAfter, source, colModel, eventSvc);\n };\n}\nfunction _getColumnState(beans) {\n const { colModel, rowGroupColsSvc, pivotColsSvc } = beans;\n const primaryCols = colModel.getColDefCols();\n if (_missing(primaryCols) || !colModel.isAlive()) {\n return [];\n }\n const rowGroupColumns = rowGroupColsSvc?.columns;\n const pivotColumns = pivotColsSvc?.columns;\n const res = [];\n const createStateItemFromColumn = (column) => {\n const rowGroupIndex = column.isRowGroupActive() && rowGroupColumns ? rowGroupColumns.indexOf(column) : null;\n const pivotIndex = column.isPivotActive() && pivotColumns ? pivotColumns.indexOf(column) : null;\n const aggFunc = column.isValueActive() ? column.getAggFunc() : null;\n const sortIndex = column.getSortIndex() != null ? column.getSortIndex() : null;\n res.push({\n colId: column.getColId(),\n width: column.getActualWidth(),\n hide: !column.isVisible(),\n pinned: column.getPinned(),\n sort: column.getSort(),\n sortType: column.getSortDef()?.type,\n sortIndex,\n aggFunc,\n rowGroup: column.isRowGroupActive(),\n rowGroupIndex,\n pivot: column.isPivotActive(),\n pivotIndex,\n flex: column.getFlex() ?? null\n });\n };\n colModel.forAllCols((col) => createStateItemFromColumn(col));\n const colIdToGridIndexMap = new Map(\n colModel.getCols().map((col, index) => [col.getColId(), index])\n );\n res.sort((itemA, itemB) => {\n const posA = colIdToGridIndexMap.has(itemA.colId) ? colIdToGridIndexMap.get(itemA.colId) : -1;\n const posB = colIdToGridIndexMap.has(itemB.colId) ? colIdToGridIndexMap.get(itemB.colId) : -1;\n return posA - posB;\n });\n return res;\n}\nfunction getColumnStateFromColDef(column) {\n const getValueOrNull = (a, b) => a != null ? a : b != null ? b : null;\n const colDef = column.getColDef();\n const sortDefFromColDef = _getSortDefFromInput(getValueOrNull(colDef.sort, colDef.initialSort));\n const sort = sortDefFromColDef.direction;\n const sortType = sortDefFromColDef.type;\n const sortIndex = getValueOrNull(colDef.sortIndex, colDef.initialSortIndex);\n const hide = getValueOrNull(colDef.hide, colDef.initialHide);\n const pinned = getValueOrNull(colDef.pinned, colDef.initialPinned);\n const width = getValueOrNull(colDef.width, colDef.initialWidth);\n const flex = getValueOrNull(colDef.flex, colDef.initialFlex);\n let rowGroupIndex = getValueOrNull(colDef.rowGroupIndex, colDef.initialRowGroupIndex);\n let rowGroup = getValueOrNull(colDef.rowGroup, colDef.initialRowGroup);\n if (rowGroupIndex == null && !rowGroup) {\n rowGroupIndex = null;\n rowGroup = null;\n }\n let pivotIndex = getValueOrNull(colDef.pivotIndex, colDef.initialPivotIndex);\n let pivot = getValueOrNull(colDef.pivot, colDef.initialPivot);\n if (pivotIndex == null && !pivot) {\n pivotIndex = null;\n pivot = null;\n }\n const aggFunc = getValueOrNull(colDef.aggFunc, colDef.initialAggFunc);\n return {\n colId: column.getColId(),\n sort,\n sortType,\n sortIndex,\n hide,\n pinned,\n width,\n flex,\n rowGroup,\n rowGroupIndex,\n pivot,\n pivotIndex,\n aggFunc\n };\n}\nfunction orderLiveColsLikeState(params, colModel, gos) {\n if (!params.applyOrder || !params.state) {\n return;\n }\n const colIds = [];\n for (const item of params.state) {\n if (item.colId != null) {\n colIds.push(item.colId);\n }\n }\n sortColsLikeKeys(colModel.cols, colIds, colModel, gos);\n}\nfunction sortColsLikeKeys(cols, colIds, colModel, gos) {\n if (cols == null) {\n return;\n }\n let newOrder = [];\n const processedColIds = {};\n for (const colId of colIds) {\n if (processedColIds[colId]) {\n continue;\n }\n const col = cols.map[colId];\n if (col) {\n newOrder.push(col);\n processedColIds[colId] = true;\n }\n }\n let autoGroupInsertIndex = 0;\n for (const col of cols.list) {\n const colId = col.getColId();\n const alreadyProcessed = processedColIds[colId] != null;\n if (alreadyProcessed) {\n continue;\n }\n const isAutoGroupCol = colId.startsWith(GROUP_AUTO_COLUMN_ID);\n if (isAutoGroupCol) {\n newOrder.splice(autoGroupInsertIndex++, 0, col);\n } else {\n newOrder.push(col);\n }\n }\n newOrder = placeLockedColumns(newOrder, gos);\n if (!doesMovePassMarryChildren(newOrder, colModel.getColTree())) {\n _warn(39);\n return;\n }\n cols.list = newOrder;\n}\nfunction normaliseColumnMovedEventForColumnState(colStateBefore, colStateAfter, source, colModel, eventSvc) {\n const colStateAfterMapped = {};\n for (const s of colStateAfter) {\n colStateAfterMapped[s.colId] = s;\n }\n const colsIntersectIds = {};\n for (const s of colStateBefore) {\n if (colStateAfterMapped[s.colId]) {\n colsIntersectIds[s.colId] = true;\n }\n }\n const beforeFiltered = colStateBefore.filter((c) => colsIntersectIds[c.colId]);\n const afterFiltered = colStateAfter.filter((c) => colsIntersectIds[c.colId]);\n const movedColumns = [];\n afterFiltered.forEach((csAfter, index) => {\n const csBefore = beforeFiltered?.[index];\n if (csBefore && csBefore.colId !== csAfter.colId) {\n const gridCol = colModel.getCol(csBefore.colId);\n if (gridCol) {\n movedColumns.push(gridCol);\n }\n }\n });\n if (!movedColumns.length) {\n return;\n }\n eventSvc.dispatchEvent({\n type: \"columnMoved\",\n columns: movedColumns,\n column: movedColumns.length === 1 ? movedColumns[0] : null,\n finished: true,\n source\n });\n}\nvar comparatorByIndex = (indexes, oldList, colA, colB) => {\n const indexA = indexes[colA.getId()];\n const indexB = indexes[colB.getId()];\n const aHasIndex = indexA != null;\n const bHasIndex = indexB != null;\n if (aHasIndex && bHasIndex) {\n return indexA - indexB;\n }\n if (aHasIndex) {\n return -1;\n }\n if (bHasIndex) {\n return 1;\n }\n const oldIndexA = oldList.indexOf(colA);\n const oldIndexB = oldList.indexOf(colB);\n const aHasOldIndex = oldIndexA >= 0;\n const bHasOldIndex = oldIndexB >= 0;\n if (aHasOldIndex && bHasOldIndex) {\n return oldIndexA - oldIndexB;\n }\n if (aHasOldIndex) {\n return -1;\n }\n return 1;\n};\n\n// packages/ag-grid-community/src/columns/columnModel.ts\nvar ColumnModel = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colModel\";\n // if pivotMode is on, however pivot results are NOT shown if no pivot columns are set\n this.pivotMode = false;\n this.ready = false;\n this.changeEventsDispatching = false;\n }\n postConstruct() {\n this.pivotMode = this.gos.get(\"pivotMode\");\n this.addManagedPropertyListeners(\n [\n \"groupDisplayType\",\n \"treeData\",\n \"treeDataDisplayType\",\n \"groupHideOpenParents\",\n \"groupHideColumnsUntilExpanded\",\n \"rowNumbers\",\n \"hidePaddedHeaderRows\"\n ],\n (event) => this.refreshAll(_convertColumnEventSourceType(event.source))\n );\n this.addManagedPropertyListeners(\n [\"defaultColDef\", \"defaultColGroupDef\", \"columnTypes\", \"suppressFieldDotNotation\"],\n this.recreateColumnDefs.bind(this)\n );\n this.addManagedPropertyListener(\n \"pivotMode\",\n (event) => this.setPivotMode(this.gos.get(\"pivotMode\"), _convertColumnEventSourceType(event.source))\n );\n }\n // called from SyncService, when grid has finished initialising\n createColsFromColDefs(source) {\n const { beans } = this;\n const {\n valueCache,\n colAutosize,\n rowGroupColsSvc,\n pivotColsSvc,\n valueColsSvc,\n visibleCols,\n eventSvc,\n groupHierarchyColSvc\n } = beans;\n const dispatchEventsFunc = this.colDefs ? _compareColumnStatesAndDispatchEvents(beans, source) : void 0;\n valueCache?.expire();\n const oldCols = this.colDefCols?.list;\n const oldTree = this.colDefCols?.tree;\n const newTree = _createColumnTree(beans, this.colDefs, true, oldTree, source);\n _destroyColumnTree(beans, this.colDefCols?.tree, newTree.columnTree);\n const tree = newTree.columnTree;\n const treeDepth = newTree.treeDepth;\n const list = _getColumnsFromTree(tree);\n const map = {};\n for (const col of list) {\n map[col.getId()] = col;\n }\n this.colDefCols = { tree, treeDepth, list, map };\n this.createColumnsForService([groupHierarchyColSvc], this.colDefCols, source);\n rowGroupColsSvc?.extractCols(source, oldCols);\n pivotColsSvc?.extractCols(source, oldCols);\n valueColsSvc?.extractCols(source, oldCols);\n this.ready = true;\n this.changeEventsDispatching = true;\n this.refreshCols(true, source);\n this.changeEventsDispatching = false;\n visibleCols.refresh(source);\n eventSvc.dispatchEvent({\n type: \"columnEverythingChanged\",\n source\n });\n if (dispatchEventsFunc) {\n this.changeEventsDispatching = true;\n dispatchEventsFunc();\n this.changeEventsDispatching = false;\n }\n eventSvc.dispatchEvent({\n type: \"newColumnsLoaded\",\n source\n });\n if (source === \"gridInitializing\") {\n colAutosize?.applyAutosizeStrategy();\n }\n }\n // called from: buildAutoGroupColumns (events 'groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents')\n // createColsFromColDefs (recreateColumnDefs, setColumnsDefs),\n // setPivotMode, applyColumnState,\n // functionColsService.setPrimaryColList, functionColsService.updatePrimaryColList,\n // pivotResultCols.setPivotResultCols\n refreshCols(newColDefs, source) {\n if (!this.colDefCols) {\n return;\n }\n const prevColTree = this.cols?.tree;\n this.saveColOrder();\n const {\n autoColSvc,\n selectionColSvc,\n rowNumbersSvc,\n quickFilter,\n pivotResultCols,\n showRowGroupCols,\n rowAutoHeight,\n visibleCols,\n colViewport,\n eventSvc,\n formula\n } = this.beans;\n const cols = this.selectCols(pivotResultCols, this.colDefCols);\n formula?.setFormulasActive(cols);\n this.createColumnsForService([autoColSvc, selectionColSvc, rowNumbersSvc], cols, source);\n const shouldSortNewColDefs = _shouldMaintainColumnOrder(this.gos, this.showingPivotResult);\n if (!newColDefs || shouldSortNewColDefs) {\n this.restoreColOrder(cols);\n }\n this.positionLockedCols(cols);\n showRowGroupCols?.refresh();\n quickFilter?.refreshCols();\n this.setColSpanActive();\n rowAutoHeight?.setAutoHeightActive(cols);\n visibleCols.clear();\n colViewport.clear();\n if (!_areEqual(prevColTree, this.cols.tree)) {\n eventSvc.dispatchEvent({\n type: \"gridColumnsChanged\"\n });\n }\n }\n createColumnsForService(services, cols, source) {\n for (const service of services) {\n if (!service) {\n continue;\n }\n service.createColumns(\n cols,\n (updateOrder) => {\n this.lastOrder = updateOrder(this.lastOrder);\n this.lastPivotOrder = updateOrder(this.lastPivotOrder);\n },\n source\n );\n service.addColumns(cols);\n }\n }\n selectCols(pivotResultColsSvc, colDefCols) {\n const pivotResultCols = pivotResultColsSvc?.getPivotResultCols() ?? null;\n this.showingPivotResult = pivotResultCols != null;\n const { map, list, tree, treeDepth } = pivotResultCols ?? colDefCols;\n this.cols = {\n list: list.slice(),\n map: { ...map },\n tree: tree.slice(),\n treeDepth\n };\n if (pivotResultCols) {\n const hasSameColumns = pivotResultCols.list.some((col) => this.cols?.map[col.getColId()] !== void 0);\n if (!hasSameColumns) {\n this.lastPivotOrder = null;\n }\n }\n return this.cols;\n }\n getColsToShow() {\n if (!this.cols) {\n return [];\n }\n const { beans, showingPivotResult, cols } = this;\n const { valueColsSvc, selectionColSvc, gos } = beans;\n const showAutoGroupAndValuesOnly = this.isPivotMode() && !showingPivotResult;\n const showSelectionColumn = selectionColSvc?.isSelectionColumnEnabled();\n const showRowNumbers = _isRowNumbers(beans);\n const valueColumns = valueColsSvc?.columns;\n const hideEmptyAutoColGroups = _isGroupHideColumnsUntilExpanded(gos);\n const res = cols.list.filter((col) => {\n const isAutoGroupCol = isColumnGroupAutoCol(col);\n if (showAutoGroupAndValuesOnly) {\n const isValueCol = valueColumns?.includes(col);\n return isValueCol || isAutoGroupCol && (!hideEmptyAutoColGroups || col.isVisible()) || showSelectionColumn && isColumnSelectionCol(col) || showRowNumbers && isRowNumberCol(col);\n } else {\n return isAutoGroupCol && !hideEmptyAutoColGroups || col.isVisible();\n }\n });\n return res;\n }\n // on events 'groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents'\n refreshAll(source) {\n if (!this.ready) {\n return;\n }\n this.refreshCols(false, source);\n this.beans.visibleCols.refresh(source);\n }\n setColsVisible(keys, visible = false, source) {\n _applyColumnState(\n this.beans,\n {\n state: keys.map((key) => ({\n colId: typeof key === \"string\" ? key : key.getColId(),\n hide: !visible\n }))\n },\n source\n );\n }\n /**\n * Restores provided columns order to the previous order in this.lastPivotOrder / this.lastOrder\n * If columns are not in the last order:\n * - Check column groups, and apply column after the last column in the lowest shared group\n * - If no sibling is found, apply the column at the end of the cols\n */\n restoreColOrder(cols) {\n const lastOrder = this.showingPivotResult ? this.lastPivotOrder : this.lastOrder;\n if (!lastOrder) {\n return;\n }\n const preservedOrder = lastOrder.filter((col) => cols.map[col.getId()] != null);\n if (preservedOrder.length === 0) {\n return;\n }\n if (preservedOrder.length === cols.list.length) {\n cols.list = preservedOrder;\n return;\n }\n const hasSiblings = (col) => {\n const ancestor = col.getOriginalParent();\n if (!ancestor) {\n return false;\n }\n const children = ancestor.getChildren();\n if (children.length > 1) {\n return true;\n }\n return hasSiblings(ancestor);\n };\n if (!preservedOrder.some((col) => hasSiblings(col))) {\n const preservedOrderSet = new Set(preservedOrder);\n for (const col of cols.list) {\n if (!preservedOrderSet.has(col)) {\n preservedOrder.push(col);\n }\n }\n cols.list = preservedOrder;\n return;\n }\n const colPositionMap = /* @__PURE__ */ new Map();\n for (let i = 0; i < preservedOrder.length; i++) {\n const col = preservedOrder[i];\n colPositionMap.set(col, i);\n }\n const additionalCols = cols.list.filter((col) => !colPositionMap.has(col));\n if (additionalCols.length === 0) {\n cols.list = preservedOrder;\n return;\n }\n const getPreviousSibling = (col, group) => {\n const parent = group ? group.getOriginalParent() : col.getOriginalParent();\n if (!parent) {\n return null;\n }\n let highestIdx = null;\n let highestSibling = null;\n for (const child of parent.getChildren()) {\n if (child === group || child === col) {\n continue;\n }\n if (child instanceof AgColumn) {\n const colIdx = colPositionMap.get(child);\n if (colIdx == null) {\n continue;\n }\n if (highestIdx == null || highestIdx < colIdx) {\n highestIdx = colIdx;\n highestSibling = child;\n }\n continue;\n }\n child.forEachLeafColumn((leafCol) => {\n const colIdx = colPositionMap.get(leafCol);\n if (colIdx == null) {\n return;\n }\n if (highestIdx == null || highestIdx < colIdx) {\n highestIdx = colIdx;\n highestSibling = leafCol;\n }\n });\n }\n if (highestSibling == null) {\n return getPreviousSibling(col, parent);\n }\n return highestSibling;\n };\n const noSiblingsAvailable = [];\n const previousSiblingPosMap = /* @__PURE__ */ new Map();\n for (const col of additionalCols) {\n const prevSiblingIdx = getPreviousSibling(col, null);\n if (prevSiblingIdx == null) {\n noSiblingsAvailable.push(col);\n continue;\n }\n const prev = previousSiblingPosMap.get(prevSiblingIdx);\n if (prev === void 0) {\n previousSiblingPosMap.set(prevSiblingIdx, col);\n } else if (Array.isArray(prev)) {\n prev.push(col);\n } else {\n previousSiblingPosMap.set(prevSiblingIdx, [prev, col]);\n }\n }\n const result = new Array(cols.list.length);\n let resultPointer = result.length - 1;\n for (let i = noSiblingsAvailable.length - 1; i >= 0; i--) {\n result[resultPointer--] = noSiblingsAvailable[i];\n }\n for (let i = preservedOrder.length - 1; i >= 0; i--) {\n const nextCol = preservedOrder[i];\n const extraCols = previousSiblingPosMap.get(nextCol);\n if (extraCols) {\n if (Array.isArray(extraCols)) {\n for (let x = extraCols.length - 1; x >= 0; x--) {\n const col = extraCols[x];\n result[resultPointer--] = col;\n }\n } else {\n result[resultPointer--] = extraCols;\n }\n }\n result[resultPointer--] = nextCol;\n }\n cols.list = result;\n }\n positionLockedCols(cols) {\n cols.list = placeLockedColumns(cols.list, this.gos);\n }\n saveColOrder() {\n if (this.showingPivotResult) {\n this.lastPivotOrder = this.cols?.list ?? null;\n } else {\n this.lastOrder = this.cols?.list ?? null;\n }\n }\n getColumnDefs(sorted) {\n return this.colDefCols && this.beans.colDefFactory?.getColumnDefs(\n this.colDefCols.list,\n this.showingPivotResult,\n this.lastOrder,\n this.cols?.list ?? [],\n sorted\n );\n }\n setColSpanActive() {\n this.colSpanActive = !!this.cols?.list.some((col) => col.getColDef().colSpan != null);\n }\n isPivotMode() {\n return this.pivotMode;\n }\n setPivotMode(pivotMode, source) {\n if (pivotMode === this.pivotMode) {\n return;\n }\n this.pivotMode = pivotMode;\n if (!this.ready) {\n return;\n }\n this.refreshCols(false, source);\n const { visibleCols, eventSvc } = this.beans;\n visibleCols.refresh(source);\n eventSvc.dispatchEvent({\n type: \"columnPivotModeChanged\"\n });\n }\n // + clientSideRowModel\n isPivotActive() {\n const pivotColumns = this.beans.pivotColsSvc?.columns;\n return this.pivotMode && !!pivotColumns?.length;\n }\n // called when dataTypes change\n recreateColumnDefs(e) {\n if (!this.cols) {\n return;\n }\n this.beans.autoColSvc?.updateColumns(e);\n const source = _convertColumnEventSourceType(e.source);\n this.createColsFromColDefs(source);\n }\n setColumnDefs(columnDefs, source) {\n this.colDefs = columnDefs;\n this.createColsFromColDefs(source);\n }\n destroy() {\n _destroyColumnTree(this.beans, this.colDefCols?.tree);\n super.destroy();\n }\n getColTree() {\n return this.cols?.tree ?? [];\n }\n // + columnSelectPanel\n getColDefColTree() {\n return this.colDefCols?.tree ?? [];\n }\n // + clientSideRowController -> sorting, building quick filter text\n // + headerRenderer -> sorting (clearing icon)\n getColDefCols() {\n return this.colDefCols?.list ?? null;\n }\n // + moveColumnController\n getCols() {\n return this.cols?.list ?? [];\n }\n /**\n * If callback returns true, exit early.\n */\n forAllCols(callback) {\n const { pivotResultCols, autoColSvc, selectionColSvc, groupHierarchyColSvc } = this.beans;\n if (_forAll(this.colDefCols?.list, callback)) {\n return;\n }\n if (_forAll(autoColSvc?.columns?.list, callback)) {\n return;\n }\n if (_forAll(selectionColSvc?.columns?.list, callback)) {\n return;\n }\n if (_forAll(groupHierarchyColSvc?.columns?.list, callback)) {\n return;\n }\n if (_forAll(pivotResultCols?.getPivotResultCols()?.list, callback)) {\n return;\n }\n }\n getColsForKeys(keys) {\n if (!keys) {\n return [];\n }\n return keys.map((key) => this.getCol(key)).filter((col) => col != null);\n }\n getColDefCol(key) {\n if (!this.colDefCols?.list) {\n return null;\n }\n return this.getColFromCollection(key, this.colDefCols);\n }\n getCol(key) {\n if (key == null) {\n return null;\n }\n return this.getColFromCollection(key, this.cols);\n }\n /**\n * Get column exclusively by ID.\n *\n * Note getCol/getColFromCollection have poor performance when col has been removed.\n */\n getColById(key) {\n return this.cols?.map[key] ?? null;\n }\n getColFromCollection(key, cols) {\n if (cols == null) {\n return null;\n }\n const { map, list } = cols;\n if (typeof key == \"string\" && map[key]) {\n return map[key];\n }\n for (let i = 0; i < list.length; i++) {\n if (_columnsMatch(list[i], key)) {\n return list[i];\n }\n }\n const { autoColSvc, selectionColSvc, groupHierarchyColSvc } = this.beans;\n return autoColSvc?.getColumn(key) ?? selectionColSvc?.getColumn(key) ?? groupHierarchyColSvc?.getColumn(key) ?? null;\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agAbstractLabel.css\nvar agAbstractLabel_default = \".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-label-align-right){.ag-label,.ag-wrapper{flex:none}}.ag-label-align-top{align-items:flex-start;flex-direction:column}:where(.ag-label-align-top){.ag-label,.ag-wrapper{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}\";\n\n// packages/ag-grid-community/src/agStack/widgets/agAbstractLabel.ts\nvar AgAbstractLabel = class extends AgComponentStub {\n constructor(config, template, components) {\n super(template, components);\n this.labelSeparator = \"\";\n this.labelAlignment = \"left\";\n this.disabled = false;\n this.label = \"\";\n this.config = config || {};\n this.registerCSS(agAbstractLabel_default);\n }\n postConstruct() {\n this.addCss(\"ag-labeled\");\n this.eLabel.classList.add(\"ag-label\");\n const { labelSeparator, label, labelWidth, labelAlignment, disabled, labelEllipsis } = this.config;\n if (disabled != null) {\n this.setDisabled(disabled);\n }\n if (labelSeparator != null) {\n this.setLabelSeparator(labelSeparator);\n }\n if (label != null) {\n this.setLabel(label);\n }\n if (labelWidth != null) {\n this.setLabelWidth(labelWidth);\n }\n if (labelEllipsis != null) {\n this.setLabelEllipsis(labelEllipsis);\n }\n this.setLabelAlignment(labelAlignment || this.labelAlignment);\n this.refreshLabel();\n }\n refreshLabel() {\n const { label, eLabel } = this;\n _clearElement(eLabel);\n if (typeof label === \"string\") {\n eLabel.innerText = label + this.labelSeparator;\n } else if (label) {\n eLabel.appendChild(label);\n }\n if (label === \"\") {\n _setDisplayed(eLabel, false);\n _setAriaRole(eLabel, \"presentation\");\n } else {\n _setDisplayed(eLabel, true);\n _setAriaRole(eLabel, null);\n }\n }\n setLabelSeparator(labelSeparator) {\n if (this.labelSeparator === labelSeparator) {\n return this;\n }\n this.labelSeparator = labelSeparator;\n if (this.label != null) {\n this.refreshLabel();\n }\n return this;\n }\n getLabelId() {\n const eLabel = this.eLabel;\n eLabel.id = eLabel.id || `ag-${this.getCompId()}-label`;\n return eLabel.id;\n }\n getLabel() {\n return this.label;\n }\n setLabel(label) {\n if (this.label === label) {\n return this;\n }\n this.label = label;\n this.refreshLabel();\n return this;\n }\n setLabelAlignment(alignment) {\n const eGui = this.getGui();\n const eGuiClassList = eGui.classList;\n eGuiClassList.toggle(\"ag-label-align-left\", alignment === \"left\");\n eGuiClassList.toggle(\"ag-label-align-right\", alignment === \"right\");\n eGuiClassList.toggle(\"ag-label-align-top\", alignment === \"top\");\n return this;\n }\n setLabelEllipsis(hasEllipsis) {\n this.eLabel.classList.toggle(\"ag-label-ellipsis\", hasEllipsis);\n return this;\n }\n setLabelWidth(width) {\n if (this.label == null) {\n return this;\n }\n _setElementWidth(this.eLabel, width);\n return this;\n }\n setDisabled(disabled) {\n disabled = !!disabled;\n const element = this.getGui();\n _setDisabled(element, disabled);\n element.classList.toggle(\"ag-disabled\", disabled);\n this.disabled = disabled;\n return this;\n }\n isDisabled() {\n return !!this.disabled;\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agAbstractField.ts\nvar AgAbstractField = class extends AgAbstractLabel {\n constructor(config, template, components, className) {\n super(config, template, components);\n this.className = className;\n }\n postConstruct() {\n super.postConstruct();\n const { width, value, onValueChange, ariaLabel } = this.config;\n if (width != null) {\n this.setWidth(width);\n }\n if (value != null) {\n this.setValue(value);\n }\n if (onValueChange != null) {\n this.onValueChange(onValueChange);\n }\n if (ariaLabel != null) {\n this.setAriaLabel(ariaLabel);\n }\n if (this.className) {\n this.addCss(this.className);\n }\n this.refreshAriaLabelledBy();\n }\n setLabel(label) {\n super.setLabel(label);\n this.refreshAriaLabelledBy();\n return this;\n }\n refreshAriaLabelledBy() {\n const ariaEl = this.getAriaElement();\n const labelId = this.getLabelId();\n const label = this.getLabel();\n if (label == null || label == \"\" || _getAriaLabel(ariaEl) !== null) {\n _setAriaLabelledBy(ariaEl, \"\");\n } else {\n _setAriaLabelledBy(ariaEl, labelId ?? \"\");\n }\n }\n setAriaLabel(label) {\n _setAriaLabel(this.getAriaElement(), label);\n this.refreshAriaLabelledBy();\n return this;\n }\n onValueChange(callbackFn) {\n this.addManagedListeners(this, { fieldValueChanged: () => callbackFn(this.getValue()) });\n return this;\n }\n getWidth() {\n return this.getGui().clientWidth;\n }\n setWidth(width) {\n _setFixedWidth(this.getGui(), width);\n return this;\n }\n getPreviousValue() {\n return this.previousValue;\n }\n getValue() {\n return this.value;\n }\n setValue(value, silent) {\n if (this.value === value) {\n return this;\n }\n this.previousValue = this.value;\n this.value = value;\n if (!silent) {\n this.dispatchLocalEvent({ type: \"fieldValueChanged\" });\n }\n return this;\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agAbstractInputField.ts\nfunction buildTemplate(displayFieldTag) {\n return {\n tag: \"div\",\n role: \"presentation\",\n children: [\n { tag: \"div\", ref: \"eLabel\", cls: \"ag-input-field-label\" },\n {\n tag: \"div\",\n ref: \"eWrapper\",\n cls: \"ag-wrapper ag-input-wrapper\",\n role: \"presentation\",\n children: [{ tag: displayFieldTag, ref: \"eInput\", cls: \"ag-input-field-input\" }]\n }\n ]\n };\n}\nvar AgAbstractInputField = class extends AgAbstractField {\n constructor(config, className, inputType = \"text\", displayFieldTag = \"input\") {\n super(config, config?.template ?? buildTemplate(displayFieldTag), [], className);\n this.inputType = inputType;\n this.displayFieldTag = displayFieldTag;\n this.eLabel = RefPlaceholder;\n this.eWrapper = RefPlaceholder;\n this.eInput = RefPlaceholder;\n }\n postConstruct() {\n super.postConstruct();\n this.setInputType(this.inputType);\n const { eLabel, eWrapper, eInput, className } = this;\n eLabel.classList.add(`${className}-label`);\n eWrapper.classList.add(`${className}-input-wrapper`);\n eInput.classList.add(`${className}-input`);\n this.addCss(\"ag-input-field\");\n eInput.id = eInput.id || `ag-${this.getCompId()}-input`;\n const { inputName, inputWidth, inputPlaceholder, autoComplete, tabIndex } = this.config;\n if (inputName != null) {\n this.setInputName(inputName);\n }\n if (inputWidth != null) {\n this.setInputWidth(inputWidth);\n }\n if (inputPlaceholder != null) {\n this.setInputPlaceholder(inputPlaceholder);\n }\n if (autoComplete != null) {\n this.setAutoComplete(autoComplete);\n }\n this.addInputListeners();\n this.activateTabIndex([eInput], tabIndex);\n }\n addInputListeners() {\n this.addManagedElementListeners(this.eInput, {\n input: (e) => this.setValue(e.target.value)\n });\n }\n setInputType(inputType) {\n if (this.displayFieldTag === \"input\") {\n this.inputType = inputType;\n _addOrRemoveAttribute(this.eInput, \"type\", inputType);\n }\n }\n getInputElement() {\n return this.eInput;\n }\n getWrapperElement() {\n return this.eWrapper;\n }\n setInputWidth(width) {\n _setElementWidth(this.eWrapper, width);\n return this;\n }\n setInputName(name) {\n this.getInputElement().setAttribute(\"name\", name);\n return this;\n }\n getFocusableElement() {\n return this.eInput;\n }\n setMaxLength(length) {\n const eInput = this.eInput;\n eInput.maxLength = length;\n return this;\n }\n setInputPlaceholder(placeholder) {\n _addOrRemoveAttribute(this.eInput, \"placeholder\", placeholder);\n return this;\n }\n setInputAriaLabel(label) {\n _setAriaLabel(this.eInput, label);\n this.refreshAriaLabelledBy();\n return this;\n }\n setDisabled(disabled) {\n _setDisabled(this.eInput, disabled);\n return super.setDisabled(disabled);\n }\n setAutoComplete(value) {\n if (value === true) {\n _addOrRemoveAttribute(this.eInput, \"autocomplete\", null);\n } else {\n const autoCompleteValue = typeof value === \"string\" ? value : \"off\";\n _addOrRemoveAttribute(this.eInput, \"autocomplete\", autoCompleteValue);\n }\n return this;\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agCheckbox.ts\nvar AgCheckbox = class extends AgAbstractInputField {\n constructor(config, className = \"ag-checkbox\", inputType = \"checkbox\") {\n super(config, className, inputType);\n this.labelAlignment = \"right\";\n this.selected = false;\n this.readOnly = false;\n this.passive = false;\n }\n postConstruct() {\n super.postConstruct();\n const { readOnly, passive, name } = this.config;\n if (typeof readOnly === \"boolean\") {\n this.setReadOnly(readOnly);\n }\n if (typeof passive === \"boolean\") {\n this.setPassive(passive);\n }\n if (name != null) {\n this.setName(name);\n }\n }\n addInputListeners() {\n this.addManagedElementListeners(this.eInput, { click: this.onCheckboxClick.bind(this) });\n this.addManagedElementListeners(this.eLabel, { click: this.toggle.bind(this) });\n }\n getNextValue() {\n return this.selected === void 0 ? true : !this.selected;\n }\n setPassive(passive) {\n this.passive = passive;\n }\n isReadOnly() {\n return this.readOnly;\n }\n setReadOnly(readOnly) {\n this.eWrapper.classList.toggle(\"ag-disabled\", readOnly);\n this.eInput.disabled = readOnly;\n this.readOnly = readOnly;\n }\n setDisabled(disabled) {\n this.eWrapper.classList.toggle(\"ag-disabled\", disabled);\n return super.setDisabled(disabled);\n }\n toggle() {\n if (this.eInput.disabled) {\n return;\n }\n const previousValue = this.isSelected();\n const nextValue = this.getNextValue();\n if (this.passive) {\n this.dispatchChange(nextValue, previousValue);\n } else {\n this.setValue(nextValue);\n }\n }\n getValue() {\n return this.isSelected();\n }\n setValue(value, silent) {\n this.refreshSelectedClass(value);\n this.setSelected(value, silent);\n return this;\n }\n setName(name) {\n const input = this.getInputElement();\n input.name = name;\n return this;\n }\n isSelected() {\n return this.selected;\n }\n setSelected(selected, silent) {\n if (this.isSelected() === selected) {\n return;\n }\n this.previousValue = this.isSelected();\n selected = this.selected = typeof selected === \"boolean\" ? selected : void 0;\n const eInput = this.eInput;\n eInput.checked = selected;\n eInput.indeterminate = selected === void 0;\n if (!silent) {\n this.dispatchChange(this.selected, this.previousValue);\n }\n }\n dispatchChange(selected, previousValue, event) {\n this.dispatchLocalEvent({ type: \"fieldValueChanged\", selected, previousValue, event });\n const input = this.getInputElement();\n this.eventSvc.dispatchEvent({\n type: \"checkboxChanged\",\n id: input.id,\n name: input.name,\n selected,\n previousValue\n });\n }\n onCheckboxClick(e) {\n if (this.passive || this.eInput.disabled) {\n return;\n }\n const previousValue = this.isSelected();\n const selected = this.selected = e.target.checked;\n this.refreshSelectedClass(selected);\n this.dispatchChange(selected, previousValue, e);\n }\n refreshSelectedClass(value) {\n const classList = this.eWrapper.classList;\n classList.toggle(\"ag-checked\", value === true);\n classList.toggle(\"ag-indeterminate\", value == null);\n }\n};\nvar AgCheckboxSelector = {\n selector: \"AG-CHECKBOX\",\n component: AgCheckbox\n};\n\n// packages/ag-grid-community/src/rendering/cellRenderers/checkboxCellRenderer.css\nvar checkboxCellRenderer_default = \".ag-checkbox-cell{height:100%}\";\n\n// packages/ag-grid-community/src/rendering/cellRenderers/checkboxCellRenderer.ts\nvar CheckboxCellRendererElement = {\n tag: \"div\",\n cls: \"ag-cell-wrapper ag-checkbox-cell\",\n role: \"presentation\",\n children: [\n {\n tag: \"ag-checkbox\",\n ref: \"eCheckbox\",\n role: \"presentation\"\n }\n ]\n};\nvar CheckboxCellRenderer = class extends Component {\n constructor() {\n super(CheckboxCellRendererElement, [AgCheckboxSelector]);\n this.eCheckbox = RefPlaceholder;\n this.registerCSS(checkboxCellRenderer_default);\n }\n init(params) {\n this.refresh(params);\n const { eCheckbox, beans } = this;\n const inputEl = eCheckbox.getInputElement();\n inputEl.setAttribute(\"tabindex\", \"-1\");\n _setAriaLive(inputEl, \"polite\");\n this.addManagedListeners(inputEl, {\n click: (event) => {\n _stopPropagationForAgGrid(event);\n if (eCheckbox.isDisabled()) {\n return;\n }\n const isSelected = eCheckbox.getValue();\n this.onCheckboxChanged(isSelected);\n },\n dblclick: (event) => {\n _stopPropagationForAgGrid(event);\n }\n });\n this.addManagedElementListeners(params.eGridCell, {\n keydown: (event) => {\n if (event.key === KeyCode.SPACE && !eCheckbox.isDisabled()) {\n if (params.eGridCell === _getActiveDomElement(beans)) {\n eCheckbox.toggle();\n }\n const isSelected = eCheckbox.getValue();\n this.onCheckboxChanged(isSelected);\n event.preventDefault();\n }\n }\n });\n }\n refresh(params) {\n this.params = params;\n this.updateCheckbox(params);\n return true;\n }\n updateCheckbox(params) {\n let isSelected;\n let displayed = true;\n const { value, column, node } = params;\n if (node.group && column) {\n if (typeof value === \"boolean\") {\n isSelected = value;\n } else {\n const colId = column.getColId();\n if (colId.startsWith(GROUP_AUTO_COLUMN_ID)) {\n isSelected = value == null || value === \"\" ? void 0 : value === \"true\";\n } else if (node.aggData && node.aggData[colId] !== void 0) {\n isSelected = value ?? void 0;\n } else if (node.sourceRowIndex >= 0) {\n isSelected = value ?? void 0;\n } else {\n displayed = false;\n }\n }\n } else {\n isSelected = value ?? void 0;\n }\n const { eCheckbox } = this;\n if (!displayed) {\n eCheckbox.setDisplayed(false);\n return;\n }\n eCheckbox.setValue(isSelected);\n const disabled = params.disabled ?? !column?.isCellEditable(node);\n eCheckbox.setDisabled(disabled);\n const translate = this.getLocaleTextFunc();\n const stateName = _getAriaCheckboxStateName(translate, isSelected);\n const ariaLabel = disabled ? stateName : `${translate(\"ariaToggleCellValue\", \"Press SPACE to toggle cell value\")} (${stateName})`;\n eCheckbox.setInputAriaLabel(ariaLabel);\n }\n onCheckboxChanged(isSelected) {\n const { params } = this;\n const { column, node, value: oldValue } = params;\n const { editSvc } = this.beans;\n if (!column) {\n return;\n }\n const position = { rowNode: node, column };\n editSvc?.dispatchCellEvent(position, null, \"cellEditingStarted\", { value: oldValue });\n const valueChanged = node.setDataValue(column, isSelected, \"ui\");\n editSvc?.dispatchCellEvent(position, null, \"cellEditingStopped\", {\n oldValue,\n newValue: isSelected,\n valueChanged\n });\n if (!valueChanged) {\n this.updateCheckbox(params);\n }\n }\n};\n\n// packages/ag-grid-community/src/rendering/cellRenderers/skeletonCellRenderer.ts\nvar SkeletonCellRendererElement = { tag: \"div\", cls: \"ag-skeleton-container\" };\nvar SkeletonCellRenderer = class extends Component {\n constructor() {\n super(SkeletonCellRendererElement);\n }\n init(params) {\n const id = `ag-cell-skeleton-renderer-${this.getCompId()}`;\n this.getGui().setAttribute(\"id\", id);\n this.addDestroyFunc(() => _setAriaLabelledBy(params.eParentOfValue));\n _setAriaLabelledBy(params.eParentOfValue, id);\n if (params.deferRender) {\n this.setupLoading(params);\n } else if (params.node.failedLoad) {\n this.setupFailed();\n } else {\n this.setupLoading(params);\n }\n }\n setupFailed() {\n const localeTextFunc = this.getLocaleTextFunc();\n this.getGui().textContent = localeTextFunc(\"loadingError\", \"ERR\");\n const ariaFailed = localeTextFunc(\"ariaSkeletonCellLoadingFailed\", \"Row failed to load\");\n _setAriaLabel(this.getGui(), ariaFailed);\n }\n setupLoading(params) {\n const skeletonEffect = _createElement({\n tag: \"div\",\n cls: \"ag-skeleton-effect\"\n });\n const rowIndex = params.node.rowIndex;\n if (rowIndex != null) {\n const width = 75 + 25 * (rowIndex % 2 === 0 ? Math.sin(rowIndex) : Math.cos(rowIndex));\n skeletonEffect.style.width = `${width}%`;\n }\n this.getGui().appendChild(skeletonEffect);\n const localeTextFunc = this.getLocaleTextFunc();\n const ariaLoading = params.deferRender ? localeTextFunc(\"ariaDeferSkeletonCellLoading\", \"Cell is loading\") : localeTextFunc(\"ariaSkeletonCellLoading\", \"Row data is loading\");\n _setAriaLabel(this.getGui(), ariaLoading);\n }\n refresh(_params) {\n return false;\n }\n};\n\n// packages/ag-grid-community/src/rendering/cellRenderers/cellRendererModule.ts\nvar CheckboxCellRendererModule = {\n moduleName: \"CheckboxCellRenderer\",\n version: VERSION,\n userComponents: {\n agCheckboxCellRenderer: CheckboxCellRenderer\n }\n};\nvar SkeletonCellRendererModule = {\n moduleName: \"SkeletonCellRenderer\",\n version: VERSION,\n userComponents: {\n agSkeletonCellRenderer: SkeletonCellRenderer\n }\n};\n\n// packages/ag-grid-community/src/columns/columnApi.ts\nfunction getColumnDef(beans, key) {\n const column = beans.colModel.getColDefCol(key);\n if (column) {\n return column.getColDef();\n }\n return null;\n}\nfunction getColumnDefs(beans) {\n return beans.colModel.getColumnDefs(true);\n}\nfunction getDisplayNameForColumn(beans, column, location) {\n return beans.colNames.getDisplayNameForColumn(column, location) || \"\";\n}\nfunction getColumn(beans, key) {\n return beans.colModel.getColDefCol(key);\n}\nfunction getColumns(beans) {\n return beans.colModel.getColDefCols();\n}\nfunction applyColumnState(beans, params) {\n return _applyColumnState(beans, params, \"api\");\n}\nfunction getColumnState(beans) {\n return _getColumnState(beans);\n}\nfunction resetColumnState(beans) {\n _resetColumnState(beans, \"api\");\n}\nfunction isPinning(beans) {\n return beans.visibleCols.isPinningLeft() || beans.visibleCols.isPinningRight();\n}\nfunction isPinningLeft(beans) {\n return beans.visibleCols.isPinningLeft();\n}\nfunction isPinningRight(beans) {\n return beans.visibleCols.isPinningRight();\n}\nfunction getDisplayedColAfter(beans, col) {\n return beans.visibleCols.getColAfter(col);\n}\nfunction getDisplayedColBefore(beans, col) {\n return beans.visibleCols.getColBefore(col);\n}\nfunction setColumnsVisible(beans, keys, visible) {\n beans.colModel.setColsVisible(keys, visible, \"api\");\n}\nfunction setColumnsPinned(beans, keys, pinned) {\n beans.pinnedCols?.setColsPinned(keys, pinned, \"api\");\n}\nfunction getAllGridColumns(beans) {\n return beans.colModel.getCols();\n}\nfunction getDisplayedLeftColumns(beans) {\n return beans.visibleCols.leftCols;\n}\nfunction getDisplayedCenterColumns(beans) {\n return beans.visibleCols.centerCols;\n}\nfunction getDisplayedRightColumns(beans) {\n return beans.visibleCols.rightCols;\n}\nfunction getAllDisplayedColumns(beans) {\n return beans.visibleCols.allCols;\n}\nfunction getAllDisplayedVirtualColumns(beans) {\n return beans.colViewport.getViewportColumns();\n}\n\n// packages/ag-grid-community/src/columns/columnDefFactory.ts\nfunction _deepCloneDefinition(object, keysToSkip) {\n if (!object) {\n return;\n }\n const obj = object;\n const res = {};\n for (const key of Object.keys(obj)) {\n if (keysToSkip && keysToSkip.indexOf(key) >= 0 || SKIP_JS_BUILTINS.has(key)) {\n continue;\n }\n const value = obj[key];\n const sourceIsSimpleObject = typeof value === \"object\" && value !== null && value.constructor === Object;\n if (sourceIsSimpleObject) {\n res[key] = _deepCloneDefinition(value);\n } else {\n res[key] = value;\n }\n }\n return res;\n}\nvar ColumnDefFactory = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colDefFactory\";\n }\n wireBeans(beans) {\n this.rowGroupColsSvc = beans.rowGroupColsSvc;\n this.pivotColsSvc = beans.pivotColsSvc;\n }\n getColumnDefs(colDefColsList, showingPivotResult, lastOrder, colsList, sorted = false) {\n const cols = colDefColsList.slice();\n if (showingPivotResult) {\n cols.sort((a, b) => lastOrder.indexOf(a) - lastOrder.indexOf(b));\n } else if (lastOrder || sorted) {\n cols.sort((a, b) => colsList.indexOf(a) - colsList.indexOf(b));\n }\n const rowGroupColumns = this.rowGroupColsSvc?.columns;\n const pivotColumns = this.pivotColsSvc?.columns;\n return this.buildColumnDefs(cols, rowGroupColumns, pivotColumns);\n }\n buildColumnDefs(cols, rowGroupColumns = [], pivotColumns = []) {\n const res = [];\n const colGroupDefs = {};\n for (const col of cols) {\n const colDef = this.createDefFromColumn(col, rowGroupColumns, pivotColumns);\n let addToResult = true;\n let childDef = colDef;\n let pointer = col.getOriginalParent();\n let lastPointer = null;\n while (pointer) {\n let parentDef = null;\n if (pointer.isPadding()) {\n pointer = pointer.getOriginalParent();\n continue;\n }\n const existingParentDef = colGroupDefs[pointer.getGroupId()];\n if (existingParentDef) {\n existingParentDef.children.push(childDef);\n addToResult = false;\n break;\n }\n parentDef = this.createDefFromGroup(pointer);\n if (parentDef) {\n parentDef.children = [childDef];\n colGroupDefs[parentDef.groupId] = parentDef;\n childDef = parentDef;\n pointer = pointer.getOriginalParent();\n }\n if (pointer != null && lastPointer === pointer) {\n addToResult = false;\n break;\n }\n lastPointer = pointer;\n }\n if (addToResult) {\n res.push(childDef);\n }\n }\n return res;\n }\n createDefFromGroup(group) {\n const defCloned = _deepCloneDefinition(group.getColGroupDef(), [\"children\"]);\n if (defCloned) {\n defCloned.groupId = group.getGroupId();\n }\n return defCloned;\n }\n createDefFromColumn(col, rowGroupColumns, pivotColumns) {\n const colDefCloned = _deepCloneDefinition(col.getColDef());\n colDefCloned.colId = col.getColId();\n colDefCloned.width = col.getActualWidth();\n colDefCloned.rowGroup = col.isRowGroupActive();\n colDefCloned.rowGroupIndex = col.isRowGroupActive() ? rowGroupColumns.indexOf(col) : null;\n colDefCloned.pivot = col.isPivotActive();\n colDefCloned.pivotIndex = col.isPivotActive() ? pivotColumns.indexOf(col) : null;\n colDefCloned.aggFunc = col.isValueActive() ? col.getAggFunc() : null;\n colDefCloned.hide = col.isVisible() ? void 0 : true;\n colDefCloned.pinned = col.isPinned() ? col.getPinned() : null;\n colDefCloned.sort = col.getSortDef();\n colDefCloned.sortIndex = col.getSortIndex() != null ? col.getSortIndex() : null;\n return colDefCloned;\n }\n};\n\n// packages/ag-grid-community/src/columns/columnFlexService.ts\nvar ColumnFlexService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colFlex\";\n this.columnsHidden = false;\n }\n refreshFlexedColumns(params = {}) {\n const source = params.source ?? \"flex\";\n if (params.viewportWidth != null) {\n this.flexViewportWidth = params.viewportWidth;\n }\n const totalSpace = this.flexViewportWidth;\n const { visibleCols, colDelayRenderSvc } = this.beans;\n const visibleCenterCols = visibleCols.centerCols;\n let flexAfterDisplayIndex = -1;\n if (params.resizingCols) {\n const allResizingCols = new Set(params.resizingCols);\n for (let i = visibleCenterCols.length - 1; i >= 0; i--) {\n if (allResizingCols.has(visibleCenterCols[i])) {\n flexAfterDisplayIndex = i;\n break;\n }\n }\n }\n let hasFlexItems = false;\n const items = visibleCenterCols.map((col, i) => {\n const flex = col.getFlex();\n const isFlex = flex != null && flex > 0 && i > flexAfterDisplayIndex;\n hasFlexItems || (hasFlexItems = isFlex);\n return {\n col,\n isFlex,\n flex: Math.max(0, flex ?? 0),\n initialSize: col.getActualWidth(),\n min: col.getMinWidth(),\n max: col.getMaxWidth(),\n targetSize: 0\n };\n });\n if (hasFlexItems) {\n colDelayRenderSvc?.hideColumns(\"colFlex\");\n this.columnsHidden = true;\n } else if (this.columnsHidden) {\n this.revealColumns(colDelayRenderSvc);\n }\n if (!totalSpace || !hasFlexItems) {\n return [];\n }\n let unfrozenItemCount = items.length;\n let unfrozenFlex = items.reduce((acc, item) => acc + item.flex, 0);\n let unfrozenSpace = totalSpace;\n const freeze = (item, width) => {\n item.frozenSize = width;\n item.col.setActualWidth(width, source);\n unfrozenSpace -= width;\n unfrozenFlex -= item.flex;\n unfrozenItemCount -= 1;\n };\n const isFrozen = (item) => item.frozenSize != null;\n for (const item of items) {\n if (!item.isFlex) {\n freeze(item, item.initialSize);\n }\n }\n while (unfrozenItemCount > 0) {\n const spaceToFill = Math.round(unfrozenFlex < 1 ? unfrozenSpace * unfrozenFlex : unfrozenSpace);\n let lastUnfrozenItem;\n let actualLeft = 0;\n let idealRight = 0;\n for (const item of items) {\n if (isFrozen(item)) {\n continue;\n }\n lastUnfrozenItem = item;\n idealRight += spaceToFill * (item.flex / unfrozenFlex);\n const idealSize = idealRight - actualLeft;\n const roundedSize = Math.round(idealSize);\n item.targetSize = roundedSize;\n actualLeft += roundedSize;\n }\n if (lastUnfrozenItem) {\n lastUnfrozenItem.targetSize += spaceToFill - actualLeft;\n }\n let totalViolation = 0;\n for (const item of items) {\n if (isFrozen(item)) {\n continue;\n }\n const unclampedSize = item.targetSize;\n const clampedSize = Math.min(Math.max(unclampedSize, item.min), item.max);\n totalViolation += clampedSize - unclampedSize;\n item.violationType = clampedSize === unclampedSize ? void 0 : clampedSize < unclampedSize ? \"max\" : \"min\";\n item.targetSize = clampedSize;\n }\n const freezeType = totalViolation === 0 ? \"all\" : totalViolation > 0 ? \"min\" : \"max\";\n for (const item of items) {\n if (isFrozen(item)) {\n continue;\n }\n if (freezeType === \"all\" || item.violationType === freezeType) {\n freeze(item, item.targetSize);\n }\n }\n }\n if (!params.skipSetLeft) {\n visibleCols.setLeftValues(source);\n }\n if (params.updateBodyWidths) {\n visibleCols.updateBodyWidths();\n }\n const unconstrainedFlexColumns = items.filter((item) => item.isFlex && !item.violationType).map((item) => item.col);\n if (params.fireResizedEvent) {\n const changedColumns = items.filter((item) => item.initialSize !== item.frozenSize).map((item) => item.col);\n const flexingColumns = items.filter((item) => item.flex).map((item) => item.col);\n dispatchColumnResizedEvent(this.eventSvc, changedColumns, true, source, flexingColumns);\n }\n this.revealColumns(colDelayRenderSvc);\n return unconstrainedFlexColumns;\n }\n revealColumns(colDelayRenderSvc) {\n if (this.columnsHidden) {\n colDelayRenderSvc?.revealColumns(\"colFlex\");\n this.columnsHidden = false;\n }\n }\n initCol(column) {\n const { flex, initialFlex } = column.colDef;\n if (flex !== void 0) {\n column.flex = flex;\n } else if (initialFlex !== void 0) {\n column.flex = initialFlex;\n }\n }\n // this method should only be used by the colModel to\n // change flex when required by the applyColumnState method.\n setColFlex(column, flex) {\n column.flex = flex ?? null;\n column.dispatchStateUpdatedEvent(\"flex\");\n }\n};\n\n// packages/ag-grid-community/src/agStack/utils/bigInt.ts\nvar _parseBigIntOrNull = (value) => {\n if (typeof value === \"bigint\") {\n return value;\n }\n let trimmed;\n if (typeof value === \"number\") {\n trimmed = value;\n } else if (typeof value === \"string\") {\n trimmed = value.trim();\n if (trimmed === \"\") {\n return null;\n }\n if (trimmed.endsWith(\"n\")) {\n trimmed = trimmed.slice(0, -1);\n }\n if (!/^[+-]?\\d+$/.test(trimmed)) {\n return null;\n }\n }\n if (trimmed == null) {\n return null;\n }\n try {\n return BigInt(trimmed);\n } catch {\n return null;\n }\n};\n\n// packages/ag-grid-community/src/agStack/utils/date.ts\nvar DATE_TIME_SEPARATOR = \"T\";\nvar DATE_TIME_SEPARATOR_REGEXP = new RegExp(`[${DATE_TIME_SEPARATOR} ]`);\nvar DATE_TIME_REGEXP = new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}(${DATE_TIME_SEPARATOR}\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\D?)?`);\nfunction _padStartWidthZeros(value, totalStringSize) {\n return value.toString().padStart(totalStringSize, \"0\");\n}\nfunction _serialiseDate(date, includeTime = true, separator = DATE_TIME_SEPARATOR) {\n if (!date) {\n return null;\n }\n let serialised = [date.getFullYear(), date.getMonth() + 1, date.getDate()].map((part) => _padStartWidthZeros(part, 2)).join(\"-\");\n if (includeTime) {\n serialised += separator + [date.getHours(), date.getMinutes(), date.getSeconds()].map((part) => _padStartWidthZeros(part, 2)).join(\":\");\n }\n return serialised;\n}\nfunction _getDateParts(d, includeTime = true) {\n if (!d) {\n return null;\n }\n if (includeTime) {\n return [\n String(d.getFullYear()),\n String(d.getMonth() + 1),\n _padStartWidthZeros(d.getDate(), 2),\n _padStartWidthZeros(d.getHours(), 2),\n `:${_padStartWidthZeros(d.getMinutes(), 2)}`,\n `:${_padStartWidthZeros(d.getSeconds(), 2)}`\n ];\n }\n return [d.getFullYear(), d.getMonth() + 1, _padStartWidthZeros(d.getDate(), 2)].map(String);\n}\nvar calculateOrdinal = (value) => {\n if (value > 3 && value < 21) {\n return \"th\";\n }\n const remainder = value % 10;\n switch (remainder) {\n case 1:\n return \"st\";\n case 2:\n return \"nd\";\n case 3:\n return \"rd\";\n }\n return \"th\";\n};\nvar MONTHS = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n];\nvar DAYS = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\nfunction _dateToFormattedString(date, format) {\n if (format == null) {\n return _serialiseDate(date, false);\n }\n const fullYear = _padStartWidthZeros(date.getFullYear(), 4);\n const replace = {\n YYYY: () => fullYear.slice(fullYear.length - 4, fullYear.length),\n YY: () => fullYear.slice(fullYear.length - 2, fullYear.length),\n Y: () => `${date.getFullYear()}`,\n MMMM: () => MONTHS[date.getMonth()],\n MMM: () => MONTHS[date.getMonth()].slice(0, 3),\n MM: () => _padStartWidthZeros(date.getMonth() + 1, 2),\n Mo: () => `${date.getMonth() + 1}${calculateOrdinal(date.getMonth() + 1)}`,\n M: () => `${date.getMonth() + 1}`,\n Do: () => `${date.getDate()}${calculateOrdinal(date.getDate())}`,\n DD: () => _padStartWidthZeros(date.getDate(), 2),\n D: () => `${date.getDate()}`,\n dddd: () => DAYS[date.getDay()],\n ddd: () => DAYS[date.getDay()].slice(0, 3),\n dd: () => DAYS[date.getDay()].slice(0, 2),\n do: () => `${date.getDay()}${calculateOrdinal(date.getDay())}`,\n d: () => `${date.getDay()}`\n };\n const regexp = new RegExp(Object.keys(replace).join(\"|\"), \"g\");\n return format.replace(regexp, (match) => {\n if (match in replace) {\n return replace[match]();\n }\n return match;\n });\n}\nfunction _isValidDate(value, bailIfInvalidTime = false) {\n return !!_parseDateTimeFromString(value, bailIfInvalidTime);\n}\nfunction _isValidDateTime(value) {\n return _isValidDate(value, true);\n}\nfunction _parseDateTimeFromString(value, bailIfInvalidTime = false, skipValidation) {\n if (!value) {\n return null;\n }\n if (!skipValidation && !DATE_TIME_REGEXP.test(value)) {\n return null;\n }\n const [dateStr, timeStr] = value.split(DATE_TIME_SEPARATOR_REGEXP);\n if (!dateStr) {\n return null;\n }\n const fields = dateStr.split(\"-\").map((f) => Number.parseInt(f, 10));\n if (fields.filter((f) => !isNaN(f)).length !== 3) {\n return null;\n }\n const [year, month, day] = fields;\n const date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n return null;\n }\n if (!timeStr && bailIfInvalidTime) {\n return null;\n }\n if (!timeStr || timeStr === \"00:00:00\") {\n return date;\n }\n const [hours, minutes, seconds] = timeStr.split(\":\").map((part) => Number.parseInt(part, 10));\n if (hours >= 0 && hours < 24) {\n date.setHours(hours);\n } else if (bailIfInvalidTime) {\n return null;\n }\n if (minutes >= 0 && minutes < 60) {\n date.setMinutes(minutes);\n } else if (bailIfInvalidTime) {\n return null;\n }\n if (seconds >= 0 && seconds < 60) {\n date.setSeconds(seconds);\n } else if (bailIfInvalidTime) {\n return null;\n }\n return date;\n}\n\n// packages/ag-grid-community/src/agStack/utils/value.ts\nfunction _getValueUsingField(data, field, fieldContainsDots) {\n if (!field || !data) {\n return;\n }\n if (!fieldContainsDots) {\n return data[field];\n }\n const fields = field.split(\".\");\n let currentObject = data;\n for (let i = 0; i < fields.length; i++) {\n if (currentObject == null) {\n return void 0;\n }\n currentObject = currentObject[fields[i]];\n }\n return currentObject;\n}\n\n// packages/ag-grid-community/src/columns/dataTypeService.ts\nvar SORTED_CELL_DATA_TYPES_FOR_MATCHING = [\n \"dateTimeString\",\n \"dateString\",\n \"text\",\n \"number\",\n \"bigint\",\n \"boolean\",\n \"date\"\n];\nvar DataTypeService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"dataTypeSvc\";\n this.dataTypeDefinitions = {};\n this.isPendingInference = false;\n this.isColumnTypeOverrideInDataTypeDefinitions = false;\n // keep track of any column state updates whilst waiting for data types to be inferred\n this.columnStateUpdatesPendingInference = {};\n this.columnStateUpdateListenerDestroyFuncs = [];\n // using an object here to enforce dev to not forget to implement new types as they are added\n this.columnDefinitionPropsPerDataType = {\n number() {\n return { cellEditor: \"agNumberCellEditor\" };\n },\n bigint({ filterModuleBean }) {\n if (filterModuleBean) {\n return {\n cellEditor: \"agTextCellEditor\"\n };\n }\n return {\n cellEditor: \"agTextCellEditor\",\n comparator: {\n default: bigintComparator,\n absolute: bigintAbsoluteComparator\n }\n };\n },\n boolean() {\n return {\n cellEditor: \"agCheckboxCellEditor\",\n cellRenderer: \"agCheckboxCellRenderer\",\n getFindText: () => null,\n suppressKeyboardEvent: ({ node, event, column }) => event.key === KeyCode.SPACE && column.isCellEditable(node)\n };\n },\n date({ formatValue }) {\n return { cellEditor: \"agDateCellEditor\", keyCreator: formatValue };\n },\n dateString({ formatValue }) {\n return { cellEditor: \"agDateStringCellEditor\", keyCreator: formatValue };\n },\n dateTime(args) {\n return this.date(args);\n },\n dateTimeString(args) {\n return this.dateString(args);\n },\n object({ formatValue, colModel, colId }) {\n return {\n cellEditorParams: {\n useFormatter: true\n },\n comparator: (a, b) => {\n const column = colModel.getColDefCol(colId);\n const colDef = column?.getColDef();\n if (!column || !colDef) {\n return 0;\n }\n const valA = a == null ? \"\" : formatValue({ column, node: null, value: a });\n const valB = b == null ? \"\" : formatValue({ column, node: null, value: b });\n if (valA === valB) {\n return 0;\n }\n return valA > valB ? 1 : -1;\n },\n keyCreator: formatValue\n };\n },\n text() {\n return {};\n }\n };\n }\n wireBeans(beans) {\n this.colModel = beans.colModel;\n }\n postConstruct() {\n this.processDataTypeDefinitions();\n this.addManagedPropertyListener(\"dataTypeDefinitions\", (event) => {\n this.processDataTypeDefinitions();\n this.colModel.recreateColumnDefs(event);\n });\n }\n processDataTypeDefinitions() {\n const defaultDataTypes = this.getDefaultDataTypes();\n const newDataTypeDefinitions = {};\n const newFormatValueFuncs = {};\n const generateFormatValueFunc = (dataTypeDefinition) => {\n return (params) => {\n const { column, node, value } = params;\n let valueFormatter = column.getColDef().valueFormatter;\n if (valueFormatter === dataTypeDefinition.groupSafeValueFormatter) {\n valueFormatter = dataTypeDefinition.valueFormatter;\n }\n return this.beans.valueSvc.formatValue(column, node, value, valueFormatter);\n };\n };\n for (const cellDataType of Object.keys(defaultDataTypes)) {\n const defaultDataTypeDef = defaultDataTypes[cellDataType];\n const mergedDataTypeDefinition = {\n ...defaultDataTypeDef,\n groupSafeValueFormatter: createGroupSafeValueFormatter(defaultDataTypeDef, this.gos)\n };\n newDataTypeDefinitions[cellDataType] = mergedDataTypeDefinition;\n newFormatValueFuncs[cellDataType] = generateFormatValueFunc(mergedDataTypeDefinition);\n }\n const userDataTypeDefs = this.gos.get(\"dataTypeDefinitions\") ?? {};\n const newDataTypeMatchers = {};\n for (const cellDataType of Object.keys(userDataTypeDefs)) {\n const userDataTypeDef = userDataTypeDefs[cellDataType];\n const mergedDataTypeDefinition = this.processDataTypeDefinition(\n userDataTypeDef,\n userDataTypeDefs,\n [cellDataType],\n defaultDataTypes\n );\n if (mergedDataTypeDefinition) {\n newDataTypeDefinitions[cellDataType] = mergedDataTypeDefinition;\n if (userDataTypeDef.dataTypeMatcher) {\n newDataTypeMatchers[cellDataType] = userDataTypeDef.dataTypeMatcher;\n }\n newFormatValueFuncs[cellDataType] = generateFormatValueFunc(mergedDataTypeDefinition);\n }\n }\n const { valueParser: defaultValueParser, valueFormatter: defaultValueFormatter } = defaultDataTypes.object;\n const { valueParser: userValueParser, valueFormatter: userValueFormatter } = newDataTypeDefinitions.object;\n this.hasObjectValueParser = userValueParser !== defaultValueParser;\n this.hasObjectValueFormatter = userValueFormatter !== defaultValueFormatter;\n this.formatValueFuncs = newFormatValueFuncs;\n this.dataTypeDefinitions = newDataTypeDefinitions;\n this.dataTypeMatchers = this.sortKeysInMatchers(newDataTypeMatchers, defaultDataTypes);\n }\n /**\n * Sorts the keys in the matchers object.\n * Does not mutate the original object, creates a copy of it with sorted keys instead.\n */\n sortKeysInMatchers(matchers, dataTypes) {\n const sortedMatchers = { ...matchers };\n for (const cellDataType of SORTED_CELL_DATA_TYPES_FOR_MATCHING) {\n delete sortedMatchers[cellDataType];\n sortedMatchers[cellDataType] = matchers[cellDataType] ?? dataTypes[cellDataType].dataTypeMatcher;\n }\n return sortedMatchers;\n }\n processDataTypeDefinition(userDataTypeDef, userDataTypeDefs, alreadyProcessedDataTypes, defaultDataTypes) {\n let mergedDataTypeDefinition;\n const extendsCellDataType = userDataTypeDef.extendsDataType;\n if (userDataTypeDef.columnTypes) {\n this.isColumnTypeOverrideInDataTypeDefinitions = true;\n }\n if (userDataTypeDef.extendsDataType === userDataTypeDef.baseDataType) {\n let baseDataTypeDefinition = defaultDataTypes[extendsCellDataType];\n const overriddenBaseDataTypeDefinition = userDataTypeDefs[extendsCellDataType];\n if (baseDataTypeDefinition && overriddenBaseDataTypeDefinition) {\n baseDataTypeDefinition = overriddenBaseDataTypeDefinition;\n }\n if (!validateDataTypeDefinition(userDataTypeDef, baseDataTypeDefinition, extendsCellDataType)) {\n return void 0;\n }\n mergedDataTypeDefinition = mergeDataTypeDefinitions(baseDataTypeDefinition, userDataTypeDef);\n } else {\n if (alreadyProcessedDataTypes.includes(extendsCellDataType)) {\n _warn(44);\n return void 0;\n }\n const extendedDataTypeDefinition = userDataTypeDefs[extendsCellDataType];\n if (!validateDataTypeDefinition(userDataTypeDef, extendedDataTypeDefinition, extendsCellDataType)) {\n return void 0;\n }\n const mergedExtendedDataTypeDefinition = this.processDataTypeDefinition(\n extendedDataTypeDefinition,\n userDataTypeDefs,\n [...alreadyProcessedDataTypes, extendsCellDataType],\n defaultDataTypes\n );\n if (!mergedExtendedDataTypeDefinition) {\n return void 0;\n }\n mergedDataTypeDefinition = mergeDataTypeDefinitions(mergedExtendedDataTypeDefinition, userDataTypeDef);\n }\n return {\n ...mergedDataTypeDefinition,\n groupSafeValueFormatter: createGroupSafeValueFormatter(mergedDataTypeDefinition, this.gos)\n };\n }\n updateColDefAndGetColumnType(colDef, userColDef, colId) {\n let { cellDataType } = userColDef;\n if (cellDataType === void 0) {\n cellDataType = colDef.cellDataType;\n }\n const { field } = userColDef;\n if (cellDataType == null || cellDataType === true) {\n cellDataType = this.canInferCellDataType(colDef, userColDef) ? this.inferCellDataType(field, colId) : false;\n }\n this.addFormulaCellEditorToColDef(colDef, userColDef);\n if (!cellDataType) {\n colDef.cellDataType = false;\n return void 0;\n }\n const dataTypeDefinition = this.dataTypeDefinitions[cellDataType];\n if (!dataTypeDefinition) {\n _warn(47, { cellDataType });\n return void 0;\n }\n colDef.cellDataType = cellDataType;\n if (dataTypeDefinition.groupSafeValueFormatter) {\n colDef.valueFormatter = dataTypeDefinition.groupSafeValueFormatter;\n }\n if (dataTypeDefinition.valueParser) {\n colDef.valueParser = dataTypeDefinition.valueParser;\n }\n if (!dataTypeDefinition.suppressDefaultProperties) {\n this.setColDefPropertiesForBaseDataType(colDef, cellDataType, dataTypeDefinition, colId);\n }\n return dataTypeDefinition.columnTypes;\n }\n addFormulaCellEditorToColDef(colDef, userColDef) {\n const allowFormula = userColDef.allowFormula ?? colDef.allowFormula;\n if (!allowFormula || userColDef.cellEditor) {\n return;\n }\n colDef.cellEditor = \"agFormulaCellEditor\";\n }\n addColumnListeners(column) {\n if (!this.isPendingInference) {\n return;\n }\n const columnStateUpdates = this.columnStateUpdatesPendingInference[column.getColId()];\n if (!columnStateUpdates) {\n return;\n }\n const columnListener = (event) => {\n columnStateUpdates.add(event.key);\n };\n column.__addEventListener(\"columnStateUpdated\", columnListener);\n this.columnStateUpdateListenerDestroyFuncs.push(\n () => column.__removeEventListener(\"columnStateUpdated\", columnListener)\n );\n }\n canInferCellDataType(colDef, userColDef) {\n const { gos } = this;\n if (!_isClientSideRowModel(gos)) {\n return false;\n }\n const propsToCheckForInference = { cellRenderer: true, valueGetter: true, valueParser: true, refData: true };\n if (doColDefPropsPreventInference(userColDef, propsToCheckForInference)) {\n return false;\n }\n const columnTypes = userColDef.type === null ? colDef.type : userColDef.type;\n if (columnTypes) {\n const columnTypeDefs = gos.get(\"columnTypes\") ?? {};\n const hasPropsPreventingInference = convertColumnTypes(columnTypes).some((columnType) => {\n const columnTypeDef = columnTypeDefs[columnType.trim()];\n return columnTypeDef && doColDefPropsPreventInference(columnTypeDef, propsToCheckForInference);\n });\n if (hasPropsPreventingInference) {\n return false;\n }\n }\n return !doColDefPropsPreventInference(colDef, propsToCheckForInference);\n }\n inferCellDataType(field, colId) {\n if (!field) {\n return void 0;\n }\n let value;\n const initialData = this.getInitialData();\n if (initialData) {\n const fieldContainsDots = field.includes(\".\") && !this.gos.get(\"suppressFieldDotNotation\");\n value = _getValueUsingField(initialData, field, fieldContainsDots);\n } else {\n this.initWaitForRowData(colId);\n }\n if (value == null) {\n return void 0;\n }\n const matchedType = Object.keys(this.dataTypeMatchers).find(\n (_cellDataType) => this.dataTypeMatchers[_cellDataType](value)\n );\n return matchedType ?? \"object\";\n }\n getInitialData() {\n const rowData = this.gos.get(\"rowData\");\n if (rowData?.length) {\n return rowData[0];\n } else if (this.initialData) {\n return this.initialData;\n } else {\n const rowNodes = this.beans.rowModel.rootNode?._leafs;\n if (rowNodes?.length) {\n return rowNodes[0].data;\n }\n }\n return null;\n }\n initWaitForRowData(colId) {\n this.columnStateUpdatesPendingInference[colId] = /* @__PURE__ */ new Set();\n if (this.isPendingInference) {\n return;\n }\n this.isPendingInference = true;\n const columnTypeOverridesExist = this.isColumnTypeOverrideInDataTypeDefinitions;\n const { colAutosize, eventSvc } = this.beans;\n if (columnTypeOverridesExist && colAutosize) {\n colAutosize.shouldQueueResizeOperations = true;\n }\n const [destroyFunc] = this.addManagedEventListeners({\n rowDataUpdateStarted: (event) => {\n const { firstRowData } = event;\n if (!firstRowData) {\n return;\n }\n destroyFunc?.();\n this.isPendingInference = false;\n this.processColumnsPendingInference(firstRowData, columnTypeOverridesExist);\n this.columnStateUpdatesPendingInference = {};\n if (columnTypeOverridesExist) {\n colAutosize?.processResizeOperations();\n }\n eventSvc.dispatchEvent({\n type: \"dataTypesInferred\"\n });\n }\n });\n }\n processColumnsPendingInference(firstRowData, columnTypeOverridesExist) {\n this.initialData = firstRowData;\n const state = [];\n this.destroyColumnStateUpdateListeners();\n const newRowGroupColumnStateWithoutIndex = {};\n const newPivotColumnStateWithoutIndex = {};\n for (const colId of Object.keys(this.columnStateUpdatesPendingInference)) {\n const columnStateUpdates = this.columnStateUpdatesPendingInference[colId];\n const column = this.colModel.getCol(colId);\n if (!column) {\n continue;\n }\n const oldColDef = column.getColDef();\n if (!this.resetColDefIntoCol(column, \"cellDataTypeInferred\")) {\n continue;\n }\n const newColDef = column.getColDef();\n if (columnTypeOverridesExist && newColDef.type && newColDef.type !== oldColDef.type) {\n const updatedColumnState = getUpdatedColumnState(column, columnStateUpdates);\n if (updatedColumnState.rowGroup && updatedColumnState.rowGroupIndex == null) {\n newRowGroupColumnStateWithoutIndex[colId] = updatedColumnState;\n }\n if (updatedColumnState.pivot && updatedColumnState.pivotIndex == null) {\n newPivotColumnStateWithoutIndex[colId] = updatedColumnState;\n }\n state.push(updatedColumnState);\n }\n }\n if (columnTypeOverridesExist) {\n state.push(\n ...this.generateColumnStateForRowGroupAndPivotIndexes(\n newRowGroupColumnStateWithoutIndex,\n newPivotColumnStateWithoutIndex\n )\n );\n }\n if (state.length) {\n _applyColumnState(this.beans, { state }, \"cellDataTypeInferred\");\n }\n this.initialData = null;\n }\n generateColumnStateForRowGroupAndPivotIndexes(updatedRowGroupColumnState, updatedPivotColumnState) {\n const existingColumnStateUpdates = {};\n const { rowGroupColsSvc, pivotColsSvc } = this.beans;\n rowGroupColsSvc?.restoreColumnOrder(existingColumnStateUpdates, updatedRowGroupColumnState);\n pivotColsSvc?.restoreColumnOrder(existingColumnStateUpdates, updatedPivotColumnState);\n return Object.values(existingColumnStateUpdates);\n }\n resetColDefIntoCol(column, source) {\n const userColDef = column.getUserProvidedColDef();\n if (!userColDef) {\n return false;\n }\n const newColDef = _addColumnDefaultAndTypes(this.beans, userColDef, column.getColId());\n column.setColDef(newColDef, userColDef, source);\n return true;\n }\n getDateStringTypeDefinition(column) {\n const { dateString } = this.dataTypeDefinitions;\n if (!column) {\n return dateString;\n }\n return this.getDataTypeDefinition(column) ?? dateString;\n }\n getDateParserFunction(column) {\n return this.getDateStringTypeDefinition(column).dateParser;\n }\n getDateFormatterFunction(column) {\n return this.getDateStringTypeDefinition(column).dateFormatter;\n }\n getDateIncludesTimeFlag(cellDataType) {\n return cellDataType === \"dateTime\" || cellDataType === \"dateTimeString\";\n }\n getDataTypeDefinition(column) {\n const colDef = column.getColDef();\n if (!colDef.cellDataType) {\n return void 0;\n }\n return this.dataTypeDefinitions[colDef.cellDataType];\n }\n getBaseDataType(column) {\n return this.getDataTypeDefinition(column)?.baseDataType;\n }\n checkType(column, value) {\n if (value == null) {\n return true;\n }\n const dataTypeMatcher = this.getDataTypeDefinition(column)?.dataTypeMatcher;\n if (!dataTypeMatcher) {\n return true;\n }\n if (column.getColDef().allowFormula && this.beans.formula?.isFormula(value)) {\n return true;\n }\n return dataTypeMatcher(value);\n }\n validateColDef(colDef, userColDef, defaultColDef, colId) {\n if (colDef.cellDataType === \"object\") {\n const wasInferred = (colDef2) => {\n return colDef2?.cellDataType == null || colDef2?.cellDataType === true;\n };\n const inferred = wasInferred(userColDef) && wasInferred(defaultColDef);\n const warning = (property) => _warn(48, { property, inferred, colId });\n const { object } = this.dataTypeDefinitions;\n if (colDef.valueFormatter === object.groupSafeValueFormatter && !this.hasObjectValueFormatter) {\n warning(\"Formatter\");\n }\n if (colDef.editable && colDef.valueParser === object.valueParser && !this.hasObjectValueParser) {\n warning(\"Parser\");\n }\n }\n }\n postProcess(colDef) {\n const cellDataType = colDef.cellDataType;\n if (!cellDataType || typeof cellDataType !== \"string\") {\n return;\n }\n const { dataTypeDefinitions, beans, formatValueFuncs } = this;\n const dataTypeDefinition = dataTypeDefinitions[cellDataType];\n if (!dataTypeDefinition) {\n return;\n }\n beans.colFilter?.setColDefPropsForDataType(colDef, dataTypeDefinition, formatValueFuncs[cellDataType]);\n }\n // noinspection JSUnusedGlobalSymbols\n getFormatValue(cellDataType) {\n return this.formatValueFuncs[cellDataType];\n }\n isColPendingInference(colId) {\n return this.isPendingInference && !!this.columnStateUpdatesPendingInference[colId];\n }\n setColDefPropertiesForBaseDataType(colDef, cellDataType, dataTypeDefinition, colId) {\n const formatValue = this.formatValueFuncs[cellDataType];\n const partialColDef = this.columnDefinitionPropsPerDataType[dataTypeDefinition.baseDataType]({\n colDef,\n cellDataType,\n colModel: this.colModel,\n dataTypeDefinition,\n colId,\n formatValue,\n filterModuleBean: this.beans.filterManager\n });\n if (colDef.cellEditor === \"agFormulaCellEditor\" && partialColDef.cellEditor !== colDef.cellEditor) {\n partialColDef.cellEditor = colDef.cellEditor;\n }\n Object.assign(colDef, partialColDef);\n }\n getDateObjectTypeDef(baseDataType) {\n const translate = this.getLocaleTextFunc();\n const includeTime = this.getDateIncludesTimeFlag(baseDataType);\n return {\n baseDataType,\n valueParser: (params) => _parseDateTimeFromString(params.newValue && String(params.newValue)),\n valueFormatter: (params) => {\n if (params.value == null) {\n return \"\";\n }\n if (!(params.value instanceof Date) || isNaN(params.value.getTime())) {\n return translate(\"invalidDate\", \"Invalid Date\");\n }\n return _serialiseDate(params.value, includeTime) ?? \"\";\n },\n dataTypeMatcher: (value) => value instanceof Date\n };\n }\n getDateStringTypeDef(baseDataType) {\n const includeTime = this.getDateIncludesTimeFlag(baseDataType);\n return {\n baseDataType,\n dateParser: (value) => _parseDateTimeFromString(value) ?? void 0,\n dateFormatter: (value) => _serialiseDate(value ?? null, includeTime) ?? void 0,\n valueParser: (params) => _isValidDate(String(params.newValue)) ? params.newValue : null,\n valueFormatter: (params) => _isValidDate(String(params.value)) ? String(params.value) : \"\",\n dataTypeMatcher: (value) => typeof value === \"string\" && _isValidDate(value)\n };\n }\n getDefaultDataTypes() {\n const translate = this.getLocaleTextFunc();\n return {\n number: {\n baseDataType: \"number\",\n // can be empty space with legacy copy\n valueParser: (params) => params.newValue?.trim?.() === \"\" ? null : Number(params.newValue),\n valueFormatter: (params) => {\n if (params.value == null) {\n return \"\";\n }\n if (typeof params.value !== \"number\" || isNaN(params.value)) {\n return translate(\"invalidNumber\", \"Invalid Number\");\n }\n return String(params.value);\n },\n dataTypeMatcher: (value) => typeof value === \"number\"\n },\n bigint: {\n baseDataType: \"bigint\",\n valueParser: (params) => {\n const { newValue } = params;\n if (newValue == null) {\n return null;\n }\n if (typeof newValue === \"string\" && newValue.trim() === \"\") {\n return null;\n }\n return _parseBigIntOrNull(newValue);\n },\n valueFormatter: (params) => {\n if (params.value == null) {\n return \"\";\n }\n if (typeof params.value !== \"bigint\") {\n return translate(\"invalidBigInt\", \"Invalid BigInt\");\n }\n return String(params.value);\n },\n dataTypeMatcher: (value) => typeof value === \"bigint\"\n },\n text: {\n baseDataType: \"text\",\n valueParser: (params) => params.newValue === \"\" ? null : _toStringOrNull(params.newValue),\n dataTypeMatcher: (value) => typeof value === \"string\"\n },\n boolean: {\n baseDataType: \"boolean\",\n valueParser: (params) => {\n if (params.newValue == null) {\n return params.newValue;\n }\n return params.newValue?.trim?.() === \"\" ? null : String(params.newValue).toLowerCase() === \"true\";\n },\n valueFormatter: (params) => params.value == null ? \"\" : String(params.value),\n dataTypeMatcher: (value) => typeof value === \"boolean\"\n },\n date: this.getDateObjectTypeDef(\"date\"),\n dateString: this.getDateStringTypeDef(\"dateString\"),\n dateTime: this.getDateObjectTypeDef(\"dateTime\"),\n dateTimeString: {\n ...this.getDateStringTypeDef(\"dateTimeString\"),\n dataTypeMatcher: (value) => typeof value === \"string\" && _isValidDateTime(value)\n },\n object: {\n baseDataType: \"object\",\n valueParser: () => null,\n valueFormatter: (params) => _toStringOrNull(params.value) ?? \"\"\n }\n };\n }\n destroyColumnStateUpdateListeners() {\n for (const destroyFunc of this.columnStateUpdateListenerDestroyFuncs) {\n destroyFunc();\n }\n this.columnStateUpdateListenerDestroyFuncs = [];\n }\n destroy() {\n this.dataTypeDefinitions = {};\n this.dataTypeMatchers = {};\n this.formatValueFuncs = {};\n this.columnStateUpdatesPendingInference = {};\n this.destroyColumnStateUpdateListeners();\n super.destroy();\n }\n};\nfunction mergeDataTypeDefinitions(parentDataTypeDefinition, childDataTypeDefinition) {\n const mergedDataTypeDefinition = {\n ...parentDataTypeDefinition,\n ...childDataTypeDefinition\n };\n if (parentDataTypeDefinition.columnTypes && childDataTypeDefinition.columnTypes && childDataTypeDefinition.appendColumnTypes) {\n mergedDataTypeDefinition.columnTypes = [\n ...convertColumnTypes(parentDataTypeDefinition.columnTypes),\n ...convertColumnTypes(childDataTypeDefinition.columnTypes)\n ];\n }\n return mergedDataTypeDefinition;\n}\nfunction validateDataTypeDefinition(dataTypeDefinition, parentDataTypeDefinition, parentCellDataType) {\n if (!parentDataTypeDefinition) {\n _warn(45, { parentCellDataType });\n return false;\n }\n if (parentDataTypeDefinition.baseDataType !== dataTypeDefinition.baseDataType) {\n _warn(46);\n return false;\n }\n return true;\n}\nvar isNumberOrBigintType = (v) => typeof v === \"bigint\" || typeof v === \"number\";\nvar isNumberOrBigintBaseDataType = (v) => v === \"number\" || v === \"bigint\";\nfunction createGroupSafeValueFormatter(dataTypeDefinition, gos) {\n if (!dataTypeDefinition.valueFormatter) {\n return void 0;\n }\n return (params) => {\n const { node, colDef, column, value } = params;\n if (node?.group) {\n const aggFunc = (colDef.pivotValueColumn ?? column).getAggFunc();\n if (aggFunc) {\n if (aggFunc === \"first\" || aggFunc === \"last\") {\n return dataTypeDefinition.valueFormatter(params);\n }\n const { baseDataType } = dataTypeDefinition;\n if (isNumberOrBigintBaseDataType(baseDataType) && aggFunc !== \"count\") {\n if (isNumberOrBigintType(value)) {\n return dataTypeDefinition.valueFormatter(params);\n }\n if (value == null) {\n return void 0;\n }\n if (typeof value === \"object\") {\n if (typeof value.toNumber === \"function\") {\n return dataTypeDefinition.valueFormatter({ ...params, value: value.toNumber() });\n }\n if (\"value\" in value) {\n return dataTypeDefinition.valueFormatter({ ...params, value: value.value });\n }\n }\n }\n return void 0;\n }\n } else if (gos.get(\"groupHideOpenParents\") && params.column.isRowGroupActive()) {\n if (typeof params.value === \"string\" && !dataTypeDefinition.dataTypeMatcher?.(params.value)) {\n return void 0;\n }\n }\n return dataTypeDefinition.valueFormatter(params);\n };\n}\nfunction doesColDefPropPreventInference(colDef, checkProps, prop, comparisonValue) {\n if (!checkProps[prop]) {\n return false;\n }\n const value = colDef[prop];\n if (value === null) {\n checkProps[prop] = false;\n return false;\n } else {\n return comparisonValue === void 0 ? !!value : value === comparisonValue;\n }\n}\nfunction bigintComparator(valueA, valueB) {\n if (valueA == null) {\n return valueB == null ? 0 : -1;\n }\n if (valueB == null) {\n return 1;\n }\n const bigA = _parseBigIntOrNull(valueA);\n const bigB = _parseBigIntOrNull(valueB);\n if (bigA != null && bigB != null) {\n if (bigA === bigB) {\n return 0;\n }\n return bigA > bigB ? 1 : -1;\n }\n return 0;\n}\nfunction bigintAbsoluteComparator(valueA, valueB) {\n if (valueA == null) {\n return valueB == null ? 0 : -1;\n }\n if (valueB == null) {\n return 1;\n }\n const bigA = toAbsoluteBigInt(valueA);\n const bigB = toAbsoluteBigInt(valueB);\n if (bigA != null && bigB != null) {\n if (bigA === bigB) {\n return 0;\n }\n return bigA > bigB ? 1 : -1;\n }\n return 0;\n}\nfunction toAbsoluteBigInt(value) {\n const bigIntValue = _parseBigIntOrNull(value);\n if (bigIntValue == null) {\n return null;\n }\n return bigIntValue < 0n ? -bigIntValue : bigIntValue;\n}\nfunction doColDefPropsPreventInference(colDef, propsToCheckForInference) {\n return [\n [\"cellRenderer\", \"agSparklineCellRenderer\"],\n [\"valueGetter\", void 0],\n [\"valueParser\", void 0],\n [\"refData\", void 0]\n ].some(\n ([prop, comparisonValue]) => doesColDefPropPreventInference(colDef, propsToCheckForInference, prop, comparisonValue)\n );\n}\nfunction getUpdatedColumnState(column, columnStateUpdates) {\n const columnState = getColumnStateFromColDef(column);\n for (const key of columnStateUpdates) {\n delete columnState[key];\n if (key === \"rowGroup\") {\n delete columnState.rowGroupIndex;\n } else if (key === \"pivot\") {\n delete columnState.pivotIndex;\n }\n }\n return columnState;\n}\n\n// packages/ag-grid-community/src/columns/columnModule.ts\nvar DataTypeModule = {\n moduleName: \"DataType\",\n version: VERSION,\n beans: [DataTypeService],\n dependsOn: [CheckboxCellRendererModule]\n};\nvar ColumnFlexModule = {\n moduleName: \"ColumnFlex\",\n version: VERSION,\n beans: [ColumnFlexService]\n};\nvar ColumnApiModule = {\n moduleName: \"ColumnApi\",\n version: VERSION,\n beans: [ColumnDefFactory],\n apiFunctions: {\n getColumnDef,\n getDisplayNameForColumn,\n getColumn,\n getColumns,\n applyColumnState,\n getColumnState,\n resetColumnState,\n isPinning,\n isPinningLeft,\n isPinningRight,\n getDisplayedColAfter,\n getDisplayedColBefore,\n setColumnsVisible,\n setColumnsPinned,\n getAllGridColumns,\n getDisplayedLeftColumns,\n getDisplayedCenterColumns,\n getDisplayedRightColumns,\n getAllDisplayedColumns,\n getAllDisplayedVirtualColumns,\n getColumnDefs\n }\n};\n\n// packages/ag-grid-community/src/columns/columnNameService.ts\nvar ColumnNameService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colNames\";\n }\n getDisplayNameForColumn(column, location, includeAggFunc = false) {\n if (!column) {\n return null;\n }\n const headerName = this.getHeaderName(column.getColDef(), column, null, null, location);\n const { aggColNameSvc } = this.beans;\n if (includeAggFunc && aggColNameSvc) {\n return aggColNameSvc.getHeaderName(column, headerName);\n }\n return headerName;\n }\n getDisplayNameForProvidedColumnGroup(columnGroup, providedColumnGroup, location) {\n const colGroupDef = providedColumnGroup?.getColGroupDef();\n if (colGroupDef) {\n return this.getHeaderName(colGroupDef, null, columnGroup, providedColumnGroup, location);\n }\n return null;\n }\n getDisplayNameForColumnGroup(columnGroup, location) {\n return this.getDisplayNameForProvidedColumnGroup(columnGroup, columnGroup.getProvidedColumnGroup(), location);\n }\n // location is where the column is going to appear, ie who is calling us\n getHeaderName(colDef, column, columnGroup, providedColumnGroup, location) {\n const headerValueGetter = colDef.headerValueGetter;\n if (headerValueGetter) {\n const params = _addGridCommonParams(this.gos, {\n colDef,\n column,\n columnGroup,\n providedColumnGroup,\n location\n });\n if (typeof headerValueGetter === \"function\") {\n return headerValueGetter(params);\n } else if (typeof headerValueGetter === \"string\") {\n return this.beans.expressionSvc?.evaluate(headerValueGetter, params) ?? null;\n }\n return \"\";\n } else if (colDef.headerName != null) {\n return colDef.headerName;\n } else if (colDef.field) {\n return _camelCaseToHumanText(colDef.field);\n }\n return \"\";\n }\n};\n\n// packages/ag-grid-community/src/columns/columnViewportService.ts\nvar ColumnViewportService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colViewport\";\n // cols in center that are in the viewport\n this.colsWithinViewport = [];\n // same as colsWithinViewport, except we always include columns with headerAutoHeight\n this.headerColsWithinViewport = [];\n // A hash key to keep track of changes in viewport columns\n this.colsWithinViewportHash = \"\";\n // all columns & groups to be rendered, index by row.\n // used by header rows to get all items to render for that row.\n this.rowsOfHeadersToRenderLeft = {};\n this.rowsOfHeadersToRenderRight = {};\n this.rowsOfHeadersToRenderCenter = {};\n this.columnsToRenderLeft = [];\n this.columnsToRenderRight = [];\n this.columnsToRenderCenter = [];\n }\n wireBeans(beans) {\n this.visibleCols = beans.visibleCols;\n this.colModel = beans.colModel;\n }\n postConstruct() {\n this.suppressColumnVirtualisation = this.gos.get(\"suppressColumnVirtualisation\");\n }\n getScrollPosition() {\n return this.scrollPosition;\n }\n setScrollPosition(scrollWidth, scrollPosition, afterScroll = false) {\n const { visibleCols } = this;\n const bodyWidthDirty = visibleCols.isBodyWidthDirty;\n const noChange = scrollWidth === this.scrollWidth && scrollPosition === this.scrollPosition && !bodyWidthDirty;\n if (noChange) {\n return;\n }\n this.scrollWidth = scrollWidth;\n this.scrollPosition = scrollPosition;\n visibleCols.isBodyWidthDirty = true;\n if (this.gos.get(\"enableRtl\")) {\n const bodyWidth = visibleCols.bodyWidth;\n this.viewportLeft = bodyWidth - scrollPosition - scrollWidth;\n this.viewportRight = bodyWidth - scrollPosition;\n } else {\n this.viewportLeft = scrollPosition;\n this.viewportRight = scrollWidth + scrollPosition;\n }\n if (this.colModel.ready) {\n this.checkViewportColumns(afterScroll);\n }\n }\n /**\n * Returns the columns that are currently rendered in the viewport.\n */\n getColumnHeadersToRender(type) {\n switch (type) {\n case \"left\":\n return this.columnsToRenderLeft;\n case \"right\":\n return this.columnsToRenderRight;\n default:\n return this.columnsToRenderCenter;\n }\n }\n /**\n * Returns the column groups that are currently rendered in the viewport at a specific header row index.\n */\n getHeadersToRender(type, depth) {\n let result;\n switch (type) {\n case \"left\":\n result = this.rowsOfHeadersToRenderLeft[depth];\n break;\n case \"right\":\n result = this.rowsOfHeadersToRenderRight[depth];\n break;\n default:\n result = this.rowsOfHeadersToRenderCenter[depth];\n break;\n }\n return result ?? [];\n }\n extractViewportColumns() {\n const displayedColumnsCenter = this.visibleCols.centerCols;\n if (this.isColumnVirtualisationSuppressed()) {\n this.colsWithinViewport = displayedColumnsCenter;\n this.headerColsWithinViewport = displayedColumnsCenter;\n } else {\n this.colsWithinViewport = displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this));\n this.headerColsWithinViewport = displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this));\n }\n }\n isColumnVirtualisationSuppressed() {\n return this.suppressColumnVirtualisation || this.viewportRight === 0;\n }\n clear() {\n this.rowsOfHeadersToRenderLeft = {};\n this.rowsOfHeadersToRenderRight = {};\n this.rowsOfHeadersToRenderCenter = {};\n this.colsWithinViewportHash = \"\";\n }\n isColumnInHeaderViewport(col) {\n if (col.isAutoHeaderHeight() || isAnyParentAutoHeaderHeight(col)) {\n return true;\n }\n return this.isColumnInRowViewport(col);\n }\n isColumnInRowViewport(col) {\n if (col.isAutoHeight()) {\n return true;\n }\n const columnLeft = col.getLeft() || 0;\n const columnRight = columnLeft + col.getActualWidth();\n const leftBounds = this.viewportLeft - 200;\n const rightBounds = this.viewportRight + 200;\n const columnToMuchLeft = columnLeft < leftBounds && columnRight < leftBounds;\n const columnToMuchRight = columnLeft > rightBounds && columnRight > rightBounds;\n return !columnToMuchLeft && !columnToMuchRight;\n }\n // used by Grid API only\n getViewportColumns() {\n const { leftCols, rightCols } = this.visibleCols;\n const res = this.colsWithinViewport.concat(leftCols).concat(rightCols);\n return res;\n }\n // + rowRenderer\n // if we are not column spanning, this just returns back the virtual centre columns,\n // however if we are column spanning, then different rows can have different virtual\n // columns, so we have to work out the list for each individual row.\n getColsWithinViewport(rowNode) {\n if (!this.colModel.colSpanActive) {\n return this.colsWithinViewport;\n }\n const emptySpaceBeforeColumn = (col) => {\n const left = col.getLeft();\n return _exists(left) && left > this.viewportLeft;\n };\n const inViewportCallback = this.isColumnVirtualisationSuppressed() ? void 0 : this.isColumnInRowViewport.bind(this);\n const { visibleCols } = this;\n const displayedColumnsCenter = visibleCols.centerCols;\n return visibleCols.getColsForRow(rowNode, displayedColumnsCenter, inViewportCallback, emptySpaceBeforeColumn);\n }\n // checks what columns are currently displayed due to column virtualisation. dispatches an event\n // if the list of columns has changed.\n // + setColumnWidth(), setViewportPosition(), setColumnDefs(), sizeColumnsToFit()\n checkViewportColumns(afterScroll = false) {\n const viewportColumnsChanged = this.extractViewport();\n if (viewportColumnsChanged) {\n this.eventSvc.dispatchEvent({\n type: \"virtualColumnsChanged\",\n afterScroll\n });\n }\n }\n calculateHeaderRows() {\n const { leftCols, rightCols } = this.visibleCols;\n this.columnsToRenderLeft = leftCols;\n this.columnsToRenderRight = rightCols;\n this.columnsToRenderCenter = this.colsWithinViewport;\n const workOutGroupsToRender = (cols) => {\n const groupsToRenderSet = /* @__PURE__ */ new Set();\n const groupsToRender = {};\n for (const col of cols) {\n let group = col.getParent();\n const skipFillers = col.isSpanHeaderHeight();\n while (group) {\n if (groupsToRenderSet.has(group)) {\n break;\n }\n const skipFillerGroup = skipFillers && group.isPadding();\n if (skipFillerGroup) {\n group = group.getParent();\n continue;\n }\n const level = group.getProvidedColumnGroup().getLevel();\n groupsToRender[level] ?? (groupsToRender[level] = []);\n groupsToRender[level].push(group);\n groupsToRenderSet.add(group);\n group = group.getParent();\n }\n }\n return groupsToRender;\n };\n this.rowsOfHeadersToRenderLeft = workOutGroupsToRender(leftCols);\n this.rowsOfHeadersToRenderRight = workOutGroupsToRender(rightCols);\n this.rowsOfHeadersToRenderCenter = workOutGroupsToRender(this.headerColsWithinViewport);\n }\n extractViewport() {\n const hashColumn = (c) => `${c.getId()}-${c.getPinned() || \"normal\"}`;\n this.extractViewportColumns();\n const newHash = this.getViewportColumns().map(hashColumn).join(\"#\");\n const changed = this.colsWithinViewportHash !== newHash;\n if (changed) {\n this.colsWithinViewportHash = newHash;\n this.calculateHeaderRows();\n }\n return changed;\n }\n};\nfunction isAnyParentAutoHeaderHeight(col) {\n while (col) {\n if (col.isAutoHeaderHeight()) {\n return true;\n }\n col = col.getParent();\n }\n return false;\n}\n\n// packages/ag-grid-community/src/components/framework/agComponentUtils.ts\nvar AgComponentUtils = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"agCompUtils\";\n }\n adaptFunction(type, jsCompFunc) {\n if (!type.cellRenderer) {\n return null;\n }\n class Adapter {\n refresh() {\n return false;\n }\n getGui() {\n return this.eGui;\n }\n init(params) {\n const callbackResult = jsCompFunc(params);\n const type2 = typeof callbackResult;\n if (type2 === \"string\" || type2 === \"number\" || type2 === \"boolean\") {\n this.eGui = _loadTemplate(\"\" + callbackResult + \"\");\n return;\n }\n if (callbackResult == null) {\n this.eGui = _createElement({ tag: \"span\" });\n return;\n }\n this.eGui = callbackResult;\n }\n }\n return Adapter;\n }\n};\n\n// packages/ag-grid-community/src/components/framework/cellRendererFunctionModule.ts\nvar CellRendererFunctionModule = {\n moduleName: \"CellRendererFunction\",\n version: VERSION,\n beans: [AgComponentUtils]\n};\n\n// packages/ag-grid-community/src/agStack/core/baseRegistry.ts\nvar BaseRegistry = class extends AgBeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"registry\";\n }\n registerDynamicBeans(dynamicBeans) {\n if (dynamicBeans) {\n this.dynamicBeans ?? (this.dynamicBeans = {});\n for (const name of Object.keys(dynamicBeans)) {\n this.dynamicBeans[name] = dynamicBeans[name];\n }\n }\n }\n createDynamicBean(name, mandatory, ...args) {\n if (!this.dynamicBeans) {\n throw new Error(this.getDynamicError(name, true));\n }\n const BeanClass = this.dynamicBeans[name];\n if (BeanClass == null) {\n if (mandatory) {\n throw new Error(this.getDynamicError(name, false));\n }\n return void 0;\n }\n return new BeanClass(...args);\n }\n};\n\n// packages/ag-grid-community/src/context/context.ts\nfunction isComponentMetaFunc(componentMeta) {\n return typeof componentMeta === \"object\" && !!componentMeta.getComp;\n}\n\n// packages/ag-grid-community/src/components/framework/registry.ts\nvar Registry = class extends BaseRegistry {\n constructor() {\n super(...arguments);\n this.agGridDefaults = {};\n this.agGridDefaultOverrides = {};\n this.jsComps = {};\n this.selectors = {};\n this.icons = {};\n }\n postConstruct() {\n const comps = this.gos.get(\"components\");\n if (comps != null) {\n for (const key of Object.keys(comps)) {\n this.jsComps[key] = comps[key];\n }\n }\n }\n registerModule(module) {\n const { icons, userComponents, dynamicBeans, selectors } = module;\n if (userComponents) {\n const registerUserComponent = (name, component, params, processParams) => {\n this.agGridDefaults[name] = component;\n if (params || processParams) {\n this.agGridDefaultOverrides[name] = { params, processParams };\n }\n };\n for (const name of Object.keys(userComponents)) {\n let comp = userComponents[name];\n if (isComponentMetaFunc(comp)) {\n comp = comp.getComp(this.beans);\n }\n if (typeof comp === \"object\") {\n const { classImp, params, processParams } = comp;\n registerUserComponent(name, classImp, params, processParams);\n } else {\n registerUserComponent(name, comp);\n }\n }\n }\n this.registerDynamicBeans(dynamicBeans);\n for (const selector of selectors ?? []) {\n this.selectors[selector.selector] = selector;\n }\n if (icons) {\n for (const name of Object.keys(icons)) {\n this.icons[name] = icons[name];\n }\n }\n }\n getUserComponent(propertyName, name) {\n const createResult = (component, componentFromFramework, params, processParams) => ({\n componentFromFramework,\n component,\n params,\n processParams\n });\n const { frameworkOverrides } = this.beans;\n const registeredViaFrameworkComp = frameworkOverrides.frameworkComponent(name, this.gos.get(\"components\"));\n if (registeredViaFrameworkComp != null) {\n return createResult(registeredViaFrameworkComp, true);\n }\n const jsComponent = this.jsComps[name];\n if (jsComponent) {\n const isFwkComp = frameworkOverrides.isFrameworkComponent(jsComponent);\n return createResult(jsComponent, isFwkComp);\n }\n const defaultComponent = this.agGridDefaults[name];\n if (defaultComponent) {\n const overrides = this.agGridDefaultOverrides[name];\n return createResult(defaultComponent, false, overrides?.params, overrides?.processParams);\n }\n this.beans.validation?.missingUserComponent(propertyName, name, this.agGridDefaults, this.jsComps);\n return null;\n }\n getSelector(name) {\n return this.selectors[name];\n }\n getIcon(name) {\n return this.icons[name];\n }\n getDynamicError(name, init) {\n if (init) {\n return _errMsg(279, { name });\n }\n return this.beans.validation?.missingDynamicBean(name) ?? _errMsg(256);\n }\n};\n\n// packages/ag-grid-community/src/ctrlsService.ts\nvar NUM_CTRLS = 23;\nvar CtrlsService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"ctrlsSvc\";\n this.params = {};\n this.ready = false;\n this.readyCallbacks = [];\n }\n postConstruct() {\n this.addEventListener(\n \"ready\",\n () => {\n this.updateReady();\n if (this.ready) {\n for (const callback of this.readyCallbacks) {\n callback(this.params);\n }\n this.readyCallbacks.length = 0;\n }\n },\n this.beans.frameworkOverrides.runWhenReadyAsync?.() ?? false\n );\n }\n updateReady() {\n const values = Object.values(this.params);\n this.ready = values.length === NUM_CTRLS && values.every((ctrl) => {\n return ctrl?.isAlive() ?? false;\n });\n }\n whenReady(caller, callback) {\n if (this.ready) {\n callback(this.params);\n } else {\n this.readyCallbacks.push(callback);\n }\n caller.addDestroyFunc(() => {\n const index = this.readyCallbacks.indexOf(callback);\n if (index >= 0) {\n this.readyCallbacks.splice(index, 1);\n }\n });\n }\n register(ctrlType, ctrl) {\n this.params[ctrlType] = ctrl;\n this.updateReady();\n if (this.ready) {\n this.dispatchLocalEvent({ type: \"ready\" });\n }\n ctrl.addDestroyFunc(() => {\n this.updateReady();\n });\n }\n get(ctrlType) {\n return this.params[ctrlType];\n }\n getGridBodyCtrl() {\n return this.params.gridBodyCtrl;\n }\n getHeaderRowContainerCtrls() {\n const { leftHeader, centerHeader, rightHeader } = this.params;\n return [leftHeader, rightHeader, centerHeader];\n }\n getHeaderRowContainerCtrl(pinned) {\n const params = this.params;\n switch (pinned) {\n case \"left\":\n return params.leftHeader;\n case \"right\":\n return params.rightHeader;\n default:\n return params.centerHeader;\n }\n }\n getScrollFeature() {\n return this.getGridBodyCtrl().scrollFeature;\n }\n};\n\n// packages/ag-grid-community/src/agStack/theming/shared/shared.css\nvar shared_default = ':where([class^=ag-]),:where([class^=ag-]):after,:where([class^=ag-]):before{box-sizing:border-box}:where([class^=ag-]):where(button){color:inherit}:where([class^=ag-]):where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}:where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-tab-guard{display:block;height:0;position:absolute;width:0}.ag-tab-guard-top{top:1px}.ag-tab-guard-bottom{bottom:1px}.ag-measurement-container{height:0;overflow:hidden;visibility:hidden;width:0}.ag-measurement-element-border{display:inline-block}.ag-measurement-element-border:before{border-left:var(--ag-internal-measurement-border);content:\"\";display:block}.ag-popup-child{top:0;z-index:5}.ag-popup-child:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);font-weight:var(--ag-font-weight);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:\"\";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled .ag-icon,[disabled] .ag-icon{opacity:.5}.ag-icon-grip.ag-disabled,.ag-icon-grip[disabled]{opacity:.35}.ag-icon-loading{animation-duration:1s;animation-iteration-count:infinite;animation-name:spin;animation-timing-function:linear}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}.ag-menu{background-color:var(--ag-menu-background-color);border:var(--ag-menu-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-menu-shadow);color:var(--ag-menu-text-color);max-height:100%;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}';\n\n// packages/ag-grid-community/src/agStack/theming/inject.ts\nvar IS_SSR = typeof window !== \"object\" || !window?.document?.fonts?.forEach;\nvar FORCE_LEGACY_THEMES = false;\nvar _injectGlobalCSS = (css, styleContainer, debugId, layer, priority, nonce, isParams = false) => {\n if (IS_SSR || FORCE_LEGACY_THEMES) {\n return;\n }\n if (layer) {\n css = `@layer ${CSS.escape(layer).replaceAll(\"\\\\.\", \".\")} { ${css} }`;\n }\n let injections = injectionState.map.get(styleContainer);\n if (!injections) {\n injections = [];\n injectionState.map.set(styleContainer, injections);\n }\n if (injections.some((i) => i.css === css)) {\n return;\n }\n const el = document.createElement(\"style\");\n if (nonce) {\n el.setAttribute(\"nonce\", nonce);\n }\n el.dataset.agCss = debugId;\n el.dataset.agCssVersion = VERSION;\n el.textContent = css;\n const newInjection = { css, el, priority, isParams };\n let insertAfter;\n for (const injection of injections) {\n if (injection.priority > priority) {\n break;\n }\n insertAfter = injection;\n }\n if (insertAfter) {\n insertAfter.el.after(el);\n const index = injections.indexOf(insertAfter);\n injections.splice(index + 1, 0, newInjection);\n } else {\n if (styleContainer.nodeName === \"STYLE\") {\n styleContainer.after(el);\n } else {\n styleContainer.insertBefore(el, styleContainer.querySelector(\":not(title, meta)\"));\n }\n injections.push(newInjection);\n }\n};\nvar _injectCoreAndModuleCSS = (styleContainer, layer, nonce, moduleCss) => {\n _injectGlobalCSS(shared_default, styleContainer, \"shared\", layer, 0, nonce);\n moduleCss?.forEach(\n (css, debugId) => css.forEach((singleCss) => _injectGlobalCSS(singleCss, styleContainer, debugId, layer, 0, nonce))\n );\n};\nvar _useParamsCss = (environment, paramsCss, paramsDebugId, styleContainer, layer, nonce) => {\n if (IS_SSR || FORCE_LEGACY_THEMES) {\n return;\n }\n const gridState = injectionState.grids.get(environment);\n if (!gridState) {\n injectionState.grids.set(environment, { styleContainer, paramsCss });\n } else {\n gridState.paramsCss = paramsCss;\n }\n removeStaleParamsCss(styleContainer);\n if (paramsCss && paramsDebugId) {\n _injectGlobalCSS(paramsCss, styleContainer, paramsDebugId, layer, 2, nonce, true);\n }\n};\nvar _unregisterInstanceUsingThemingAPI = (environment) => {\n const styleContainer = injectionState.grids.get(environment)?.styleContainer;\n if (!styleContainer) {\n return;\n }\n injectionState.grids.delete(environment);\n const containerStillInUse = Array.from(injectionState.grids.values()).some(\n (gs) => gs.styleContainer === styleContainer\n );\n if (containerStillInUse) {\n removeStaleParamsCss(styleContainer);\n } else {\n removeStaleParamsCss(styleContainer, true);\n injectionState.map.delete(styleContainer);\n }\n};\nvar removeStaleParamsCss = (styleContainer, deleteAll = false) => {\n const neededCss = /* @__PURE__ */ new Set();\n for (const gs of injectionState.grids.values()) {\n if (gs.styleContainer === styleContainer) {\n neededCss.add(gs.paramsCss);\n }\n }\n const injections = injectionState.map.get(styleContainer) ?? [];\n for (let i = injections.length - 1; i >= 0; i--) {\n if (deleteAll || injections[i].isParams && !neededCss.has(injections[i].css)) {\n injections[i].el.remove();\n injections.splice(i, 1);\n }\n }\n};\nvar getInjectionState = () => {\n const versionMap = globalThis.agStyleInjectionVersions ?? (globalThis.agStyleInjectionVersions = /* @__PURE__ */ new Map());\n let state = versionMap.get(VERSION);\n if (!state) {\n state = {\n map: /* @__PURE__ */ new WeakMap(),\n grids: /* @__PURE__ */ new Map(),\n paramsId: 0\n };\n versionMap.set(VERSION, state);\n }\n return state;\n};\nvar injectionState = getInjectionState();\n\n// packages/ag-grid-community/src/agStack/theming/partImpl.ts\nvar createPart = (args) => {\n return new PartImpl(args);\n};\nvar defaultModeName = \"$default\";\nvar partCounter = 0;\nvar PartImpl = class {\n constructor({ feature, params, modeParams = {}, css, cssImports }) {\n this.feature = feature;\n this.css = css;\n this.cssImports = cssImports;\n this.modeParams = {\n // NOTE: it's important that default is defined first, putting it\n // first in iteration order, because when merging params the default\n // params override any prior modal params, so modal params in this\n // part need to come after default params to prevent them from being\n // immediately overridden.\n [defaultModeName]: {\n ...modeParams[defaultModeName] ?? {},\n ...params ?? {}\n },\n ...modeParams\n };\n }\n use(styleContainer, layer, nonce) {\n let inject = this._inject;\n if (inject == null) {\n let { css } = this;\n if (css) {\n const className = `ag-theme-${this.feature ?? \"part\"}-${++partCounter}`;\n if (typeof css === \"function\") {\n css = css();\n }\n css = `:where(.${className}) {\n${css}\n}\n`;\n for (const cssImport of this.cssImports ?? []) {\n css = `@import url(${JSON.stringify(cssImport)});\n${css}`;\n }\n inject = { css, class: className };\n } else {\n inject = false;\n }\n this._inject = inject;\n }\n if (inject && styleContainer) {\n _injectGlobalCSS(inject.css, styleContainer, inject.class, layer, 1, nonce);\n }\n return inject ? inject.class : false;\n }\n};\n\n// packages/ag-grid-community/src/agStack/theming/themeUtils.ts\nvar kebabCase = (str) => str.replace(/[A-Z]|\\d+/g, (m) => `-${m}`).toLowerCase();\nvar paramToVariableName = (paramName) => `--ag-${kebabCase(paramName)}`;\nvar paramToVariableExpression = (paramName) => `var(${paramToVariableName(paramName)})`;\nvar clamp = (value, min, max) => Math.max(min, Math.min(max, value));\nvar memoize = (fn) => {\n const values = /* @__PURE__ */ new Map();\n return (a) => {\n const key = a;\n if (!values.has(key)) {\n values.set(key, fn(a));\n }\n return values.get(key);\n };\n};\nvar accentMix = (mix) => ({ ref: \"accentColor\", mix });\nvar foregroundMix = (mix) => ({ ref: \"foregroundColor\", mix });\nvar foregroundBackgroundMix = (mix) => ({\n ref: \"foregroundColor\",\n mix,\n onto: \"backgroundColor\"\n});\nvar foregroundHeaderBackgroundMix = (mix) => ({\n ref: \"foregroundColor\",\n mix,\n onto: \"headerBackgroundColor\"\n});\nvar backgroundColor = { ref: \"backgroundColor\" };\nvar foregroundColor = { ref: \"foregroundColor\" };\nvar accentColor = { ref: \"accentColor\" };\n\n// packages/ag-grid-community/src/agStack/theming/shared/shared-css.ts\nvar defaultLightColorSchemeParams = {\n backgroundColor: \"#fff\",\n foregroundColor: \"#181d1f\",\n borderColor: foregroundMix(0.15),\n chromeBackgroundColor: foregroundBackgroundMix(0.02),\n browserColorScheme: \"light\"\n};\nvar sharedDefaults = {\n ...defaultLightColorSchemeParams,\n textColor: foregroundColor,\n accentColor: \"#2196f3\",\n invalidColor: \"#e02525\",\n fontFamily: [\n \"-apple-system\",\n \"BlinkMacSystemFont\",\n \"Segoe UI\",\n \"Roboto\",\n \"Oxygen-Sans\",\n \"Ubuntu\",\n \"Cantarell\",\n \"Helvetica Neue\",\n \"sans-serif\"\n ],\n subtleTextColor: {\n ref: \"textColor\",\n mix: 0.5\n },\n borderWidth: 1,\n borderRadius: 4,\n spacing: 8,\n fontSize: 14,\n fontWeight: \"inherit\",\n focusShadow: {\n spread: 3,\n color: accentMix(0.5)\n },\n focusErrorShadow: {\n spread: 3,\n color: {\n ref: \"invalidColor\",\n onto: \"backgroundColor\",\n mix: 0.5\n }\n },\n popupShadow: \"0 0 16px #00000026\",\n cardShadow: \"0 1px 4px 1px #00000018\",\n dropdownShadow: { ref: \"cardShadow\" },\n listItemHeight: {\n calc: \"max(iconSize, dataFontSize) + widgetVerticalSpacing\"\n },\n dragAndDropImageBackgroundColor: backgroundColor,\n dragAndDropImageBorder: true,\n dragAndDropImageNotAllowedBorder: {\n color: {\n ref: \"invalidColor\",\n onto: \"dragAndDropImageBackgroundColor\",\n mix: 0.5\n }\n },\n dragAndDropImageShadow: {\n ref: \"popupShadow\"\n },\n iconSize: 16,\n iconColor: \"inherit\",\n toggleButtonWidth: 28,\n toggleButtonHeight: 18,\n toggleButtonOnBackgroundColor: accentColor,\n toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.3),\n toggleButtonSwitchBackgroundColor: backgroundColor,\n toggleButtonSwitchInset: 2,\n tooltipBackgroundColor: {\n ref: \"chromeBackgroundColor\"\n },\n tooltipErrorBackgroundColor: {\n ref: \"invalidColor\",\n onto: \"backgroundColor\",\n mix: 0.1\n },\n tooltipTextColor: {\n ref: \"textColor\"\n },\n tooltipErrorTextColor: {\n ref: \"invalidColor\"\n },\n tooltipBorder: true,\n tooltipErrorBorder: {\n color: {\n ref: \"invalidColor\",\n onto: \"backgroundColor\",\n mix: 0.25\n }\n },\n panelBackgroundColor: backgroundColor,\n panelTitleBarHeight: { ref: \"headerHeight\" },\n panelTitleBarBackgroundColor: {\n ref: \"headerBackgroundColor\"\n },\n panelTitleBarIconColor: {\n ref: \"headerTextColor\"\n },\n panelTitleBarTextColor: {\n ref: \"headerTextColor\"\n },\n panelTitleBarFontFamily: {\n ref: \"headerFontFamily\"\n },\n panelTitleBarFontSize: {\n ref: \"headerFontSize\"\n },\n panelTitleBarFontWeight: {\n ref: \"headerFontWeight\"\n },\n panelTitleBarBorder: true,\n dialogShadow: {\n ref: \"popupShadow\"\n },\n dialogBorder: {\n color: foregroundMix(0.2)\n },\n widgetContainerHorizontalPadding: {\n calc: \"spacing * 1.5\"\n },\n widgetContainerVerticalPadding: {\n calc: \"spacing * 1.5\"\n },\n widgetHorizontalSpacing: {\n calc: \"spacing * 1.5\"\n },\n widgetVerticalSpacing: {\n ref: \"spacing\"\n },\n dataFontSize: {\n ref: \"fontSize\"\n },\n headerBackgroundColor: {\n ref: \"chromeBackgroundColor\"\n },\n headerFontFamily: {\n ref: \"fontFamily\"\n },\n headerFontSize: {\n ref: \"fontSize\"\n },\n headerFontWeight: 500,\n headerTextColor: {\n ref: \"textColor\"\n },\n headerHeight: {\n calc: \"max(iconSize, dataFontSize) + spacing * 4 * headerVerticalPaddingScale\"\n },\n headerVerticalPaddingScale: 1,\n menuBorder: {\n color: foregroundMix(0.2)\n },\n menuBackgroundColor: foregroundBackgroundMix(0.03),\n menuTextColor: foregroundBackgroundMix(0.95),\n menuShadow: {\n ref: \"popupShadow\"\n },\n menuSeparatorColor: {\n ref: \"borderColor\"\n }\n};\n\n// packages/ag-grid-community/src/agStack/theming/themeTypeUtils.ts\nvar paramTypes = [\n \"colorScheme\",\n \"color\",\n \"length\",\n \"scale\",\n \"borderStyle\",\n \"border\",\n \"shadow\",\n \"image\",\n \"fontFamily\",\n \"fontWeight\",\n \"duration\"\n];\nvar getParamType = memoize((param) => {\n param = param.toLowerCase();\n return paramTypes.find((type) => param.endsWith(type.toLowerCase())) ?? \"length\";\n});\nvar literalToCSS = (value) => {\n if (typeof value === \"object\" && value?.ref) {\n return paramToVariableExpression(value.ref);\n }\n if (typeof value === \"string\") {\n return value;\n }\n if (typeof value === \"number\") {\n return String(value);\n }\n return false;\n};\nvar colorValueToCss = (value) => {\n if (typeof value === \"string\") {\n return value;\n }\n if (typeof value === \"object\" && value && \"ref\" in value) {\n const colorExpr = paramToVariableExpression(value.ref);\n if (value.mix == null) {\n return colorExpr;\n }\n const backgroundExpr = value.onto ? paramToVariableExpression(value.onto) : \"transparent\";\n return `color-mix(in srgb, ${backgroundExpr}, ${colorExpr} ${clamp(value.mix * 100, 0, 100)}%)`;\n }\n return false;\n};\nvar colorSchemeValueToCss = literalToCSS;\nvar lengthValueToCss = (value) => {\n if (typeof value === \"string\") {\n return value;\n }\n if (typeof value === \"number\") {\n return `${value}px`;\n }\n if (typeof value === \"object\" && value && \"calc\" in value) {\n const valueWithSpaces = value.calc.replace(/ ?[*/+] ?/g, \" $& \");\n return `calc(${valueWithSpaces.replace(/-?\\b[a-z][a-z0-9]*\\b(?![-(])/gi, (p) => p[0] === \"-\" ? p : \" \" + paramToVariableExpression(p) + \" \")})`;\n }\n if (typeof value === \"object\" && value && \"ref\" in value) {\n return paramToVariableExpression(value.ref);\n }\n return false;\n};\nvar scaleValueToCss = literalToCSS;\nvar borderValueToCss = (value, param) => {\n if (typeof value === \"string\") {\n return value;\n }\n if (value === true) {\n return borderValueToCss({}, param);\n }\n if (value === false) {\n return param === \"columnBorder\" ? borderValueToCss({ color: \"transparent\" }, param) : \"none\";\n }\n if (typeof value === \"object\" && value && \"ref\" in value) {\n return paramToVariableExpression(value.ref);\n }\n return borderStyleValueToCss(value.style ?? \"solid\") + \" \" + lengthValueToCss(value.width ?? { ref: \"borderWidth\" }) + \" \" + colorValueToCss(value.color ?? { ref: \"borderColor\" });\n};\nvar shadowValueParamsToCss = (value) => {\n return [\n lengthValueToCss(value.offsetX ?? 0),\n lengthValueToCss(value.offsetY ?? 0),\n lengthValueToCss(value.radius ?? 0),\n lengthValueToCss(value.spread ?? 0),\n colorValueToCss(value.color ?? { ref: \"foregroundColor\" }),\n ...value.inset ? [\"inset\"] : []\n ].join(\" \");\n};\nvar shadowValueToCss = (value) => {\n if (typeof value === \"string\") {\n return value;\n }\n if (value === false) {\n return \"none\";\n }\n if (typeof value === \"object\" && value && \"ref\" in value) {\n return paramToVariableExpression(value.ref);\n }\n if (Array.isArray(value)) {\n return value.map(shadowValueParamsToCss).join(\", \");\n }\n return shadowValueParamsToCss(value);\n};\nvar borderStyleValueToCss = literalToCSS;\nvar fontFamilyValueToCss = (value) => {\n if (typeof value === \"string\") {\n return value.includes(\",\") ? value : quoteUnsafeChars(value);\n }\n if (typeof value === \"object\" && value && \"googleFont\" in value) {\n return fontFamilyValueToCss(value.googleFont);\n }\n if (typeof value === \"object\" && value && \"ref\" in value) {\n return paramToVariableExpression(value.ref);\n }\n if (Array.isArray(value)) {\n return value.map((font) => {\n if (typeof font === \"object\" && \"googleFont\" in font) {\n font = font.googleFont;\n }\n return quoteUnsafeChars(font);\n }).join(\", \");\n }\n return false;\n};\nvar quoteUnsafeChars = (font) => (\n // don't quote var() expressions or quote safe identifier names, so that\n // people can specify fonts like sans-serif which are keywords not strings,\n // or var(--my-var)\n /^[\\w-]+$|\\w\\(/.test(font) ? font : JSON.stringify(font)\n);\nvar fontWeightValueToCss = literalToCSS;\nvar imageValueToCss = (value) => {\n if (typeof value === \"string\") {\n return value;\n }\n if (typeof value === \"object\" && value && \"url\" in value) {\n return `url(${JSON.stringify(value.url)})`;\n }\n if (typeof value === \"object\" && value && \"svg\" in value) {\n return imageValueToCss({ url: `data:image/svg+xml,${encodeURIComponent(value.svg)}` });\n }\n if (typeof value === \"object\" && value && \"ref\" in value) {\n return paramToVariableExpression(value.ref);\n }\n return false;\n};\nvar durationValueToCss = (value, param, themeLogger) => {\n if (typeof value === \"string\") {\n return value;\n }\n if (typeof value === \"number\") {\n if (value >= 10) {\n themeLogger?.warn(104, { value, param });\n }\n return `${value}s`;\n }\n if (typeof value === \"object\" && value && \"ref\" in value) {\n return paramToVariableExpression(value.ref);\n }\n return false;\n};\nvar paramValidators = {\n color: colorValueToCss,\n colorScheme: colorSchemeValueToCss,\n length: lengthValueToCss,\n scale: scaleValueToCss,\n border: borderValueToCss,\n borderStyle: borderStyleValueToCss,\n shadow: shadowValueToCss,\n image: imageValueToCss,\n fontFamily: fontFamilyValueToCss,\n fontWeight: fontWeightValueToCss,\n duration: durationValueToCss\n};\nvar paramValueToCss = (param, value, themeLogger) => {\n const type = getParamType(param);\n return paramValidators[type](value, param, themeLogger);\n};\n\n// packages/ag-grid-community/src/agStack/theming/themeImpl.ts\nvar _asThemeImpl = (theme) => {\n if (!(theme instanceof ThemeImpl)) {\n throw new Error(\"theme is not an object created by createTheme\");\n }\n return theme;\n};\nvar createSharedTheme = (themeLogger, overridePrefix) => new ThemeImpl({ themeLogger, overridePrefix });\nvar ThemeImpl = class _ThemeImpl {\n constructor(params, parts = []) {\n this.params = params;\n this.parts = parts;\n }\n withPart(part) {\n if (typeof part === \"function\") {\n part = part();\n }\n if (!(part instanceof PartImpl)) {\n this.params.themeLogger.preInitErr(259, \"Invalid part\", { part });\n return this;\n }\n return new _ThemeImpl(this.params, [...this.parts, part]);\n }\n withoutPart(feature) {\n return this.withPart(createPart({ feature }));\n }\n withParams(params, mode = defaultModeName) {\n return this.withPart(\n createPart({\n modeParams: { [mode]: params }\n })\n );\n }\n _startUse({ styleContainer, cssLayer, nonce, loadThemeGoogleFonts, moduleCss }) {\n if (IS_SSR) {\n return;\n }\n if (FORCE_LEGACY_THEMES) {\n return;\n }\n uninstallLegacyCSS();\n _injectCoreAndModuleCSS(styleContainer, cssLayer, nonce, moduleCss);\n const googleFontsUsed = getGoogleFontsUsed(this);\n if (googleFontsUsed.length > 0) {\n for (const googleFont of googleFontsUsed) {\n if (loadThemeGoogleFonts) {\n loadGoogleFont(googleFont, nonce);\n }\n }\n }\n for (const part of this.parts) {\n part.use(styleContainer, cssLayer, nonce);\n }\n }\n _getCssClass() {\n if (FORCE_LEGACY_THEMES) {\n return \"ag-theme-quartz\";\n }\n return this._cssClassCache ?? (this._cssClassCache = deduplicatePartsByFeature(this.parts).map((part) => part.use(void 0, void 0, void 0)).filter(Boolean).concat(this._getParamsClassName()).join(\" \"));\n }\n _getParamsClassName() {\n return this._paramsClassName ?? (this._paramsClassName = `ag-theme-params-${++getInjectionState().paramsId}`);\n }\n _getModeParams() {\n let paramsCache = this._paramsCache;\n if (!paramsCache) {\n const mergedModeParams = {\n // NOTE: defining the default mode here is important, it ensures\n // that the default mode is first in iteration order, which puts\n // it first in outputted CSS, allowing other modes to override it\n [defaultModeName]: { ...sharedDefaults }\n };\n for (const part of deduplicatePartsByFeature(this.parts)) {\n for (const partMode of Object.keys(part.modeParams)) {\n const partParams = part.modeParams[partMode];\n if (partParams) {\n const mergedParams = mergedModeParams[partMode] ?? (mergedModeParams[partMode] = {});\n const partParamNames = /* @__PURE__ */ new Set();\n for (const partParamName of Object.keys(partParams)) {\n const partParamValue = partParams[partParamName];\n if (partParamValue !== void 0) {\n mergedParams[partParamName] = partParamValue;\n partParamNames.add(partParamName);\n }\n }\n if (partMode === defaultModeName) {\n for (const mergedMode of Object.keys(mergedModeParams)) {\n const mergedParams2 = mergedModeParams[mergedMode];\n if (mergedMode !== defaultModeName) {\n for (const partParamName of partParamNames) {\n delete mergedParams2[partParamName];\n }\n }\n }\n }\n }\n }\n }\n this._paramsCache = paramsCache = mergedModeParams;\n }\n return paramsCache;\n }\n _getParamsCss() {\n if (!this._paramsCssCache) {\n let variablesCss = \"\";\n let inheritanceCss = \"\";\n const modeParams = this._getModeParams();\n const { overridePrefix, themeLogger } = this.params;\n const cssOverridePrefix = overridePrefix ? `--ag-${overridePrefix}-` : void 0;\n for (const mode of Object.keys(modeParams)) {\n const params = modeParams[mode];\n if (mode !== defaultModeName) {\n const escapedMode = typeof CSS === \"object\" ? CSS.escape(mode) : mode;\n const wrapPrefix = `:where([data-ag-theme-mode=\"${escapedMode}\"]) & {\n`;\n variablesCss += wrapPrefix;\n inheritanceCss += wrapPrefix;\n }\n for (const key of Object.keys(params).sort()) {\n const value = params[key];\n const cssValue = paramValueToCss(key, value, themeLogger);\n if (cssValue === false) {\n themeLogger.error(107, { key, value });\n } else {\n const cssName = paramToVariableName(key);\n const overrideName = cssOverridePrefix ? cssName.replace(\"--ag-\", cssOverridePrefix) : cssName;\n const inheritedName = cssName.replace(\"--ag-\", \"--ag-inherited-\");\n variablesCss += `\t${cssName}: var(${inheritedName}, ${cssValue});\n`;\n inheritanceCss += `\t${inheritedName}: var(${overrideName});\n`;\n }\n }\n if (mode !== defaultModeName) {\n variablesCss += \"}\\n\";\n inheritanceCss += \"}\\n\";\n }\n }\n const selectorPlaceholder = `:where(.${this._getParamsClassName()})`;\n let css = `${selectorPlaceholder} {\n${variablesCss}}\n`;\n css += `:has(> ${selectorPlaceholder}):not(${selectorPlaceholder}) {\n${inheritanceCss}}\n`;\n this._paramsCssCache = css;\n }\n return this._paramsCssCache;\n }\n};\nvar deduplicatePartsByFeature = (parts) => {\n const lastPartByFeature = /* @__PURE__ */ new Map();\n for (const part of parts) {\n lastPartByFeature.set(part.feature, part);\n }\n const result = [];\n for (const part of parts) {\n if (!part.feature || lastPartByFeature.get(part.feature) === part) {\n result.push(part);\n }\n }\n return result;\n};\nvar getGoogleFontsUsed = (theme) => {\n const googleFontsUsed = /* @__PURE__ */ new Set();\n const visitParamValue = (paramValue) => {\n if (Array.isArray(paramValue)) {\n paramValue.forEach(visitParamValue);\n } else {\n const googleFont = paramValue?.googleFont;\n if (typeof googleFont === \"string\") {\n googleFontsUsed.add(googleFont);\n }\n }\n };\n const allModeValues = Object.values(theme._getModeParams());\n const allValues = allModeValues.flatMap((mv) => Object.values(mv));\n allValues.forEach(visitParamValue);\n return Array.from(googleFontsUsed).sort();\n};\nvar uninstalledLegacyCSS = false;\nvar uninstallLegacyCSS = () => {\n if (uninstalledLegacyCSS) {\n return;\n }\n uninstalledLegacyCSS = true;\n for (const style of Array.from(document.head.querySelectorAll('style[data-ag-scope=\"legacy\"]'))) {\n style.remove();\n }\n};\nvar loadGoogleFont = async (font, nonce) => {\n const css = `@import url('https://${googleFontsDomain}/css2?family=${encodeURIComponent(font)}:wght@100;200;300;400;500;600;700;800;900&display=swap');\n`;\n _injectGlobalCSS(css, document.head, `googleFont:${font}`, void 0, 0, nonce);\n};\nvar googleFontsDomain = \"fonts.googleapis.com\";\n\n// packages/ag-grid-community/src/agStack/core/baseEnvironment.ts\nvar LIST_ITEM_HEIGHT = {\n changeKey: \"listItemHeight\",\n type: \"length\",\n defaultValue: 24\n};\nvar BaseEnvironment = class extends AgBeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"environment\";\n this.sizeEls = /* @__PURE__ */ new Map();\n this.lastKnownValues = /* @__PURE__ */ new Map();\n this.sizesMeasured = false;\n this.globalCSS = [];\n }\n wireBeans(beans) {\n this.eRootDiv = beans.eRootDiv;\n }\n postConstruct() {\n const { gos, eRootDiv } = this;\n gos.setInstanceDomData(eRootDiv);\n const themeStyleContainer = gos.get(\"themeStyleContainer\");\n const hasShadowRootGlobal = typeof ShadowRoot !== \"undefined\";\n const isShadowRoot = hasShadowRootGlobal && eRootDiv.getRootNode() instanceof ShadowRoot;\n this.eStyleContainer = (typeof themeStyleContainer === \"function\" ? themeStyleContainer() : themeStyleContainer) ?? (isShadowRoot ? eRootDiv : document.head);\n if (!themeStyleContainer && !isShadowRoot && hasShadowRootGlobal) {\n warnOnAttachToShadowRoot(eRootDiv, this.shadowRootError.bind(this), this.addDestroyFunc.bind(this));\n }\n this.cssLayer = gos.get(\"themeCssLayer\");\n this.styleNonce = gos.get(\"styleNonce\");\n this.addManagedPropertyListener(\"theme\", () => this.handleThemeChange());\n this.handleThemeChange();\n this.getSizeEl(LIST_ITEM_HEIGHT);\n this.initVariables();\n this.addDestroyFunc(() => _unregisterInstanceUsingThemingAPI(this));\n this.mutationObserver = new MutationObserver(() => {\n this.fireStylesChangedEvent(\"theme\");\n });\n this.addDestroyFunc(() => this.mutationObserver.disconnect());\n }\n applyThemeClasses(el, extraClasses = []) {\n const { theme } = this;\n const themeClass = theme ? theme._getCssClass() : this.applyLegacyThemeClasses();\n for (const className of Array.from(el.classList)) {\n if (className.startsWith(\"ag-theme-\")) {\n el.classList.remove(className);\n }\n }\n if (themeClass) {\n const oldClass = el.className;\n el.className = `${oldClass}${oldClass ? \" \" : \"\"}${themeClass}${extraClasses?.length ? \" \" + extraClasses.join(\" \") : \"\"}`;\n }\n }\n applyLegacyThemeClasses() {\n let themeClass = \"\";\n this.mutationObserver.disconnect();\n let node = this.eRootDiv;\n while (node) {\n let isThemeEl = false;\n for (const className of Array.from(node.classList)) {\n if (className.startsWith(\"ag-theme-\")) {\n isThemeEl = true;\n themeClass = themeClass ? `${themeClass} ${className}` : className;\n }\n }\n if (isThemeEl) {\n this.mutationObserver.observe(node, {\n attributes: true,\n attributeFilter: [\"class\"]\n });\n }\n node = node.parentElement;\n }\n return themeClass;\n }\n addGlobalCSS(css, debugId) {\n if (this.theme) {\n _injectGlobalCSS(css, this.eStyleContainer, debugId, this.cssLayer, 0, this.styleNonce);\n } else {\n this.globalCSS.push([css, debugId]);\n }\n }\n getDefaultListItemHeight() {\n return this.getCSSVariablePixelValue(LIST_ITEM_HEIGHT);\n }\n getCSSVariablePixelValue(variable) {\n const cached = this.lastKnownValues.get(variable);\n if (cached != null) {\n return cached;\n }\n const measurement = this.measureSizeEl(variable);\n if (measurement === \"detached\" || measurement === \"no-styles\") {\n if (variable.cacheDefault) {\n this.lastKnownValues.set(variable, variable.defaultValue);\n }\n return variable.defaultValue;\n }\n this.lastKnownValues.set(variable, measurement);\n return measurement;\n }\n measureSizeEl(variable) {\n const sizeEl = this.getSizeEl(variable);\n if (sizeEl.offsetParent == null) {\n return \"detached\";\n }\n const newSize = sizeEl.offsetWidth;\n if (newSize === NO_VALUE_SENTINEL) {\n return \"no-styles\";\n }\n this.sizesMeasured = true;\n return newSize;\n }\n getMeasurementContainer() {\n let container = this.eMeasurementContainer;\n if (!container) {\n container = this.eMeasurementContainer = _createAgElement({ tag: \"div\", cls: \"ag-measurement-container\" });\n this.eRootDiv.appendChild(container);\n }\n return container;\n }\n getSizeEl(variable) {\n let sizeEl = this.sizeEls.get(variable);\n if (sizeEl) {\n return sizeEl;\n }\n const container = this.getMeasurementContainer();\n sizeEl = _createAgElement({ tag: \"div\" });\n const cssName = this.setSizeElStyles(sizeEl, variable);\n container.appendChild(sizeEl);\n this.sizeEls.set(variable, sizeEl);\n const { type, noWarn } = variable;\n if (type !== \"length\" && type !== \"border\") {\n return sizeEl;\n }\n let lastMeasurement = this.measureSizeEl(variable);\n if (lastMeasurement === \"no-styles\" && !noWarn) {\n this.varError(cssName, variable.defaultValue);\n }\n const unsubscribe = _observeResize(this.beans, sizeEl, () => {\n const newMeasurement = this.measureSizeEl(variable);\n if (newMeasurement === \"detached\" || newMeasurement === \"no-styles\") {\n return;\n }\n this.lastKnownValues.set(variable, newMeasurement);\n if (newMeasurement !== lastMeasurement) {\n lastMeasurement = newMeasurement;\n this.fireStylesChangedEvent(variable.changeKey);\n }\n });\n this.addDestroyFunc(() => unsubscribe());\n return sizeEl;\n }\n setSizeElStyles(sizeEl, variable) {\n const { changeKey, type } = variable;\n let cssName = paramToVariableName(changeKey);\n if (type === \"border\") {\n if (cssName.endsWith(\"-width\")) {\n cssName = cssName.slice(0, -6);\n }\n sizeEl.className = \"ag-measurement-element-border\";\n sizeEl.style.setProperty(\n \"--ag-internal-measurement-border\",\n `var(${cssName}, solid ${NO_VALUE_SENTINEL}px)`\n );\n } else {\n sizeEl.style.width = `var(${cssName}, ${NO_VALUE_SENTINEL}px)`;\n }\n return cssName;\n }\n handleThemeChange() {\n const { gos, theme: oldTheme } = this;\n const themeProperty = gos.get(\"theme\");\n let newTheme;\n if (themeProperty === \"legacy\") {\n newTheme = void 0;\n } else {\n const themeOrDefault = themeProperty ?? this.getDefaultTheme();\n if (themeOrDefault instanceof ThemeImpl) {\n newTheme = themeOrDefault;\n } else {\n this.themeError(themeOrDefault);\n }\n }\n if (newTheme !== oldTheme) {\n this.handleNewTheme(newTheme);\n }\n this.postProcessThemeChange(newTheme, themeProperty);\n }\n handleNewTheme(newTheme) {\n const { gos, eRootDiv, globalCSS } = this;\n const additionalCss = this.getAdditionalCss();\n if (newTheme) {\n _injectCoreAndModuleCSS(this.eStyleContainer, this.cssLayer, this.styleNonce, additionalCss);\n for (const [css, debugId] of globalCSS) {\n _injectGlobalCSS(css, this.eStyleContainer, debugId, this.cssLayer, 0, this.styleNonce);\n }\n globalCSS.length = 0;\n }\n this.theme = newTheme;\n newTheme?._startUse({\n loadThemeGoogleFonts: gos.get(\"loadThemeGoogleFonts\"),\n styleContainer: this.eStyleContainer,\n cssLayer: this.cssLayer,\n nonce: this.styleNonce,\n moduleCss: additionalCss\n });\n _useParamsCss(\n this,\n newTheme?._getParamsCss() ?? null,\n newTheme?._getParamsClassName() ?? null,\n this.eStyleContainer,\n this.cssLayer,\n this.styleNonce\n );\n this.applyThemeClasses(eRootDiv);\n this.fireStylesChangedEvent(\"theme\");\n }\n fireStylesChangedEvent(change) {\n this.eventSvc.dispatchEvent({\n type: \"stylesChanged\",\n [`${change}Changed`]: true\n });\n }\n};\nvar NO_VALUE_SENTINEL = 15538;\nvar warnOnAttachToShadowRoot = (el, errorCallback, onDestroy) => {\n let retries = 60;\n const interval = setInterval(() => {\n if (typeof ShadowRoot !== \"undefined\" && el.getRootNode() instanceof ShadowRoot) {\n errorCallback();\n clearInterval(interval);\n }\n if (el.isConnected || --retries < 0) {\n clearInterval(interval);\n }\n }, 1e3);\n onDestroy(() => clearInterval(interval));\n};\n\n// packages/ag-grid-community/src/theming/core/core.css\nvar core_default = '.ag-aria-description-container{border:0;z-index:9999;clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.ag-unselectable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-selectable{-webkit-user-select:text;-moz-user-select:text;user-select:text}.ag-shake-left-to-right{animation-direction:alternate;animation-duration:.2s;animation-iteration-count:infinite;animation-name:ag-shake-left-to-right}@keyframes ag-shake-left-to-right{0%{padding-left:6px;padding-right:2px}to{padding-left:2px;padding-right:6px}}.ag-body-horizontal-scroll-viewport,.ag-body-vertical-scroll-viewport,.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:hidden;position:relative}.ag-viewport{position:relative}.ag-spanning-container{position:absolute;top:0;z-index:1}.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{overflow-x:auto;-ms-overflow-style:none!important;scrollbar-width:none!important}.ag-body-viewport::-webkit-scrollbar,.ag-center-cols-viewport::-webkit-scrollbar,.ag-floating-bottom-viewport::-webkit-scrollbar,.ag-floating-top-viewport::-webkit-scrollbar,.ag-header-viewport::-webkit-scrollbar,.ag-sticky-bottom-viewport::-webkit-scrollbar,.ag-sticky-top-viewport::-webkit-scrollbar{display:none!important}.ag-body-viewport{display:flex;overflow-x:hidden;&:where(.ag-layout-normal){overflow-y:auto;-webkit-overflow-scrolling:touch}}.ag-floating-bottom-container,.ag-floating-top-container,.ag-sticky-bottom-container,.ag-sticky-top-container{min-height:1px}.ag-center-cols-viewport{min-height:100%;width:100%}.ag-body-horizontal-scroll-viewport{overflow-x:scroll}.ag-body-vertical-scroll-viewport{overflow-y:scroll}.ag-body-container,.ag-body-horizontal-scroll-container,.ag-body-vertical-scroll-container,.ag-center-cols-container,.ag-floating-bottom-container,.ag-floating-bottom-full-width-container,.ag-floating-top-container,.ag-full-width-container,.ag-header-container,.ag-pinned-left-cols-container,.ag-pinned-left-sticky-bottom,.ag-pinned-right-cols-container,.ag-pinned-right-sticky-bottom,.ag-sticky-bottom-container,.ag-sticky-top-container{position:relative}.ag-floating-bottom-container,.ag-floating-top-container,.ag-header-container,.ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top,.ag-sticky-bottom-container,.ag-sticky-top-container{height:100%;white-space:nowrap}.ag-center-cols-container,.ag-pinned-right-cols-container{display:block}.ag-body-horizontal-scroll-container{height:100%}.ag-body-vertical-scroll-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container,.ag-full-width-container,.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{pointer-events:none;position:absolute;top:0}:where(.ag-ltr) .ag-floating-bottom-full-width-container,:where(.ag-ltr) .ag-floating-top-full-width-container,:where(.ag-ltr) .ag-full-width-container,:where(.ag-ltr) .ag-sticky-bottom-full-width-container,:where(.ag-ltr) .ag-sticky-top-full-width-container{left:0}:where(.ag-rtl) .ag-floating-bottom-full-width-container,:where(.ag-rtl) .ag-floating-top-full-width-container,:where(.ag-rtl) .ag-full-width-container,:where(.ag-rtl) .ag-sticky-bottom-full-width-container,:where(.ag-rtl) .ag-sticky-top-full-width-container{right:0}.ag-full-width-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container{display:inline-block;height:100%;overflow:hidden;width:100%}.ag-body{display:flex;flex:1 1 auto;flex-direction:row!important;min-height:0;position:relative}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:flex;min-height:0;min-width:0;position:relative;&:where(.ag-scrollbar-invisible){bottom:0;position:absolute;&:where(.ag-apple-scrollbar){opacity:0;transition:opacity .4s;visibility:hidden;&:where(.ag-scrollbar-active),&:where(.ag-scrollbar-scrolling){opacity:1;visibility:visible}}}}.ag-body-horizontal-scroll{width:100%;&:where(.ag-scrollbar-invisible){left:0;right:0}}.ag-body-vertical-scroll{height:100%;&:where(.ag-scrollbar-invisible){top:0;z-index:10}}:where(.ag-ltr) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){right:0}}:where(.ag-rtl) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){left:0}}.ag-force-vertical-scroll{overflow-y:scroll!important}.ag-horizontal-left-spacer,.ag-horizontal-right-spacer{height:100%;min-width:0;overflow-x:scroll;&:where(.ag-scroller-corner){overflow-x:hidden}}:where(.ag-row-animation) .ag-row{transition:transform .4s,top .4s,opacity .2s;&:where(.ag-after-created){transition:transform .4s,top .4s,height .4s,opacity .2s}}:where(.ag-row-animation.ag-prevent-animation) .ag-row{transition:none!important;&:where(.ag-row.ag-after-created){transition:none!important}}:where(.ag-row-no-animation) .ag-row{transition:none}.ag-row-loading{align-items:center;display:flex}.ag-row-position-absolute{position:absolute}.ag-row-position-relative{position:relative}.ag-full-width-row{overflow:hidden;pointer-events:all}.ag-row-inline-editing{z-index:1}.ag-row-dragging{z-index:2}.ag-stub-cell{align-items:center;display:flex}.ag-cell{display:inline-block;height:100%;position:absolute;white-space:nowrap;&:focus-visible{box-shadow:none}}.ag-cell-value{flex:1 1 auto}.ag-cell-value:not(.ag-allow-overflow),.ag-group-value{overflow:hidden;text-overflow:ellipsis}.ag-cell-wrap-text{white-space:normal;word-break:break-word}:where(.ag-cell) .ag-icon{display:inline-block;vertical-align:middle}.ag-floating-top{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-top:not(.ag-invisible)){border-bottom:var(--ag-pinned-row-border)}.ag-floating-bottom{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-bottom:not(.ag-invisible)){border-top:var(--ag-pinned-row-border)}.ag-sticky-bottom,.ag-sticky-top{background-color:var(--ag-data-background-color);display:flex;height:0;overflow:hidden;position:absolute;width:100%;z-index:1}.ag-sticky-bottom{box-sizing:content-box!important;:where(.ag-pinned-left-sticky-bottom),:where(.ag-pinned-right-sticky-bottom),:where(.ag-sticky-bottom-container){border-top:var(--ag-row-border);box-sizing:border-box}}.ag-opacity-zero{opacity:0!important}.ag-cell-label-container{align-items:center;display:flex;flex-direction:row-reverse;height:100%;justify-content:space-between;width:100%}:where(.ag-right-aligned-header){.ag-cell-label-container{flex-direction:row}.ag-header-cell-text{text-align:end}}.ag-column-group-icons{display:block;:where(.ag-column-group-closed-icon),:where(.ag-column-group-opened-icon){cursor:pointer}}:where(.ag-ltr){direction:ltr;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row}}:where(.ag-rtl){direction:rtl;text-align:right;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row-reverse}.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{display:block}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(180deg)}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(-180deg)}}:where(.ag-ltr) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-left:var(--ag-row-group-indent-size)}:where(.ag-rtl) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-right:var(--ag-row-group-indent-size)}:where(.ag-ltr) .ag-row-group-leaf-indent{margin-left:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}:where(.ag-rtl) .ag-row-group-leaf-indent{margin-right:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}.ag-value-change-delta{padding:0 2px}.ag-value-change-delta-up{color:var(--ag-value-change-delta-up-color)}.ag-value-change-delta-down{color:var(--ag-value-change-delta-down-color)}.ag-value-change-value{background-color:transparent;border-radius:1px;padding-left:1px;padding-right:1px;transition:background-color 1s}.ag-value-change-value-highlight{background-color:var(--ag-value-change-value-highlight-background-color);transition:background-color .1s}.ag-cell-data-changed{background-color:var(--ag-value-change-value-highlight-background-color)!important}.ag-cell-data-changed-animation{background-color:transparent}.ag-cell-highlight{background-color:var(--ag-range-selection-highlight-color)!important}.ag-row,.ag-spanned-row{color:var(--ag-cell-text-color);font-family:var(--ag-cell-font-family);font-size:var(--ag-cell-font-size);font-weight:var(--ag-cell-font-weight);white-space:nowrap;--ag-internal-content-line-height:calc(min(var(--ag-row-height), var(--ag-line-height, 1000px)) - var(--ag-internal-row-border-width, 1px) - 2px)}.ag-row{background-color:var(--ag-data-background-color);border-bottom:var(--ag-row-border);height:var(--ag-row-height);width:100%;&.ag-row-editing-invalid{background-color:var(--ag-full-row-edit-invalid-background-color)}}:where(.ag-body-vertical-content-no-gap>div>div>div,.ag-body-vertical-content-no-gap>div>div>div>div)>.ag-row-last{border-bottom-color:transparent}.ag-group-contracted,.ag-group-expanded{cursor:pointer}.ag-cell,.ag-full-width-row .ag-cell-wrapper.ag-row-group{border:1px solid transparent;line-height:var(--ag-internal-content-line-height);-webkit-font-smoothing:subpixel-antialiased}:where(.ag-ltr) .ag-cell{border-right:var(--ag-column-border)}:where(.ag-rtl) .ag-cell{border-left:var(--ag-column-border)}.ag-spanned-cell-wrapper{background-color:var(--ag-data-background-color);position:absolute}.ag-spanned-cell-wrapper>.ag-spanned-cell{display:block;position:relative}:where(.ag-ltr) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-right-color:transparent}:where(.ag-rtl) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-left-color:transparent}.ag-cell-wrapper{align-items:center;display:flex;>:where(:not(.ag-cell-value,.ag-group-value)){align-items:center;display:flex;height:var(--ag-internal-content-line-height)}&:where(.ag-row-group){align-items:flex-start}:where(.ag-full-width-row) &:where(.ag-row-group){align-items:center;height:100%}}:where(.ag-ltr) .ag-cell-wrapper{padding-left:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-rtl) .ag-cell-wrapper{padding-right:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-cell-wrap-text:not(.ag-cell-auto-height)) .ag-cell-wrapper{align-items:normal;height:100%;:where(.ag-cell-value){height:100%}}:where(.ag-ltr) .ag-row>.ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-row>.ag-cell-wrapper.ag-row-group{padding-right:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-cell-focus:not(.ag-cell-range-selected):focus-within,.ag-cell-range-single-cell,.ag-cell-range-single-cell.ag-cell-range-handle,.ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),.ag-context-menu-open .ag-full-width-row.ag-row-focus .ag-cell-wrapper.ag-row-group,.ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group{border:1px solid;border-color:var(--ag-range-selection-border-color);border-style:var(--ag-range-selection-border-style);outline:initial}.ag-full-width-row.ag-row-focus:focus{box-shadow:none}:where(.ag-ltr) .ag-group-contracted,:where(.ag-ltr) .ag-group-expanded,:where(.ag-ltr) .ag-row-drag,:where(.ag-ltr) .ag-selection-checkbox{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-contracted,:where(.ag-rtl) .ag-group-expanded,:where(.ag-rtl) .ag-row-drag,:where(.ag-rtl) .ag-selection-checkbox{margin-left:var(--ag-cell-widget-spacing)}.ag-drag-handle-disabled{opacity:.35;pointer-events:none}:where(.ag-ltr) .ag-group-child-count{margin-left:3px}:where(.ag-rtl) .ag-group-child-count{margin-right:3px}.ag-row-highlight-above:after,.ag-row-highlight-below:after,.ag-row-highlight-inside:after{background-color:var(--ag-row-drag-indicator-color);border-radius:calc(var(--ag-row-drag-indicator-width)/2);content:\"\";height:var(--ag-row-drag-indicator-width);pointer-events:none;position:absolute;width:calc(100% - 1px)}:where(.ag-ltr) .ag-row-highlight-above:after,:where(.ag-ltr) .ag-row-highlight-below:after,:where(.ag-ltr) .ag-row-highlight-inside:after{left:1px}:where(.ag-rtl) .ag-row-highlight-above:after,:where(.ag-rtl) .ag-row-highlight-below:after,:where(.ag-rtl) .ag-row-highlight-inside:after{right:1px}.ag-row-highlight-above:after{top:0}.ag-row-highlight-below:after{bottom:0}.ag-row-highlight-indent:after{display:block;width:auto}:where(.ag-ltr) .ag-row-highlight-indent:after{left:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size));right:1px}:where(.ag-rtl) .ag-row-highlight-indent:after{left:1px;right:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size))}.ag-row-highlight-inside:after{background-color:var(--ag-selected-row-background-color);border:1px solid var(--ag-range-selection-border-color);display:block;height:auto;inset:0;width:auto}.ag-body,.ag-floating-bottom,.ag-floating-top{background-color:var(--ag-data-background-color)}.ag-row-odd{background-color:var(--ag-odd-row-background-color)}.ag-row-selected:before{background-color:var(--ag-selected-row-background-color);content:\"\";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-full-width-row.ag-row-group:before,.ag-row-hover:not(.ag-full-width-row):before{background-color:var(--ag-row-hover-color);content:\"\";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-row-selected:before{background-color:var(--ag-row-hover-color);background-image:linear-gradient(var(--ag-selected-row-background-color),var(--ag-selected-row-background-color))}.ag-row.ag-full-width-row.ag-row-group>*{position:relative}.ag-column-hover{background-color:var(--ag-column-hover-color)}.ag-header-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-right-aligned-cell{font-variant-numeric:tabular-nums}:where(.ag-ltr) .ag-right-aligned-cell{text-align:right}:where(.ag-rtl) .ag-right-aligned-cell{text-align:left}.ag-right-aligned-cell .ag-cell-value,.ag-right-aligned-cell .ag-group-value{margin-left:auto}:where(.ag-ltr) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-ltr) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level));padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}:where(.ag-rtl) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-rtl) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-row>.ag-cell-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}.ag-row-dragging{cursor:move;opacity:.5}.ag-details-row{background-color:var(--ag-data-background-color);padding:calc(var(--ag-spacing)*3.75)}.ag-layout-auto-height,.ag-layout-print{.ag-center-cols-container,.ag-center-cols-viewport{min-height:150px}}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{background-color:var(--ag-modal-overlay-background-color)}.ag-skeleton-container{align-content:center;height:100%;width:100%}.ag-skeleton-effect{animation:ag-skeleton-loading 1.5s ease-in-out .5s infinite;background-color:var(--ag-row-loading-skeleton-effect-color);border-radius:.25rem;height:1em;width:100%}:where(.ag-ltr) .ag-right-aligned-cell .ag-skeleton-effect{margin-left:auto}:where(.ag-rtl) .ag-right-aligned-cell .ag-skeleton-effect{margin-right:auto}@keyframes ag-skeleton-loading{0%{background-color:var(--ag-row-loading-skeleton-effect-color)}50%{background-color:color-mix(in srgb,transparent,var(--ag-row-loading-skeleton-effect-color) 40%)}to{background-color:var(--ag-row-loading-skeleton-effect-color)}}.ag-loading{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-loading{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-loading{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-ltr) .ag-loading-icon{padding-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-loading-icon{padding-left:var(--ag-cell-widget-spacing)}.ag-header{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);color:var(--ag-header-text-color);display:flex;font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;white-space:nowrap;width:100%}.ag-header-row{height:var(--ag-header-height);position:absolute}.ag-floating-filter-button-button,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,:where(.ag-header-cell-sortable) .ag-header-cell-label,:where(.ag-header-group-cell-selectable) .ag-header-cell-comp-wrapper{cursor:pointer}:where(.ag-ltr) .ag-header-expand-icon{margin-left:4px}:where(.ag-rtl) .ag-header-expand-icon{margin-right:4px}.ag-header-row:where(:not(:first-child)){:where(.ag-header-cell:not(.ag-header-span-height.ag-header-span-total,.ag-header-parent-hidden)),:where(.ag-header-group-cell.ag-header-group-cell-with-group){border-top:var(--ag-header-row-border)}}.ag-header-row:where(:not(.ag-header-row-column-group)){overflow:hidden}:where(.ag-header.ag-header-allow-overflow) .ag-header-row{overflow:visible}.ag-header-cell{display:inline-flex;overflow:hidden}.ag-header-group-cell{contain:paint;display:flex}.ag-header-cell,.ag-header-group-cell{align-items:center;gap:var(--ag-cell-widget-spacing);height:100%;padding:0 var(--ag-cell-horizontal-padding);position:absolute}@property --ag-internal-moving-color{syntax:\"\";inherits:false;initial-value:transparent}@property --ag-internal-hover-color{syntax:\"\";inherits:false;initial-value:transparent}.ag-header-cell:where(:not(.ag-floating-filter)):before,.ag-header-group-cell:before{background-image:linear-gradient(var(--ag-internal-hover-color),var(--ag-internal-hover-color)),linear-gradient(var(--ag-internal-moving-color),var(--ag-internal-moving-color));content:\"\";inset:0;position:absolute;--ag-internal-moving-color:transparent;--ag-internal-hover-color:transparent;transition:--ag-internal-moving-color var(--ag-header-cell-background-transition-duration),--ag-internal-hover-color var(--ag-header-cell-background-transition-duration)}.ag-header-cell:where(:not(.ag-floating-filter)):where(:hover):before,.ag-header-group-cell:where(:hover):before{--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}.ag-header-cell:where(:not(.ag-floating-filter)):where(.ag-header-cell-moving):before,.ag-header-group-cell:where(.ag-header-cell-moving):before{--ag-internal-moving-color:var(--ag-header-cell-moving-background-color);--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}:where(.ag-header-cell:not(.ag-floating-filter)>*,.ag-header-group-cell>*){position:relative;z-index:1}.ag-header-cell-menu-button:where(:not(.ag-header-menu-always-show)){opacity:0;transition:opacity .2s}.ag-header-cell-filter-button,:where(.ag-header-cell.ag-header-active) .ag-header-cell-menu-button{opacity:1}.ag-header-cell-label,.ag-header-group-cell-label{align-items:center;align-self:stretch;display:flex;flex:1 1 auto;overflow:hidden;padding:5px 0}:where(.ag-ltr) .ag-sort-indicator-icon{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-sort-indicator-icon{padding-right:var(--ag-spacing)}.ag-header-cell-label{text-overflow:ellipsis}.ag-header-group-cell-label.ag-sticky-label{flex:none;max-width:100%;overflow:visible;position:sticky}:where(.ag-ltr) .ag-header-group-cell-label.ag-sticky-label{left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-header-group-cell-label.ag-sticky-label{right:var(--ag-cell-horizontal-padding)}.ag-header-cell-text,.ag-header-group-text{overflow:hidden;text-overflow:ellipsis}.ag-header-cell-text{word-break:break-word}.ag-header-cell-comp-wrapper{width:100%}:where(.ag-header-group-cell) .ag-header-cell-comp-wrapper{display:flex}:where(.ag-header-cell:not(.ag-header-cell-auto-height)) .ag-header-cell-comp-wrapper{align-items:center;display:flex;height:100%}.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper{white-space:normal}.ag-header-cell-comp-wrapper-limited-height>*{overflow:hidden}:where(.ag-right-aligned-header) .ag-header-cell-label{flex-direction:row-reverse}:where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}.ag-header-cell:after,.ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{content:\"\";height:var(--ag-header-column-border-height);position:absolute;top:calc(50% - var(--ag-header-column-border-height)*.5);z-index:1}:where(.ag-ltr) .ag-header-cell:after,:where(.ag-ltr) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-right:var(--ag-header-column-border);right:0}:where(.ag-rtl) .ag-header-cell:after,:where(.ag-rtl) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-left:var(--ag-header-column-border);left:0}.ag-header-highlight-after:after,.ag-header-highlight-before:after{background-color:var(--ag-column-drag-indicator-color);border-radius:calc(var(--ag-column-drag-indicator-width)/2);content:\"\";height:100%;position:absolute;top:0;width:var(--ag-column-drag-indicator-width)}:where(.ag-ltr) .ag-header-highlight-before:after{left:0}:where(.ag-rtl) .ag-header-highlight-before:after{right:0}:where(.ag-ltr) .ag-header-highlight-after:after{right:0;:where(.ag-pinned-left-header) &{right:1px}}:where(.ag-rtl) .ag-header-highlight-after:after{left:0;:where(.ag-pinned-left-header) &{left:1px}}.ag-header-cell-resize{align-items:center;cursor:ew-resize;display:flex;height:100%;position:absolute;top:0;width:8px;z-index:2}:where(.ag-ltr) .ag-header-cell-resize{right:-3px}:where(.ag-rtl) .ag-header-cell-resize{left:-3px}.ag-header-cell-resize:after{background-color:var(--ag-header-column-resize-handle-color);content:\"\";height:var(--ag-header-column-resize-handle-height);position:absolute;top:calc(50% - var(--ag-header-column-resize-handle-height)*.5);width:var(--ag-header-column-resize-handle-width);z-index:1}:where(.ag-ltr) .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-rtl) .ag-header-cell-resize:after{right:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-header-cell.ag-header-span-height) .ag-header-cell-resize:after{height:calc(100% - var(--ag-spacing)*4);top:calc(var(--ag-spacing)*2)}.ag-header-group-cell-no-group:where(.ag-header-span-height){display:none}.ag-sort-indicator-container{display:flex;gap:var(--ag-spacing)}.ag-layout-print{&.ag-body{display:block;height:unset}&.ag-root-wrapper{container-type:normal;display:inline-block}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:none}&.ag-force-vertical-scroll{overflow-y:visible!important}}@media print{.ag-root-wrapper.ag-layout-print{container-type:normal;display:table;.ag-body-horizontal-scroll-viewport,.ag-body-viewport,.ag-center-cols-container,.ag-center-cols-viewport,.ag-root,.ag-root-wrapper-body,.ag-virtual-list-viewport{display:block!important;height:auto!important;overflow:hidden!important}.ag-cell,.ag-row{-moz-column-break-inside:avoid;break-inside:avoid}}}ag-grid,ag-grid-angular{display:block}.ag-root-wrapper{border:var(--ag-wrapper-border);border-radius:var(--ag-wrapper-border-radius);container-type:inline-size;display:flex;flex-direction:column;overflow:hidden;position:relative;&.ag-layout-normal{height:100%}}.ag-root-wrapper-body{display:flex;flex-direction:row;&.ag-layout-normal{flex:1 1 auto;height:0;min-height:0}}.ag-root{display:flex;flex-direction:column;position:relative;&.ag-layout-auto-height,&.ag-layout-normal{flex:1 1 auto;overflow:hidden;width:0}&.ag-layout-normal{height:100%}}.ag-drag-handle{color:var(--ag-drag-handle-color);cursor:grab;:where(.ag-icon){color:var(--ag-drag-handle-color)}}.ag-chart-menu-icon,.ag-chart-settings-next,.ag-chart-settings-prev,.ag-column-group-icons,.ag-column-select-header-icon,.ag-filter-toolpanel-expand,.ag-floating-filter-button-button,.ag-group-title-bar-icon,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,.ag-panel-title-bar-button-icon,.ag-set-filter-group-icons,:where(.ag-group-contracted) .ag-icon,:where(.ag-group-expanded) .ag-icon{background-color:var(--ag-icon-button-background-color);border-radius:var(--ag-icon-button-border-radius);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-background-color);color:var(--ag-icon-button-color)}.ag-chart-menu-icon:hover,.ag-chart-settings-next:hover,.ag-chart-settings-prev:hover,.ag-column-group-icons:hover,.ag-column-select-header-icon:hover,.ag-filter-toolpanel-expand:hover,.ag-floating-filter-button-button:hover,.ag-group-title-bar-icon:hover,.ag-header-cell-filter-button:hover,.ag-header-cell-menu-button:hover,.ag-header-expand-icon:hover,.ag-panel-title-bar-button-icon:hover,.ag-panel-title-bar-button:hover,.ag-set-filter-group-icons:hover,:where(.ag-group-contracted) .ag-icon:hover,:where(.ag-group-expanded) .ag-icon:hover{background-color:var(--ag-icon-button-hover-background-color);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-hover-background-color);color:var(--ag-icon-button-hover-color)}:where(.ag-filter-active),:where(.ag-filter-toolpanel-group-instance-header-icon),:where(.ag-filter-toolpanel-instance-header-icon){position:relative}:where(.ag-filter-active):after,:where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-filter-toolpanel-instance-header-icon):after{background-color:var(--ag-icon-button-active-indicator-color);border-radius:50%;content:\"\";height:6px;position:absolute;top:-1px;width:6px}:where(.ag-ltr) :where(.ag-filter-active):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-instance-header-icon):after{right:-1px}:where(.ag-rtl) :where(.ag-filter-active):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-instance-header-icon):after{left:-1px}.ag-filter-active{background-image:linear-gradient(var(--ag-icon-button-active-background-color),var(--ag-icon-button-active-background-color));border-radius:1px;outline:solid var(--ag-icon-button-background-spread) var(--ag-icon-button-active-background-color);:where(.ag-icon-filter){clip-path:path(\"M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z\");color:var(--ag-icon-button-active-color)}}';\n\n// packages/ag-grid-community/src/theming/core/core-css.ts\nvar coreDefaults = {\n wrapperBorder: true,\n rowBorder: true,\n headerRowBorder: true,\n footerRowBorder: {\n ref: \"rowBorder\"\n },\n columnBorder: {\n style: \"solid\",\n width: 1,\n color: \"transparent\"\n },\n headerColumnBorder: false,\n headerColumnBorderHeight: \"100%\",\n pinnedColumnBorder: true,\n pinnedRowBorder: true,\n sidePanelBorder: true,\n sideBarPanelWidth: 250,\n sideBarPanelAnimationDuration: 0,\n sideBarBackgroundColor: {\n ref: \"chromeBackgroundColor\"\n },\n sideButtonBarBackgroundColor: {\n ref: \"sideBarBackgroundColor\"\n },\n sideButtonBarTopPadding: 0,\n sideButtonSelectedUnderlineWidth: 2,\n sideButtonSelectedUnderlineColor: \"transparent\",\n sideButtonSelectedUnderlineTransitionDuration: 0,\n sideButtonBackgroundColor: \"transparent\",\n sideButtonTextColor: { ref: \"textColor\" },\n sideButtonHoverBackgroundColor: { ref: \"sideButtonBackgroundColor\" },\n sideButtonHoverTextColor: { ref: \"sideButtonTextColor\" },\n sideButtonSelectedBackgroundColor: backgroundColor,\n sideButtonSelectedTextColor: { ref: \"sideButtonTextColor\" },\n sideButtonBorder: \"solid 1px transparent\",\n sideButtonSelectedBorder: true,\n sideButtonLeftPadding: { ref: \"spacing\" },\n sideButtonRightPadding: { ref: \"spacing\" },\n sideButtonVerticalPadding: { calc: \"spacing * 3\" },\n cellFontFamily: {\n ref: \"fontFamily\"\n },\n cellFontSize: {\n ref: \"dataFontSize\"\n },\n cellFontWeight: {\n ref: \"fontWeight\"\n },\n headerCellHoverBackgroundColor: \"transparent\",\n headerCellMovingBackgroundColor: { ref: \"headerCellHoverBackgroundColor\" },\n headerCellBackgroundTransitionDuration: \"0.2s\",\n cellTextColor: {\n ref: \"textColor\"\n },\n rangeSelectionBorderStyle: \"solid\",\n rangeSelectionBorderColor: accentColor,\n rangeSelectionBackgroundColor: accentMix(0.2),\n rangeSelectionChartBackgroundColor: \"#0058FF1A\",\n rangeSelectionChartCategoryBackgroundColor: \"#00FF841A\",\n rangeSelectionHighlightColor: accentMix(0.5),\n rangeHeaderHighlightColor: foregroundHeaderBackgroundMix(0.08),\n rowNumbersSelectedColor: accentMix(0.5),\n rowHoverColor: accentMix(0.08),\n columnHoverColor: accentMix(0.05),\n selectedRowBackgroundColor: accentMix(0.12),\n modalOverlayBackgroundColor: {\n ref: \"backgroundColor\",\n mix: 0.66\n },\n dataBackgroundColor: backgroundColor,\n oddRowBackgroundColor: { ref: \"dataBackgroundColor\" },\n wrapperBorderRadius: 8,\n cellHorizontalPadding: {\n calc: \"spacing * 2 * cellHorizontalPaddingScale\"\n },\n cellWidgetSpacing: {\n calc: \"spacing * 1.5\"\n },\n cellHorizontalPaddingScale: 1,\n rowGroupIndentSize: {\n calc: \"cellWidgetSpacing + iconSize\"\n },\n valueChangeDeltaUpColor: \"#43a047\",\n valueChangeDeltaDownColor: \"#e53935\",\n valueChangeValueHighlightBackgroundColor: \"#16a08580\",\n rowHeight: {\n calc: \"max(iconSize, cellFontSize) + spacing * 3.25 * rowVerticalPaddingScale\"\n },\n rowVerticalPaddingScale: 1,\n paginationPanelHeight: {\n ref: \"rowHeight\",\n calc: \"max(rowHeight, 22px)\"\n },\n dragHandleColor: foregroundMix(0.7),\n headerColumnResizeHandleHeight: \"30%\",\n headerColumnResizeHandleWidth: 2,\n headerColumnResizeHandleColor: {\n ref: \"borderColor\"\n },\n iconButtonColor: { ref: \"iconColor\" },\n iconButtonBackgroundColor: \"transparent\",\n iconButtonBackgroundSpread: 4,\n iconButtonBorderRadius: 1,\n iconButtonHoverColor: { ref: \"iconButtonColor\" },\n iconButtonHoverBackgroundColor: foregroundMix(0.1),\n iconButtonActiveColor: accentColor,\n iconButtonActiveBackgroundColor: accentMix(0.28),\n iconButtonActiveIndicatorColor: accentColor,\n setFilterIndentSize: {\n ref: \"iconSize\"\n },\n chartMenuPanelWidth: 260,\n chartMenuLabelColor: foregroundMix(0.8),\n cellEditingBorder: {\n color: accentColor\n },\n cellEditingShadow: { ref: \"cardShadow\" },\n fullRowEditInvalidBackgroundColor: {\n ref: \"invalidColor\",\n onto: \"backgroundColor\",\n mix: 0.25\n },\n columnSelectIndentSize: {\n ref: \"iconSize\"\n },\n toolPanelSeparatorBorder: true,\n columnDropCellBackgroundColor: foregroundMix(0.07),\n columnDropCellTextColor: {\n ref: \"textColor\"\n },\n columnDropCellDragHandleColor: {\n ref: \"textColor\"\n },\n columnDropCellBorder: {\n color: foregroundMix(0.13)\n },\n selectCellBackgroundColor: foregroundMix(0.07),\n selectCellBorder: {\n color: foregroundMix(0.13)\n },\n advancedFilterBuilderButtonBarBorder: true,\n advancedFilterBuilderIndentSize: {\n calc: \"spacing * 2 + iconSize\"\n },\n advancedFilterBuilderJoinPillColor: \"#f08e8d\",\n advancedFilterBuilderColumnPillColor: \"#a6e194\",\n advancedFilterBuilderOptionPillColor: \"#f3c08b\",\n advancedFilterBuilderValuePillColor: \"#85c0e4\",\n filterPanelApplyButtonColor: backgroundColor,\n filterPanelApplyButtonBackgroundColor: accentColor,\n columnPanelApplyButtonColor: backgroundColor,\n columnPanelApplyButtonBackgroundColor: accentColor,\n filterPanelCardSubtleColor: {\n ref: \"textColor\",\n mix: 0.7\n },\n filterPanelCardSubtleHoverColor: { ref: \"textColor\" },\n findMatchColor: foregroundColor,\n findMatchBackgroundColor: \"#ffff00\",\n findActiveMatchColor: foregroundColor,\n findActiveMatchBackgroundColor: \"#ffa500\",\n filterToolPanelGroupIndent: {\n ref: \"spacing\"\n },\n rowLoadingSkeletonEffectColor: foregroundMix(0.15),\n statusBarLabelColor: foregroundColor,\n statusBarLabelFontWeight: 500,\n statusBarValueColor: foregroundColor,\n statusBarValueFontWeight: 500,\n pinnedSourceRowTextColor: {\n ref: \"textColor\"\n },\n pinnedSourceRowBackgroundColor: {\n ref: \"dataBackgroundColor\"\n },\n pinnedSourceRowFontWeight: 600,\n pinnedRowFontWeight: 600,\n pinnedRowBackgroundColor: {\n ref: \"dataBackgroundColor\"\n },\n pinnedRowTextColor: {\n ref: \"textColor\"\n },\n rowDragIndicatorColor: { ref: \"rangeSelectionBorderColor\" },\n rowDragIndicatorWidth: 2,\n columnDragIndicatorColor: { ref: \"accentColor\" },\n columnDragIndicatorWidth: 2\n};\n\n// packages/ag-grid-community/src/theming/parts/batch-edit/batch-edit-style-default.css\nvar batch_edit_style_default_default = \".ag-cell-batch-edit{background-color:var(--ag-cell-batch-edit-background-color);color:var(--ag-cell-batch-edit-text-color);display:inherit}.ag-row-batch-edit{background-color:var(--ag-row-batch-edit-background-color);color:var(--ag-row-batch-edit-text-color)}\";\n\n// packages/ag-grid-community/src/theming/parts/batch-edit/batch-edit-styles.ts\nvar baseParams = {\n cellBatchEditBackgroundColor: \"rgba(220 181 139 / 16%)\",\n cellBatchEditTextColor: \"#422f00\",\n rowBatchEditBackgroundColor: {\n ref: \"cellBatchEditBackgroundColor\"\n },\n rowBatchEditTextColor: {\n ref: \"cellBatchEditTextColor\"\n }\n};\nvar baseDarkBatchEditParams = {\n ...baseParams,\n cellBatchEditTextColor: \"#f3d0b3\"\n};\nvar makeBatchEditStyleBaseTreeShakeable = () => createPart({\n feature: \"batchEditStyle\",\n params: baseParams,\n css: batch_edit_style_default_default\n});\nvar batchEditStyleBase = /* @__PURE__ */ makeBatchEditStyleBaseTreeShakeable();\n\n// packages/ag-grid-community/src/theming/parts/button-style/button-style-base.css\nvar button_style_base_default = \":where(.ag-button){background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-indent:inherit;text-shadow:inherit;text-transform:inherit;word-spacing:inherit;&:disabled{cursor:default}&:focus-visible{box-shadow:var(--ag-focus-shadow);outline:none}}.ag-standard-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--ag-button-background-color);border:var(--ag-button-border);border-radius:var(--ag-button-border-radius);color:var(--ag-button-text-color);cursor:pointer;font-weight:var(--ag-button-font-weight);padding:var(--ag-button-vertical-padding) var(--ag-button-horizontal-padding);&:active{background-color:var(--ag-button-active-background-color);border:var(--ag-button-active-border);color:var(--ag-button-active-text-color)}&:disabled{background-color:var(--ag-button-disabled-background-color);border:var(--ag-button-disabled-border);color:var(--ag-button-disabled-text-color)}}.ag-standard-button:hover{background-color:var(--ag-button-hover-background-color);border:var(--ag-button-hover-border);color:var(--ag-button-hover-text-color)}\";\n\n// packages/ag-grid-community/src/theming/parts/button-style/button-styles.ts\nvar baseParams2 = {\n buttonTextColor: \"inherit\",\n buttonFontWeight: \"normal\",\n buttonBackgroundColor: \"transparent\",\n buttonBorder: false,\n buttonBorderRadius: { ref: \"borderRadius\" },\n buttonHorizontalPadding: { calc: \"spacing * 2\" },\n buttonVerticalPadding: { ref: \"spacing\" },\n buttonHoverTextColor: { ref: \"buttonTextColor\" },\n buttonHoverBackgroundColor: { ref: \"buttonBackgroundColor\" },\n buttonHoverBorder: { ref: \"buttonBorder\" },\n buttonActiveTextColor: { ref: \"buttonHoverTextColor\" },\n buttonActiveBackgroundColor: { ref: \"buttonHoverBackgroundColor\" },\n buttonActiveBorder: { ref: \"buttonHoverBorder\" },\n buttonDisabledTextColor: { ref: \"inputDisabledTextColor\" },\n buttonDisabledBackgroundColor: { ref: \"inputDisabledBackgroundColor\" },\n buttonDisabledBorder: { ref: \"inputDisabledBorder\" }\n};\nvar makeButtonStyleBaseTreeShakeable = () => createPart({\n feature: \"buttonStyle\",\n params: baseParams2,\n css: button_style_base_default\n});\nvar buttonStyleBase = /* @__PURE__ */ makeButtonStyleBaseTreeShakeable();\nvar makeButtonStyleQuartzTreeShakeable = () => createPart({\n feature: \"buttonStyle\",\n params: {\n ...baseParams2,\n buttonBackgroundColor: backgroundColor,\n buttonBorder: true,\n buttonHoverBackgroundColor: { ref: \"rowHoverColor\" },\n buttonActiveBorder: { color: accentColor }\n },\n css: button_style_base_default\n});\nvar buttonStyleQuartz = /* @__PURE__ */ makeButtonStyleQuartzTreeShakeable();\nvar makeButtonStyleAlpineTreeShakeable = () => createPart({\n feature: \"buttonStyle\",\n params: {\n ...baseParams2,\n buttonBackgroundColor: backgroundColor,\n buttonBorder: { color: accentColor },\n buttonFontWeight: 600,\n buttonTextColor: accentColor,\n buttonHoverBackgroundColor: { ref: \"rowHoverColor\" },\n buttonActiveBackgroundColor: accentColor,\n buttonActiveTextColor: backgroundColor\n },\n css: button_style_base_default\n});\nvar buttonStyleAlpine = /* @__PURE__ */ makeButtonStyleAlpineTreeShakeable();\nvar makeButtonStyleBalhamTreeShakeable = () => createPart({\n feature: \"buttonStyle\",\n params: {\n ...baseParams2,\n buttonBorder: { color: foregroundColor, width: 2, style: \"outset\" },\n buttonActiveBorder: { color: foregroundColor, width: 2, style: \"inset\" },\n buttonBackgroundColor: foregroundBackgroundMix(0.07),\n buttonHoverBackgroundColor: backgroundColor,\n buttonVerticalPadding: { calc: \"spacing * 0.5\" }\n },\n css: button_style_base_default\n});\nvar buttonStyleBalham = /* @__PURE__ */ makeButtonStyleBalhamTreeShakeable();\n\n// packages/ag-grid-community/src/theming/parts/column-drop-style/column-drop-style-bordered.css\nvar column_drop_style_bordered_default = \".ag-column-drop-vertical-empty-message{align-items:center;border:dashed var(--ag-border-width);border-color:var(--ag-border-color);display:flex;inset:0;justify-content:center;margin:calc(var(--ag-spacing)*1.5) calc(var(--ag-spacing)*2);overflow:hidden;padding:calc(var(--ag-spacing)*2);position:absolute}\";\n\n// packages/ag-grid-community/src/theming/parts/column-drop-style/column-drop-style-plain.css\nvar column_drop_style_plain_default = \".ag-column-drop-vertical-empty-message{color:var(--ag-subtle-text-color);font-size:calc(var(--ag-font-size) - 1px);font-weight:600;padding-top:var(--ag-spacing)}:where(.ag-ltr) .ag-column-drop-vertical-empty-message{padding-left:calc(var(--ag-icon-size) + var(--ag-spacing) + var(--ag-widget-horizontal-spacing));padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-column-drop-vertical-empty-message{padding-left:var(--ag-spacing);padding-right:calc(var(--ag-icon-size) + var(--ag-spacing) + var(--ag-widget-horizontal-spacing))}\";\n\n// packages/ag-grid-community/src/theming/parts/column-drop-style/column-drop-styles.ts\nvar makeColumnDropStyleBorderedTreeShakeable = () => {\n return createPart({\n feature: \"columnDropStyle\",\n css: column_drop_style_bordered_default\n });\n};\nvar columnDropStyleBordered = /* @__PURE__ */ makeColumnDropStyleBorderedTreeShakeable();\nvar makeColumnDropStylePlainTreeShakeable = () => {\n return createPart({\n feature: \"columnDropStyle\",\n css: column_drop_style_plain_default\n });\n};\nvar columnDropStylePlain = /* @__PURE__ */ makeColumnDropStylePlainTreeShakeable();\n\n// packages/ag-grid-community/src/theming/parts/formula-style/formula-styles.ts\nvar baseParams3 = {\n formulaToken1Color: \"#3269c6\",\n formulaToken1BackgroundColor: { ref: \"formulaToken1Color\", mix: 0.08 },\n formulaToken1Border: {\n color: {\n ref: \"formulaToken1Color\"\n }\n },\n formulaToken2Color: \"#c0343f\",\n formulaToken2BackgroundColor: { ref: \"formulaToken2Color\", mix: 0.06 },\n formulaToken2Border: {\n color: {\n ref: \"formulaToken2Color\"\n }\n },\n formulaToken3Color: \"#8156b8\",\n formulaToken3BackgroundColor: { ref: \"formulaToken3Color\", mix: 0.08 },\n formulaToken3Border: {\n color: {\n ref: \"formulaToken3Color\"\n }\n },\n formulaToken4Color: \"#007c1f\",\n formulaToken4BackgroundColor: { ref: \"formulaToken4Color\", mix: 0.06 },\n formulaToken4Border: {\n color: {\n ref: \"formulaToken4Color\"\n }\n },\n formulaToken5Color: \"#b03e85\",\n formulaToken5BackgroundColor: { ref: \"formulaToken5Color\", mix: 0.08 },\n formulaToken5Border: {\n color: {\n ref: \"formulaToken5Color\"\n }\n },\n formulaToken6Color: \"#b74900\",\n formulaToken6BackgroundColor: { ref: \"formulaToken6Color\", mix: 0.06 },\n formulaToken6Border: {\n color: {\n ref: \"formulaToken6Color\"\n }\n },\n formulaToken7Color: \"#247492\",\n formulaToken7BackgroundColor: { ref: \"formulaToken7Color\", mix: 0.08 },\n formulaToken7Border: {\n color: {\n ref: \"formulaToken7Color\"\n }\n }\n};\nvar makeBatchEditStyleBaseTreeShakeable2 = () => createPart({\n feature: \"formulaStyle\",\n params: baseParams3\n});\nvar formulaStyleBase = /* @__PURE__ */ makeBatchEditStyleBaseTreeShakeable2();\n\n// packages/ag-grid-community/src/theming/createTheme.ts\nvar gridThemeLogger = {\n warn: (...args) => {\n _warn(args[0], args[1]);\n },\n error: (...args) => {\n _error(args[0], args[1]);\n },\n preInitErr: (...args) => {\n _logPreInitErr(args[0], args[2], args[1]);\n }\n};\nvar createTheme = () => createSharedTheme(gridThemeLogger).withParams(coreDefaults).withPart(buttonStyleQuartz).withPart(columnDropStyleBordered).withPart(batchEditStyleBase).withPart(formulaStyleBase);\n\n// packages/ag-grid-community/src/theming/parts/checkbox-style/checkbox-style-default.css\nvar checkbox_style_default_default = '.ag-checkbox-input-wrapper,.ag-radio-button-input-wrapper{background-color:var(--ag-checkbox-unchecked-background-color);border:solid var(--ag-checkbox-border-width) var(--ag-checkbox-unchecked-border-color);flex:none;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:where(.ag-checked){background-color:var(--ag-checkbox-checked-background-color);border-color:var(--ag-checkbox-checked-border-color)}&:where(.ag-checked):after{background-color:var(--ag-checkbox-checked-shape-color)}&:where(.ag-disabled){filter:grayscale();opacity:.5}}.ag-checkbox-input,.ag-radio-button-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-icon-size);margin:0;opacity:0;width:var(--ag-icon-size)}.ag-checkbox-input-wrapper:after,.ag-radio-button-input-wrapper:after{content:\"\";display:block;inset:0;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute}.ag-checkbox-input-wrapper:where(:focus-within,:active),.ag-radio-button-input-wrapper:where(:focus-within,:active){box-shadow:var(--ag-focus-shadow)}.ag-checkbox-input-wrapper{border-radius:var(--ag-checkbox-border-radius);&:where(.ag-checked):after{-webkit-mask-image:var(--ag-checkbox-checked-shape-image);mask-image:var(--ag-checkbox-checked-shape-image)}&:where(.ag-indeterminate){background-color:var(--ag-checkbox-indeterminate-background-color);border-color:var(--ag-checkbox-indeterminate-border-color)}&:where(.ag-indeterminate):after{background-color:var(--ag-checkbox-indeterminate-shape-color);-webkit-mask-image:var(--ag-checkbox-indeterminate-shape-image);mask-image:var(--ag-checkbox-indeterminate-shape-image)}}.ag-cell-editing-error .ag-checkbox-input-wrapper:focus-within{box-shadow:var(--ag-focus-error-shadow)}.ag-radio-button-input-wrapper{border-radius:100%;&:where(.ag-checked):after{-webkit-mask-image:var(--ag-radio-checked-shape-image);mask-image:var(--ag-radio-checked-shape-image)}}';\n\n// packages/ag-grid-community/src/theming/parts/checkbox-style/checkbox-styles.ts\nvar makeCheckboxStyleDefaultTreeShakeable = () => createPart({\n feature: \"checkboxStyle\",\n params: {\n checkboxBorderWidth: 1,\n checkboxBorderRadius: {\n ref: \"borderRadius\"\n },\n checkboxUncheckedBackgroundColor: backgroundColor,\n checkboxUncheckedBorderColor: foregroundBackgroundMix(0.3),\n checkboxCheckedBackgroundColor: accentColor,\n checkboxCheckedBorderColor: { ref: \"checkboxCheckedBackgroundColor\" },\n checkboxCheckedShapeImage: {\n svg: ''\n },\n checkboxCheckedShapeColor: backgroundColor,\n checkboxIndeterminateBackgroundColor: foregroundBackgroundMix(0.3),\n checkboxIndeterminateBorderColor: { ref: \"checkboxIndeterminateBackgroundColor\" },\n checkboxIndeterminateShapeImage: {\n svg: ''\n },\n checkboxIndeterminateShapeColor: backgroundColor,\n radioCheckedShapeImage: {\n svg: ''\n }\n },\n css: checkbox_style_default_default\n});\nvar checkboxStyleDefault = /* @__PURE__ */ makeCheckboxStyleDefaultTreeShakeable();\n\n// packages/ag-grid-community/src/theming/parts/color-scheme/color-schemes.ts\nvar makeColorSchemeLightTreeShakeable = () => createPart({\n feature: \"colorScheme\",\n params: defaultLightColorSchemeParams\n});\nvar colorSchemeLight = /* @__PURE__ */ makeColorSchemeLightTreeShakeable();\nvar makeColorSchemeLightWarmTreeShakeable = () => createPart({\n feature: \"colorScheme\",\n params: {\n ...defaultLightColorSchemeParams,\n foregroundColor: \"#000000de\",\n borderColor: \"#60300026\",\n chromeBackgroundColor: \"#60300005\"\n }\n});\nvar colorSchemeLightWarm = /* @__PURE__ */ makeColorSchemeLightWarmTreeShakeable();\nvar makeColorSchemeLightColdTreeShakeable = () => createPart({\n feature: \"colorScheme\",\n params: {\n ...defaultLightColorSchemeParams,\n foregroundColor: \"#000\",\n chromeBackgroundColor: \"#f3f8f8\"\n }\n});\nvar colorSchemeLightCold = /* @__PURE__ */ makeColorSchemeLightColdTreeShakeable();\nvar darkParams = () => ({\n ...defaultLightColorSchemeParams,\n ...baseDarkBatchEditParams,\n backgroundColor: \"hsl(217, 0%, 17%)\",\n foregroundColor: \"#FFF\",\n chromeBackgroundColor: foregroundBackgroundMix(0.05),\n rowHoverColor: accentMix(0.15),\n selectedRowBackgroundColor: accentMix(0.2),\n menuBackgroundColor: foregroundBackgroundMix(0.1),\n browserColorScheme: \"dark\",\n popupShadow: \"0 0px 20px #000A\",\n cardShadow: \"0 1px 4px 1px #000A\",\n advancedFilterBuilderJoinPillColor: \"#7a3a37\",\n advancedFilterBuilderColumnPillColor: \"#355f2d\",\n advancedFilterBuilderOptionPillColor: \"#5a3168\",\n advancedFilterBuilderValuePillColor: \"#374c86\",\n filterPanelApplyButtonColor: foregroundColor,\n columnPanelApplyButtonColor: foregroundColor,\n findMatchColor: backgroundColor,\n findActiveMatchColor: backgroundColor,\n checkboxUncheckedBorderColor: foregroundBackgroundMix(0.4),\n toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.4),\n rowBatchEditBackgroundColor: foregroundBackgroundMix(0.1),\n // dark colours for formula editor / formula ranges\n formulaToken1Color: \"#4da3e5\",\n formulaToken2Color: \"#f55864\",\n formulaToken3Color: \"#b688f2\",\n formulaToken4Color: \"#24bb4a\",\n formulaToken5Color: \"#e772ba\",\n formulaToken6Color: \"#f69b5f\",\n formulaToken7Color: \"#a3e6ff\"\n});\nvar makeColorSchemeDarkTreeShakeable = () => createPart({\n feature: \"colorScheme\",\n params: darkParams()\n});\nvar colorSchemeDark = /* @__PURE__ */ makeColorSchemeDarkTreeShakeable();\nvar makeColorSchemeDarkWarmTreeShakeable = () => createPart({\n feature: \"colorScheme\",\n params: {\n backgroundColor: \"hsl(29, 10%, 17%)\",\n foregroundColor: \"#FFF\",\n browserColorScheme: \"dark\"\n }\n});\nvar darkBlueParams = () => ({\n ...darkParams(),\n backgroundColor: \"#1f2836\"\n});\nvar colorSchemeDarkWarm = /* @__PURE__ */ makeColorSchemeDarkWarmTreeShakeable();\nvar makeColorSchemeDarkBlueTreeShakeable = () => createPart({\n feature: \"colorScheme\",\n params: darkBlueParams()\n});\nvar colorSchemeDarkBlue = /* @__PURE__ */ makeColorSchemeDarkBlueTreeShakeable();\nvar makeColorSchemeVariableTreeShakeable = () => createPart({\n feature: \"colorScheme\",\n params: defaultLightColorSchemeParams,\n modeParams: {\n light: defaultLightColorSchemeParams,\n dark: darkParams(),\n \"dark-blue\": darkBlueParams()\n }\n});\nvar colorSchemeVariable = /* @__PURE__ */ makeColorSchemeVariableTreeShakeable();\n\n// packages/ag-grid-community/src/theming/parts/icon-set/balham/icon-set-balham.css\nvar icon_set_balham_default = `.ag-icon-aggregation:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eaggregation%3C/title%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0M7.006 4c-1.57.02-2.946 1.348-3.004 2.922-.078 6.078-.23 12.16.002 18.234.094 1.484 1.354 2.746 2.84 2.84 6.1.232 12.212.232 18.312 0 1.48-.094 2.746-1.35 2.84-2.84.232-6.1.232-12.212 0-18.312-.094-1.48-1.35-2.746-2.84-2.84C19.11 3.774 13.056 4 7.006 4M22 12h-2v-2h-8v.092c.056 1.352 3.426 2.598 4.472 4.404.682 1.174.438 2.754-.572 3.72C14.29 19.618 12 20.924 12 22h8v-2h2v4H10c0-1.586-.098-3.304 1.016-4.314 1.904-1.632 4.89-3.108 3.54-4.42-1.918-1.68-4.464-2.936-4.554-5.12L10 8h12z'/%3E%3C/svg%3E\")}.ag-icon-arrows:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Earrows%3C/title%3E%3Cpath d='m6.414 17 2.294 2.292-1.416 1.416L2.586 16l4.706-4.708 1.416 1.416L6.414 15H15V6.414l-2.292 2.294-1.416-1.416L16 2.586l4.708 4.706-1.416 1.416L17 6.414V15h8.586l-2.294-2.292 1.416-1.416L29.414 16l-4.706 4.708-1.416-1.416L25.586 17H17v8.586l2.292-2.294 1.416 1.416L16 29.414l-4.708-4.706 1.416-1.416L15 25.586V17z'/%3E%3C/svg%3E\")}.ag-icon-asc:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m15 10.621-4.292 4.294-1.416-1.416L16 6.793l6.708 6.706-1.416 1.416L17 10.621v14.586h-2z'/%3E%3C/svg%3E\")}.ag-icon-aasc:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M13.201 8.08q.65 0 1.135.222.487.222.759.618.27.396.279.919H14.19a.72.72 0 0 0-.293-.536q-.26-.191-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125q.382.086.701.229.32.143.554.35.234.21.362.49.131.284.134.648a1.6 1.6 0 0 1-.273.93q-.27.391-.777.608-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.642q-.29-.428-.305-1.058h1.194q.02.294.17.49.15.195.402.294.253.097.573.097.313 0 .544-.09a.84.84 0 0 0 .362-.255.6.6 0 0 0 .129-.374q0-.195-.117-.33a.9.9 0 0 0-.337-.228 3.4 3.4 0 0 0-.54-.171l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.927q.287-.396.79-.618a2.8 2.8 0 0 1 1.14-.223'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 14H4.489l-.432-1.332H1.948L1.515 14H.19l2.017-5.84h1.592zm-3.551-2.296h1.481l-.718-2.21H2.98zM8.452 8.16q.645 0 1.075.19.43.191.648.531a1.4 1.4 0 0 1 .217.775q0 .343-.137.602-.137.256-.376.422a1.6 1.6 0 0 1-.542.231v.057q.333.015.624.188.294.175.476.489.183.31.183.74 0 .466-.231.831a1.56 1.56 0 0 1-.676.573Q9.265 14 8.609 14H6.114V8.16zM7.35 12.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.29 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.396.64.64 0 0 0-.226-.511q-.223-.195-.633-.194H7.35z' clip-rule='evenodd'/%3E%3Cpath fill='%23000' d='M7.166.377a.75.75 0 0 1 .919.066l3.333 3a.75.75 0 0 1-1.003 1.115L7.609 2.033 5.113 4.53a.75.75 0 0 1-1.06-1.06l3-3z'/%3E%3C/svg%3E\")}.ag-icon-cancel:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecancel%3C/title%3E%3Cpath d='M16 4C9.378 4 4 9.378 4 16s5.378 12 12 12 12-5.378 12-12S22.622 4 16 4m0 2c5.52 0 10 4.48 10 10s-4.48 10-10 10S6 21.52 6 16 10.48 6 16 6m0 8.586 5.292-5.294 1.416 1.416L17.414 16l5.294 5.292-1.416 1.416L16 17.414l-5.292 5.294-1.416-1.416L14.586 16l-5.294-5.292 1.416-1.416z'/%3E%3C/svg%3E\")}.ag-icon-chart:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Echart%3C/title%3E%3Cpath d='M6.667 12.267h4v13.067h-4zm7.466-5.6h3.733v18.667h-3.733zM21.6 17.333h3.733v8H21.6z'/%3E%3C/svg%3E\")}.ag-icon-color-picker:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolor-picker%3C/title%3E%3Cpath d='M23.907 17.587 10.574 4.254l-1.88 1.88 3.173 3.173-8.28 8.28 10.16 10.16zm-16.547 0 6.387-6.387 6.387 6.387H7.361zm18.387 2s-2.667 2.893-2.667 4.667c0 1.467 1.2 2.667 2.667 2.667s2.667-1.2 2.667-2.667c0-1.773-2.667-4.667-2.667-4.667'/%3E%3C/svg%3E\")}.ag-icon-columns:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolumns%3C/title%3E%3Cpath d='M14 25h-2V7h2zm6 0h-2V7h2zm6 0h-2V7h2zM8 25H6V7h2z'/%3E%3C/svg%3E\")}.ag-icon-contracted:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Econtracted%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E\")}.ag-icon-copy:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecopy%3C/title%3E%3Cpath d='M21.929 27.999h-7.828a5.09 5.09 0 0 1-5.086-5.086v-9.812a5.087 5.087 0 0 1 5.086-5.086h7.828a5.09 5.09 0 0 1 5.086 5.086v9.812a5.087 5.087 0 0 1-5.086 5.086m.16-17.984h-8.088a2.94 2.94 0 0 0-2.938 2.938v10.132a2.94 2.94 0 0 0 2.938 2.938h8.088a2.94 2.94 0 0 0 2.936-2.938V12.953a2.94 2.94 0 0 0-2.936-2.938M7.041 26.013h-2.05a4 4 0 0 1-.006-.228V9.065a5.07 5.07 0 0 1 5.064-5.064h12.812q.069 0 .134.002v2.012H9.915a2.876 2.876 0 0 0-2.874 2.874z'/%3E%3C/svg%3E\")}.ag-icon-cross:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='4 4 24 24'%3E%3Ctitle%3Ecross%3C/title%3E%3Cpath d='m16 14.586 5.292-5.294 1.416 1.416L17.414 16l5.294 5.292-1.416 1.416L16 17.414l-5.292 5.294-1.416-1.416L14.586 16l-5.294-5.292 1.416-1.416z'/%3E%3C/svg%3E\")}.ag-icon-csv:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='M.688-.226a.2.2 0 0 1-.017.074.28.28 0 0 1-.145.14.412.412 0 0 1-.234.013.28.28 0 0 1-.202-.168.468.468 0 0 1-.04-.19q0-.086.025-.155a.319.319 0 0 1 .182-.191.4.4 0 0 1 .134-.025q.087 0 .155.035a.3.3 0 0 1 .104.085.17.17 0 0 1 .036.097.06.06 0 0 1-.018.044.06.06 0 0 1-.042.019.06.06 0 0 1-.042-.013.2.2 0 0 1-.031-.046.2.2 0 0 0-.066-.079.16.16 0 0 0-.095-.027.17.17 0 0 0-.142.068.3.3 0 0 0-.053.193.4.4 0 0 0 .023.139.2.2 0 0 0 .067.083.2.2 0 0 0 .1.027q.063 0 .106-.031a.2.2 0 0 0 .065-.091.2.2 0 0 1 .023-.046q.014-.018.044-.018a.06.06 0 0 1 .044.018.06.06 0 0 1 .019.045' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 7.122 25.977)'/%3E%3Cpath d='M.622-.215a.2.2 0 0 1-.033.117.23.23 0 0 1-.098.081.4.4 0 0 1-.153.029.34.34 0 0 1-.175-.04.23.23 0 0 1-.079-.077.17.17 0 0 1-.031-.093q0-.027.019-.045a.06.06 0 0 1 .046-.019.06.06 0 0 1 .039.014.1.1 0 0 1 .027.044.3.3 0 0 0 .03.057q.015.023.044.038.03.015.076.015.065 0 .105-.03a.09.09 0 0 0 .04-.075.08.08 0 0 0-.022-.058.14.14 0 0 0-.056-.034 1 1 0 0 0-.092-.025.7.7 0 0 1-.129-.042.2.2 0 0 1-.083-.066.17.17 0 0 1-.03-.104q0-.058.032-.105a.2.2 0 0 1 .093-.07.4.4 0 0 1 .144-.025q.066 0 .114.016a.3.3 0 0 1 .08.044.2.2 0 0 1 .046.057q.015.03.015.058a.07.07 0 0 1-.018.046.06.06 0 0 1-.046.021q-.025 0-.038-.012a.2.2 0 0 1-.028-.041.2.2 0 0 0-.047-.063Q.387-.625.326-.625a.15.15 0 0 0-.09.025q-.035.024-.035.059 0 .021.012.037a.1.1 0 0 0 .032.027.4.4 0 0 0 .111.036q.06.015.11.031.048.018.083.042a.2.2 0 0 1 .054.062.2.2 0 0 1 .019.091' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 13.339 25.977)'/%3E%3Cpath d='m.184-.633.162.48.163-.483q.013-.038.019-.053a.062.062 0 0 1 .061-.039q.018 0 .034.009a.1.1 0 0 1 .025.025q.009.015.009.031L.654-.64l-.007.025-.009.024-.173.468-.019.051a.2.2 0 0 1-.021.042.1.1 0 0 1-.033.03.1.1 0 0 1-.049.012.1.1 0 0 1-.05-.011A.1.1 0 0 1 .26-.03a.2.2 0 0 1-.021-.042L.22-.123.05-.587.041-.612.033-.638.03-.662q0-.025.02-.046a.07.07 0 0 1 .05-.02q.037 0 .053.023.015.023.031.072' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 18.94 25.977)'/%3E%3C/svg%3E\")}.ag-icon-cut:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M14.703 15.096 6.215 4.719a1 1 0 1 1 1.548-1.267l13.058 15.965A5.001 5.001 0 0 1 28 23.916a5 5 0 0 1-4.999 4.999 5 5 0 0 1-4.999-4.999 4.98 4.98 0 0 1 1.23-3.283l-3.238-3.958-3.272 4.001a4.98 4.98 0 0 1 1.265 3.323 5 5 0 0 1-4.999 4.999 5 5 0 0 1-4.999-4.999 5 5 0 0 1 7.13-4.522zM8.991 20.8a3.1 3.1 0 0 0-3.1 3.1c0 1.711 1.389 3.1 3.1 3.1s3.1-1.389 3.1-3.1-1.389-3.1-3.1-3.1M23 20.8a3.1 3.1 0 0 0-3.1 3.1c0 1.711 1.389 3.1 3.1 3.1s3.1-1.389 3.1-3.1-1.389-3.1-3.1-3.1m-5.723-8.852 1.292 1.579 7.205-8.808a1 1 0 0 0-1.548-1.267z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-desc:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m17 21.379 4.292-4.294 1.416 1.416L16 25.207l-6.708-6.706 1.416-1.416L15 21.379V6.793h2z'/%3E%3C/svg%3E\")}.ag-icon-adesc:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M10.387 11.47a.75.75 0 0 1 1.06 1.06l-3 3-.113.093a.75.75 0 0 1-.919-.065l-3.333-3a.75.75 0 0 1 1.003-1.116l2.806 2.525zM13.201 3.08q.65 0 1.135.222.487.223.759.619.27.396.279.918H14.19a.72.72 0 0 0-.293-.536q-.26-.192-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125a3.7 3.7 0 0 1 .701.229q.32.143.554.35.234.21.362.492.131.282.134.647a1.6 1.6 0 0 1-.273.93 1.74 1.74 0 0 1-.777.607q-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.641q-.29-.429-.305-1.059h1.194q.02.294.17.49.15.195.402.294.253.098.573.098.313 0 .544-.092a.84.84 0 0 0 .362-.254.6.6 0 0 0 .129-.373.5.5 0 0 0-.117-.33.9.9 0 0 0-.337-.23 3.4 3.4 0 0 0-.54-.17l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.926q.287-.396.79-.62a2.8 2.8 0 0 1 1.14-.222'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 9H4.489l-.432-1.332H1.948L1.515 9H.19l2.017-5.84h1.592zM2.262 6.704h1.481l-.718-2.21H2.98zM8.452 3.16q.645 0 1.075.19.43.192.648.53a1.4 1.4 0 0 1 .217.776q0 .342-.137.602a1.2 1.2 0 0 1-.376.423 1.6 1.6 0 0 1-.542.23v.058q.333.014.624.187.294.175.476.489.183.31.183.74 0 .465-.231.83a1.56 1.56 0 0 1-.676.574Q9.265 9 8.609 9H6.114V3.16zM7.35 7.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.291 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.397.64.64 0 0 0-.226-.51q-.223-.194-.633-.194H7.35z' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-down:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m17 21.379 4.292-4.294 1.416 1.416L16 25.207l-6.708-6.706 1.416-1.416L15 21.379V6.793h2z'/%3E%3C/svg%3E\")}.ag-icon-excel:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='m.052-.139.16-.234-.135-.208a.4.4 0 0 1-.028-.052.1.1 0 0 1-.01-.042.05.05 0 0 1 .018-.037.07.07 0 0 1 .045-.016q.03 0 .047.018a1 1 0 0 1 .047.066l.107.174.115-.174.024-.038.019-.026.021-.015a.1.1 0 0 1 .027-.005.06.06 0 0 1 .044.016.05.05 0 0 1 .018.039q0 .033-.038.089l-.141.211.152.234a.3.3 0 0 1 .03.051.1.1 0 0 1 .009.038.1.1 0 0 1-.008.031.1.1 0 0 1-.024.023.1.1 0 0 1-.034.008.1.1 0 0 1-.035-.008.1.1 0 0 1-.023-.022L.427-.067.301-.265l-.134.204-.022.034-.016.019a.1.1 0 0 1-.022.015.1.1 0 0 1-.03.005.06.06 0 0 1-.044-.016.06.06 0 0 1-.017-.047q0-.036.036-.088' style='fill-rule:nonzero' transform='matrix(17.82892 0 0 16.50777 10.371 25.928)'/%3E%3C/svg%3E\")}.ag-icon-expanded:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eexpanded%3C/title%3E%3Cpath d='M21.061 8.708 13.767 16l7.294 7.292-1.416 1.416L10.939 16l8.706-8.708z'/%3E%3C/svg%3E\")}.ag-icon-eye-slash:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye-slash%3C/title%3E%3Cpath d='M9.304 7.89a15.2 15.2 0 0 1 6.404-1.638c.294-.002.292-.002.584 0 5.956.174 11.328 4.088 13.62 9.748 0 0-1.318 3.178-3.224 5.174a13.6 13.6 0 0 1-2.226 1.874L26.414 25 25 26.414l-2.336-2.336C17.866 26.396 11.776 26.15 7.36 22.96a14.9 14.9 0 0 1-4.168-4.612c-.41-.71-.694-1.336-1.104-2.348 0 0 .898-2.218 2.002-3.718a14.6 14.6 0 0 1 3.442-3.334L5.586 7 7 5.586zm-.3 2.528c-2.038 1.344-3.708 3.246-4.724 5.508L4.248 16c2.46 5.762 9.622 9.064 15.63 7.15q.688-.219 1.342-.516l-.912-.912a6.96 6.96 0 0 1-4.19 1.394c-3.862 0-7-3.136-7-7 0-1.57.52-3.022 1.394-4.19zm14.032 11.204a13.25 13.25 0 0 0 4.684-5.548l.032-.074c-1.984-4.646-6.834-7.798-12.006-7.748-1.712.05-3.386.458-4.922 1.158l1.102 1.102a6.97 6.97 0 0 1 4.192-1.396 7.003 7.003 0 0 1 5.606 11.192zm-11.09-8.262a5.003 5.003 0 0 0 6.928 6.928zm8.342 5.514a5.002 5.002 0 0 0-6.928-6.928z'/%3E%3C/svg%3E\")}.ag-icon-eye:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye%3C/title%3E%3Cpath d='M16.292 6.32c5.956.174 11.328 4.086 13.62 9.746 0 0-1.318 3.18-3.224 5.176-4.862 5.088-13.534 5.97-19.328 1.784a14.9 14.9 0 0 1-4.168-4.612c-.41-.71-.694-1.336-1.104-2.348 0 0 .898-2.216 2.002-3.716 2.678-3.64 7.03-5.896 11.618-6.03.294-.004.292-.004.584 0m-.546 2c-4.896.142-9.458 3.202-11.466 7.672l-.032.074c2.46 5.762 9.622 9.066 15.63 7.152 3.458-1.102 6.342-3.738 7.842-7.076l.032-.076C25.768 11.42 20.918 8.27 15.746 8.32m.254.946c3.754 0 6.8 3.048 6.8 6.8 0 3.754-3.046 6.8-6.8 6.8s-6.8-3.046-6.8-6.8c0-3.752 3.046-6.8 6.8-6.8m5 6.768V16c0-2.76-2.24-5-5-5s-5 2.24-5 5v.066c0 2.76 2.24 5 5 5s5-2.24 5-5z'/%3E%3C/svg%3E\")}.ag-icon-filter:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efilter%3C/title%3E%3Cpath d='M26 8.184c-.066 2.658-4.058 5.154-6.742 7.974a1.05 1.05 0 0 0-.258.682v3.66L13 25c0-2.74.066-5.482-.002-8.222a1.05 1.05 0 0 0-.256-.62C10.026 13.304 6.06 10.61 6 8.184V6h20zM8 8c0 .304.06.612.258.842 2.716 2.854 6.682 5.548 6.742 7.974V21l2-1.5v-2.684c.066-2.658 4.058-5.154 6.742-7.974.198-.23.258-.538.258-.842z'/%3E%3C/svg%3E\")}.ag-icon-first:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efirst%3C/title%3E%3Cpath d='M24.354 8.708 17.06 16l7.294 7.292-1.416 1.416L14.232 16l8.706-8.708zM9.646 8v16h-2V8z'/%3E%3C/svg%3E\")}.ag-icon-group:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egroup%3C/title%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0M7.006 4c-1.57.02-2.946 1.348-3.004 2.922-.078 6.078-.23 12.16.002 18.234.094 1.484 1.354 2.746 2.84 2.84 6.1.232 12.212.232 18.312 0 1.48-.094 2.746-1.35 2.84-2.84.232-6.1.232-12.212 0-18.312-.094-1.48-1.35-2.746-2.84-2.84C19.11 3.774 13.056 4 7.006 4M14 21h-4v-2h4zm12 0H16v-2h10zm-12-4h-4v-2h4zm12 0H16v-2h10zm-16-4H6v-2h4zm16 0H12v-2h14z'/%3E%3C/svg%3E\")}.ag-icon-last:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elast%3C/title%3E%3Cpath d='m17.768 16-8.706 8.708-1.416-1.416L14.94 16 7.646 8.708l1.416-1.416zm6.586 8h-2V8h2z'/%3E%3C/svg%3E\")}.ag-icon-left:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eleft%3C/title%3E%3Cpath d='m17.621 11-2 2h12.586v6H15.621l2 2-4.414 4.414L3.793 16l9.414-9.414zm-11 5 6.586 6.586L14.793 21l-4-4h15.414v-2H10.793l4-4-1.586-1.586z'/%3E%3C/svg%3E\")}.ag-icon-linked:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elinked%3C/title%3E%3Cpath d='M17.138 13.418a1.03 1.03 0 0 0-.298.658s.125.096.226.178c1.372 1.114 2.033 3.039 1.582 4.796a4.7 4.7 0 0 1-1.205 2.123c-1.145 1.151-2.296 2.294-3.445 3.441-1.241 1.232-3.185 1.691-4.864 1.105-1.546-.54-2.756-1.938-3.048-3.572-.267-1.496.246-3.108 1.319-4.186l.578-.578-.03-.092a10.5 10.5 0 0 1-.452-2.3v-.005c-.776.775-1.621 1.489-2.275 2.396-1.817 2.522-1.643 6.323.706 8.669 1.813 1.811 4.708 2.462 7.171 1.517a6.75 6.75 0 0 0 2.336-1.518l3.427-3.424c1.939-1.954 2.533-5.126 1.294-7.674a6.8 6.8 0 0 0-2.071-2.481l-.003-.002zM21.265 4a6.8 6.8 0 0 0-4.734 1.964l-3.427 3.424c-1.961 1.977-2.52 5.092-1.32 7.619a6.8 6.8 0 0 0 2.098 2.537l.003.002c.32-.32.643-.637.96-.96.167-.172.27-.401.286-.64l-.204-.167c-1.603-1.287-2.215-3.68-1.316-5.616a4.7 4.7 0 0 1 .918-1.32c1.145-1.151 2.296-2.294 3.445-3.441 1.239-1.23 3.178-1.694 4.864-1.105 1.83.639 3.16 2.498 3.12 4.493a4.8 4.8 0 0 1-1.391 3.265l-.578.578.03.092c.235.743.387 1.519.452 2.3v.005c.732-.731 1.521-1.406 2.162-2.244 1.192-1.559 1.643-3.651 1.204-5.575a6.8 6.8 0 0 0-3.98-4.703 6.8 6.8 0 0 0-2.529-.506h-.061z'/%3E%3C/svg%3E\")}.ag-icon-loading:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eloading%3C/title%3E%3Cpath d='M17 29h-2v-8h2zm-3.586-9L7 26.414 5.586 25 12 18.586zm13 5L25 26.414 18.586 20 20 18.586zM29 17h-8v-2h8zm-18 0H3v-2h8zm2.414-5L12 13.414 5.586 7 7 5.586zm13-5L20 13.414 18.586 12 25 5.586zM17 11h-2V3h2z'/%3E%3C/svg%3E\")}.ag-icon-maximize:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3 3 26 26'%3E%3Ctitle%3Emaximize%3C/title%3E%3Cpath d='m7.54 17.4.1 6.98 6.96.1-2.24-2.24L16 18.6 13.4 16l-3.64 3.64zm16.92-2.8-.1-6.98-6.96-.1 2.24 2.24L16 13.4l2.6 2.6 3.64-3.64z'/%3E%3C/svg%3E\")}.ag-icon-menu:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Emenu%3C/title%3E%3Cpath d='M26 23H6v-2h20zm0-6H6v-2h20zm0-6H6V9h20z'/%3E%3C/svg%3E\")}.ag-icon-menu-alt:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none'%3E%3Cpath fill='%23000' d='M16 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4m0-7a2 2 0 1 0 0-4 2 2 0 0 0 0 4m0 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4'/%3E%3C/svg%3E\")}.ag-icon-minimize:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3 3 26 26'%3E%3Ctitle%3Eminimize%3C/title%3E%3Cpath d='m14.8 24.26-.1-6.96-6.96-.1 2.24 2.24-3.64 3.64 2.6 2.6 3.64-3.64zm2.4-16.52.1 6.96 6.96.1-2.24-2.24 3.64-3.64-2.6-2.6-3.64 3.64z'/%3E%3C/svg%3E\")}.ag-icon-minus:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.515 7.515c-4.683 4.682-4.683 12.288 0 16.97 4.682 4.683 12.288 4.683 16.97 0 4.683-4.682 4.683-12.288 0-16.97-4.682-4.683-12.288-4.683-16.97 0m1.414 1.414c3.903-3.903 10.239-3.903 14.142 0s3.903 10.239 0 14.142-10.239 3.903-14.142 0-3.903-10.239 0-14.142m-1.414 6.07h16.97v2.002H7.515z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-next:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enext%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E\")}.ag-icon-none:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enone%3C/title%3E%3Cpath d='m10.044 21.258 4.478-4.198L16 18.444 9 25l-7-6.556 1.478-1.384 4.478 4.198V7h2.088zm14 3.742h-2.088V10.742l-4.478 4.198L16 13.556 23 7q3.5 3.28 7 6.556l-1.478 1.384-4.478-4.198z'/%3E%3C/svg%3E\")}.ag-icon-not-allowed:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enot-allowed%3C/title%3E%3Cpath d='M16.186 3.646c8.188.154 14.898 9.796 11.17 17.78-3.298 7.066-13.932 9.374-19.848 3.87-3.9-3.632-5.076-9.896-2.684-14.708 2.082-4.19 6.588-6.974 11.362-6.942m-.298 1.998c-6.922.132-12.578 8.308-9.33 15.052 3.342 6.934 15.246 7.646 18.932 0 3.076-6.386-1.988-15.1-9.602-15.052m7.596 6.422c2.864 5.33-1.744 13.186-8.306 12.536a8.6 8.6 0 0 1-3.232-.998l-1.266-.706L22.778 10.8q.351.633.706 1.266m-9.422 10.276c3.296 1.028 7.246-1.006 8.216-4.418a6.6 6.6 0 0 0-.056-3.742zm2.104-14.696a8.8 8.8 0 0 1 3.936 1.038l1.266.706L9.27 21.488c-3.018-5.41-.99-13.37 6.318-13.834q.289-.01.578-.008m-.31 2c-4.06.154-7.23 4.614-6.03 8.46l8.16-8.16a6.8 6.8 0 0 0-2.13-.3'/%3E%3C/svg%3E\")}.ag-icon-paste:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epaste%3C/title%3E%3Cpath d='M20 6.5c0-1-1-3-4-3s-4 2-4 3H8c-2.21 0-4 1.79-4 4v14c0 2.21 1.79 4 4 4h16c2.21 0 4-1.79 4-4v-14c0-2.21-1.79-4-4-4zm-4 .546c.734 0 1.334.572 1.334 1.272S16.734 9.59 16 9.59s-1.334-.572-1.334-1.272.6-1.272 1.334-1.272M24 26.5H8a2 2 0 0 1-2-2v-14a2 2 0 0 1 2-2h2v4h12v-4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2'/%3E%3C/svg%3E\")}.ag-icon-pin:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epin%3C/title%3E%3Cpath d='m10.78 19.777-4.668-4.666s.032-1 .67-1.87c1.366-1.86 4.052-1.96 6.056-1.572l3.158-3.108c-.7-2.342 3.352-5.046 3.352-5.046l9.166 9.168q-.334.447-.67.894c-1.074 1.426-2.538 2.63-4.272 2.338l-3.32 3.218c.046.344.042.03.118 1.152.144 2.13-.64 4.324-2.632 5.34l-.746.364-4.798-4.798-7.292 7.294-1.416-1.416zm8.24-13.672c-.688.568-1.416 1.45-1.024 2.072l.49.722-4.986 4.988c-1.988-.506-4.346-.636-5.156.614l9.02 9.032q.14-.099.272-.21c1.226-1.08.764-3.04.498-4.9l4.79-4.79s1.47.938 2.936-.776l-6.79-6.79q-.026.019-.05.038'/%3E%3C/svg%3E\")}.ag-icon-pivot:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epivot%3C/title%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0m2.966 7.954H9.892v18.136c5.086.13 10.18.098 15.264-.096 1.48-.094 2.746-1.35 2.84-2.84.192-5.064.226-10.134.098-15.2M3.968 24.1q.015.528.036 1.056c.094 1.484 1.354 2.746 2.84 2.84l1.012.036V24.1zM22 15.414l-.292.294-1.416-1.416L23 11.586l2.708 2.706-1.416 1.416-.292-.294v3.592c-.032 2.604-2.246 4.892-4.872 4.992L15.414 24l.294.292-1.416 1.416L11.586 23l2.706-2.708 1.416 1.416-.322.32c3.372.03 6.578-.164 6.614-3.034zM3.88 18.038c.002 1.346.012 2.694.038 4.04h3.938v-4.04zm.05-6.062a681 681 0 0 0-.044 4.042h3.97v-4.042zm5.962-7.99Q8.449 3.999 7.006 4c-1.57.02-2.946 1.348-3.004 2.922q-.02 1.517-.042 3.034h3.896v-2.02h2.036zm14.244-.016v3.966h3.898q-.017-.546-.038-1.092c-.094-1.48-1.35-2.746-2.84-2.84q-.51-.019-1.02-.034m-8.14-.054q-2.035.022-4.07.048v3.972h4.07zm6.106.008c-1.358-.022-2.714-.026-4.07-.022v4.034h4.07z'/%3E%3C/svg%3E\")}.ag-icon-plus:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.515 7.515c-4.683 4.682-4.683 12.288 0 16.97 4.682 4.683 12.288 4.683 16.97 0 4.683-4.682 4.683-12.288 0-16.97-4.682-4.683-12.288-4.683-16.97 0m1.414 1.414c3.903-3.903 10.239-3.903 14.142 0s3.903 10.239 0 14.142-10.239 3.903-14.142 0-3.903-10.239 0-14.142M15 15l-.001-7.485h2.002L17 15l7.485-.001v2.002L17 17l.001 7.485h-2.002L15 17l-7.485.001v-2.002z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-previous:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eprevious%3C/title%3E%3Cpath d='M21.061 8.708 13.767 16l7.294 7.292-1.416 1.416L10.939 16l8.706-8.708z'/%3E%3C/svg%3E\")}.ag-icon-right:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eright%3C/title%3E%3Cpath d='m28.207 16-9.414 9.414L14.379 21l2-2H3.793v-6h12.586l-2-2 4.414-4.414zm-11-5 4 4H5.793v2h15.414l-4 4 1.586 1.586L25.379 16l-6.586-6.586z'/%3E%3C/svg%3E\")}.ag-icon-save:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esave%3C/title%3E%3Cpath d='M25.333 16v9.333H6.666V16H3.999v9.333C3.999 26.8 5.199 28 6.666 28h18.667C26.8 28 28 26.8 28 25.333V16zm-8 .893 3.453-3.44 1.88 1.88L15.999 22l-6.667-6.667 1.88-1.88 3.453 3.44V4h2.667v12.893z'/%3E%3C/svg%3E\")}.ag-icon-small-down:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-down%3C/title%3E%3Cpath d='M24.708 12.355 16 21.061l-8.708-8.706 1.416-1.416L16 18.233l7.292-7.294z'/%3E%3C/svg%3E\")}.ag-icon-small-left:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-left%3C/title%3E%3Cpath d='M21.061 8.708 13.767 16l7.294 7.292-1.416 1.416L10.939 16l8.706-8.708z'/%3E%3C/svg%3E\")}.ag-icon-small-right:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-right%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E\")}.ag-icon-small-up:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-up%3C/title%3E%3Cpath d='m24.708 19.645-1.416 1.416L16 13.767l-7.292 7.294-1.416-1.416L16 10.939z'/%3E%3C/svg%3E\")}.ag-icon-tick:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etick%3C/title%3E%3Cpath d='M24.708 10.855 13 22.561l-5.708-5.706 1.416-1.416L13 19.733 23.292 9.439z'/%3E%3C/svg%3E\")}.ag-icon-tree-closed:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-closed%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E\")}.ag-icon-tree-indeterminate:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-indeterminate%3C/title%3E%3Cpath d='M6 15h20v2H6z'/%3E%3C/svg%3E\")}.ag-icon-tree-open:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-open%3C/title%3E%3Cpath d='M24.708 12.355 16 21.061l-8.708-8.706 1.416-1.416L16 18.233l7.292-7.294z'/%3E%3C/svg%3E\")}.ag-icon-unlinked:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eunlinked%3C/title%3E%3Cpath d='M5.35 3.999a.2.2 0 0 0-.14.058c-.388.38-.768.768-1.152 1.152a.21.21 0 0 0-.002.288c7.459 7.506 14.965 14.965 22.447 22.447a.21.21 0 0 0 .288.002q.576-.574 1.151-1.151a.21.21 0 0 0 .002-.288C20.484 19.002 12.979 11.542 5.497 4.06a.2.2 0 0 0-.146-.061zm.611 12.548c-1.933 1.939-2.538 5.119-1.289 7.688a6.79 6.79 0 0 0 4.891 3.672 6.82 6.82 0 0 0 5.893-1.866l1.984-1.984-1.438-1.438-1.986 1.986c-1.486 1.476-3.993 1.81-5.834.629a4.73 4.73 0 0 1-2.024-2.853 4.76 4.76 0 0 1 1.241-4.393l1.986-1.986-1.438-1.438-1.984 1.984zM21.273 3.999a6.78 6.78 0 0 0-4.727 1.963l-1.984 1.984L16 9.384l1.985-1.985a4.74 4.74 0 0 1 2.776-1.338c1.974-.224 4.045.926 4.845 2.834.712 1.699.329 3.778-1.004 5.12L22.616 16l1.439 1.438q1-1 2-2c2.012-2.031 2.557-5.368 1.112-7.982-1.144-2.07-3.432-3.441-5.834-3.459h-.061z'/%3E%3C/svg%3E\")}.ag-icon-up:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m15 10.621-4.292 4.294-1.416-1.416L16 6.793l6.708 6.706-1.416 1.416L17 10.621v14.586h-2z'/%3E%3C/svg%3E\")}.ag-icon-grip:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egrip%3C/title%3E%3Cpath d='M8 24H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 18H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 12H6V8h2zm6 0h-2V8h2zm6 0h-2V8h2zm6 0h-2V8h2z'/%3E%3C/svg%3E\")}.ag-icon-settings:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3M2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3 1.3-3 3-3'/%3E%3C/svg%3E\")}.ag-icon-column-arrow:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11 4a1 1 0 0 1 1 1v22a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 13a1 1 0 0 1 1-1h23.5a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 4h18v24H2zm2 2v20h14V6zM26.793 13 23 9.207l1.414-1.414L29.621 13l-5.207 5.207L23 16.793z' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-un-pin:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m6.112 15.111 3.272 3.271 1.436-1.402-2.476-2.479c.81-1.25 3.168-1.12 5.156-.614l4.986-4.988-.49-.722c-.392-.622.336-1.504 1.024-2.072l.008-.007.01-.006.032-.025 1.447 1.447 1.432-1.397-2.601-2.602s-4.052 2.704-3.352 5.046l-3.158 3.108c-2.004-.388-4.69-.288-6.056 1.572-.638.87-.67 1.87-.67 1.87m.581 11.582.014.014 5.502-5.501 4.783 4.783.746-.364c1.992-1.016 2.776-3.21 2.632-5.34-.055-.805-.068-.87-.088-.97-.008-.04-.017-.085-.03-.182l3.32-3.218c1.734.292 3.198-.912 4.272-2.338q.337-.447.67-.894l-.001-.001-.007-.007-.007-.007-.007-.007-3.87-3.87 1.585-1.584-1.414-1.414-14.381 14.38-1.237 1.209-5.69 5.687 1.417 1.416zM23.21 10.206l2.65 2.651c-1.465 1.714-2.935.776-2.935.776l-4.79 4.79q.041.291.087.583c.257 1.676.513 3.35-.585 4.317a4 4 0 0 1-.272.21l-3.739-3.744z' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-pinned-top:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='m16.708 10.878 8.708 8.706L24 21l-6.292-6.294V27h-2V14.706L9.416 21 8 19.584q4.348-4.344 8.691-8.69zM25 6H8v2h17z'/%3E%3C/svg%3E\")}.ag-icon-pinned-bottom:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M16.708 22.122 8 13.416 9.416 12l6.292 6.294V6h2v12.294L24 12l1.416 1.416-8.691 8.69zM7.416 28h17v-2h-17z'/%3E%3C/svg%3E\")}.ag-icon-chevron-up:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3.479 10.521a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1-1.06 1.06l-3.47-3.47-3.47 3.47a.75.75 0 0 1-1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-chevron-down:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.521 5.461a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 1.06-1.06l3.47 3.47 3.47-3.47a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-chevron-left:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.53 12.512a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 1.06l-3.47 3.47 3.47 3.47a.75.75 0 0 1 0 1.06' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-chevron-right:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M5.47 3.47a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06-1.06L8.94 8 5.47 4.53a.75.75 0 0 1 0-1.06' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-filter-add:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M19.834 8H8c0 .304.06.612.258.842 2.716 2.854 6.682 5.548 6.742 7.974V21l2-1.5v-2.684c.056-2.267 2.968-4.417 5.49-6.75v3.087c-1.081.974-2.245 1.968-3.232 3.005a1.05 1.05 0 0 0-.258.682v3.66L13 25c0-2.74.066-5.482-.002-8.222a1.05 1.05 0 0 0-.256-.62C10.026 13.304 6.06 10.61 6 8.184V6h13.834z'/%3E%3Cpath fill='currentColor' d='M26 6h2.946v2.002H26v3.313h-2.002V8.002h-2.946V6h2.946V3.04H26z'/%3E%3C/svg%3E\")}.ag-icon-edit:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M23.182 5a3.82 3.82 0 0 1 2.83 6.383l-.131.137-2.09 2.088a1 1 0 0 1-.084.099 1 1 0 0 1-.098.084L12.533 24.869a3 3 0 0 1-1.245.746l-4.353 1.32-.003.002a1.5 1.5 0 0 1-1.87-1.867l.003-.004 1.32-4.352v-.003l.06-.174c.13-.344.321-.661.565-.936l.126-.135L18.209 8.39a1 1 0 0 1 .18-.181l2.092-2.09.137-.132A3.82 3.82 0 0 1 23.182 5M8.548 20.883a1 1 0 0 0-.25.415l-1.049 3.451 3.457-1.048.114-.042q.17-.076.301-.206l10.458-10.46-2.572-2.572zM23.182 7c-.482 0-.946.19-1.287.531v.001l-1.474 1.475 2.572 2.572 1.474-1.474.121-.133A1.82 1.82 0 0 0 23.182 7'/%3E%3C/svg%3E\")}`;\n\n// packages/ag-grid-community/src/theming/parts/icon-set/balham/icon-set-balham.ts\nvar iconSetBalham = /* @__PURE__ */ createPart({\n feature: \"iconSet\",\n css: icon_set_balham_default\n});\n\n// packages/ag-grid-community/src/theming/parts/icon-set/alpine/icon-set-alpine.css\nvar icon_set_alpine_default = `.ag-icon-aggregation:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M24 6H8v2l8 8-8 8v2h16v-2H11l8-8-8-8h13z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-arrows:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.515 11.171 2.687 16l4.828 4.829-1.414 1.414L-.142 16l6.243-6.243zm16.97 0 1.414-1.414L32.142 16l-6.243 6.243-1.414-1.414L29.313 16zM16.028 13.2l2.829 2.828-2.829 2.829-2.828-2.829zm-4.857 11.285L16 29.313l4.829-4.828 1.414 1.414L16 32.142l-6.243-6.243zm0-16.97L9.757 6.101 16-.142l6.243 6.243-1.414 1.414L16 2.687z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-asc:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333 5.332 16z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-aasc:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M13.201 8.08q.65 0 1.135.222.487.222.759.618.27.396.279.919H14.19a.72.72 0 0 0-.293-.536q-.26-.191-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125q.382.086.701.229.32.143.554.35.234.21.362.49.131.284.134.648a1.6 1.6 0 0 1-.273.93q-.27.391-.777.608-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.642q-.29-.428-.305-1.058h1.194q.02.294.17.49.15.195.402.294.253.097.573.097.313 0 .544-.09a.84.84 0 0 0 .362-.255.6.6 0 0 0 .129-.374q0-.195-.117-.33a.9.9 0 0 0-.337-.228 3.4 3.4 0 0 0-.54-.171l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.927q.287-.396.79-.618a2.8 2.8 0 0 1 1.14-.223'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 14H4.489l-.432-1.332H1.948L1.515 14H.19l2.017-5.84h1.592zm-3.551-2.296h1.481l-.718-2.21H2.98zM8.452 8.16q.645 0 1.075.19.43.191.648.531a1.4 1.4 0 0 1 .217.775q0 .343-.137.602-.137.256-.376.422a1.6 1.6 0 0 1-.542.231v.057q.333.015.624.188.294.175.476.489.183.31.183.74 0 .466-.231.831a1.56 1.56 0 0 1-.676.573Q9.265 14 8.609 14H6.114V8.16zM7.35 12.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.29 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.396.64.64 0 0 0-.226-.511q-.223-.195-.633-.194H7.35z' clip-rule='evenodd'/%3E%3Cpath fill='%23000' d='M7.166.377a.75.75 0 0 1 .919.066l3.333 3a.75.75 0 0 1-1.003 1.115L7.609 2.033 5.113 4.53a.75.75 0 0 1-1.06-1.06l3-3z'/%3E%3C/svg%3E\")}.ag-icon-cancel:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M16 2.667A13.32 13.32 0 0 0 2.667 16c0 7.373 5.96 13.333 13.333 13.333S29.333 23.373 29.333 16 23.373 2.667 16 2.667m6.667 18.12-1.88 1.88L16 17.88l-4.787 4.787-1.88-1.88L14.12 16l-4.787-4.787 1.88-1.88L16 14.12l4.787-4.787 1.88 1.88L17.88 16z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-chart:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Echart%3C/title%3E%3Cg fill='%23000' fill-rule='nonzero'%3E%3Cpath d='M14 7h4v18h-4zM8 17h4v8H8zM20 13h4v12h-4z'/%3E%3C/g%3E%3C/svg%3E\")}.ag-icon-color-picker:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M23.907 17.587 10.574 4.254l-1.88 1.88 3.173 3.173-8.28 8.28 10.16 10.16zm-16.547 0 6.387-6.387 6.387 6.387zm18.387 2s-2.667 2.893-2.667 4.667c0 1.467 1.2 2.667 2.667 2.667s2.667-1.2 2.667-2.667c0-1.773-2.667-4.667-2.667-4.667' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-columns:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M26 25H6V7h20zM12 11H8v12h4zm6 0h-4v12h4zm6 12V11h-4v12z' style='fill-rule:nonzero' transform='translate(0 -1)'/%3E%3C/svg%3E\")}.ag-icon-contracted:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m12 6 10 10-10 10-2-2 8-8-8-8z'/%3E%3C/svg%3E\")}.ag-icon-copy:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M22 1.333H6A2.675 2.675 0 0 0 3.333 4v18.667H6V4h16zm4 5.334H11.333a2.675 2.675 0 0 0-2.667 2.667v18.667c0 1.467 1.2 2.667 2.667 2.667H26c1.467 0 2.667-1.2 2.667-2.667V9.334c0-1.467-1.2-2.667-2.667-2.667M26 28H11.333V9.333H26z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-cross:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M15.984 13.894 27.05 2.828l2.122 2.122-11.066 11.066 11.066 11.066-2.122 2.12-11.066-11.066L4.918 29.202l-2.12-2.12 11.066-11.066L2.798 4.95l2.12-2.122z'/%3E%3C/svg%3E\")}.ag-icon-csv:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='M.688-.226a.2.2 0 0 1-.017.074.28.28 0 0 1-.145.14.412.412 0 0 1-.234.013.28.28 0 0 1-.202-.168.468.468 0 0 1-.04-.19q0-.086.025-.155a.319.319 0 0 1 .182-.191.4.4 0 0 1 .134-.025q.087 0 .155.035a.3.3 0 0 1 .104.085.17.17 0 0 1 .036.097.06.06 0 0 1-.018.044.06.06 0 0 1-.042.019.06.06 0 0 1-.042-.013.2.2 0 0 1-.031-.046.2.2 0 0 0-.066-.079.16.16 0 0 0-.095-.027.17.17 0 0 0-.142.068.3.3 0 0 0-.053.193.4.4 0 0 0 .023.139.2.2 0 0 0 .067.083.2.2 0 0 0 .1.027q.063 0 .106-.031a.2.2 0 0 0 .065-.091.2.2 0 0 1 .023-.046q.014-.018.044-.018a.06.06 0 0 1 .044.018.06.06 0 0 1 .019.045' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 7.122 25.977)'/%3E%3Cpath d='M.622-.215a.2.2 0 0 1-.033.117.23.23 0 0 1-.098.081.4.4 0 0 1-.153.029.34.34 0 0 1-.175-.04.23.23 0 0 1-.079-.077.17.17 0 0 1-.031-.093q0-.027.019-.045a.06.06 0 0 1 .046-.019.06.06 0 0 1 .039.014.1.1 0 0 1 .027.044.3.3 0 0 0 .03.057q.015.023.044.038.03.015.076.015.065 0 .105-.03a.09.09 0 0 0 .04-.075.08.08 0 0 0-.022-.058.14.14 0 0 0-.056-.034 1 1 0 0 0-.092-.025.7.7 0 0 1-.129-.042.2.2 0 0 1-.083-.066.17.17 0 0 1-.03-.104q0-.058.032-.105a.2.2 0 0 1 .093-.07.4.4 0 0 1 .144-.025q.066 0 .114.016a.3.3 0 0 1 .08.044.2.2 0 0 1 .046.057q.015.03.015.058a.07.07 0 0 1-.018.046.06.06 0 0 1-.046.021q-.025 0-.038-.012a.2.2 0 0 1-.028-.041.2.2 0 0 0-.047-.063Q.387-.625.326-.625a.15.15 0 0 0-.09.025q-.035.024-.035.059 0 .021.012.037a.1.1 0 0 0 .032.027.4.4 0 0 0 .111.036q.06.015.11.031.048.018.083.042a.2.2 0 0 1 .054.062.2.2 0 0 1 .019.091' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 13.339 25.977)'/%3E%3Cpath d='m.184-.633.162.48.163-.483q.013-.038.019-.053a.062.062 0 0 1 .061-.039q.018 0 .034.009a.1.1 0 0 1 .025.025q.009.015.009.031L.654-.64l-.007.025-.009.024-.173.468-.019.051a.2.2 0 0 1-.021.042.1.1 0 0 1-.033.03.1.1 0 0 1-.049.012.1.1 0 0 1-.05-.011A.1.1 0 0 1 .26-.03a.2.2 0 0 1-.021-.042L.22-.123.05-.587.041-.612.033-.638.03-.662q0-.025.02-.046a.07.07 0 0 1 .05-.02q.037 0 .053.023.015.023.031.072' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 18.94 25.977)'/%3E%3C/svg%3E\")}.ag-icon-cut:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M13.775 15.198 3.835 2.945a1.501 1.501 0 0 1 2.33-1.89l14.997 18.488A6.003 6.003 0 0 1 29.657 25c0 3.311-2.688 6-6 6s-6-2.689-6-6c0-1.335.437-2.569 1.176-3.566l-3.127-3.855-3.001 3.7A5.97 5.97 0 0 1 14 25c0 3.311-2.689 6-6 6s-6-2.689-6-6a6.003 6.003 0 0 1 8.315-5.536zm9.882 6.702a3.1 3.1 0 0 0-3.1 3.1c0 1.711 1.389 3.1 3.1 3.1s3.1-1.389 3.1-3.1-1.389-3.1-3.1-3.1M8 21.95a3.05 3.05 0 1 0 .001 6.101A3.05 3.05 0 0 0 8 21.95m9.63-11.505 1.932 2.381 8.015-9.881a1.5 1.5 0 0 0-2.329-1.89z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-desc:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-adesc:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M10.387 11.47a.75.75 0 0 1 1.06 1.06l-3 3-.113.093a.75.75 0 0 1-.919-.065l-3.333-3a.75.75 0 0 1 1.003-1.116l2.806 2.525zM13.201 3.08q.65 0 1.135.222.487.223.759.619.27.396.279.918H14.19a.72.72 0 0 0-.293-.536q-.26-.192-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125a3.7 3.7 0 0 1 .701.229q.32.143.554.35.234.21.362.492.131.282.134.647a1.6 1.6 0 0 1-.273.93 1.74 1.74 0 0 1-.777.607q-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.641q-.29-.429-.305-1.059h1.194q.02.294.17.49.15.195.402.294.253.098.573.098.313 0 .544-.092a.84.84 0 0 0 .362-.254.6.6 0 0 0 .129-.373.5.5 0 0 0-.117-.33.9.9 0 0 0-.337-.23 3.4 3.4 0 0 0-.54-.17l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.926q.287-.396.79-.62a2.8 2.8 0 0 1 1.14-.222'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 9H4.489l-.432-1.332H1.948L1.515 9H.19l2.017-5.84h1.592zM2.262 6.704h1.481l-.718-2.21H2.98zM8.452 3.16q.645 0 1.075.19.43.192.648.53a1.4 1.4 0 0 1 .217.776q0 .342-.137.602a1.2 1.2 0 0 1-.376.423 1.6 1.6 0 0 1-.542.23v.058q.333.014.624.187.294.175.476.489.183.31.183.74 0 .465-.231.83a1.56 1.56 0 0 1-.676.574Q9.265 9 8.609 9H6.114V3.16zM7.35 7.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.291 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.397.64.64 0 0 0-.226-.51q-.223-.194-.633-.194H7.35z' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-down:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-excel:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='m.052-.139.16-.234-.135-.208a.4.4 0 0 1-.028-.052.1.1 0 0 1-.01-.042.05.05 0 0 1 .018-.037.07.07 0 0 1 .045-.016q.03 0 .047.018a1 1 0 0 1 .047.066l.107.174.115-.174.024-.038.019-.026.021-.015a.1.1 0 0 1 .027-.005.06.06 0 0 1 .044.016.05.05 0 0 1 .018.039q0 .033-.038.089l-.141.211.152.234a.3.3 0 0 1 .03.051.1.1 0 0 1 .009.038.1.1 0 0 1-.008.031.1.1 0 0 1-.024.023.1.1 0 0 1-.034.008.1.1 0 0 1-.035-.008.1.1 0 0 1-.023-.022L.427-.067.301-.265l-.134.204-.022.034-.016.019a.1.1 0 0 1-.022.015.1.1 0 0 1-.03.005.06.06 0 0 1-.044-.016.06.06 0 0 1-.017-.047q0-.036.036-.088' style='fill-rule:nonzero' transform='matrix(17.82892 0 0 16.50777 10.371 25.928)'/%3E%3C/svg%3E\")}.ag-icon-expanded:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M20 26 10 16 20 6l2 2-8 8 8 8z'/%3E%3C/svg%3E\")}.ag-icon-eye-slash:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye-slash%3C/title%3E%3Cpath fill='%23000' fill-rule='nonzero' d='M8.95 10.364 7 8.414 8.414 7l2.32 2.32A13.2 13.2 0 0 1 16.5 8c5.608 0 10.542 3.515 12.381 8.667L29 17l-.119.333a13 13 0 0 1-4.255 5.879l1.466 1.466-1.414 1.414-1.754-1.753A13.2 13.2 0 0 1 16.5 26c-5.608 0-10.542-3.515-12.381-8.667L4 17l.119-.333a13 13 0 0 1 4.83-6.303m1.445 1.445A11.02 11.02 0 0 0 6.148 17c1.646 4.177 5.728 7 10.352 7 1.76 0 3.441-.409 4.94-1.146l-1.878-1.878A5.06 5.06 0 0 1 16.5 22c-2.789 0-5.05-2.239-5.05-5 0-1.158.398-2.223 1.065-3.07zm1.855-.974 1.794 1.795A5.07 5.07 0 0 1 16.5 12c2.789 0 5.05 2.239 5.05 5 0 .9-.24 1.745-.661 2.474l2.305 2.306A11 11 0 0 0 26.852 17c-1.646-4.177-5.728-7-10.352-7-1.495 0-2.933.295-4.25.835'/%3E%3C/svg%3E\")}.ag-icon-eye:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M16.5 23c4.624 0 8.706-2.823 10.352-7-1.646-4.177-5.728-7-10.352-7s-8.706 2.823-10.352 7c1.646 4.177 5.728 7 10.352 7M4.119 15.667C5.958 10.515 10.892 7 16.5 7s10.542 3.515 12.381 8.667L29 16l-.119.333C27.042 21.485 22.108 25 16.5 25S5.958 21.485 4.119 16.333L4 16zM16.5 21c2.789 0 5.049-2.239 5.049-5s-2.26-5-5.049-5-5.049 2.239-5.049 5 2.26 5 5.049 5' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-filter:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m28 8-8 8v5l-6 6V16L6 8V6h22zM9 8l7 7v7l2-2v-5l7-7z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-first:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M24.273 22.12 18.153 16l6.12-6.12L22.393 8l-8 8 8 8zM7.727 8h2.667v16H7.727z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-group:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M14 7v1H9V7zm0-3v1H5.001V4zm-7 7H5v-1h2zm0-3H5V7h2zM3 5H1V4h2zm11 5v1H9v-1zm-7 4H5v-1h2zm7-1v1H9v-1z' style='fill-rule:nonzero' transform='matrix(2 0 0 2 0 -2)'/%3E%3C/svg%3E\")}.ag-icon-last:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m7.727 9.88 6.12 6.12-6.12 6.12L9.607 24l8-8-8-8zM21.607 8h2.667v16h-2.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-left:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M26.667 14.667H10.44l7.453-7.453L16 5.334 5.333 16.001 16 26.668l1.88-1.88-7.44-7.453h16.227z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-linked:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M5.2 16a4.136 4.136 0 0 1 4.133-4.133h5.333V9.334H9.333a6.67 6.67 0 0 0-6.667 6.667 6.67 6.67 0 0 0 6.667 6.667h5.333v-2.533H9.333A4.136 4.136 0 0 1 5.2 16.002zm5.467 1.333h10.667v-2.667H10.667zm12-8h-5.333v2.533h5.333a4.136 4.136 0 0 1 4.133 4.133 4.136 4.136 0 0 1-4.133 4.133h-5.333v2.533h5.333a6.67 6.67 0 0 0 6.667-6.667 6.67 6.67 0 0 0-6.667-6.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-loading:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M17 29h-2v-8h2zm-3.586-9L7 26.414 5.586 25 12 18.586zm13 5L25 26.414 18.586 20 20 18.586zM29 17h-8v-2h8zm-18 0H3v-2h8zm2.414-5L12 13.414 5.586 7 7 5.586zm13-5L20 13.414 18.586 12 25 5.586zM17 11h-2V3h2z' style='fill-rule:nonzero' transform='translate(-3.692 -3.692)scale(1.23077)'/%3E%3C/svg%3E\")}.ag-icon-maximize:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M14 30H2V18h2.828v7.05l8.254-8.252 2.12 2.12-8.252 8.254H14zm4-28h12v12h-2.828V6.95l-8.254 8.252-2.12-2.12 8.252-8.254H18z'/%3E%3C/svg%3E\")}.ag-icon-menu:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M20 13H0v-2h20zm0-6H0V5h20zm0-6H0v-2h20z' style='fill-rule:nonzero' transform='translate(6 9)'/%3E%3C/svg%3E\")}.ag-icon-menu-alt:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M16 19a3 3 0 1 0 0-6 3 3 0 0 0 0 6M16 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6M16 27a3 3 0 1 0 0-6 3 3 0 0 0 0 6'/%3E%3C/svg%3E\")}.ag-icon-minimize:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M2 18h12v12h-2.828v-7.05l-8.254 8.252-2.12-2.12 8.252-8.254H2zm28-4H18V2h2.828v7.05L29.082.798l2.12 2.12-8.252 8.254H30z'/%3E%3C/svg%3E\")}.ag-icon-minus:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658H7.901v-2.658z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-next:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M10.94 6 9.06 7.88 17.167 16 9.06 24.12 10.94 26l10-10z' style='fill-rule:nonzero' transform='translate(1)'/%3E%3C/svg%3E\")}.ag-icon-none:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enone%3C/title%3E%3Cg fill='%23000' fill-rule='nonzero'%3E%3Cpath d='M23.708 14.645 16 6.939l-7.708 7.706 1.416 1.416L16 9.767l6.292 6.294zM23.708 20.355 16 28.061l-7.708-7.706 1.416-1.416L16 25.233l6.292-6.294z'/%3E%3C/g%3E%3C/svg%3E\")}.ag-icon-not-allowed:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M16 2.667C8.64 2.667 2.667 8.64 2.667 16S8.64 29.333 16 29.333 29.333 23.36 29.333 16 23.36 2.667 16 2.667M5.333 16c0-5.893 4.773-10.667 10.667-10.667 2.467 0 4.733.84 6.533 2.253L7.586 22.533A10.54 10.54 0 0 1 5.333 16M16 26.667c-2.467 0-4.733-.84-6.533-2.253L24.414 9.467A10.54 10.54 0 0 1 26.667 16c0 5.893-4.773 10.667-10.667 10.667' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-paste:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M25.334 4H19.76C19.2 2.453 17.733 1.333 16 1.333S12.8 2.453 12.24 4H6.667A2.675 2.675 0 0 0 4 6.667V28c0 1.467 1.2 2.667 2.667 2.667h18.667c1.467 0 2.667-1.2 2.667-2.667V6.667C28.001 5.2 26.801 4 25.334 4M16 4c.733 0 1.333.6 1.333 1.333s-.6 1.333-1.333 1.333-1.333-.6-1.333-1.333S15.267 4 16 4m9.333 24H6.666V6.667h2.667v4h13.333v-4h2.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-pin:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m10.78 19.777-4.668-4.666s.032-1 .67-1.87c1.366-1.86 4.052-1.96 6.056-1.572l3.158-3.108c-.7-2.342 3.352-5.046 3.352-5.046l9.166 9.168q-.334.447-.67.894c-1.074 1.426-2.538 2.63-4.272 2.338l-3.32 3.218c.046.344.042.03.118 1.152.144 2.13-.64 4.324-2.632 5.34l-.746.364-4.798-4.798-7.292 7.294-1.416-1.416zm8.24-13.672c-.688.568-1.416 1.45-1.024 2.072l.49.722-4.986 4.988c-1.988-.506-4.346-.636-5.156.614l9.02 9.032q.14-.099.272-.21c1.226-1.08.764-3.04.498-4.9l4.79-4.79s1.47.938 2.936-.776l-6.79-6.79q-.026.019-.05.038' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-pivot:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0m2.966 7.954H9.892v18.136c5.086.13 10.18.098 15.264-.096 1.48-.094 2.746-1.35 2.84-2.84.192-5.064.226-10.134.098-15.2M3.968 24.1q.015.528.036 1.056c.094 1.484 1.354 2.746 2.84 2.84l1.012.036V24.1zM22 15.414l-.292.294-1.416-1.416L23 11.586l2.708 2.706-1.416 1.416-.292-.294v3.592c-.032 2.604-2.246 4.892-4.872 4.992L15.414 24l.294.292-1.416 1.416L11.586 23l2.706-2.708 1.416 1.416-.322.32c3.372.03 6.578-.164 6.614-3.034zM3.88 18.038c.002 1.346.012 2.694.038 4.04h3.938v-4.04zm.05-6.062a681 681 0 0 0-.044 4.042h3.97v-4.042zm5.962-7.99Q8.449 3.999 7.006 4c-1.57.02-2.946 1.348-3.004 2.922q-.02 1.517-.042 3.034h3.896v-2.02h2.036zm14.244-.016v3.966h3.898q-.017-.546-.038-1.092c-.094-1.48-1.35-2.746-2.84-2.84q-.51-.019-1.02-.034m-8.14-.054q-2.035.022-4.07.048v3.972h4.07zm6.106.008a213 213 0 0 0-4.07-.022v4.034h4.07z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-plus:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658h-6.77v6.77h-2.658v-6.77h-6.77v-2.658h6.77v-6.77h2.658v6.77z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-previous:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M21.94 7.88 20.06 6l-10 10 10 10 1.88-1.88L13.833 16z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-right:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m16 5.333-1.88 1.88 7.44 7.453H5.333v2.667H21.56l-7.44 7.453 1.88 1.88 10.667-10.667L16 5.332z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-save:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M15.708 2.355 8 10.061.292 2.355 1.708.939 8 7.233 14.292.939z' style='fill-rule:nonzero' transform='translate(8 14)'/%3E%3Cpath d='M5 26h22v2H5zM15 4h2v18h-2z'/%3E%3C/svg%3E\")}.ag-icon-small-down:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.334 10.667 16 21.334l8.667-10.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-small-left:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M21.333 7.334 10.666 16l10.667 8.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-small-right:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M10.667 24.666 21.334 16 10.667 7.333z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-small-up:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.334 21.333 16 10.666l8.667 10.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-tick:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M11.586 22.96 27.718 6.828 29.84 8.95 11.586 27.202 2.4 18.016l2.12-2.122z'/%3E%3C/svg%3E\")}.ag-icon-tree-closed:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m11.94 6-1.88 1.88L18.167 16l-8.107 8.12L11.94 26l10-10z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-tree-indeterminate:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6 13.5h20v3H6z'/%3E%3C/svg%3E\")}.ag-icon-tree-open:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M24.12 9.06 16 17.167 7.88 9.06 6 10.94l10 10 10-10z' style='fill-rule:nonzero' transform='translate(0 1)'/%3E%3C/svg%3E\")}.ag-icon-unlinked:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M22.667 9.333h-5.333v2.533h5.333a4.136 4.136 0 0 1 4.133 4.133c0 1.907-1.307 3.507-3.08 3.973l1.947 1.947c2.173-1.107 3.667-3.32 3.667-5.92a6.67 6.67 0 0 0-6.667-6.667zm-1.334 5.334h-2.92l2.667 2.667h.253zM2.667 5.693 6.814 9.84A6.65 6.65 0 0 0 2.667 16a6.67 6.67 0 0 0 6.667 6.667h5.333v-2.533H9.334a4.136 4.136 0 0 1-4.133-4.133c0-2.12 1.613-3.867 3.68-4.093l2.76 2.76h-.973v2.667h3.64l3.027 3.027v2.307h2.307l5.347 5.333 1.68-1.68L4.362 4.002 2.669 5.695z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-up:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333 5.332 16z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-grip:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M8 24H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 18H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 12H6V8h2zm6 0h-2V8h2zm6 0h-2V8h2zm6 0h-2V8h2z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-settings:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3M2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3 1.3-3 3-3'/%3E%3C/svg%3E\")}.ag-icon-column-arrow:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11 4a1 1 0 0 1 1 1v22a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 13a1 1 0 0 1 1-1h23.5a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 4h18v24H2zm2 2v20h14V6zM26.793 13 23 9.207l1.414-1.414L29.621 13l-5.207 5.207L23 16.793z' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-un-pin:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m6.112 15.111 3.272 3.271 1.436-1.402-2.476-2.479c.81-1.25 3.168-1.12 5.156-.614l4.986-4.988-.49-.722c-.392-.622.336-1.504 1.024-2.072l.008-.007.01-.006.032-.025 1.447 1.447 1.432-1.397-2.601-2.602s-4.052 2.704-3.352 5.046l-3.158 3.108c-2.004-.388-4.69-.288-6.056 1.572-.638.87-.67 1.87-.67 1.87m.581 11.582.014.014 5.502-5.501 4.783 4.783.746-.364c1.992-1.016 2.776-3.21 2.632-5.34-.055-.805-.068-.87-.088-.97-.008-.04-.017-.085-.03-.182l3.32-3.218c1.734.292 3.198-.912 4.272-2.338q.337-.447.67-.894l-.001-.001-.007-.007-.007-.007-.007-.007-3.87-3.87 1.585-1.584-1.414-1.414-14.381 14.38-1.237 1.209-5.69 5.687 1.417 1.416zM23.21 10.206l2.65 2.651c-1.465 1.714-2.935.776-2.935.776l-4.79 4.79q.041.291.087.583c.257 1.676.513 3.35-.585 4.317a4 4 0 0 1-.272.21l-3.739-3.744z' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-pinned-top:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='m16.708 10.878 8.708 8.706L24 21l-6.292-6.294V27h-2V14.706L9.416 21 8 19.584q4.348-4.344 8.691-8.69zM25 6H8v2h17z'/%3E%3C/svg%3E\")}.ag-icon-pinned-bottom:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M16.708 22.122 8 13.416 9.416 12l6.292 6.294V6h2v12.294L24 12l1.416 1.416-8.691 8.69zM7.416 28h17v-2h-17z'/%3E%3C/svg%3E\")}.ag-icon-chevron-up:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3.479 10.521a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1-1.06 1.06l-3.47-3.47-3.47 3.47a.75.75 0 0 1-1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-chevron-down:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.521 5.461a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 1.06-1.06l3.47 3.47 3.47-3.47a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-chevron-left:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.53 12.512a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 1.06l-3.47 3.47 3.47 3.47a.75.75 0 0 1 0 1.06' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-chevron-right:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M5.47 3.47a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06-1.06L8.94 8 5.47 4.53a.75.75 0 0 1 0-1.06' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-filter-add:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M19.834 8H8c0 .304.06.612.258.842 2.716 2.854 6.682 5.548 6.742 7.974V21l2-1.5v-2.684c.056-2.267 2.968-4.417 5.49-6.75v3.087c-1.081.974-2.245 1.968-3.232 3.005a1.05 1.05 0 0 0-.258.682v3.66L13 25c0-2.74.066-5.482-.002-8.222a1.05 1.05 0 0 0-.256-.62C10.026 13.304 6.06 10.61 6 8.184V6h13.834z'/%3E%3Cpath fill='currentColor' d='M26 6h2.946v2.002H26v3.313h-2.002V8.002h-2.946V6h2.946V3.04H26z'/%3E%3C/svg%3E\")}.ag-icon-edit:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M6.222 25.778h1.611l14.834-14.811-1.611-1.611-14.834 14.81zM4 28v-4.733L22.644 4.656a2.26 2.26 0 0 1 1.567-.634q.423 0 .833.167.412.166.734.478l1.589 1.6q.333.322.483.733t.15.822q0 .423-.161.839-.162.416-.472.728L8.733 28zm17.856-17.833-.8-.811 1.61 1.61z'/%3E%3C/svg%3E\")}`;\n\n// packages/ag-grid-community/src/theming/parts/icon-set/alpine/icon-set-alpine.ts\nvar iconSetAlpine = /* @__PURE__ */ createPart({\n feature: \"iconSet\",\n css: icon_set_alpine_default\n});\n\n// packages/ag-grid-community/src/theming/parts/icon-set/material/icon-set-material.css\nvar icon_set_material_default = `.ag-icon-aggregation:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eaggregation%3C/title%3E%3Cpath d='M24 5.333H8V8l8.667 8L8 24v2.667h16v-4h-9.333L21.334 16l-6.667-6.667H24z'/%3E%3C/svg%3E\")}.ag-icon-arrows:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Earrows%3C/title%3E%3Cpath d='M13.333 11.556h5.333V8h3.556L16 1.778 9.778 8h3.556zm-1.777 1.777H8V9.777l-6.222 6.222L8 22.221v-3.556h3.556zM30.222 16 24 9.778v3.556h-3.556v5.333H24v3.556l6.222-6.222zm-11.555 4.444h-5.333V24H9.778L16 30.222 22.222 24h-3.556z'/%3E%3C/svg%3E\")}.ag-icon-asc:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333z'/%3E%3C/svg%3E\")}.ag-icon-aasc:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M13.201 8.08q.65 0 1.135.222.487.222.759.618.27.396.279.919H14.19a.72.72 0 0 0-.293-.536q-.26-.191-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125q.382.086.701.229.32.143.554.35.234.21.362.49.131.284.134.648a1.6 1.6 0 0 1-.273.93q-.27.391-.777.608-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.642q-.29-.428-.305-1.058h1.194q.02.294.17.49.15.195.402.294.253.097.573.097.313 0 .544-.09a.84.84 0 0 0 .362-.255.6.6 0 0 0 .129-.374q0-.195-.117-.33a.9.9 0 0 0-.337-.228 3.4 3.4 0 0 0-.54-.171l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.927q.287-.396.79-.618a2.8 2.8 0 0 1 1.14-.223'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 14H4.489l-.432-1.332H1.948L1.515 14H.19l2.017-5.84h1.592zm-3.551-2.296h1.481l-.718-2.21H2.98zM8.452 8.16q.645 0 1.075.19.43.191.648.531a1.4 1.4 0 0 1 .217.775q0 .343-.137.602-.137.256-.376.422a1.6 1.6 0 0 1-.542.231v.057q.333.015.624.188.294.175.476.489.183.31.183.74 0 .466-.231.831a1.56 1.56 0 0 1-.676.573Q9.265 14 8.609 14H6.114V8.16zM7.35 12.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.29 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.396.64.64 0 0 0-.226-.511q-.223-.195-.633-.194H7.35z' clip-rule='evenodd'/%3E%3Cpath fill='%23000' d='M7.166.377a.75.75 0 0 1 .919.066l3.333 3a.75.75 0 0 1-1.003 1.115L7.609 2.033 5.113 4.53a.75.75 0 0 1-1.06-1.06l3-3z'/%3E%3C/svg%3E\")}.ag-icon-cancel:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecancel%3C/title%3E%3Cpath d='M16 2.667C8.627 2.667 2.667 8.627 2.667 16S8.627 29.333 16 29.333 29.333 23.373 29.333 16 23.373 2.667 16 2.667m6.667 18.12-1.88 1.88L16 17.88l-4.787 4.787-1.88-1.88L14.12 16l-4.787-4.787 1.88-1.88L16 14.12l4.787-4.787 1.88 1.88L17.88 16z'/%3E%3C/svg%3E\")}.ag-icon-chart:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Echart%3C/title%3E%3Cpath d='M6.667 12.267h4v13.067h-4zm7.466-5.6h3.733v18.667h-3.733zM21.6 17.333h3.733v8H21.6z'/%3E%3C/svg%3E\")}.ag-icon-color-picker:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolor-picker%3C/title%3E%3Cpath d='M23.907 17.587 10.574 4.254l-1.88 1.88 3.173 3.173-8.28 8.28 10.16 10.16zm-16.547 0 6.387-6.387 6.387 6.387H7.361zm18.387 2s-2.667 2.893-2.667 4.667c0 1.467 1.2 2.667 2.667 2.667s2.667-1.2 2.667-2.667c0-1.773-2.667-4.667-2.667-4.667'/%3E%3C/svg%3E\")}.ag-icon-columns:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolumns%3C/title%3E%3Cpath d='M5.333 10.667h5.333V5.334H5.333zm8 16h5.333v-5.333h-5.333zm-8 0h5.333v-5.333H5.333zm0-8h5.333v-5.333H5.333zm8 0h5.333v-5.333h-5.333zm8-13.334v5.333h5.333V5.333zm-8 5.334h5.333V5.334h-5.333zm8 8h5.333v-5.333h-5.333zm0 8h5.333v-5.333h-5.333z'/%3E%3C/svg%3E\")}.ag-icon-contracted:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Econtracted%3C/title%3E%3Cpath d='m12.94 8-1.88 1.88L17.167 16l-6.107 6.12L12.94 24l8-8z'/%3E%3C/svg%3E\")}.ag-icon-copy:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecopy%3C/title%3E%3Cpath d='M22 1.333H6A2.675 2.675 0 0 0 3.333 4v18.667H6V4h16zm4 5.334H11.333a2.675 2.675 0 0 0-2.667 2.667v18.667c0 1.467 1.2 2.667 2.667 2.667H26c1.467 0 2.667-1.2 2.667-2.667V9.334c0-1.467-1.2-2.667-2.667-2.667M26 28H11.333V9.333H26z'/%3E%3C/svg%3E\")}.ag-icon-cross:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecross%3C/title%3E%3Cpath d='m25.333 8.547-1.88-1.88L16 14.12 8.547 6.667l-1.88 1.88L14.12 16l-7.453 7.453 1.88 1.88L16 17.88l7.453 7.453 1.88-1.88L17.88 16z'/%3E%3C/svg%3E\")}.ag-icon-csv:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='M.688-.226a.2.2 0 0 1-.017.074.28.28 0 0 1-.145.14.412.412 0 0 1-.234.013.28.28 0 0 1-.202-.168.468.468 0 0 1-.04-.19q0-.086.025-.155a.319.319 0 0 1 .182-.191.4.4 0 0 1 .134-.025q.087 0 .155.035a.3.3 0 0 1 .104.085.17.17 0 0 1 .036.097.06.06 0 0 1-.018.044.06.06 0 0 1-.042.019.06.06 0 0 1-.042-.013.2.2 0 0 1-.031-.046.2.2 0 0 0-.066-.079.16.16 0 0 0-.095-.027.17.17 0 0 0-.142.068.3.3 0 0 0-.053.193.4.4 0 0 0 .023.139.2.2 0 0 0 .067.083.2.2 0 0 0 .1.027q.063 0 .106-.031a.2.2 0 0 0 .065-.091.2.2 0 0 1 .023-.046q.014-.018.044-.018a.06.06 0 0 1 .044.018.06.06 0 0 1 .019.045' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 7.122 25.977)'/%3E%3Cpath d='M.622-.215a.2.2 0 0 1-.033.117.23.23 0 0 1-.098.081.4.4 0 0 1-.153.029.34.34 0 0 1-.175-.04.23.23 0 0 1-.079-.077.17.17 0 0 1-.031-.093q0-.027.019-.045a.06.06 0 0 1 .046-.019.06.06 0 0 1 .039.014.1.1 0 0 1 .027.044.3.3 0 0 0 .03.057q.015.023.044.038.03.015.076.015.065 0 .105-.03a.09.09 0 0 0 .04-.075.08.08 0 0 0-.022-.058.14.14 0 0 0-.056-.034 1 1 0 0 0-.092-.025.7.7 0 0 1-.129-.042.2.2 0 0 1-.083-.066.17.17 0 0 1-.03-.104q0-.058.032-.105a.2.2 0 0 1 .093-.07.4.4 0 0 1 .144-.025q.066 0 .114.016a.3.3 0 0 1 .08.044.2.2 0 0 1 .046.057q.015.03.015.058a.07.07 0 0 1-.018.046.06.06 0 0 1-.046.021q-.025 0-.038-.012a.2.2 0 0 1-.028-.041.2.2 0 0 0-.047-.063Q.387-.625.326-.625a.15.15 0 0 0-.09.025q-.035.024-.035.059 0 .021.012.037a.1.1 0 0 0 .032.027.4.4 0 0 0 .111.036q.06.015.11.031.048.018.083.042a.2.2 0 0 1 .054.062.2.2 0 0 1 .019.091' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 13.339 25.977)'/%3E%3Cpath d='m.184-.633.162.48.163-.483q.013-.038.019-.053a.062.062 0 0 1 .061-.039q.018 0 .034.009a.1.1 0 0 1 .025.025q.009.015.009.031L.654-.64l-.007.025-.009.024-.173.468-.019.051a.2.2 0 0 1-.021.042.1.1 0 0 1-.033.03.1.1 0 0 1-.049.012.1.1 0 0 1-.05-.011A.1.1 0 0 1 .26-.03a.2.2 0 0 1-.021-.042L.22-.123.05-.587.041-.612.033-.638.03-.662q0-.025.02-.046a.07.07 0 0 1 .05-.02q.037 0 .053.023.015.023.031.072' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 18.94 25.977)'/%3E%3C/svg%3E\")}.ag-icon-cut:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m19 3-6 6 2 2 7-7V3m-10 9.5a.503.503 0 0 1-.5-.5c0-.274.226-.5.5-.5s.5.226.5.5-.226.5-.5.5M6 20c-1.097 0-2-.903-2-2a2 2 0 0 1 2-2c1.097 0 2 .903 2 2a2 2 0 0 1-2 2M6 8c-1.097 0-2-.903-2-2a2 2 0 0 1 2-2c1.097 0 2 .903 2 2a2 2 0 0 1-2 2m3.64-.36c.23-.5.36-1.05.36-1.64 0-2.194-1.806-4-4-4S2 3.806 2 6s1.806 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.194 0-4 1.806-4 4s1.806 4 4 4 4-1.806 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1z' style='fill-rule:nonzero' transform='translate(4 4)'/%3E%3C/svg%3E\")}.ag-icon-desc:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667L26.668 16z'/%3E%3C/svg%3E\")}.ag-icon-adesc:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M10.387 11.47a.75.75 0 0 1 1.06 1.06l-3 3-.113.093a.75.75 0 0 1-.919-.065l-3.333-3a.75.75 0 0 1 1.003-1.116l2.806 2.525zM13.201 3.08q.65 0 1.135.222.487.223.759.619.27.396.279.918H14.19a.72.72 0 0 0-.293-.536q-.26-.192-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125a3.7 3.7 0 0 1 .701.229q.32.143.554.35.234.21.362.492.131.282.134.647a1.6 1.6 0 0 1-.273.93 1.74 1.74 0 0 1-.777.607q-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.641q-.29-.429-.305-1.059h1.194q.02.294.17.49.15.195.402.294.253.098.573.098.313 0 .544-.092a.84.84 0 0 0 .362-.254.6.6 0 0 0 .129-.373.5.5 0 0 0-.117-.33.9.9 0 0 0-.337-.23 3.4 3.4 0 0 0-.54-.17l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.926q.287-.396.79-.62a2.8 2.8 0 0 1 1.14-.222'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 9H4.489l-.432-1.332H1.948L1.515 9H.19l2.017-5.84h1.592zM2.262 6.704h1.481l-.718-2.21H2.98zM8.452 3.16q.645 0 1.075.19.43.192.648.53a1.4 1.4 0 0 1 .217.776q0 .342-.137.602a1.2 1.2 0 0 1-.376.423 1.6 1.6 0 0 1-.542.23v.058q.333.014.624.187.294.175.476.489.183.31.183.74 0 .465-.231.83a1.56 1.56 0 0 1-.676.574Q9.265 9 8.609 9H6.114V3.16zM7.35 7.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.291 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.397.64.64 0 0 0-.226-.51q-.223-.194-.633-.194H7.35z' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-down:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667L26.668 16z'/%3E%3C/svg%3E\")}.ag-icon-excel:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='m.052-.139.16-.234-.135-.208a.4.4 0 0 1-.028-.052.1.1 0 0 1-.01-.042.05.05 0 0 1 .018-.037.07.07 0 0 1 .045-.016q.03 0 .047.018a1 1 0 0 1 .047.066l.107.174.115-.174.024-.038.019-.026.021-.015a.1.1 0 0 1 .027-.005.06.06 0 0 1 .044.016.05.05 0 0 1 .018.039q0 .033-.038.089l-.141.211.152.234a.3.3 0 0 1 .03.051.1.1 0 0 1 .009.038.1.1 0 0 1-.008.031.1.1 0 0 1-.024.023.1.1 0 0 1-.034.008.1.1 0 0 1-.035-.008.1.1 0 0 1-.023-.022L.427-.067.301-.265l-.134.204-.022.034-.016.019a.1.1 0 0 1-.022.015.1.1 0 0 1-.03.005.06.06 0 0 1-.044-.016.06.06 0 0 1-.017-.047q0-.036.036-.088' style='fill-rule:nonzero' transform='matrix(17.82892 0 0 16.50777 10.371 25.928)'/%3E%3C/svg%3E\")}.ag-icon-expanded:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eexpanded%3C/title%3E%3Cpath d='M20.94 9.88 19.06 8l-8 8 8 8 1.88-1.88L14.833 16z'/%3E%3C/svg%3E\")}.ag-icon-eye-slash:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye-slash%3C/title%3E%3Cpath d='M21.106 15.088A5.19 5.19 0 0 0 16 10.814a5.17 5.17 0 0 0-3.668 1.522L9.866 9.868a12.2 12.2 0 0 1 6.133-1.646c5.186 0 9.614 3.225 11.408 7.778a12.34 12.34 0 0 1-5.276 6.133l-2.468-2.466a5.17 5.17 0 0 0 1.449-2.802h-2.123c-.148.508-.42.964-.782 1.33l-1.33-1.33h-2.514l2.196 2.196q-.272.049-.56.05a3.11 3.11 0 0 1-2.99-2.245h-2.123a5.19 5.19 0 0 0 7.3 3.836l2.247 2.247a12.2 12.2 0 0 1-4.434.828c-5.186 0-9.614-3.225-11.408-7.778a12.3 12.3 0 0 1 3.781-5.111l2.924 2.924a5.1 5.1 0 0 0-.404 1.275h4.206l-1.296-1.296a3.1 3.1 0 0 1 2.196-.903c1.404 0 2.587.924 2.976 2.199h2.13z'/%3E%3C/svg%3E\")}.ag-icon-eye:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye%3C/title%3E%3Cpath d='M16 8.222c-5.186 0-9.614 3.225-11.408 7.778 1.794 4.553 6.222 7.778 11.408 7.778S25.614 20.553 27.408 16C25.614 11.447 21.186 8.222 16 8.222m0 12.964c-2.862 0-5.186-2.324-5.186-5.186s2.324-5.186 5.186-5.186 5.186 2.324 5.186 5.186-2.324 5.186-5.186 5.186m0-8.297c-1.721 0-3.111 1.39-3.111 3.111s1.39 3.111 3.111 3.111 3.111-1.39 3.111-3.111-1.39-3.111-3.111-3.111'/%3E%3C/svg%3E\")}.ag-icon-filter:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efilter%3C/title%3E%3Cpath d='M13.333 24h5.333v-2.667h-5.333zM4 8v2.667h24V8zm4 9.333h16v-2.667H8z'/%3E%3C/svg%3E\")}.ag-icon-first:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efirst%3C/title%3E%3Cpath d='M24.273 22.12 18.153 16l6.12-6.12L22.393 8l-8 8 8 8zM7.727 8h2.667v16H7.727z'/%3E%3C/svg%3E\")}.ag-icon-group:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egroup%3C/title%3E%3Cpath d='M18.667 21.333h8.889A3.555 3.555 0 0 1 24 24.889h-5.333zm8.888-7.111v3.556h-8.889v-3.556zM24 7.111a3.555 3.555 0 0 1 3.556 3.556h-16V7.111zm-8.889 17.778h-3.556v-3.556h3.556zm0-7.111h-3.556v-3.556h3.556zM8 10.667H4.444A3.555 3.555 0 0 1 8 7.111z'/%3E%3C/svg%3E\")}.ag-icon-last:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elast%3C/title%3E%3Cpath d='m7.727 9.88 6.12 6.12-6.12 6.12L9.607 24l8-8-8-8zM21.607 8h2.667v16h-2.667z'/%3E%3C/svg%3E\")}.ag-icon-left:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eleft%3C/title%3E%3Cpath d='M26.667 14.667H10.44l7.453-7.453L16 5.334 5.333 16.001 16 26.668l1.88-1.88-7.44-7.453h16.227v-2.667z'/%3E%3C/svg%3E\")}.ag-icon-linked:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elinked%3C/title%3E%3Cpath d='M5.2 16a4.136 4.136 0 0 1 4.133-4.133h5.333V9.334H9.333c-3.68 0-6.667 2.987-6.667 6.667s2.987 6.667 6.667 6.667h5.333v-2.533H9.333A4.136 4.136 0 0 1 5.2 16.002zm5.467 1.333h10.667v-2.667H10.667zm12-8h-5.333v2.533h5.333c2.28 0 4.133 1.853 4.133 4.133s-1.853 4.133-4.133 4.133h-5.333v2.533h5.333c3.68 0 6.667-2.987 6.667-6.667s-2.987-6.667-6.667-6.667z'/%3E%3C/svg%3E\")}.ag-icon-loading:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eloading%3C/title%3E%3Cpath d='m17.778 11.708 3.25-3.251 2.516 2.516-3.251 3.25h4.597v3.556h-4.597l3.251 3.25-2.516 2.516-3.25-3.251v4.597h-3.556v-4.597l-3.25 3.251-2.516-2.516 3.251-3.25H7.11v-3.556h4.597l-3.251-3.25 2.516-2.516 3.25 3.251V7.111h3.556zm-3.251 7.847h2.944l2.084-2.084v-2.944l-2.084-2.084h-2.944l-2.084 2.084v2.944z'/%3E%3C/svg%3E\")}.ag-icon-maximize:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Emaximize%3C/title%3E%3Cpath d='M4 4h24v2.667H4z'/%3E%3C/svg%3E\")}.ag-icon-menu:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Emenu%3C/title%3E%3Cpath d='M4 24h24v-2.667H4zm0-6.667h24v-2.667H4zM4 8v2.667h24V8z'/%3E%3C/svg%3E\")}.ag-icon-menu-alt:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M16 26.667a2.57 2.57 0 0 1-1.883-.784A2.57 2.57 0 0 1 13.333 24q0-1.1.784-1.883A2.57 2.57 0 0 1 16 21.333q1.1 0 1.883.784.784.783.784 1.883t-.784 1.883a2.57 2.57 0 0 1-1.883.784m0-8a2.57 2.57 0 0 1-1.883-.784A2.57 2.57 0 0 1 13.333 16q0-1.1.784-1.883A2.57 2.57 0 0 1 16 13.333q1.1 0 1.883.784.784.783.784 1.883t-.784 1.883a2.57 2.57 0 0 1-1.883.784m0-8a2.57 2.57 0 0 1-1.883-.784A2.57 2.57 0 0 1 13.333 8q0-1.1.784-1.883A2.57 2.57 0 0 1 16 5.333q1.1 0 1.883.784.784.783.784 1.883t-.784 1.883a2.57 2.57 0 0 1-1.883.784'/%3E%3C/svg%3E\")}.ag-icon-minimize:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eminimize%3C/title%3E%3Cpath d='M8 25.333h16V28H8z'/%3E%3C/svg%3E\")}.ag-icon-minus:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658H7.901v-2.658z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-next:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enext%3C/title%3E%3Cpath d='m12.94 8-1.88 1.88L17.167 16l-6.107 6.12L12.94 24l8-8z'/%3E%3C/svg%3E\")}.ag-icon-none:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enone%3C/title%3E%3Cpath d='M4 24h16v-2.667H4zM4 8v2.667h24V8zm0 9.333h24v-2.667H4z'/%3E%3C/svg%3E\")}.ag-icon-not-allowed:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enot-allowed%3C/title%3E%3Cpath d='M16 2.667C8.64 2.667 2.667 8.64 2.667 16S8.64 29.333 16 29.333 29.333 23.36 29.333 16 23.36 2.667 16 2.667M5.333 16c0-5.893 4.773-10.667 10.667-10.667 2.467 0 4.733.84 6.533 2.253L7.586 22.533A10.54 10.54 0 0 1 5.333 16M16 26.667c-2.467 0-4.733-.84-6.533-2.253L24.414 9.467A10.54 10.54 0 0 1 26.667 16c0 5.893-4.773 10.667-10.667 10.667'/%3E%3C/svg%3E\")}.ag-icon-paste:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epaste%3C/title%3E%3Cpath d='M25.333 4H19.76C19.2 2.453 17.733 1.333 16 1.333S12.8 2.453 12.24 4H6.667A2.675 2.675 0 0 0 4 6.667V28c0 1.467 1.2 2.667 2.667 2.667h18.667c1.467 0 2.667-1.2 2.667-2.667V6.667C28.001 5.2 26.801 4 25.334 4zM16 4c.733 0 1.333.6 1.333 1.333s-.6 1.333-1.333 1.333-1.333-.6-1.333-1.333S15.267 4 16 4m9.333 24H6.666V6.667h2.667v4h13.333v-4h2.667z'/%3E%3C/svg%3E\")}.ag-icon-pin:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epin%3C/title%3E%3Cpath d='m11.106 22.093-4.444 4.444-1.259-1.259 4.444-4.444zm5.872-16.63 9.618 9.62-.962.962-.962-.962-7.694 3.847 1.924 1.924-2.74 2.74-7.696-7.696 2.741-2.74 1.924 1.925 3.847-7.696-.962-.962z'/%3E%3C/svg%3E\")}.ag-icon-pivot:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epivot%3C/title%3E%3Cpath d='M26.667 30.223H5.334a3.556 3.556 0 0 1-3.556-3.556V5.334a3.556 3.556 0 0 1 3.556-3.556h21.333a3.556 3.556 0 0 1 3.556 3.556v21.333a3.556 3.556 0 0 1-3.556 3.556m-16-8.89H5.334v5.333h5.333zm16-7.11H12.444v12.444h14.223zm-9.15 6.85-2.039 2.037 2.039 2.039-1.257 1.257-3.295-3.296 3.295-3.295q.63.628 1.257 1.257zm-6.85-6.85H5.334v5.333h5.333zm15.74 3.816-1.257 1.256-2.039-2.037-2.037 2.037-1.257-1.256 3.295-3.296zM10.667 5.333H5.334v5.333h5.333zm8.889 0h-7.112v5.333h7.112zm7.111 0h-5.333v5.333h5.333z'/%3E%3C/svg%3E\")}.ag-icon-plus:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658h-6.77v6.77h-2.658v-6.77h-6.77v-2.658h6.77v-6.77h2.658v6.77z' style='fill-rule:nonzero'/%3E%3C/svg%3E\")}.ag-icon-previous:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eprevious%3C/title%3E%3Cpath d='M20.94 9.88 19.06 8l-8 8 8 8 1.88-1.88L14.833 16z'/%3E%3C/svg%3E\")}.ag-icon-right:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eright%3C/title%3E%3Cpath d='m16 5.333-1.88 1.88 7.44 7.453H5.333v2.667H21.56l-7.44 7.453 1.88 1.88 10.667-10.667L16 5.332z'/%3E%3C/svg%3E\")}.ag-icon-save:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esave%3C/title%3E%3Cpath d='M25.333 16v9.333H6.666V16H3.999v9.333C3.999 26.8 5.199 28 6.666 28h18.667C26.8 28 28 26.8 28 25.333V16zm-8 .893 3.453-3.44 1.88 1.88L15.999 22l-6.667-6.667 1.88-1.88 3.453 3.44V4h2.667v12.893z'/%3E%3C/svg%3E\")}.ag-icon-small-down:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-down%3C/title%3E%3Cpath d='M9.333 12.667 16 19.334l6.667-6.667H9.334z'/%3E%3C/svg%3E\")}.ag-icon-small-left:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-left%3C/title%3E%3Cpath d='M19.333 9.333 12.666 16l6.667 6.667V9.334z'/%3E%3C/svg%3E\")}.ag-icon-small-right:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-right%3C/title%3E%3Cpath d='M12.667 22.667 19.334 16l-6.667-6.667v13.333z'/%3E%3C/svg%3E\")}.ag-icon-small-up:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-up%3C/title%3E%3Cpath d='M9.333 19.333 16 12.666l6.667 6.667H9.334z'/%3E%3C/svg%3E\")}.ag-icon-tick:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etick%3C/title%3E%3Cpath d='m11.727 21.167-5.56-5.56-1.893 1.88 7.453 7.453 16-16-1.88-1.88z'/%3E%3C/svg%3E\")}.ag-icon-tree-closed:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-closed%3C/title%3E%3Cpath d='m12.94 8-1.88 1.88L17.167 16l-6.107 6.12L12.94 24l8-8z'/%3E%3C/svg%3E\")}.ag-icon-tree-indeterminate:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-indeterminate%3C/title%3E%3Cpath d='M6.667 14.667h18.667v2.667H6.667z'/%3E%3C/svg%3E\")}.ag-icon-tree-open:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-open%3C/title%3E%3Cpath d='M22.12 11.06 16 17.167 9.88 11.06 8 12.94l8 8 8-8z'/%3E%3C/svg%3E\")}.ag-icon-unlinked:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eunlinked%3C/title%3E%3Cpath d='M22.667 9.333h-5.333v2.533h5.333a4.136 4.136 0 0 1 4.133 4.133c0 1.907-1.307 3.507-3.08 3.973l1.947 1.947c2.173-1.107 3.667-3.32 3.667-5.92a6.67 6.67 0 0 0-6.667-6.667zm-1.334 5.334h-2.92l2.667 2.667h.253zM2.667 5.693 6.814 9.84A6.65 6.65 0 0 0 2.667 16a6.67 6.67 0 0 0 6.667 6.667h5.333v-2.533H9.334a4.136 4.136 0 0 1-4.133-4.133c0-2.12 1.613-3.867 3.68-4.093l2.76 2.76h-.973v2.667h3.64l3.027 3.027v2.307h2.307l5.347 5.333 1.68-1.68L4.362 4.002 2.669 5.695z'/%3E%3C/svg%3E\")}.ag-icon-up:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333z'/%3E%3C/svg%3E\")}.ag-icon-grip:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egrip%3C/title%3E%3Cpath d='M26.667 12H5.334v2.667h21.333zM5.333 20h21.333v-2.667H5.333z'/%3E%3C/svg%3E\")}.ag-icon-settings:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3M2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3 1.3-3 3-3'/%3E%3C/svg%3E\")}.ag-icon-column-arrow:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11 4a1 1 0 0 1 1 1v22a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 13a1 1 0 0 1 1-1h23.5a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 4h18v24H2zm2 2v20h14V6zM26.793 13 23 9.207l1.414-1.414L29.621 13l-5.207 5.207L23 16.793z' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-un-pin:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M8 11a.75.75 0 0 0-.75.75v3.333a.75.75 0 1 0 1.5 0V11.75A.75.75 0 0 0 8 11'/%3E%3Cpath fill='currentColor' d='M13.11 1.436a.75.75 0 0 0-1.22-.872l-10 14a.75.75 0 1 0 1.22.872L5.207 12.5h7.376a.75.75 0 0 0 .75-.75v-1.174a2.08 2.08 0 0 0-1.153-1.863l-1.185-.599-.005-.002a.58.58 0 0 1-.323-.522V5.165a2.083 2.083 0 0 0 1.854-2.904zm-3.943 5.52v.634a2.08 2.08 0 0 0 1.153 1.863l1.185.6.005.002a.58.58 0 0 1 .323.522V11H6.28zM9.277 1H5.25a2.084 2.084 0 0 0-.083 4.165v1.676l1.5-2.132v-.292a.75.75 0 0 0-.75-.75H5.25a.584.584 0 0 1 0-1.167h2.972z'/%3E%3C/svg%3E\")}.ag-icon-pinned-top:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M12.53 3.72A.75.75 0 0 1 12 5H4a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 .53.22M3.269 10.744a.75.75 0 0 1 .2-.524l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 1 1-1.06 1.06L8.75 8.56V14a.75.75 0 0 1-1.5 0V8.56l-2.72 2.72a.75.75 0 0 1-1.26-.536'/%3E%3C/svg%3E\")}.ag-icon-pinned-bottom:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M3.47 12.28A.75.75 0 0 1 4 11h8a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1-.53-.22M12.731 5.256a.75.75 0 0 1-.2.524l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06l2.72 2.72V2a.75.75 0 0 1 1.5 0v5.44l2.72-2.72a.75.75 0 0 1 1.26.536'/%3E%3C/svg%3E\")}.ag-icon-chevron-up:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3.479 10.521a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1-1.06 1.06l-3.47-3.47-3.47 3.47a.75.75 0 0 1-1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-chevron-down:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.521 5.461a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 1.06-1.06l3.47 3.47 3.47-3.47a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-chevron-left:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.53 12.512a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 1.06l-3.47 3.47 3.47 3.47a.75.75 0 0 1 0 1.06' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-chevron-right:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M5.47 3.47a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06-1.06L8.94 8 5.47 4.53a.75.75 0 0 1 0-1.06' clip-rule='evenodd'/%3E%3C/svg%3E\")}.ag-icon-filter-add:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M18.666 24h-5.333v-2.667h5.333zM24 17.333H8v-2.667h16zm3.59-9.344h3.221v2.657h-3.22v3.22h-2.656v-3.22h-3.221V7.989h3.22V4.77h2.657zm-8.582 2.678H4V8h15.008z'/%3E%3C/svg%3E\")}.ag-icon-edit:before{mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M6.222 25.778h1.611l14.834-14.811-1.611-1.611-14.834 14.81zM4 28v-4.733L22.644 4.656a2.26 2.26 0 0 1 1.567-.634q.423 0 .833.167.412.166.734.478l1.589 1.6q.333.322.483.733t.15.822q0 .423-.161.839-.162.416-.472.728L8.733 28zm17.856-17.833-.8-.811 1.61 1.61z'/%3E%3C/svg%3E\")}`;\n\n// packages/ag-grid-community/src/theming/parts/icon-set/material/icon-set-material.ts\nvar iconSetMaterial = /* @__PURE__ */ createPart({\n feature: \"iconSet\",\n css: icon_set_material_default\n});\n\n// packages/ag-grid-community/src/theming/parts/icon-set/overrides/icon-overrides.ts\nvar iconOverrides = (args) => {\n const cssParts = [];\n if (args.type === \"image\") {\n const { icons, mask } = args;\n for (const key of Object.keys(icons)) {\n const imageCssValue = imageValueToCss(icons[key]);\n if (mask) {\n cssParts.push(`.ag-icon-${key}::before { mask-image: ${imageCssValue}; }`);\n } else {\n cssParts.push(`.ag-icon-${key}::before { background-image: ${imageCssValue}; ${unsetMaskIcon} }`);\n }\n }\n }\n if (args.type === \"font\") {\n const { family, weight, color, icons } = args;\n let properties = unsetMaskIcon;\n if (family) {\n properties += ` font-family: ${fontFamilyValueToCss(family)};`;\n }\n if (weight) {\n properties += ` font-weight: ${fontWeightValueToCss(weight)};`;\n }\n if (color) {\n properties += ` color: ${colorValueToCss(color)};`;\n }\n for (const key of Object.keys(icons)) {\n cssParts.push(`.ag-icon-${key}::before { content: ${JSON.stringify(icons[key])}; ${properties} }`);\n }\n }\n return createPart({\n css: cssParts.join(\";\\n\"),\n cssImports: args.cssImports\n });\n};\nvar unsetMaskIcon = `background-color: unset; mask-image: unset; -webkit-mask-image: unset;`;\n\n// packages/ag-grid-community/src/theming/parts/icon-set/quartz/quartz-icon-data.ts\nvar iconNameToSvgFragment = {\n aggregation: '',\n arrows: '',\n asc: '',\n cancel: '',\n chart: '',\n \"color-picker\": '',\n columns: '',\n contracted: '',\n copy: '',\n cross: '',\n csv: '',\n cut: '',\n desc: '',\n down: '',\n excel: '',\n expanded: '',\n eye: '',\n \"eye-slash\": '',\n filter: '',\n first: '',\n grip: '',\n group: '',\n last: '',\n left: '',\n linked: '',\n loading: '',\n maximize: '',\n menu: '',\n \"menu-alt\": '',\n minimize: '',\n minus: '',\n next: '',\n none: '',\n \"not-allowed\": '',\n paste: '',\n pin: '',\n pivot: '',\n plus: '',\n previous: '',\n right: '',\n save: '',\n settings: '',\n \"small-left\": '',\n \"small-right\": '',\n tick: '',\n \"tree-closed\": '',\n \"tree-indeterminate\": '',\n \"tree-open\": '',\n unlinked: '',\n up: ''\n};\nvar iconNameToFullSvg = {\n aasc: ``,\n adesc: ``,\n \"chevron-down\": '',\n \"chevron-left\": '',\n \"chevron-right\": '',\n \"chevron-up\": '',\n \"column-arrow\": '',\n edit: '',\n \"filter-add\": '',\n \"pinned-bottom\": '',\n \"pinned-top\": '',\n \"small-down\": '',\n \"small-up\": '',\n \"un-pin\": ''\n};\nvar getQuartzIconsCss = (args = {}) => {\n let result = \"\";\n for (const iconName of [...Object.keys(iconNameToSvgFragment), ...Object.keys(iconNameToFullSvg)]) {\n const iconSvg = quartzIconSvg(iconName, args.strokeWidth);\n result += `.ag-icon-${iconName}::before { mask-image: url('data:image/svg+xml,${encodeURIComponent(iconSvg)}'); }\n`;\n }\n return result;\n};\nvar quartzIconSvg = (name, strokeWidth = 1.5) => {\n const fullSVG = iconNameToFullSvg[name];\n if (fullSVG) {\n return fullSVG;\n }\n const svgFragment = iconNameToSvgFragment[name];\n if (!svgFragment) {\n throw new Error(`Missing icon data for ${name}`);\n }\n return `` + svgFragment + \"\";\n};\n\n// packages/ag-grid-community/src/theming/parts/icon-set/quartz/icon-set-quartz.ts\nvar iconSetQuartz = (args = {}) => {\n return createPart({\n feature: \"iconSet\",\n css: () => getQuartzIconsCss(args)\n });\n};\nvar iconSetQuartzLight = /* @__PURE__ */ iconSetQuartz({ strokeWidth: 1 });\nvar iconSetQuartzRegular = /* @__PURE__ */ iconSetQuartz();\nvar iconSetQuartzBold = /* @__PURE__ */ iconSetQuartz({ strokeWidth: 2 });\n\n// packages/ag-grid-community/src/theming/parts/input-style/input-style-base.css\nvar input_style_base_default = ':where(.ag-input-field-input[type=number]:not(.ag-number-field-input-stepper)){-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);font-family:inherit;font-size:inherit;line-height:inherit;margin:0;min-height:var(--ag-input-height);padding:0;&:where(:disabled){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}&:where(:focus){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color);outline:none}&:where(:invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&::-moz-placeholder{color:var(--ag-input-placeholder-text-color)}&::placeholder{color:var(--ag-input-placeholder-text-color)}}:where(.ag-ltr) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-left:var(--ag-input-padding-start)}:where(.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-right:var(--ag-input-padding-start)}&:where(.ag-ltr,.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding:0 var(--ag-input-padding-start)}:where(.ag-column-select-header-filter-wrapper),:where(.ag-filter-add-select),:where(.ag-filter-filter),:where(.ag-filter-toolpanel-search),:where(.ag-floating-filter-search-icon),:where(.ag-mini-filter){.ag-input-wrapper:before{background-color:currentcolor;color:var(--ag-input-icon-color);content:\"\";display:block;height:12px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==\");mask-image:url(\"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==\");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;opacity:.5;position:absolute;width:12px}}:where(.ag-ltr) :where(.ag-column-select-header-filter-wrapper),:where(.ag-ltr) :where(.ag-filter-add-select),:where(.ag-ltr) :where(.ag-filter-filter),:where(.ag-ltr) :where(.ag-filter-toolpanel-search),:where(.ag-ltr) :where(.ag-floating-filter-search-icon),:where(.ag-ltr) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-left:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)}}:where(.ag-rtl) :where(.ag-column-select-header-filter-wrapper),:where(.ag-rtl) :where(.ag-filter-add-select),:where(.ag-rtl) :where(.ag-filter-filter),:where(.ag-rtl) :where(.ag-filter-toolpanel-search),:where(.ag-rtl) :where(.ag-floating-filter-search-icon),:where(.ag-rtl) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-right:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)}}';\n\n// packages/ag-grid-community/src/theming/parts/input-style/input-style-bordered.css\nvar input_style_bordered_default = \".ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){&:focus{box-shadow:var(--ag-focus-shadow);&:where(.invalid),&:where(:invalid){box-shadow:var(--ag-focus-error-shadow)}}}\";\n\n// packages/ag-grid-community/src/theming/parts/input-style/input-style-underlined.css\nvar input_style_underlined_default = \".ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){border-left:none;border-right:none;border-top:none}\";\n\n// packages/ag-grid-community/src/theming/parts/input-style/input-styles.ts\nvar baseParams4 = {\n inputBackgroundColor: \"transparent\",\n inputBorder: false,\n inputBorderRadius: 0,\n inputTextColor: {\n ref: \"textColor\"\n },\n inputPlaceholderTextColor: {\n ref: \"inputTextColor\",\n mix: 0.5\n },\n inputPaddingStart: 0,\n inputHeight: {\n calc: \"max(iconSize, fontSize) + spacing * 2\"\n },\n inputFocusBackgroundColor: {\n ref: \"inputBackgroundColor\"\n },\n inputFocusBorder: {\n ref: \"inputBorder\"\n },\n inputFocusShadow: \"none\",\n inputFocusTextColor: {\n ref: \"inputTextColor\"\n },\n inputDisabledBackgroundColor: {\n ref: \"inputBackgroundColor\"\n },\n inputDisabledBorder: {\n ref: \"inputBorder\"\n },\n inputDisabledTextColor: {\n ref: \"inputTextColor\"\n },\n inputInvalidBackgroundColor: {\n ref: \"inputBackgroundColor\"\n },\n inputInvalidBorder: {\n ref: \"inputBorder\"\n },\n inputInvalidTextColor: {\n ref: \"inputTextColor\"\n },\n inputIconColor: {\n ref: \"inputTextColor\"\n },\n pickerButtonBorder: false,\n pickerButtonFocusBorder: { ref: \"inputFocusBorder\" },\n pickerButtonBackgroundColor: { ref: \"backgroundColor\" },\n pickerButtonFocusBackgroundColor: { ref: \"backgroundColor\" },\n pickerListBorder: false,\n pickerListBackgroundColor: { ref: \"backgroundColor\" },\n colorPickerThumbSize: 18,\n colorPickerTrackSize: 12,\n colorPickerThumbBorderWidth: 3,\n colorPickerTrackBorderRadius: 12,\n colorPickerColorBorderRadius: 4\n};\nvar makeInputStyleBaseTreeShakeable = () => createPart({\n feature: \"inputStyle\",\n params: baseParams4,\n css: input_style_base_default\n});\nvar inputStyleBase = /* @__PURE__ */ makeInputStyleBaseTreeShakeable();\nvar makeInputStyleBorderedTreeShakeable = () => createPart({\n feature: \"inputStyle\",\n params: {\n ...baseParams4,\n inputBackgroundColor: backgroundColor,\n inputBorder: true,\n inputBorderRadius: {\n ref: \"borderRadius\"\n },\n inputPaddingStart: {\n ref: \"spacing\"\n },\n inputFocusBorder: {\n color: accentColor\n },\n inputFocusShadow: {\n ref: \"focusShadow\"\n },\n inputDisabledBackgroundColor: foregroundBackgroundMix(0.06),\n inputDisabledTextColor: {\n ref: \"textColor\",\n mix: 0.5\n },\n inputInvalidBorder: {\n color: { ref: \"invalidColor\" }\n },\n pickerButtonBorder: true,\n pickerListBorder: true\n },\n css: () => input_style_base_default + input_style_bordered_default\n});\nvar inputStyleBordered = /* @__PURE__ */ makeInputStyleBorderedTreeShakeable();\nvar makeInputStyleUnderlinedTreeShakeable = () => createPart({\n feature: \"inputStyle\",\n params: {\n ...baseParams4,\n inputBackgroundColor: \"transparent\",\n inputBorder: {\n width: 2,\n color: foregroundMix(0.3)\n },\n inputPaddingStart: {\n ref: \"spacing\"\n },\n inputFocusBorder: \"solid 2px var(--ag-accent-color)\",\n inputDisabledTextColor: {\n ref: \"textColor\",\n mix: 0.5\n },\n inputDisabledBorder: \"solid 1px var(--ag-border-color)\",\n inputInvalidBorder: {\n width: 2,\n color: {\n ref: \"invalidColor\",\n mix: 0.3\n }\n }\n },\n css: () => input_style_base_default + input_style_underlined_default\n});\nvar inputStyleUnderlined = /* @__PURE__ */ makeInputStyleUnderlinedTreeShakeable();\n\n// packages/ag-grid-community/src/theming/parts/tab-style/tab-style-base.css\nvar tab_style_base_default = '.ag-tabs-header{background-color:var(--ag-tab-bar-background-color);border-bottom:var(--ag-tab-bar-border);display:flex;flex:1;gap:var(--ag-tab-spacing);padding:var(--ag-tab-bar-top-padding) var(--ag-tab-bar-horizontal-padding) 0}.ag-tabs-header-wrapper{display:flex}.ag-tabs-close-button-wrapper{align-items:center;border:0;display:flex;padding:var(--ag-spacing)}:where(.ag-ltr) .ag-tabs-close-button-wrapper{border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-tabs-close-button-wrapper{border-left:solid var(--ag-border-width) var(--ag-border-color)}.ag-tabs-close-button{background-color:unset;border:0;cursor:pointer;padding:0}.ag-tab{align-items:center;background-color:var(--ag-tab-background-color);border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;color:var(--ag-tab-text-color);cursor:pointer;display:flex;flex:1;justify-content:center;padding:var(--ag-tab-top-padding) var(--ag-tab-horizontal-padding) var(--ag-tab-bottom-padding);position:relative}.ag-tab:hover{background-color:var(--ag-tab-hover-background-color);color:var(--ag-tab-hover-text-color)}.ag-tab.ag-tab-selected{background-color:var(--ag-tab-selected-background-color);color:var(--ag-tab-selected-text-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-left-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-left-color:var(--ag-tab-selected-border-color)}.ag-tab:after{background-color:var(--ag-tab-selected-underline-color);bottom:0;content:\"\";display:block;height:var(--ag-tab-selected-underline-width);left:0;opacity:0;position:absolute;right:0;transition:opacity var(--ag-tab-selected-underline-transition-duration)}.ag-tab.ag-tab-selected:after{opacity:1}';\n\n// packages/ag-grid-community/src/theming/parts/tab-style/tab-style-rolodex.css\nvar tab_style_rolodex_default = \".ag-tab{border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;border-top:var(--ag-tab-selected-border-width) solid transparent;flex:none;&.ag-tab-selected{border-left-color:var(--ag-tab-selected-border-color);border-right-color:var(--ag-tab-selected-border-color);border-top-color:var(--ag-tab-selected-border-color);margin-bottom:-1px;padding-bottom:calc(var(--ag-tab-bottom-padding) + 1px)}}\";\n\n// packages/ag-grid-community/src/theming/parts/tab-style/tab-styles.ts\nvar baseParams5 = {\n tabBarBackgroundColor: \"transparent\",\n tabBarHorizontalPadding: 0,\n tabBarTopPadding: 0,\n tabBackgroundColor: \"transparent\",\n tabTextColor: {\n ref: \"textColor\"\n },\n tabHorizontalPadding: {\n ref: \"spacing\"\n },\n tabTopPadding: {\n ref: \"spacing\"\n },\n tabBottomPadding: {\n ref: \"spacing\"\n },\n tabSpacing: \"0\",\n tabHoverBackgroundColor: {\n ref: \"tabBackgroundColor\"\n },\n tabHoverTextColor: {\n ref: \"tabTextColor\"\n },\n tabSelectedBackgroundColor: {\n ref: \"tabBackgroundColor\"\n },\n tabSelectedTextColor: {\n ref: \"tabTextColor\"\n },\n tabSelectedBorderWidth: { ref: \"borderWidth\" },\n tabSelectedBorderColor: \"transparent\",\n tabSelectedUnderlineColor: \"transparent\",\n tabSelectedUnderlineWidth: 0,\n tabSelectedUnderlineTransitionDuration: 0,\n tabBarBorder: false\n};\nvar makeTabStyleBaseTreeShakeable = () => createPart({\n feature: \"tabStyle\",\n params: baseParams5,\n css: tab_style_base_default\n});\nvar tabStyleBase = /* @__PURE__ */ makeTabStyleBaseTreeShakeable();\nvar makeTabStyleQuartzTreeShakeable = () => createPart({\n feature: \"tabStyle\",\n params: {\n ...baseParams5,\n tabBarBorder: true,\n tabBarBackgroundColor: foregroundMix(0.05),\n tabTextColor: {\n ref: \"textColor\",\n mix: 0.7\n },\n tabSelectedTextColor: {\n ref: \"textColor\"\n },\n tabHoverTextColor: {\n ref: \"textColor\"\n },\n tabSelectedBorderColor: {\n ref: \"borderColor\"\n },\n tabSelectedBackgroundColor: backgroundColor\n },\n css: tab_style_base_default\n});\nvar tabStyleQuartz = /* @__PURE__ */ makeTabStyleQuartzTreeShakeable();\nvar makeTabStyleMaterialTreeShakeable = () => createPart({\n feature: \"tabStyle\",\n params: {\n ...baseParams5,\n tabBarBackgroundColor: {\n ref: \"chromeBackgroundColor\"\n },\n tabSelectedUnderlineColor: {\n ref: \"primaryColor\"\n },\n tabSelectedUnderlineWidth: 2,\n tabSelectedUnderlineTransitionDuration: 0\n },\n css: tab_style_base_default\n});\nvar tabStyleMaterial = /* @__PURE__ */ makeTabStyleMaterialTreeShakeable();\nvar makeTabStyleAlpineTreeShakeable = () => createPart({\n feature: \"tabStyle\",\n params: {\n ...baseParams5,\n tabBarBorder: true,\n tabBarBackgroundColor: {\n ref: \"chromeBackgroundColor\"\n },\n tabHoverTextColor: accentColor,\n tabSelectedTextColor: accentColor,\n tabSelectedUnderlineColor: accentColor,\n tabSelectedUnderlineWidth: 2,\n tabSelectedUnderlineTransitionDuration: \"0.3s\"\n },\n css: tab_style_base_default\n});\nvar tabStyleAlpine = /* @__PURE__ */ makeTabStyleAlpineTreeShakeable();\nvar makeTabStyleRolodexTreeShakeable = () => createPart({\n feature: \"tabStyle\",\n params: {\n ...baseParams5,\n tabBarBackgroundColor: {\n ref: \"chromeBackgroundColor\"\n },\n tabBarHorizontalPadding: {\n ref: \"spacing\"\n },\n tabBarTopPadding: {\n ref: \"spacing\"\n },\n tabBarBorder: true,\n tabHorizontalPadding: { calc: \"spacing * 2\" },\n tabTopPadding: {\n ref: \"spacing\"\n },\n tabBottomPadding: {\n ref: \"spacing\"\n },\n tabSpacing: {\n ref: \"spacing\"\n },\n tabSelectedBorderColor: {\n ref: \"borderColor\"\n },\n tabSelectedBackgroundColor: backgroundColor\n },\n css: () => tab_style_base_default + tab_style_rolodex_default\n});\nvar tabStyleRolodex = /* @__PURE__ */ makeTabStyleRolodexTreeShakeable();\n\n// packages/ag-grid-community/src/theming/parts/theme/material-adjustments.css\nvar material_adjustments_default = \".ag-dnd-ghost,.ag-filter-toolpanel-header,.ag-filter-toolpanel-search,.ag-multi-filter-group-title-bar,.ag-panel-title-bar-title,.ag-status-bar{color:var(--ag-header-text-color);font-size:calc(var(--ag-font-size) - 1px);font-weight:600}.ag-column-drop-horizontal{background-color:color-mix(in srgb,var(--ag-background-color),var(--ag-foreground-color) 8%)}.ag-cell.ag-cell-inline-editing{background-color:var(--ag-background-color);background-image:linear-gradient(0deg,var(--ag-input-background-color),var(--ag-input-background-color));border:var(--ag-input-border)!important;border-width:1px!important;height:calc(var(--ag-row-height) + var(--ag-spacing)*3);padding:var(--ag-spacing);:where(.ag-row-last:not(.ag-row-first)) &{bottom:0}:where(.ag-has-focus) &{border:var(--ag-input-focus-border)!important;border-width:1px!important}}.ag-advanced-filter-builder-button,.ag-standard-button{text-transform:uppercase}.ag-status-bar{border:solid var(--ag-border-width) var(--ag-border-color)}.ag-list-item-hovered:after{background-color:var(--ag-primary-color)}.ag-pill-button:hover{color:var(--ag-primary-color)}.ag-filter-add-button,.ag-filter-add-button:hover{border-bottom:2px solid var(--ag-primary-color)}\";\n\n// packages/ag-grid-community/src/theming/parts/theme/themes.ts\nvar themeQuartzParams = () => ({\n fontFamily: [\n { googleFont: \"IBM Plex Sans\" },\n \"-apple-system\",\n \"BlinkMacSystemFont\",\n \"Segoe UI\",\n \"Roboto\",\n \"Oxygen-Sans\",\n \"Ubuntu\"\n ]\n});\nvar makeThemeQuartzTreeShakeable = () => createTheme().withPart(checkboxStyleDefault).withPart(colorSchemeVariable).withPart(iconSetQuartzRegular).withPart(tabStyleQuartz).withPart(inputStyleBordered).withPart(columnDropStyleBordered).withParams(themeQuartzParams());\nvar themeQuartz = /* @__PURE__ */ makeThemeQuartzTreeShakeable();\nvar themeAlpineParams = () => ({\n accentColor: \"#2196f3\",\n selectedRowBackgroundColor: accentMix(0.3),\n inputFocusBorder: {\n color: accentMix(0.4)\n },\n focusShadow: { radius: 2, spread: 1.6, color: accentMix(0.4) },\n iconButtonHoverBackgroundColor: \"transparent\",\n iconButtonActiveBackgroundColor: \"transparent\",\n checkboxUncheckedBorderColor: foregroundBackgroundMix(0.45),\n checkboxIndeterminateBackgroundColor: foregroundBackgroundMix(0.45),\n checkboxIndeterminateBorderColor: foregroundBackgroundMix(0.45),\n checkboxBorderWidth: 2,\n checkboxBorderRadius: 2,\n fontSize: 13,\n dataFontSize: 14,\n headerFontWeight: 700,\n borderRadius: 3,\n wrapperBorderRadius: 3,\n tabSelectedUnderlineColor: accentColor,\n tabSelectedBorderWidth: 0,\n tabSelectedUnderlineTransitionDuration: 0.3,\n sideButtonSelectedUnderlineColor: accentColor,\n sideButtonSelectedUnderlineWidth: 2,\n sideButtonSelectedUnderlineTransitionDuration: 0.3,\n sideButtonBorder: false,\n sideButtonSelectedBorder: false,\n sideButtonBarTopPadding: { calc: \"spacing * 3\" },\n sideButtonSelectedBackgroundColor: \"transparent\",\n sideButtonHoverTextColor: accentColor,\n iconButtonHoverColor: accentColor,\n toggleButtonWidth: 28,\n toggleButtonHeight: 18,\n toggleButtonSwitchInset: 1,\n toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.45),\n colorPickerThumbSize: 13,\n colorPickerTrackSize: 11,\n colorPickerThumbBorderWidth: 2,\n colorPickerTrackBorderRadius: 2,\n colorPickerColorBorderRadius: 2\n});\nvar makeThemeAlpineTreeShakeable = () => createTheme().withPart(buttonStyleAlpine).withPart(checkboxStyleDefault).withPart(colorSchemeVariable).withPart(iconSetAlpine).withPart(tabStyleAlpine).withPart(inputStyleBordered).withPart(columnDropStyleBordered).withParams(themeAlpineParams());\nvar themeAlpine = /* @__PURE__ */ makeThemeAlpineTreeShakeable();\nvar themeBalhamParams = () => ({\n accentColor: \"#0091ea\",\n borderColor: foregroundMix(0.2),\n spacing: 4,\n widgetVerticalSpacing: { calc: \"max(8px, spacing)\" },\n borderRadius: 2,\n wrapperBorderRadius: 2,\n headerColumnResizeHandleColor: \"transparent\",\n headerColumnBorder: true,\n headerColumnBorderHeight: \"50%\",\n oddRowBackgroundColor: {\n ref: \"chromeBackgroundColor\",\n mix: 0.5\n },\n checkboxBorderRadius: 2,\n checkboxBorderWidth: 1,\n checkboxUncheckedBackgroundColor: backgroundColor,\n checkboxUncheckedBorderColor: foregroundBackgroundMix(0.5),\n checkboxCheckedBackgroundColor: backgroundColor,\n checkboxCheckedBorderColor: accentColor,\n checkboxCheckedShapeColor: accentColor,\n checkboxIndeterminateBackgroundColor: backgroundColor,\n checkboxIndeterminateBorderColor: foregroundBackgroundMix(0.5),\n checkboxIndeterminateShapeColor: foregroundBackgroundMix(0.5),\n focusShadow: { radius: 2, spread: 1, color: accentColor },\n headerTextColor: foregroundMix(0.6),\n iconButtonHoverBackgroundColor: \"transparent\",\n iconButtonActiveBackgroundColor: \"transparent\",\n fontSize: 12,\n tabSelectedBackgroundColor: backgroundColor,\n headerFontWeight: \"bold\",\n toggleButtonWidth: 32,\n toggleButtonHeight: 16,\n toggleButtonSwitchInset: 1,\n toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.5),\n sideButtonBorder: true,\n sideButtonBarTopPadding: { calc: \"spacing * 4\" },\n popupShadow: \"5px 5px 10px rgba(0, 0, 0, 0.3)\",\n statusBarLabelColor: foregroundMix(0.54),\n statusBarLabelFontWeight: 600,\n statusBarValueFontWeight: 600,\n panelTitleBarIconColor: foregroundColor,\n colorPickerThumbSize: 13,\n colorPickerTrackSize: 11,\n colorPickerThumbBorderWidth: 2,\n colorPickerTrackBorderRadius: 2,\n colorPickerColorBorderRadius: 2\n});\nvar makeThemeBalhamTreeShakeable = () => createTheme().withPart(buttonStyleBalham).withPart(checkboxStyleDefault).withPart(colorSchemeVariable).withPart(iconSetBalham).withPart(tabStyleRolodex).withPart(inputStyleBordered).withPart(columnDropStylePlain).withParams(themeBalhamParams());\nvar themeBalham = /* @__PURE__ */ makeThemeBalhamTreeShakeable();\nvar makeStyleMaterialTreeShakeable = () => {\n const sharedParams = {\n tabSelectedUnderlineColor: { ref: \"primaryColor\" },\n sideButtonSelectedUnderlineColor: { ref: \"primaryColor\" },\n buttonTextColor: { ref: \"primaryColor\" },\n rangeSelectionBackgroundColor: {\n ref: \"primaryColor\",\n mix: 0.2\n },\n rangeSelectionBorderColor: {\n ref: \"primaryColor\"\n },\n rangeSelectionHighlightColor: {\n ref: \"primaryColor\",\n mix: 0.5\n },\n rangeHeaderHighlightColor: {\n ref: \"foregroundColor\",\n mix: 0.08\n },\n rowNumbersSelectedColor: {\n ref: \"primaryColor\",\n mix: 0.5\n },\n inputFocusBorder: {\n width: 2,\n color: { ref: \"primaryColor\" }\n },\n pickerButtonFocusBorder: {\n width: 1,\n color: { ref: \"primaryColor\" }\n },\n cellEditingBorder: {\n color: { ref: \"primaryColor\" }\n },\n menuBackgroundColor: { ref: \"backgroundColor\" },\n sideButtonBarBackgroundColor: backgroundColor,\n sideButtonSelectedBackgroundColor: \"transparent\",\n sideButtonBarTopPadding: { calc: \"spacing * 4\" },\n headerColumnResizeHandleColor: \"none\",\n headerBackgroundColor: {\n ref: \"backgroundColor\"\n },\n rowHoverColor: foregroundMix(0.08),\n columnHoverColor: foregroundMix(0.08),\n headerCellHoverBackgroundColor: foregroundMix(0.05),\n statusBarLabelColor: foregroundMix(0.63),\n statusBarLabelFontWeight: 600,\n statusBarValueFontWeight: 600,\n valueChangeValueHighlightBackgroundColor: \"#00acc1\",\n panelTitleBarIconColor: foregroundColor,\n advancedFilterBuilderButtonBarBorder: false,\n filterPanelApplyButtonColor: { ref: \"buttonTextColor\" },\n filterPanelApplyButtonBackgroundColor: { ref: \"buttonBackgroundColor\" },\n columnPanelApplyButtonColor: { ref: \"buttonTextColor\" },\n columnPanelApplyButtonBackgroundColor: { ref: \"buttonBackgroundColor\" },\n colorPickerThumbSize: 13,\n colorPickerTrackSize: 11,\n colorPickerThumbBorderWidth: 2,\n colorPickerTrackBorderRadius: 2,\n colorPickerColorBorderRadius: 2,\n rowDragIndicatorColor: { ref: \"primaryColor\" },\n columnDragIndicatorColor: { ref: \"primaryColor\" }\n };\n const lightParams = {\n ...sharedParams,\n primaryColor: \"#3f51b5\",\n foregroundColor: \"#000D\",\n headerTextColor: \"#0008\",\n accentColor: \"#ff4081\",\n checkboxUncheckedBorderColor: foregroundColor,\n checkboxIndeterminateBackgroundColor: foregroundColor,\n toggleButtonOffBackgroundColor: foregroundColor,\n selectedRowBackgroundColor: \"rgba(33, 150, 243, 0.3)\"\n };\n const darkParams2 = {\n ...sharedParams,\n primaryColor: \"#3f51b5\",\n foregroundColor: \"#fffD\",\n headerTextColor: \"#fff8\",\n accentColor: \"#bb86fc\",\n checkboxUncheckedBorderColor: foregroundBackgroundMix(0.5),\n checkboxIndeterminateBackgroundColor: foregroundBackgroundMix(0.5),\n toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.5),\n selectedRowBackgroundColor: \"#bb86fc33\"\n };\n return createPart({\n feature: \"styleMaterial\",\n css: material_adjustments_default,\n params: lightParams,\n modeParams: {\n light: lightParams,\n dark: darkParams2,\n \"dark-blue\": darkParams2\n }\n });\n};\nvar styleMaterial = /* @__PURE__ */ makeStyleMaterialTreeShakeable();\nvar themeMaterialParams = () => ({\n rowHeight: {\n calc: \"max(iconSize, cellFontSize) + spacing * 3.75 * rowVerticalPaddingScale\"\n },\n headerHeight: {\n calc: \"max(iconSize, dataFontSize) + spacing * 4.75 * headerVerticalPaddingScale\"\n },\n widgetVerticalSpacing: {\n calc: \"spacing * 1.75\"\n },\n cellHorizontalPadding: { calc: \"spacing * 3\" },\n buttonHorizontalPadding: { ref: \"spacing\" },\n widgetContainerHorizontalPadding: { calc: \"spacing * 1.5\" },\n widgetContainerVerticalPadding: { calc: \"spacing * 2\" },\n fontSize: 13,\n iconSize: 18,\n borderRadius: 0,\n wrapperBorderRadius: 0,\n wrapperBorder: false,\n menuBorder: false,\n dialogBorder: false,\n panelTitleBarBorder: false,\n tabSelectedBorderWidth: 0,\n tabSelectedUnderlineTransitionDuration: 0.3,\n sidePanelBorder: false,\n sideButtonSelectedBorder: false,\n sideButtonSelectedUnderlineWidth: 2,\n sideButtonSelectedUnderlineTransitionDuration: 0.3,\n sideButtonBorder: false,\n buttonBorder: false,\n buttonDisabledBorder: false,\n focusShadow: {\n spread: 4,\n color: foregroundMix(0.16)\n },\n fontFamily: [\n { googleFont: \"Roboto\" },\n \"-apple-system\",\n \"BlinkMacSystemFont\",\n \"Segoe UI\",\n \"Oxygen-Sans\",\n \"Ubuntu\",\n \"Cantarell\",\n \"Helvetica Neue\",\n \"sans-serif\"\n ],\n inputHeight: {\n calc: \"max(iconSize, fontSize) + spacing * 3\"\n },\n pickerButtonBorder: {\n width: 1,\n color: \"transparent\"\n },\n headerFontWeight: 600,\n headerFontSize: { calc: \"fontSize - 1px\" },\n checkboxBorderWidth: 2,\n checkboxBorderRadius: 2,\n toggleButtonWidth: 34,\n toggleButtonSwitchInset: 1,\n cardShadow: \"0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)\",\n popupShadow: \"5px 5px 10px rgba(0, 0, 0, 0.3)\"\n});\nvar makeThemeMaterialTreeShakeable = () => /* @__PURE__ */ createTheme().withPart(buttonStyleBase).withPart(checkboxStyleDefault).withPart(colorSchemeVariable).withPart(iconSetMaterial).withPart(tabStyleMaterial).withPart(inputStyleUnderlined).withPart(columnDropStylePlain).withPart(styleMaterial).withParams(themeMaterialParams());\nvar themeMaterial = /* @__PURE__ */ makeThemeMaterialTreeShakeable();\n\n// packages/ag-grid-community/src/environment.ts\nvar cssVariable = (changeKey, type, defaultValue, noWarn, cacheDefault) => ({ changeKey, type, defaultValue, noWarn, cacheDefault });\nvar CELL_HORIZONTAL_PADDING = cssVariable(\"cellHorizontalPadding\", \"length\", 16);\nvar INDENTATION_LEVEL = cssVariable(\"indentationLevel\", \"length\", 0, true, true);\nvar ROW_GROUP_INDENT_SIZE = cssVariable(\"rowGroupIndentSize\", \"length\", 0);\nvar ROW_HEIGHT = cssVariable(\"rowHeight\", \"length\", 42);\nvar HEADER_HEIGHT = cssVariable(\"headerHeight\", \"length\", 48);\nvar ROW_BORDER_WIDTH = cssVariable(\"rowBorderWidth\", \"border\", 1);\nvar PINNED_BORDER_WIDTH = cssVariable(\"pinnedRowBorderWidth\", \"border\", 1);\nvar HEADER_ROW_BORDER_WIDTH = cssVariable(\"headerRowBorderWidth\", \"border\", 1);\nfunction _addAdditionalCss(cssMap, modules) {\n for (const module of modules.sort((a, b) => a.moduleName.localeCompare(b.moduleName))) {\n const moduleCss = module.css;\n if (moduleCss) {\n cssMap.set(`module-${module.moduleName}`, moduleCss);\n }\n }\n}\nvar Environment = class extends BaseEnvironment {\n initVariables() {\n this.addManagedPropertyListener(\"rowHeight\", () => this.refreshRowHeightVariable());\n this.getSizeEl(ROW_HEIGHT);\n this.getSizeEl(HEADER_HEIGHT);\n this.getSizeEl(ROW_BORDER_WIDTH);\n this.getSizeEl(PINNED_BORDER_WIDTH);\n this.refreshRowBorderWidthVariable();\n }\n getPinnedRowBorderWidth() {\n return this.getCSSVariablePixelValue(PINNED_BORDER_WIDTH);\n }\n getRowBorderWidth() {\n return this.getCSSVariablePixelValue(ROW_BORDER_WIDTH);\n }\n getHeaderRowBorderWidth() {\n return this.getCSSVariablePixelValue(HEADER_ROW_BORDER_WIDTH);\n }\n getDefaultRowHeight() {\n return this.getCSSVariablePixelValue(ROW_HEIGHT);\n }\n getDefaultHeaderHeight() {\n return this.getCSSVariablePixelValue(HEADER_HEIGHT);\n }\n getDefaultCellHorizontalPadding() {\n return this.getCSSVariablePixelValue(CELL_HORIZONTAL_PADDING);\n }\n getCellPaddingLeft() {\n const cellHorizontalPadding = this.getDefaultCellHorizontalPadding();\n const indentationLevel = this.getCSSVariablePixelValue(INDENTATION_LEVEL);\n const rowGroupIndentSize = this.getCSSVariablePixelValue(ROW_GROUP_INDENT_SIZE);\n return cellHorizontalPadding - 1 + rowGroupIndentSize * indentationLevel;\n }\n getCellPadding() {\n const cellPaddingRight = this.getDefaultCellHorizontalPadding() - 1;\n return this.getCellPaddingLeft() + cellPaddingRight;\n }\n getDefaultColumnMinWidth() {\n return Math.min(36, this.getDefaultRowHeight());\n }\n refreshRowHeightVariable() {\n const { eRootDiv } = this;\n const oldRowHeight = eRootDiv.style.getPropertyValue(\"--ag-line-height\").trim();\n const height = this.gos.get(\"rowHeight\");\n if (height == null || isNaN(height) || !isFinite(height)) {\n if (oldRowHeight !== null) {\n eRootDiv.style.setProperty(\"--ag-line-height\", null);\n }\n return -1;\n }\n const newRowHeight = `${height}px`;\n if (oldRowHeight != newRowHeight) {\n eRootDiv.style.setProperty(\"--ag-line-height\", newRowHeight);\n return height;\n }\n return oldRowHeight != \"\" ? Number.parseFloat(oldRowHeight) : -1;\n }\n fireStylesChangedEvent(change) {\n if (change === \"rowBorderWidth\") {\n this.refreshRowBorderWidthVariable();\n }\n super.fireStylesChangedEvent(change);\n }\n refreshRowBorderWidthVariable() {\n const width = this.getCSSVariablePixelValue(ROW_BORDER_WIDTH);\n this.eRootDiv.style.setProperty(\"--ag-internal-row-border-width\", `${width}px`);\n }\n postProcessThemeChange(newGridTheme, themeGridOption) {\n if (newGridTheme && getComputedStyle(this.getMeasurementContainer()).getPropertyValue(\"--ag-legacy-styles-loaded\")) {\n if (themeGridOption) {\n _error(106);\n } else {\n _error(239);\n }\n }\n }\n getAdditionalCss() {\n const additionalCss = /* @__PURE__ */ new Map();\n additionalCss.set(\"core\", [core_default]);\n _addAdditionalCss(additionalCss, Array.from(_getAllRegisteredModules()));\n return additionalCss;\n }\n getDefaultTheme() {\n return themeQuartz;\n }\n varError(cssName, defaultValue) {\n _warn(9, { variable: { cssName, defaultValue } });\n }\n themeError(theme) {\n _error(240, { theme });\n }\n shadowRootError() {\n _error(293);\n }\n};\n\n// packages/ag-grid-community/src/agStack/events/baseEventService.ts\nvar BaseEventService = class extends AgBeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"eventSvc\";\n this.eventServiceType = \"global\";\n this.globalSvc = new LocalEventService();\n }\n addListener(eventType, listener, async) {\n this.globalSvc.addEventListener(eventType, listener, async);\n }\n removeListener(eventType, listener, async) {\n this.globalSvc.removeEventListener(eventType, listener, async);\n }\n addGlobalListener(listener, async = false) {\n this.globalSvc.addGlobalListener(listener, async);\n }\n removeGlobalListener(listener, async = false) {\n this.globalSvc.removeGlobalListener(listener, async);\n }\n dispatchEvent(event) {\n this.globalSvc.dispatchEvent(this.gos.addCommon(event));\n }\n dispatchEventOnce(event) {\n this.globalSvc.dispatchEventOnce(this.gos.addCommon(event));\n }\n};\n\n// packages/ag-grid-community/src/eventService.ts\nvar EventService = class extends BaseEventService {\n postConstruct() {\n const { globalListener, globalSyncListener } = this.beans;\n if (globalListener) {\n this.addGlobalListener(globalListener, true);\n }\n if (globalSyncListener) {\n this.addGlobalListener(globalSyncListener, false);\n }\n }\n};\n\n// packages/ag-grid-community/src/navigation/headerNavigationService.ts\nfunction getHeaderIndexToFocus(beans, column, level) {\n const columnRowIndex = beans.visibleCols.headerGroupRowCount;\n if (level >= columnRowIndex) {\n return {\n column,\n headerRowIndex: level\n };\n }\n let parent = column.getParent();\n while (parent && parent.getProvidedColumnGroup().getLevel() > level) {\n parent = parent.getParent();\n }\n const isColSpanning = column.isSpanHeaderHeight();\n if (!parent || isColSpanning && parent.isPadding()) {\n return {\n column,\n headerRowIndex: columnRowIndex\n };\n }\n return {\n column: parent,\n headerRowIndex: parent.getProvidedColumnGroup().getLevel()\n };\n}\nvar HeaderNavigationService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"headerNavigation\";\n this.currentHeaderRowWithoutSpan = -1;\n }\n postConstruct() {\n const beans = this.beans;\n beans.ctrlsSvc.whenReady(this, (p) => {\n this.gridBodyCon = p.gridBodyCtrl;\n });\n const eDocument = _getDocument(beans);\n this.addManagedElementListeners(eDocument, {\n mousedown: () => {\n this.currentHeaderRowWithoutSpan = -1;\n }\n });\n }\n getHeaderPositionForColumn(colKey, floatingFilter) {\n let column;\n const { colModel, colGroupSvc, ctrlsSvc } = this.beans;\n if (typeof colKey === \"string\") {\n column = colModel.getCol(colKey);\n if (!column) {\n column = colGroupSvc?.getColumnGroup(colKey) ?? null;\n }\n } else {\n column = colKey;\n }\n if (!column) {\n return null;\n }\n const centerHeaderContainer = ctrlsSvc.getHeaderRowContainerCtrl();\n const allCtrls = centerHeaderContainer?.getAllCtrls();\n const isFloatingFilterVisible = _last(allCtrls || []).type === \"filter\";\n const headerRowCount = getFocusHeaderRowCount(this.beans) - 1;\n let row = -1;\n let col = column;\n while (col) {\n row++;\n col = col.getParent();\n }\n let headerRowIndex = row;\n if (floatingFilter && isFloatingFilterVisible && headerRowIndex === headerRowCount - 1) {\n headerRowIndex++;\n }\n return headerRowIndex === -1 ? null : {\n headerRowIndex,\n column\n };\n }\n /*\n * This method navigates grid header vertically\n * @return {boolean} true to preventDefault on the event that caused this navigation.\n */\n navigateVertically(direction, event) {\n const { focusSvc, visibleCols } = this.beans;\n const { focusedHeader } = focusSvc;\n if (!focusedHeader) {\n return false;\n }\n const { headerRowIndex } = focusedHeader;\n const column = focusedHeader.column;\n const rowLen = getFocusHeaderRowCount(this.beans);\n const currentRowType = this.getHeaderRowType(headerRowIndex);\n const columnHeaderRowIndex = visibleCols.headerGroupRowCount;\n let {\n headerRowIndex: nextRow,\n column: nextFocusColumn,\n headerRowIndexWithoutSpan\n } = direction === \"UP\" ? getColumnVisibleParent(currentRowType, column, headerRowIndex) : getColumnVisibleChild(column, headerRowIndex, columnHeaderRowIndex);\n let skipColumn = false;\n if (nextRow < 0) {\n nextRow = 0;\n nextFocusColumn = column;\n skipColumn = true;\n }\n if (nextRow >= rowLen) {\n nextRow = -1;\n this.currentHeaderRowWithoutSpan = -1;\n } else if (headerRowIndexWithoutSpan !== void 0) {\n this.currentHeaderRowWithoutSpan = headerRowIndexWithoutSpan;\n }\n if (!skipColumn && !nextFocusColumn) {\n return false;\n }\n return focusSvc.focusHeaderPosition({\n headerPosition: { headerRowIndex: nextRow, column: nextFocusColumn },\n allowUserOverride: true,\n event\n });\n }\n /*\n * This method navigates grid header horizontally\n * @returns {boolean} true to preventDefault on the event that caused this navigation.\n */\n navigateHorizontally(direction, fromTab = false, event) {\n const { focusSvc, gos } = this.beans;\n const focusedHeader = { ...focusSvc.focusedHeader };\n let nextHeader;\n let normalisedDirection;\n if (this.currentHeaderRowWithoutSpan !== -1) {\n focusedHeader.headerRowIndex = this.currentHeaderRowWithoutSpan;\n } else {\n this.currentHeaderRowWithoutSpan = focusedHeader.headerRowIndex;\n }\n if (direction === \"LEFT\" !== gos.get(\"enableRtl\")) {\n normalisedDirection = \"Before\";\n nextHeader = this.findHeader(focusedHeader, normalisedDirection);\n } else {\n normalisedDirection = \"After\";\n nextHeader = this.findHeader(focusedHeader, normalisedDirection);\n }\n const userFunc = gos.getCallback(\"tabToNextHeader\");\n if (fromTab && userFunc) {\n const wasFocusedFromUserFunc = focusSvc.focusHeaderPositionFromUserFunc({\n userFunc,\n headerPosition: nextHeader,\n direction: normalisedDirection\n });\n if (wasFocusedFromUserFunc) {\n const { headerRowIndex } = focusSvc.focusedHeader || {};\n if (headerRowIndex != null && headerRowIndex != focusedHeader.headerRowIndex) {\n this.currentHeaderRowWithoutSpan = headerRowIndex;\n }\n }\n return wasFocusedFromUserFunc;\n }\n if (nextHeader || !fromTab) {\n return focusSvc.focusHeaderPosition({\n headerPosition: nextHeader,\n direction: normalisedDirection,\n fromTab,\n allowUserOverride: true,\n event\n });\n }\n return this.focusNextHeaderRow(focusedHeader, normalisedDirection, event);\n }\n focusNextHeaderRow(focusedHeader, direction, event) {\n const beans = this.beans;\n const currentIndex = focusedHeader.headerRowIndex;\n let nextFocusedCol = null;\n let nextRowIndex;\n const headerRowCount = getFocusHeaderRowCount(beans);\n const allVisibleCols = this.beans.visibleCols.allCols;\n if (direction === \"Before\") {\n if (currentIndex <= 0) {\n return false;\n }\n nextFocusedCol = _last(allVisibleCols);\n nextRowIndex = currentIndex - 1;\n this.currentHeaderRowWithoutSpan -= 1;\n } else {\n nextFocusedCol = allVisibleCols[0];\n nextRowIndex = currentIndex + 1;\n if (this.currentHeaderRowWithoutSpan < headerRowCount) {\n this.currentHeaderRowWithoutSpan += 1;\n } else {\n this.currentHeaderRowWithoutSpan = -1;\n }\n }\n let { column, headerRowIndex } = getHeaderIndexToFocus(this.beans, nextFocusedCol, nextRowIndex);\n if (headerRowIndex >= headerRowCount) {\n headerRowIndex = -1;\n }\n return beans.focusSvc.focusHeaderPosition({\n headerPosition: { column, headerRowIndex },\n direction,\n fromTab: true,\n allowUserOverride: true,\n event\n });\n }\n scrollToColumn(column, direction = \"After\") {\n if (column.getPinned()) {\n return;\n }\n let columnToScrollTo;\n if (isColumnGroup(column)) {\n const columns = column.getDisplayedLeafColumns();\n columnToScrollTo = direction === \"Before\" ? _last(columns) : columns[0];\n } else {\n columnToScrollTo = column;\n }\n this.gridBodyCon.scrollFeature.ensureColumnVisible(columnToScrollTo);\n }\n findHeader(focusedHeader, direction) {\n const { colGroupSvc, visibleCols } = this.beans;\n let currentFocusedColumn = focusedHeader.column;\n if (currentFocusedColumn instanceof AgColumnGroup) {\n const leafChildren = currentFocusedColumn.getDisplayedLeafColumns();\n currentFocusedColumn = direction === \"Before\" ? leafChildren[0] : leafChildren[leafChildren.length - 1];\n }\n const nextFocusedCol = direction === \"Before\" ? visibleCols.getColBefore(currentFocusedColumn) : visibleCols.getColAfter(currentFocusedColumn);\n if (!nextFocusedCol) {\n return void 0;\n }\n const headerGroupRowIndex = visibleCols.headerGroupRowCount;\n if (focusedHeader.headerRowIndex >= headerGroupRowIndex) {\n return {\n headerRowIndex: focusedHeader.headerRowIndex,\n column: nextFocusedCol\n };\n }\n const groupAtLevel = colGroupSvc?.getColGroupAtLevel(nextFocusedCol, focusedHeader.headerRowIndex);\n if (!groupAtLevel) {\n const isSpanningCol = nextFocusedCol instanceof AgColumn && nextFocusedCol.isSpanHeaderHeight();\n return {\n headerRowIndex: isSpanningCol ? visibleCols.headerGroupRowCount : focusedHeader.headerRowIndex,\n column: nextFocusedCol\n };\n }\n if (groupAtLevel.isPadding() && nextFocusedCol.isSpanHeaderHeight()) {\n return {\n headerRowIndex: visibleCols.headerGroupRowCount,\n column: nextFocusedCol\n };\n }\n return {\n headerRowIndex: focusedHeader.headerRowIndex,\n column: groupAtLevel ?? nextFocusedCol\n };\n }\n getHeaderRowType(rowIndex) {\n const centerHeaderContainer = this.beans.ctrlsSvc.getHeaderRowContainerCtrl();\n if (centerHeaderContainer) {\n return centerHeaderContainer.getRowType(rowIndex);\n }\n }\n};\nfunction getColumnVisibleParent(currentRowType, currentColumn, currentIndex) {\n const optimisticNextIndex = currentIndex - 1;\n if (currentRowType !== \"filter\") {\n const isSpanningCol = currentColumn instanceof AgColumn && currentColumn.isSpanHeaderHeight();\n let nextVisibleParent = currentColumn.getParent();\n while (nextVisibleParent && // skip if row isn't visible or col is padding and spanned\n (nextVisibleParent.getProvidedColumnGroup().getLevel() > optimisticNextIndex || isSpanningCol && nextVisibleParent.isPadding())) {\n nextVisibleParent = nextVisibleParent.getParent();\n }\n if (nextVisibleParent) {\n if (isSpanningCol) {\n return {\n column: nextVisibleParent,\n headerRowIndex: nextVisibleParent.getProvidedColumnGroup().getLevel(),\n headerRowIndexWithoutSpan: optimisticNextIndex\n };\n } else {\n return {\n column: nextVisibleParent,\n headerRowIndex: optimisticNextIndex,\n headerRowIndexWithoutSpan: optimisticNextIndex\n };\n }\n }\n }\n return {\n column: currentColumn,\n headerRowIndex: optimisticNextIndex,\n headerRowIndexWithoutSpan: optimisticNextIndex\n };\n}\nfunction getColumnVisibleChild(column, currentIndex, columnHeaderRowIndex) {\n const optimisticNextIndex = currentIndex + 1;\n const result = {\n column,\n headerRowIndex: optimisticNextIndex,\n headerRowIndexWithoutSpan: optimisticNextIndex\n };\n if (column instanceof AgColumnGroup) {\n if (optimisticNextIndex >= columnHeaderRowIndex) {\n return {\n column: column.getDisplayedLeafColumns()[0],\n headerRowIndex: columnHeaderRowIndex,\n headerRowIndexWithoutSpan: optimisticNextIndex\n };\n }\n const children = column.getDisplayedChildren();\n let firstChild = children[0];\n if (firstChild instanceof AgColumnGroup && firstChild.isPadding()) {\n const firstCol = firstChild.getDisplayedLeafColumns()[0];\n if (firstCol.isSpanHeaderHeight()) {\n firstChild = firstCol;\n }\n }\n result.column = firstChild;\n const isSpanningCol = firstChild instanceof AgColumn && firstChild.isSpanHeaderHeight();\n if (isSpanningCol) {\n result.headerRowIndex = columnHeaderRowIndex;\n result.headerRowIndexWithoutSpan = optimisticNextIndex;\n }\n }\n return result;\n}\n\n// packages/ag-grid-community/src/focusService.ts\nvar FocusService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"focusSvc\";\n /** If a cell was destroyed that previously had focus, focus needs restored when the cell reappears */\n this.focusFallbackTimeout = null;\n this.needsFocusRestored = false;\n }\n wireBeans(beans) {\n this.colModel = beans.colModel;\n this.visibleCols = beans.visibleCols;\n this.rowRenderer = beans.rowRenderer;\n this.navigation = beans.navigation;\n this.filterManager = beans.filterManager;\n this.overlays = beans.overlays;\n }\n postConstruct() {\n const clearFocusedCellListener = this.clearFocusedCell.bind(this);\n this.addManagedEventListeners({\n columnPivotModeChanged: clearFocusedCellListener,\n newColumnsLoaded: this.onColumnEverythingChanged.bind(this),\n columnGroupOpened: clearFocusedCellListener,\n columnRowGroupChanged: clearFocusedCellListener\n });\n this.addDestroyFunc(_registerKeyboardFocusEvents(this.beans));\n }\n attemptToRecoverFocus() {\n this.needsFocusRestored = true;\n if (this.focusFallbackTimeout != null) {\n clearTimeout(this.focusFallbackTimeout);\n }\n this.focusFallbackTimeout = window.setTimeout(this.setFocusRecovered.bind(this), 100);\n }\n setFocusRecovered() {\n this.needsFocusRestored = false;\n if (this.focusFallbackTimeout != null) {\n clearTimeout(this.focusFallbackTimeout);\n this.focusFallbackTimeout = null;\n }\n }\n /**\n * Specifies whether to take focus, as grid either already has focus, or lost it due\n * to a destroyed cell\n * @returns true if the grid should re-take focus, otherwise false\n */\n shouldTakeFocus() {\n if (this.gos.get(\"suppressFocusAfterRefresh\")) {\n this.setFocusRecovered();\n return false;\n }\n if (this.needsFocusRestored) {\n this.setFocusRecovered();\n return true;\n }\n return this.doesRowOrCellHaveBrowserFocus();\n }\n onColumnEverythingChanged() {\n if (!this.focusedCell) {\n return;\n }\n const col = this.focusedCell.column;\n const colFromColumnModel = this.colModel.getCol(col.getId());\n if (col !== colFromColumnModel) {\n this.clearFocusedCell();\n }\n }\n // we check if the browser is focusing something, and if it is, and\n // it's the cell we think is focused, then return the cell. so this\n // methods returns the cell if a) we think it has focus and b) the\n // browser thinks it has focus. this then returns nothing if we\n // first focus a cell, then second click outside the grid, as then the\n // grid cell will still be focused as far as the grid is concerned,\n // however the browser focus will have moved somewhere else.\n getFocusCellToUseAfterRefresh() {\n const { gos, focusedCell } = this;\n if (gos.get(\"suppressFocusAfterRefresh\") || gos.get(\"suppressCellFocus\") || !focusedCell) {\n return null;\n }\n if (!this.doesRowOrCellHaveBrowserFocus()) {\n return null;\n }\n return focusedCell;\n }\n getFocusHeaderToUseAfterRefresh() {\n if (this.gos.get(\"suppressFocusAfterRefresh\") || !this.focusedHeader) {\n return null;\n }\n if (!this.isDomDataPresentInHierarchy(_getActiveDomElement(this.beans), DOM_DATA_KEY_HEADER_CTRL)) {\n return null;\n }\n return this.focusedHeader;\n }\n /**\n * Check for both cells and rows, as a row might be destroyed and the dom data removed before the cell if the\n * row is animating out.\n */\n doesRowOrCellHaveBrowserFocus() {\n const activeElement = _getActiveDomElement(this.beans);\n if (this.isDomDataPresentInHierarchy(activeElement, DOM_DATA_KEY_CELL_CTRL, true)) {\n return true;\n }\n return this.isDomDataPresentInHierarchy(activeElement, DOM_DATA_KEY_ROW_CTRL, true);\n }\n isDomDataPresentInHierarchy(eBrowserCell, key, attemptToRefocusIfDestroyed) {\n let ePointer = eBrowserCell;\n while (ePointer) {\n const data = _getDomData(this.gos, ePointer, key);\n if (data) {\n if (data.destroyed && attemptToRefocusIfDestroyed) {\n this.attemptToRecoverFocus();\n return false;\n }\n return true;\n }\n ePointer = ePointer.parentNode;\n }\n return false;\n }\n getFocusedCell() {\n return this.focusedCell;\n }\n getFocusEventParams(focusedCellPosition) {\n const { rowIndex, rowPinned, column } = focusedCellPosition;\n const params = {\n rowIndex,\n rowPinned,\n column,\n isFullWidthCell: false\n };\n const rowCtrl = this.rowRenderer.getRowByPosition({ rowIndex, rowPinned });\n if (rowCtrl) {\n params.isFullWidthCell = rowCtrl.isFullWidth();\n }\n return params;\n }\n clearFocusedCell() {\n if (this.focusedCell == null) {\n return;\n }\n const focusEventParams = this.getFocusEventParams(this.focusedCell);\n this.focusedCell = null;\n this.eventSvc.dispatchEvent({\n type: \"cellFocusCleared\",\n ...focusEventParams\n });\n }\n setFocusedCell(params) {\n this.setFocusRecovered();\n const {\n column,\n rowIndex,\n rowPinned,\n forceBrowserFocus = false,\n preventScrollOnBrowserFocus = false,\n sourceEvent\n } = params;\n const gridColumn = this.colModel.getCol(column);\n if (!gridColumn) {\n this.focusedCell = null;\n return;\n }\n this.focusedCell = {\n rowIndex,\n rowPinned: _makeNull(rowPinned),\n column: gridColumn\n };\n const focusEventParams = this.getFocusEventParams(this.focusedCell);\n this.eventSvc.dispatchEvent({\n type: \"cellFocused\",\n ...focusEventParams,\n ...this.previousCellFocusParams && { previousParams: this.previousCellFocusParams },\n forceBrowserFocus,\n preventScrollOnBrowserFocus,\n sourceEvent\n });\n this.previousCellFocusParams = focusEventParams;\n }\n isCellFocused(cellPosition) {\n if (this.focusedCell == null) {\n return false;\n }\n return _areCellsEqual(cellPosition, this.focusedCell);\n }\n isHeaderWrapperFocused(headerCtrl) {\n if (this.focusedHeader == null) {\n return false;\n }\n const {\n column,\n rowCtrl: { rowIndex: headerRowIndex, pinned }\n } = headerCtrl;\n const { column: focusedColumn, headerRowIndex: focusedHeaderRowIndex } = this.focusedHeader;\n return column === focusedColumn && headerRowIndex === focusedHeaderRowIndex && pinned == focusedColumn.getPinned();\n }\n focusHeaderPosition(params) {\n this.setFocusRecovered();\n if (_isHeaderFocusSuppressed(this.beans)) {\n return false;\n }\n const { direction, fromTab, allowUserOverride, event, fromCell, rowWithoutSpanValue, scroll = true } = params;\n let { headerPosition } = params;\n if (fromCell && this.filterManager?.isAdvFilterHeaderActive()) {\n return this.focusAdvancedFilter(headerPosition);\n }\n if (allowUserOverride) {\n const currentPosition = this.focusedHeader;\n const headerRowCount = getFocusHeaderRowCount(this.beans);\n if (fromTab) {\n const userFunc = this.gos.getCallback(\"tabToNextHeader\");\n if (userFunc) {\n headerPosition = this.getHeaderPositionFromUserFunc({\n userFunc,\n direction,\n currentPosition,\n headerPosition,\n headerRowCount\n });\n }\n } else {\n const userFunc = this.gos.getCallback(\"navigateToNextHeader\");\n if (userFunc && event) {\n const params2 = {\n key: event.key,\n previousHeaderPosition: currentPosition,\n nextHeaderPosition: headerPosition,\n headerRowCount,\n event\n };\n const userResult = userFunc(params2);\n headerPosition = userResult === null ? currentPosition : userResult;\n }\n }\n }\n if (!headerPosition) {\n return false;\n }\n return this.focusProvidedHeaderPosition({\n headerPosition,\n direction,\n event,\n fromCell,\n rowWithoutSpanValue,\n scroll\n });\n }\n focusHeaderPositionFromUserFunc(params) {\n if (_isHeaderFocusSuppressed(this.beans)) {\n return false;\n }\n const { userFunc, headerPosition, direction, event } = params;\n const currentPosition = this.focusedHeader;\n const headerRowCount = getFocusHeaderRowCount(this.beans);\n const newHeaderPosition = this.getHeaderPositionFromUserFunc({\n userFunc,\n direction,\n currentPosition,\n headerPosition,\n headerRowCount\n });\n return !!newHeaderPosition && this.focusProvidedHeaderPosition({\n headerPosition: newHeaderPosition,\n direction,\n event\n });\n }\n getHeaderPositionFromUserFunc(params) {\n const { userFunc, direction, currentPosition, headerPosition, headerRowCount } = params;\n const userFuncParams = {\n backwards: direction === \"Before\",\n previousHeaderPosition: currentPosition,\n nextHeaderPosition: headerPosition,\n headerRowCount\n };\n const userResult = userFunc(userFuncParams);\n if (userResult === true) {\n return currentPosition;\n }\n if (userResult === false) {\n return null;\n }\n return userResult;\n }\n focusProvidedHeaderPosition(params) {\n const { headerPosition, direction, fromCell, rowWithoutSpanValue, event, scroll = true } = params;\n const { column, headerRowIndex } = headerPosition;\n const { filterManager, ctrlsSvc, headerNavigation } = this.beans;\n if (this.focusedHeader && isHeaderPositionEqual(params.headerPosition, this.focusedHeader)) {\n return false;\n }\n if (headerRowIndex === -1) {\n if (filterManager?.isAdvFilterHeaderActive()) {\n return this.focusAdvancedFilter(headerPosition);\n }\n return this.focusGridView({ column, event });\n }\n if (scroll) {\n headerNavigation?.scrollToColumn(column, direction);\n }\n const headerRowContainerCtrl = ctrlsSvc.getHeaderRowContainerCtrl(column.getPinned());\n const focusSuccess = headerRowContainerCtrl?.focusHeader(headerPosition.headerRowIndex, column, event) || false;\n if (headerNavigation && focusSuccess && (rowWithoutSpanValue != null || fromCell)) {\n headerNavigation.currentHeaderRowWithoutSpan = rowWithoutSpanValue ?? -1;\n }\n return focusSuccess;\n }\n focusFirstHeader() {\n if (this.overlays?.exclusive && this.focusOverlay()) {\n return true;\n }\n const firstColumn = this.visibleCols.allCols[0];\n if (!firstColumn) {\n return false;\n }\n const headerPosition = getHeaderIndexToFocus(this.beans, firstColumn, 0);\n return this.focusHeaderPosition({\n headerPosition,\n rowWithoutSpanValue: 0\n });\n }\n focusLastHeader(event) {\n if (this.overlays?.exclusive && this.focusOverlay(true)) {\n return true;\n }\n const headerRowIndex = getFocusHeaderRowCount(this.beans) - 1;\n const column = _last(this.visibleCols.allCols);\n return this.focusHeaderPosition({\n headerPosition: { headerRowIndex, column },\n rowWithoutSpanValue: -1,\n event\n });\n }\n focusPreviousFromFirstCell(event) {\n if (this.filterManager?.isAdvFilterHeaderActive()) {\n return this.focusAdvancedFilter(null);\n }\n return this.focusLastHeader(event);\n }\n isAnyCellFocused() {\n return !!this.focusedCell;\n }\n isRowFocused(rowIndex, rowPinnedType) {\n if (this.focusedCell == null) {\n return false;\n }\n return this.focusedCell.rowIndex === rowIndex && this.focusedCell.rowPinned === _makeNull(rowPinnedType);\n }\n focusOverlay(backwards) {\n const overlayGui = this.overlays?.isVisible() && this.overlays.eWrapper?.getGui();\n return !!overlayGui && _focusInto(overlayGui, backwards);\n }\n getDefaultTabToNextGridContainerTarget(params) {\n const { backwards, focusableContainers } = params;\n const step = backwards ? -1 : 1;\n let gridBodyTarget;\n const getGridBodyTabTarget = () => {\n if (gridBodyTarget === void 0) {\n gridBodyTarget = this.getGridBodyTabTarget(backwards);\n }\n return gridBodyTarget;\n };\n for (let index = params.nextIndex; index >= 0 && index < focusableContainers.length; index += step) {\n const target = _getDefaultTabTargetForContainer(focusableContainers[index], getGridBodyTabTarget);\n if (target) {\n return target;\n }\n }\n return null;\n }\n getGridBodyTabTarget(backwards) {\n if (backwards) {\n return this.getGridViewTabTarget({ column: _last(this.visibleCols.allCols), backwards: true });\n }\n const firstColumn = this.visibleCols.allCols[0];\n if (this.gos.get(\"headerHeight\") === 0 || _isHeaderFocusSuppressed(this.beans)) {\n return this.getGridViewTabTarget({ column: firstColumn });\n }\n if (!firstColumn) {\n return null;\n }\n return getHeaderIndexToFocus(this.beans, firstColumn, 0);\n }\n getGridViewTabTarget(params) {\n const { backwards = false } = params;\n const column = params.column ?? this.focusedHeader?.column;\n if (!column) {\n return null;\n }\n if (this.overlays?.exclusive) {\n return null;\n }\n if (_isCellFocusSuppressed(this.beans)) {\n return backwards && !_isHeaderFocusSuppressed(this.beans) ? {\n headerRowIndex: getFocusHeaderRowCount(this.beans) - 1,\n column\n } : null;\n }\n const nextRow = backwards ? _getLastRow(this.beans) : _getFirstRow(this.beans);\n if (nextRow?.rowIndex == null) {\n if (this.overlays?.isVisible()) {\n return null;\n }\n if (backwards && !_isHeaderFocusSuppressed(this.beans)) {\n const lastColumn = _last(this.visibleCols.allCols);\n if (lastColumn) {\n return {\n headerRowIndex: getFocusHeaderRowCount(this.beans) - 1,\n column: lastColumn\n };\n }\n }\n return null;\n }\n const rowNode = _getRowNode(this.beans, nextRow);\n if (!rowNode || column.isSuppressNavigable(rowNode)) {\n return null;\n }\n if (backwards) {\n const rowCtrl = this.rowRenderer.getRowByPosition(nextRow);\n if (rowCtrl?.isFullWidth()) {\n return null;\n }\n }\n return {\n rowIndex: nextRow.rowIndex,\n rowPinned: nextRow.rowPinned,\n column\n };\n }\n focusGridView(params) {\n const { backwards = false, canFocusOverlay = true, event } = params;\n if (this.overlays?.exclusive) {\n return canFocusOverlay && this.focusOverlay(backwards);\n }\n if (_isCellFocusSuppressed(this.beans)) {\n if (backwards) {\n if (!_isHeaderFocusSuppressed(this.beans)) {\n return this.focusLastHeader();\n }\n }\n if (canFocusOverlay && this.focusOverlay(backwards)) {\n return true;\n }\n if (backwards) {\n return false;\n }\n return _focusNextGridCoreContainer(this.beans, backwards);\n }\n const nextRow = backwards ? _getLastRow(this.beans) : _getFirstRow(this.beans);\n if (nextRow) {\n const column = params.column ?? this.focusedHeader?.column;\n const { rowIndex, rowPinned } = nextRow;\n const rowNode = _getRowNode(this.beans, nextRow);\n if (!column || !rowNode || rowIndex == null) {\n return false;\n }\n if (column.isSuppressNavigable(rowNode)) {\n const isRtl = this.gos.get(\"enableRtl\");\n let key;\n if (!event || event.key === KeyCode.TAB) {\n key = isRtl ? KeyCode.LEFT : KeyCode.RIGHT;\n } else {\n key = event.key;\n }\n this.beans.navigation?.navigateToNextCell(\n null,\n key,\n { rowIndex, column, rowPinned: rowPinned || null },\n true\n );\n return true;\n }\n this.navigation?.ensureCellVisible({ rowIndex, column, rowPinned });\n if (backwards) {\n const rowCtrl = this.rowRenderer.getRowByPosition(nextRow);\n if (rowCtrl?.isFullWidth() && this.navigation?.tryToFocusFullWidthRow(nextRow, backwards)) {\n return true;\n }\n }\n this.setFocusedCell({\n rowIndex,\n column,\n rowPinned: _makeNull(rowPinned),\n forceBrowserFocus: true\n });\n if (!isRowNumberCol(column)) {\n this.beans.rangeSvc?.setRangeToCell({ rowIndex, rowPinned, column });\n }\n return true;\n }\n if (canFocusOverlay && this.focusOverlay(backwards)) {\n return true;\n }\n if (backwards && this.focusLastHeader()) {\n return true;\n }\n return false;\n }\n focusAdvancedFilter(position) {\n this.advFilterFocusColumn = position?.column;\n return this.beans.advancedFilter?.getCtrl().focusHeaderComp() ?? false;\n }\n focusNextFromAdvancedFilter(backwards, forceFirstColumn) {\n const column = (forceFirstColumn ? void 0 : this.advFilterFocusColumn) ?? this.visibleCols.allCols?.[0];\n if (backwards) {\n return this.focusHeaderPosition({\n headerPosition: {\n column,\n headerRowIndex: getFocusHeaderRowCount(this.beans) - 1\n }\n });\n }\n return this.focusGridView({ column });\n }\n clearAdvancedFilterColumn() {\n this.advFilterFocusColumn = void 0;\n }\n};\n\n// packages/ag-grid-community/src/gridBodyComp/scrollVisibleService.ts\nvar ScrollVisibleService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"scrollVisibleSvc\";\n }\n wireBeans(beans) {\n this.ctrlsSvc = beans.ctrlsSvc;\n this.colAnimation = beans.colAnimation;\n }\n postConstruct() {\n const { gos } = this;\n this.horizontalScrollShowing = gos.get(\"alwaysShowHorizontalScroll\") === true;\n this.verticalScrollShowing = gos.get(\"alwaysShowVerticalScroll\") === true;\n this.getScrollbarWidth();\n const updateScrollVisible = this.updateScrollVisible.bind(this);\n this.addManagedEventListeners({\n displayedColumnsChanged: updateScrollVisible,\n displayedColumnsWidthChanged: updateScrollVisible,\n newColumnsLoaded: updateScrollVisible\n });\n }\n updateScrollVisible() {\n const { colAnimation } = this;\n if (colAnimation?.isActive()) {\n colAnimation.executeLaterVMTurn(() => {\n colAnimation.executeLaterVMTurn(() => this.updateScrollVisibleImpl());\n });\n } else {\n this.updateScrollVisibleImpl();\n }\n }\n updateScrollVisibleImpl() {\n const centerRowCtrl = this.ctrlsSvc.get(\"center\");\n if (!centerRowCtrl || this.colAnimation?.isActive()) {\n return;\n }\n const params = {\n horizontalScrollShowing: centerRowCtrl.isHorizontalScrollShowing(),\n verticalScrollShowing: this.verticalScrollShowing\n };\n this.setScrollsVisible(params);\n this.updateScrollGap();\n }\n updateScrollGap() {\n const centerRowCtrl = this.ctrlsSvc.get(\"center\");\n const horizontalGap = centerRowCtrl.hasHorizontalScrollGap();\n const verticalGap = centerRowCtrl.hasVerticalScrollGap();\n const atLeastOneDifferent = this.horizontalScrollGap !== horizontalGap || this.verticalScrollGap !== verticalGap;\n if (atLeastOneDifferent) {\n this.horizontalScrollGap = horizontalGap;\n this.verticalScrollGap = verticalGap;\n this.eventSvc.dispatchEvent({\n type: \"scrollGapChanged\"\n });\n }\n }\n setScrollsVisible(params) {\n const atLeastOneDifferent = this.horizontalScrollShowing !== params.horizontalScrollShowing || this.verticalScrollShowing !== params.verticalScrollShowing;\n if (atLeastOneDifferent) {\n this.horizontalScrollShowing = params.horizontalScrollShowing;\n this.verticalScrollShowing = params.verticalScrollShowing;\n this.eventSvc.dispatchEvent({\n type: \"scrollVisibilityChanged\"\n });\n }\n }\n // the user might be using some non-standard scrollbar, eg a scrollbar that has zero\n // width and overlays (like the Safari scrollbar, but presented in Chrome). so we\n // allow the user to provide the scroll width before we work it out.\n getScrollbarWidth() {\n if (this.scrollbarWidth == null) {\n const gridOptionsScrollbarWidth = this.gos.get(\"scrollbarWidth\");\n const useGridOptions = typeof gridOptionsScrollbarWidth === \"number\" && gridOptionsScrollbarWidth >= 0;\n const scrollbarWidth = useGridOptions ? gridOptionsScrollbarWidth : _getScrollbarWidth();\n if (scrollbarWidth != null) {\n this.scrollbarWidth = scrollbarWidth;\n this.eventSvc.dispatchEvent({\n type: \"scrollbarWidthChanged\"\n });\n }\n }\n return this.scrollbarWidth;\n }\n};\n\n// packages/ag-grid-community/src/gridDestroyService.ts\nvar GridDestroyService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"gridDestroySvc\";\n this.destroyCalled = false;\n }\n destroy() {\n if (this.destroyCalled) {\n return;\n }\n const { stateSvc, ctrlsSvc, context } = this.beans;\n this.eventSvc.dispatchEvent({\n type: \"gridPreDestroyed\",\n state: stateSvc?.getState() ?? {}\n });\n this.destroyCalled = true;\n ctrlsSvc.get(\"gridCtrl\")?.destroyGridUi();\n context.destroy();\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/eventTypes.ts\nvar _PUBLIC_EVENTS = [\n \"columnEverythingChanged\",\n \"newColumnsLoaded\",\n \"columnPivotModeChanged\",\n \"pivotMaxColumnsExceeded\",\n \"columnRowGroupChanged\",\n \"expandOrCollapseAll\",\n \"columnPivotChanged\",\n \"gridColumnsChanged\",\n \"columnValueChanged\",\n \"columnMoved\",\n \"columnVisible\",\n \"columnPinned\",\n \"columnGroupOpened\",\n \"columnResized\",\n \"displayedColumnsChanged\",\n \"virtualColumnsChanged\",\n \"columnHeaderMouseOver\",\n \"columnHeaderMouseLeave\",\n \"columnHeaderClicked\",\n \"columnHeaderContextMenu\",\n \"asyncTransactionsFlushed\",\n \"rowGroupOpened\",\n \"rowDataUpdated\",\n \"pinnedRowDataChanged\",\n \"pinnedRowsChanged\",\n \"rangeSelectionChanged\",\n \"cellSelectionChanged\",\n \"chartCreated\",\n \"chartRangeSelectionChanged\",\n \"chartOptionsChanged\",\n \"chartDestroyed\",\n \"toolPanelVisibleChanged\",\n \"toolPanelSizeChanged\",\n \"modelUpdated\",\n \"cutStart\",\n \"cutEnd\",\n \"pasteStart\",\n \"pasteEnd\",\n \"fillStart\",\n \"fillEnd\",\n \"cellSelectionDeleteStart\",\n \"cellSelectionDeleteEnd\",\n \"rangeDeleteStart\",\n \"rangeDeleteEnd\",\n \"undoStarted\",\n \"undoEnded\",\n \"redoStarted\",\n \"redoEnded\",\n \"cellClicked\",\n \"cellDoubleClicked\",\n \"cellMouseDown\",\n \"cellContextMenu\",\n \"cellValueChanged\",\n \"cellEditRequest\",\n \"rowValueChanged\",\n \"headerFocused\",\n \"cellFocused\",\n \"rowSelected\",\n \"selectionChanged\",\n \"tooltipShow\",\n \"tooltipHide\",\n \"cellKeyDown\",\n \"cellMouseOver\",\n \"cellMouseOut\",\n \"filterChanged\",\n \"filterModified\",\n \"filterUiChanged\",\n \"filterOpened\",\n \"floatingFilterUiChanged\",\n \"advancedFilterBuilderVisibleChanged\",\n \"sortChanged\",\n \"virtualRowRemoved\",\n \"rowClicked\",\n \"rowDoubleClicked\",\n \"gridReady\",\n \"gridPreDestroyed\",\n \"gridSizeChanged\",\n \"viewportChanged\",\n \"firstDataRendered\",\n \"dragStarted\",\n \"dragStopped\",\n \"dragCancelled\",\n \"rowEditingStarted\",\n \"rowEditingStopped\",\n \"cellEditingStarted\",\n \"cellEditingStopped\",\n \"bodyScroll\",\n \"bodyScrollEnd\",\n \"paginationChanged\",\n \"componentStateChanged\",\n \"storeRefreshed\",\n \"stateUpdated\",\n \"columnMenuVisibleChanged\",\n \"contextMenuVisibleChanged\",\n \"rowDragEnter\",\n \"rowDragMove\",\n \"rowDragLeave\",\n \"rowDragEnd\",\n \"rowDragCancel\",\n \"findChanged\",\n \"rowResizeStarted\",\n \"rowResizeEnded\",\n \"columnsReset\",\n \"bulkEditingStarted\",\n \"bulkEditingStopped\",\n \"batchEditingStarted\",\n \"batchEditingStopped\"\n];\nvar _INTERNAL_EVENTS = [\n \"scrollbarWidthChanged\",\n \"keyShortcutChangedCellStart\",\n \"keyShortcutChangedCellEnd\",\n \"pinnedHeightChanged\",\n \"cellFocusCleared\",\n \"fullWidthRowFocused\",\n \"checkboxChanged\",\n \"heightScaleChanged\",\n \"suppressMovableColumns\",\n \"suppressMenuHide\",\n \"suppressFieldDotNotation\",\n \"columnPanelItemDragStart\",\n \"columnPanelItemDragEnd\",\n \"bodyHeightChanged\",\n \"columnContainerWidthChanged\",\n \"displayedColumnsWidthChanged\",\n \"scrollVisibilityChanged\",\n \"scrollGapChanged\",\n \"columnHoverChanged\",\n \"flashCells\",\n \"rowDragVisibilityChanged\",\n \"paginationPixelOffsetChanged\",\n \"displayedRowsChanged\",\n \"leftPinnedWidthChanged\",\n \"rightPinnedWidthChanged\",\n \"rowContainerHeightChanged\",\n \"headerHeightChanged\",\n \"columnGroupHeaderHeightChanged\",\n \"columnHeaderHeightChanged\",\n \"stylesChanged\",\n \"storeUpdated\",\n \"filterDestroyed\",\n \"filterHandlerDestroyed\",\n \"rowDataUpdateStarted\",\n \"rowCountReady\",\n \"advancedFilterEnabledChanged\",\n \"dataTypesInferred\",\n \"fieldValueChanged\",\n \"fieldPickerValueSelected\",\n \"richSelectListRowSelected\",\n \"sideBarUpdated\",\n \"alignedGridScroll\",\n \"alignedGridColumn\",\n \"gridOptionsChanged\",\n \"chartTitleEdit\",\n \"recalculateRowBounds\",\n \"stickyTopOffsetChanged\",\n \"overlayExclusiveChanged\",\n \"rowNodeDataChanged\",\n \"cellEditValuesChanged\",\n \"filterSwitched\",\n \"filterClosed\",\n \"headerRowsChanged\",\n \"rowExpansionStateChanged\",\n \"showRowGroupColsSetChanged\"\n];\nvar _GET_ALL_EVENTS = () => [..._PUBLIC_EVENTS, ..._INTERNAL_EVENTS];\nvar ALWAYS_SYNC_GLOBAL_EVENTS = /* @__PURE__ */ new Set([\"gridPreDestroyed\", \"fillStart\", \"pasteStart\"]);\n\n// packages/ag-grid-community/src/publicEventHandlersMap.ts\nvar _PUBLIC_EVENT_HANDLERS_MAP = _PUBLIC_EVENTS.reduce(\n (mem, ev) => {\n mem[ev] = _getCallbackForEvent(ev);\n return mem;\n },\n {}\n);\n\n// packages/ag-grid-community/src/validation/rules/userCompValidations.ts\nvar USER_COMP_MODULES = {\n agSetColumnFilter: \"SetFilter\",\n agSetColumnFloatingFilter: \"SetFilter\",\n agMultiColumnFilter: \"MultiFilter\",\n agMultiColumnFloatingFilter: \"MultiFilter\",\n agGroupColumnFilter: \"GroupFilter\",\n agGroupColumnFloatingFilter: \"GroupFilter\",\n agGroupCellRenderer: \"GroupCellRenderer\",\n agGroupRowRenderer: \"GroupCellRenderer\",\n agRichSelect: \"RichSelect\",\n agRichSelectCellEditor: \"RichSelect\",\n agDetailCellRenderer: \"SharedMasterDetail\",\n agSparklineCellRenderer: \"Sparklines\",\n agDragAndDropImage: \"SharedDragAndDrop\",\n agColumnHeader: \"ColumnHeaderComp\",\n agColumnGroupHeader: \"ColumnGroupHeaderComp\",\n agSortIndicator: \"Sort\",\n agAnimateShowChangeCellRenderer: \"HighlightChanges\",\n agAnimateSlideCellRenderer: \"HighlightChanges\",\n agLoadingCellRenderer: \"LoadingCellRenderer\",\n agSkeletonCellRenderer: \"SkeletonCellRenderer\",\n agCheckboxCellRenderer: \"CheckboxCellRenderer\",\n agLoadingOverlay: \"Overlay\",\n agExportingOverlay: \"Overlay\",\n agNoRowsOverlay: \"Overlay\",\n agNoMatchingRowsOverlay: \"Overlay\",\n agTooltipComponent: \"Tooltip\",\n agReadOnlyFloatingFilter: \"CustomFilter\",\n agTextColumnFilter: \"TextFilter\",\n agNumberColumnFilter: \"NumberFilter\",\n agBigIntColumnFilter: \"BigIntFilter\",\n agDateColumnFilter: \"DateFilter\",\n agDateInput: \"DateFilter\",\n agTextColumnFloatingFilter: \"TextFilter\",\n agNumberColumnFloatingFilter: \"NumberFilter\",\n agBigIntColumnFloatingFilter: \"BigIntFilter\",\n agDateColumnFloatingFilter: \"DateFilter\",\n agFormulaCellEditor: \"Formula\",\n agCellEditor: \"TextEditor\",\n agSelectCellEditor: \"SelectEditor\",\n agTextCellEditor: \"TextEditor\",\n agNumberCellEditor: \"NumberEditor\",\n agDateCellEditor: \"DateEditor\",\n agDateStringCellEditor: \"DateEditor\",\n agCheckboxCellEditor: \"CheckboxEditor\",\n agLargeTextCellEditor: \"LargeTextEditor\",\n agMenuItem: \"MenuItem\",\n agColumnsToolPanel: \"ColumnsToolPanel\",\n agFiltersToolPanel: \"FiltersToolPanel\",\n agNewFiltersToolPanel: \"NewFiltersToolPanel\",\n agAggregationComponent: \"StatusBar\",\n agSelectedRowCountComponent: \"StatusBar\",\n agTotalRowCountComponent: \"StatusBar\",\n agFilteredRowCountComponent: \"StatusBar\",\n agTotalAndFilteredRowCountComponent: \"StatusBar\",\n agFindCellRenderer: \"Find\"\n};\n\n// packages/ag-grid-community/src/validation/rules/colDefValidations.ts\nfunction quote(s) {\n return `\"${s}\"`;\n}\nvar COLUMN_DEFINITION_DEPRECATIONS = () => ({\n checkboxSelection: { version: \"32.2\", message: \"Use `rowSelection.checkboxes` in `GridOptions` instead.\" },\n headerCheckboxSelection: {\n version: \"32.2\",\n message: \"Use `rowSelection.headerCheckbox = true` in `GridOptions` instead.\"\n },\n headerCheckboxSelectionFilteredOnly: {\n version: \"32.2\",\n message: 'Use `rowSelection.selectAll = \"filtered\"` in `GridOptions` instead.'\n },\n headerCheckboxSelectionCurrentPageOnly: {\n version: \"32.2\",\n message: 'Use `rowSelection.selectAll = \"currentPage\"` in `GridOptions` instead.'\n },\n showDisabledCheckboxes: {\n version: \"32.2\",\n message: \"Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead.\"\n },\n rowGroupingHierarchy: {\n version: \"34.3\",\n message: \"Use `colDef.groupHierarchy` instead.\"\n }\n});\nvar COLUMN_DEFINITION_MOD_VALIDATIONS = {\n allowFormula: \"Formula\",\n aggFunc: \"SharedAggregation\",\n autoHeight: \"RowAutoHeight\",\n cellClass: \"CellStyle\",\n cellClassRules: \"CellStyle\",\n cellEditor: ({ cellEditor, editable, groupRowEditable }) => {\n const editingEnabled = !!editable || !!groupRowEditable;\n if (!editingEnabled) {\n return null;\n }\n if (typeof cellEditor === \"string\") {\n return USER_COMP_MODULES[cellEditor] ?? \"CustomEditor\";\n }\n return \"CustomEditor\";\n },\n cellRenderer: ({ cellRenderer }) => {\n if (typeof cellRenderer !== \"string\") {\n return null;\n }\n return USER_COMP_MODULES[cellRenderer];\n },\n cellStyle: \"CellStyle\",\n columnChooserParams: \"ColumnMenu\",\n contextMenuItems: \"ContextMenu\",\n dndSource: \"DragAndDrop\",\n dndSourceOnRowDrag: \"DragAndDrop\",\n editable: ({ editable, cellEditor }) => {\n if (editable && !cellEditor) {\n return \"TextEditor\";\n }\n return null;\n },\n groupRowEditable: ({ groupRowEditable, cellEditor }) => {\n if (!groupRowEditable) {\n return null;\n }\n return cellEditor ? \"RowGroupingEdit\" : [\"RowGroupingEdit\", \"TextEditor\"];\n },\n groupRowValueSetter: ({ groupRowValueSetter }) => groupRowValueSetter ? \"RowGroupingEdit\" : null,\n enableCellChangeFlash: \"HighlightChanges\",\n enablePivot: \"SharedPivot\",\n enableRowGroup: \"SharedRowGrouping\",\n enableValue: \"SharedAggregation\",\n filter: ({ filter }) => {\n if (filter && typeof filter !== \"string\" && typeof filter !== \"boolean\") {\n return \"CustomFilter\";\n }\n if (typeof filter === \"string\") {\n return USER_COMP_MODULES[filter] ?? \"ColumnFilter\";\n }\n return \"ColumnFilter\";\n },\n floatingFilter: \"ColumnFilter\",\n getQuickFilterText: \"QuickFilter\",\n headerTooltip: \"Tooltip\",\n headerTooltipValueGetter: \"Tooltip\",\n mainMenuItems: \"ColumnMenu\",\n menuTabs: (options) => {\n const enterpriseMenuTabs = [\"columnsMenuTab\", \"generalMenuTab\"];\n if (options.menuTabs?.some((tab) => enterpriseMenuTabs.includes(tab))) {\n return \"ColumnMenu\";\n }\n return null;\n },\n pivot: \"SharedPivot\",\n pivotIndex: \"SharedPivot\",\n rowDrag: \"RowDrag\",\n rowGroup: \"SharedRowGrouping\",\n rowGroupIndex: \"SharedRowGrouping\",\n tooltipField: \"Tooltip\",\n tooltipValueGetter: \"Tooltip\",\n tooltipComponentSelector: \"Tooltip\",\n spanRows: \"CellSpan\",\n groupHierarchy: \"SharedRowGrouping\"\n};\nvar COLUMN_DEFINITION_VALIDATIONS = () => {\n const validations = {\n autoHeight: {\n supportedRowModels: [\"clientSide\", \"serverSide\"],\n validate: (_colDef, { paginationAutoPageSize }) => {\n if (paginationAutoPageSize) {\n return \"colDef.autoHeight is not supported with paginationAutoPageSize.\";\n }\n return null;\n }\n },\n allowFormula: {\n supportedRowModels: [\"clientSide\"]\n },\n cellRendererParams: {\n validate: (colDef) => {\n const groupColumn = colDef.rowGroup != null || colDef.rowGroupIndex != null || colDef.cellRenderer === \"agGroupCellRenderer\";\n if (groupColumn && \"checkbox\" in colDef.cellRendererParams) {\n return 'Since v33.0, `cellRendererParams.checkbox` has been deprecated. Use `rowSelection.checkboxLocation = \"autoGroupColumn\"` instead.';\n }\n return null;\n }\n },\n flex: {\n validate: (_options, gridOptions) => {\n if (gridOptions.autoSizeStrategy) {\n return \"colDef.flex is not supported with gridOptions.autoSizeStrategy\";\n }\n return null;\n }\n },\n headerCheckboxSelection: {\n supportedRowModels: [\"clientSide\", \"serverSide\"],\n validate: (_options, { rowSelection }) => rowSelection === \"multiple\" ? null : \"headerCheckboxSelection is only supported with rowSelection=multiple\"\n },\n headerCheckboxSelectionCurrentPageOnly: {\n supportedRowModels: [\"clientSide\"],\n validate: (_options, { rowSelection }) => rowSelection === \"multiple\" ? null : \"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple\"\n },\n headerCheckboxSelectionFilteredOnly: {\n supportedRowModels: [\"clientSide\"],\n validate: (_options, { rowSelection }) => rowSelection === \"multiple\" ? null : \"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple\"\n },\n headerValueGetter: {\n validate: (_options) => {\n const headerValueGetter = _options.headerValueGetter;\n if (typeof headerValueGetter === \"function\" || typeof headerValueGetter === \"string\") {\n return null;\n }\n return \"headerValueGetter must be a function or a valid string expression\";\n }\n },\n icons: {\n validate: ({ icons }) => {\n if (icons) {\n if (icons[\"smallDown\"]) {\n return _errMsg(262);\n }\n if (icons[\"smallLeft\"]) {\n return _errMsg(263);\n }\n if (icons[\"smallRight\"]) {\n return _errMsg(264);\n }\n }\n return null;\n }\n },\n sort: {\n validate: (_options) => {\n if (_isSortDefValid(_options.sort) || _isSortDirectionValid(_options.sort)) {\n return null;\n }\n return `sort must be of type (SortDirection | SortDef), currently it is ${typeof _options.sort === \"object\" ? JSON.stringify(_options.sort) : toStringWithNullUndefined(_options.sort)}`;\n }\n },\n initialSort: {\n validate: (_options) => {\n if (_isSortDefValid(_options.initialSort) || _isSortDirectionValid(_options.initialSort)) {\n return null;\n }\n return `initialSort must be of non-null type (SortDirection | SortDef), currently it is ${typeof _options.initialSort === \"object\" ? JSON.stringify(_options.initialSort) : toStringWithNullUndefined(_options.initialSort)}`;\n }\n },\n sortingOrder: {\n validate: (_options) => {\n const sortingOrder = _options.sortingOrder;\n if (Array.isArray(sortingOrder) && sortingOrder.length > 0) {\n const invalidItems = sortingOrder.filter((a) => {\n return !(_isSortDefValid(a) || _isSortDirectionValid(a));\n });\n if (invalidItems.length > 0) {\n return `sortingOrder must be an array of type non-null (SortDirection | SortDef)[], incorrect items are: [${invalidItems.map(\n (item) => typeof item === \"string\" || item == null ? toStringWithNullUndefined(item) : JSON.stringify(item)\n ).join(\", \")}]`;\n }\n } else if (!Array.isArray(sortingOrder) || !sortingOrder.length) {\n return `sortingOrder must be an array with at least one element, currently it is [${sortingOrder}]`;\n }\n return null;\n }\n },\n type: {\n validate: (_options) => {\n const type = _options.type;\n if (type instanceof Array) {\n const invalidArray = type.some((a) => typeof a !== \"string\");\n if (invalidArray) {\n return \"if colDef.type is supplied an array it should be of type 'string[]'\";\n }\n return null;\n }\n if (typeof type === \"string\") {\n return null;\n }\n return \"colDef.type should be of type 'string' | 'string[]'\";\n }\n },\n rowSpan: {\n validate: (_options, { suppressRowTransform }) => {\n if (!suppressRowTransform) {\n return \"colDef.rowSpan requires suppressRowTransform to be enabled.\";\n }\n return null;\n }\n },\n spanRows: {\n dependencies: {\n editable: { required: [false, void 0] },\n groupRowEditable: { required: [false, void 0] },\n rowDrag: { required: [false, void 0] },\n colSpan: { required: [void 0] },\n rowSpan: { required: [void 0] }\n },\n validate: (_options, {\n rowSelection,\n cellSelection,\n suppressRowTransform,\n enableCellSpan,\n rowDragEntireRow,\n enableCellTextSelection\n }) => {\n if (typeof rowSelection === \"object\") {\n if (rowSelection?.mode === \"singleRow\" && rowSelection?.enableClickSelection) {\n return \"colDef.spanRows is not supported with rowSelection.clickSelection\";\n }\n }\n if (cellSelection) {\n return \"colDef.spanRows is not supported with cellSelection.\";\n }\n if (suppressRowTransform) {\n return \"colDef.spanRows is not supported with suppressRowTransform.\";\n }\n if (!enableCellSpan) {\n return \"colDef.spanRows requires enableCellSpan to be enabled.\";\n }\n if (rowDragEntireRow) {\n return \"colDef.spanRows is not supported with rowDragEntireRow.\";\n }\n if (enableCellTextSelection) {\n return \"colDef.spanRows is not supported with enableCellTextSelection.\";\n }\n return null;\n }\n },\n groupHierarchy: {\n validate(options, { groupHierarchyConfig = {} }, beans) {\n const GROUP_HIERARCHY_PARTS = /* @__PURE__ */ new Set([\n \"year\",\n \"quarter\",\n \"month\",\n \"formattedMonth\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\"\n ]);\n const unrecognisedParts = [];\n for (const part of options.groupHierarchy ?? []) {\n if (typeof part === \"object\") {\n beans.validation?.validateColDef(part);\n continue;\n }\n if (!GROUP_HIERARCHY_PARTS.has(part) && !(part in groupHierarchyConfig)) {\n unrecognisedParts.push(quote(part));\n }\n }\n if (unrecognisedParts.length > 0) {\n const warning = `The following parts of colDef.groupHierarchy are not recognised: ${unrecognisedParts.join(\", \")}.`;\n const suggestions = `Choose one of ${[...GROUP_HIERARCHY_PARTS].map(quote).join(\", \")}, or define your own parts in gridOptions.groupHierarchyConfig.`;\n return `${warning}\n${suggestions}`;\n }\n return null;\n }\n }\n };\n return validations;\n};\nvar colDefPropertyMap = {\n headerName: void 0,\n columnGroupShow: void 0,\n headerStyle: void 0,\n headerClass: void 0,\n toolPanelClass: void 0,\n headerValueGetter: void 0,\n pivotKeys: void 0,\n groupId: void 0,\n colId: void 0,\n sort: void 0,\n initialSort: void 0,\n field: void 0,\n type: void 0,\n cellDataType: void 0,\n tooltipComponent: void 0,\n tooltipField: void 0,\n headerTooltip: void 0,\n headerTooltipValueGetter: void 0,\n cellClass: void 0,\n showRowGroup: void 0,\n filter: void 0,\n initialAggFunc: void 0,\n defaultAggFunc: void 0,\n aggFunc: void 0,\n groupRowEditable: void 0,\n groupRowValueSetter: void 0,\n pinned: void 0,\n initialPinned: void 0,\n chartDataType: void 0,\n cellAriaRole: void 0,\n cellEditorPopupPosition: void 0,\n headerGroupComponent: void 0,\n headerGroupComponentParams: void 0,\n cellStyle: void 0,\n cellRenderer: void 0,\n cellRendererParams: void 0,\n cellEditor: void 0,\n cellEditorParams: void 0,\n filterParams: void 0,\n pivotValueColumn: void 0,\n headerComponent: void 0,\n headerComponentParams: void 0,\n floatingFilterComponent: void 0,\n floatingFilterComponentParams: void 0,\n tooltipComponentParams: void 0,\n refData: void 0,\n columnChooserParams: void 0,\n children: void 0,\n sortingOrder: void 0,\n allowedAggFuncs: void 0,\n menuTabs: void 0,\n pivotTotalColumnIds: void 0,\n cellClassRules: void 0,\n icons: void 0,\n sortIndex: void 0,\n initialSortIndex: void 0,\n flex: void 0,\n initialFlex: void 0,\n width: void 0,\n initialWidth: void 0,\n minWidth: void 0,\n maxWidth: void 0,\n rowGroupIndex: void 0,\n initialRowGroupIndex: void 0,\n pivotIndex: void 0,\n initialPivotIndex: void 0,\n suppressColumnsToolPanel: void 0,\n suppressFiltersToolPanel: void 0,\n openByDefault: void 0,\n marryChildren: void 0,\n suppressStickyLabel: void 0,\n hide: void 0,\n initialHide: void 0,\n rowGroup: void 0,\n initialRowGroup: void 0,\n pivot: void 0,\n initialPivot: void 0,\n checkboxSelection: void 0,\n showDisabledCheckboxes: void 0,\n headerCheckboxSelection: void 0,\n headerCheckboxSelectionFilteredOnly: void 0,\n headerCheckboxSelectionCurrentPageOnly: void 0,\n suppressHeaderMenuButton: void 0,\n suppressMovable: void 0,\n lockPosition: void 0,\n lockVisible: void 0,\n lockPinned: void 0,\n unSortIcon: void 0,\n suppressSizeToFit: void 0,\n suppressAutoSize: void 0,\n enableRowGroup: void 0,\n enablePivot: void 0,\n enableValue: void 0,\n editable: void 0,\n suppressPaste: void 0,\n suppressNavigable: void 0,\n enableCellChangeFlash: void 0,\n rowDrag: void 0,\n dndSource: void 0,\n autoHeight: void 0,\n wrapText: void 0,\n sortable: void 0,\n resizable: void 0,\n singleClickEdit: void 0,\n floatingFilter: void 0,\n cellEditorPopup: void 0,\n suppressFillHandle: void 0,\n wrapHeaderText: void 0,\n autoHeaderHeight: void 0,\n dndSourceOnRowDrag: void 0,\n valueGetter: void 0,\n valueSetter: void 0,\n filterValueGetter: void 0,\n keyCreator: void 0,\n valueFormatter: void 0,\n valueParser: void 0,\n comparator: void 0,\n equals: void 0,\n pivotComparator: void 0,\n suppressKeyboardEvent: void 0,\n suppressHeaderKeyboardEvent: void 0,\n colSpan: void 0,\n rowSpan: void 0,\n spanRows: void 0,\n getQuickFilterText: void 0,\n onCellValueChanged: void 0,\n onCellClicked: void 0,\n onCellDoubleClicked: void 0,\n onCellContextMenu: void 0,\n rowDragText: void 0,\n tooltipValueGetter: void 0,\n tooltipComponentSelector: void 0,\n cellRendererSelector: void 0,\n cellEditorSelector: void 0,\n suppressSpanHeaderHeight: void 0,\n useValueFormatterForExport: void 0,\n useValueParserForImport: void 0,\n mainMenuItems: void 0,\n contextMenuItems: void 0,\n suppressFloatingFilterButton: void 0,\n suppressHeaderFilterButton: void 0,\n suppressHeaderContextMenu: void 0,\n loadingCellRenderer: void 0,\n loadingCellRendererParams: void 0,\n loadingCellRendererSelector: void 0,\n context: void 0,\n dateComponent: void 0,\n dateComponentParams: void 0,\n getFindText: void 0,\n rowGroupingHierarchy: void 0,\n groupHierarchy: void 0,\n allowFormula: void 0\n};\nvar ALL_PROPERTIES = () => Object.keys(colDefPropertyMap);\nvar COL_DEF_VALIDATORS = () => ({\n objectName: \"colDef\",\n allProperties: ALL_PROPERTIES(),\n docsUrl: \"column-properties/\",\n deprecations: COLUMN_DEFINITION_DEPRECATIONS(),\n validations: COLUMN_DEFINITION_VALIDATIONS()\n});\n\n// packages/ag-grid-community/src/propertyKeys.ts\nvar STRING_GRID_OPTIONS = [\n \"overlayLoadingTemplate\",\n \"overlayNoRowsTemplate\",\n \"gridId\",\n \"quickFilterText\",\n \"rowModelType\",\n \"editType\",\n \"domLayout\",\n \"clipboardDelimiter\",\n \"rowGroupPanelShow\",\n \"multiSortKey\",\n \"pivotColumnGroupTotals\",\n \"pivotRowTotals\",\n \"pivotPanelShow\",\n \"fillHandleDirection\",\n \"groupDisplayType\",\n \"treeDataDisplayType\",\n \"treeDataChildrenField\",\n \"treeDataParentIdField\",\n \"colResizeDefault\",\n \"tooltipTrigger\",\n \"serverSidePivotResultFieldSeparator\",\n \"columnMenu\",\n \"tooltipShowMode\",\n \"invalidEditValueMode\",\n \"grandTotalRow\",\n \"themeCssLayer\",\n \"findSearchValue\",\n \"styleNonce\",\n \"renderingMode\"\n];\nvar OBJECT_GRID_OPTIONS = [\n \"components\",\n \"rowStyle\",\n \"context\",\n \"autoGroupColumnDef\",\n \"localeText\",\n \"icons\",\n \"datasource\",\n \"dragAndDropImageComponentParams\",\n \"serverSideDatasource\",\n \"viewportDatasource\",\n \"groupRowRendererParams\",\n \"aggFuncs\",\n \"fullWidthCellRendererParams\",\n \"defaultColGroupDef\",\n \"defaultColDef\",\n \"defaultCsvExportParams\",\n \"defaultExcelExportParams\",\n \"columnTypes\",\n \"rowClassRules\",\n \"detailCellRendererParams\",\n \"loadingCellRendererParams\",\n \"overlayComponentParams\",\n \"loadingOverlayComponentParams\",\n \"noRowsOverlayComponentParams\",\n \"activeOverlayParams\",\n \"popupParent\",\n \"themeStyleContainer\",\n \"statusBar\",\n \"chartThemeOverrides\",\n \"customChartThemes\",\n \"chartToolPanelsDef\",\n \"dataTypeDefinitions\",\n \"advancedFilterParent\",\n \"advancedFilterBuilderParams\",\n \"advancedFilterParams\",\n \"formulaDataSource\",\n \"formulaFuncs\",\n \"initialState\",\n \"autoSizeStrategy\",\n \"selectionColumnDef\",\n \"findOptions\",\n \"filterHandlers\",\n \"groupHierarchyConfig\"\n];\nvar ARRAY_GRID_OPTIONS = [\n \"sortingOrder\",\n \"alignedGrids\",\n \"rowData\",\n \"columnDefs\",\n \"excelStyles\",\n \"pinnedTopRowData\",\n \"pinnedBottomRowData\",\n \"chartThemes\",\n \"rowClass\",\n \"paginationPageSizeSelector\",\n \"suppressOverlays\"\n];\nvar _NUMBER_GRID_OPTIONS = [\n \"rowHeight\",\n \"detailRowHeight\",\n \"rowBuffer\",\n \"headerHeight\",\n \"groupHeaderHeight\",\n \"groupLockGroupColumns\",\n \"floatingFiltersHeight\",\n \"pivotHeaderHeight\",\n \"pivotGroupHeaderHeight\",\n \"groupDefaultExpanded\",\n \"pivotDefaultExpanded\",\n \"viewportRowModelPageSize\",\n \"viewportRowModelBufferSize\",\n \"autoSizePadding\",\n \"maxBlocksInCache\",\n \"maxConcurrentDatasourceRequests\",\n \"tooltipShowDelay\",\n \"tooltipSwitchShowDelay\",\n \"tooltipHideDelay\",\n \"cacheOverflowSize\",\n \"paginationPageSize\",\n \"cacheBlockSize\",\n \"infiniteInitialRowCount\",\n \"serverSideInitialRowCount\",\n \"scrollbarWidth\",\n \"asyncTransactionWaitMillis\",\n \"blockLoadDebounceMillis\",\n \"keepDetailRowsCount\",\n \"undoRedoCellEditingLimit\",\n \"cellFlashDuration\",\n \"cellFadeDuration\",\n \"tabIndex\",\n \"pivotMaxGeneratedColumns\",\n \"rowDragInsertDelay\"\n];\nvar OTHER_GRID_OPTIONS = [\"theme\", \"rowSelection\"];\nvar _BOOLEAN_MIXED_GRID_OPTIONS = [\n \"cellSelection\",\n \"sideBar\",\n \"rowNumbers\",\n \"suppressGroupChangesColumnVisibility\",\n \"groupAggFiltering\",\n \"suppressStickyTotalRow\",\n \"groupHideParentOfSingleChild\",\n \"enableRowPinning\"\n];\nvar _BOOLEAN_GRID_OPTIONS = [\n \"loadThemeGoogleFonts\",\n \"suppressMakeColumnVisibleAfterUnGroup\",\n \"suppressRowClickSelection\",\n \"suppressCellFocus\",\n \"suppressHeaderFocus\",\n \"suppressHorizontalScroll\",\n \"groupSelectsChildren\",\n \"alwaysShowHorizontalScroll\",\n \"alwaysShowVerticalScroll\",\n \"debug\",\n \"enableBrowserTooltips\",\n \"enableCellExpressions\",\n \"groupSuppressBlankHeader\",\n \"suppressMenuHide\",\n \"suppressRowDeselection\",\n \"unSortIcon\",\n \"suppressMultiSort\",\n \"alwaysMultiSort\",\n \"singleClickEdit\",\n \"suppressLoadingOverlay\",\n \"suppressNoRowsOverlay\",\n \"suppressAutoSize\",\n \"skipHeaderOnAutoSize\",\n \"suppressColumnMoveAnimation\",\n \"suppressMoveWhenColumnDragging\",\n \"suppressMovableColumns\",\n \"suppressFieldDotNotation\",\n \"enableRangeSelection\",\n \"enableRangeHandle\",\n \"enableFillHandle\",\n \"suppressClearOnFillReduction\",\n \"deltaSort\",\n \"suppressTouch\",\n \"allowContextMenuWithControlKey\",\n \"suppressContextMenu\",\n \"suppressDragLeaveHidesColumns\",\n \"suppressRowGroupHidesColumns\",\n \"suppressMiddleClickScrolls\",\n \"suppressPreventDefaultOnMouseWheel\",\n \"suppressCopyRowsToClipboard\",\n \"copyHeadersToClipboard\",\n \"copyGroupHeadersToClipboard\",\n \"pivotMode\",\n \"suppressAggFuncInHeader\",\n \"suppressColumnVirtualisation\",\n \"alwaysAggregateAtRootLevel\",\n \"suppressFocusAfterRefresh\",\n \"functionsReadOnly\",\n \"animateRows\",\n \"groupSelectsFiltered\",\n \"groupRemoveSingleChildren\",\n \"groupRemoveLowestSingleChildren\",\n \"enableRtl\",\n \"enableCellSpan\",\n \"suppressClickEdit\",\n \"rowDragEntireRow\",\n \"rowDragManaged\",\n \"refreshAfterGroupEdit\",\n \"suppressRowDrag\",\n \"suppressMoveWhenRowDragging\",\n \"rowDragMultiRow\",\n \"enableGroupEdit\",\n \"embedFullWidthRows\",\n \"suppressPaginationPanel\",\n \"groupHideOpenParents\",\n \"groupHideColumnsUntilExpanded\",\n \"groupAllowUnbalanced\",\n \"pagination\",\n \"paginationAutoPageSize\",\n \"suppressScrollOnNewData\",\n \"suppressScrollWhenPopupsAreOpen\",\n \"purgeClosedRowNodes\",\n \"cacheQuickFilter\",\n \"includeHiddenColumnsInQuickFilter\",\n \"ensureDomOrder\",\n \"accentedSort\",\n \"suppressChangeDetection\",\n \"valueCache\",\n \"valueCacheNeverExpires\",\n \"aggregateOnlyChangedColumns\",\n \"suppressAnimationFrame\",\n \"suppressExcelExport\",\n \"suppressCsvExport\",\n \"includeHiddenColumnsInAdvancedFilter\",\n \"suppressMultiRangeSelection\",\n \"enterNavigatesVerticallyAfterEdit\",\n \"enterNavigatesVertically\",\n \"suppressPropertyNamesCheck\",\n \"rowMultiSelectWithClick\",\n \"suppressRowHoverHighlight\",\n \"suppressRowTransform\",\n \"suppressClipboardPaste\",\n \"suppressLastEmptyLineOnPaste\",\n \"enableCharts\",\n \"suppressMaintainUnsortedOrder\",\n \"enableCellTextSelection\",\n \"suppressBrowserResizeObserver\",\n \"suppressMaxRenderedRowRestriction\",\n \"excludeChildrenWhenTreeDataFiltering\",\n \"tooltipMouseTrack\",\n \"tooltipInteraction\",\n \"keepDetailRows\",\n \"paginateChildRows\",\n \"preventDefaultOnContextMenu\",\n \"undoRedoCellEditing\",\n \"allowDragFromColumnsToolPanel\",\n \"pivotSuppressAutoColumn\",\n \"suppressExpandablePivotGroups\",\n \"debounceVerticalScrollbar\",\n \"detailRowAutoHeight\",\n \"serverSideSortAllLevels\",\n \"serverSideEnableClientSideSort\",\n \"serverSideOnlyRefreshFilteredGroups\",\n \"suppressAggFilteredOnly\",\n \"showOpenedGroup\",\n \"suppressClipboardApi\",\n \"suppressModelUpdateAfterUpdateTransaction\",\n \"stopEditingWhenCellsLoseFocus\",\n \"groupMaintainOrder\",\n \"columnHoverHighlight\",\n \"readOnlyEdit\",\n \"suppressRowVirtualisation\",\n \"enableCellEditingOnBackspace\",\n \"resetRowDataOnUpdate\",\n \"removePivotHeaderRowWhenSingleValueColumn\",\n \"suppressCopySingleCellRanges\",\n \"suppressGroupRowsSticky\",\n \"suppressCutToClipboard\",\n \"rowGroupPanelSuppressSort\",\n \"allowShowChangeAfterFilter\",\n \"enableAdvancedFilter\",\n \"masterDetail\",\n \"treeData\",\n \"reactiveCustomComponents\",\n \"applyQuickFilterBeforePivotOrAgg\",\n \"suppressServerSideFullWidthLoadingRow\",\n \"suppressAdvancedFilterEval\",\n \"loading\",\n \"maintainColumnOrder\",\n \"enableStrictPivotColumnOrder\",\n \"suppressSetFilterByDefault\",\n \"enableFilterHandlers\",\n \"suppressStartEditOnTab\",\n \"hidePaddedHeaderRows\",\n \"ssrmExpandAllAffectsAllRows\",\n \"animateColumnResizing\"\n];\nvar _FUNCTION_GRID_OPTIONS = [\n \"doesExternalFilterPass\",\n \"processPivotResultColDef\",\n \"processPivotResultColGroupDef\",\n \"getBusinessKeyForNode\",\n \"isRowSelectable\",\n \"rowDragText\",\n \"groupRowRenderer\",\n \"dragAndDropImageComponent\",\n \"fullWidthCellRenderer\",\n \"loadingCellRenderer\",\n \"overlayComponent\",\n \"loadingOverlayComponent\",\n \"noRowsOverlayComponent\",\n \"overlayComponentSelector\",\n \"activeOverlay\",\n \"detailCellRenderer\",\n \"quickFilterParser\",\n \"quickFilterMatcher\",\n \"getLocaleText\",\n \"isExternalFilterPresent\",\n \"getRowHeight\",\n \"getRowClass\",\n \"getRowStyle\",\n \"getFullRowEditValidationErrors\",\n \"getContextMenuItems\",\n \"getMainMenuItems\",\n \"processRowPostCreate\",\n \"processCellForClipboard\",\n \"getGroupRowAgg\",\n \"isFullWidthRow\",\n \"sendToClipboard\",\n \"focusGridInnerElement\",\n \"navigateToNextHeader\",\n \"tabToNextHeader\",\n \"navigateToNextCell\",\n \"tabToNextCell\",\n \"tabToNextGridContainer\",\n \"processCellFromClipboard\",\n \"getDocument\",\n \"postProcessPopup\",\n \"getChildCount\",\n \"getDataPath\",\n \"isRowMaster\",\n \"postSortRows\",\n \"processHeaderForClipboard\",\n \"processUnpinnedColumns\",\n \"processGroupHeaderForClipboard\",\n \"paginationNumberFormatter\",\n \"processDataFromClipboard\",\n \"getServerSideGroupKey\",\n \"isServerSideGroup\",\n \"createChartContainer\",\n \"getChartToolbarItems\",\n \"fillOperation\",\n \"isApplyServerSideTransaction\",\n \"getServerSideGroupLevelParams\",\n \"isServerSideGroupOpenByDefault\",\n \"isGroupOpenByDefault\",\n \"initialGroupOrderComparator\",\n \"loadingCellRendererSelector\",\n \"getRowId\",\n \"chartMenuItems\",\n \"groupTotalRow\",\n \"alwaysPassFilter\",\n \"isRowPinnable\",\n \"isRowPinned\",\n \"isRowValidDropPosition\"\n];\nvar _GET_ALL_GRID_OPTIONS = () => [\n ...ARRAY_GRID_OPTIONS,\n ...OBJECT_GRID_OPTIONS,\n ...STRING_GRID_OPTIONS,\n ..._NUMBER_GRID_OPTIONS,\n ..._FUNCTION_GRID_OPTIONS,\n ..._BOOLEAN_GRID_OPTIONS,\n ..._BOOLEAN_MIXED_GRID_OPTIONS,\n ...OTHER_GRID_OPTIONS\n];\nvar _GET_SHALLOW_GRID_OPTIONS = () => [\n ...STRING_GRID_OPTIONS,\n ..._NUMBER_GRID_OPTIONS,\n ..._FUNCTION_GRID_OPTIONS,\n ..._BOOLEAN_GRID_OPTIONS,\n ..._BOOLEAN_MIXED_GRID_OPTIONS\n];\n\n// packages/ag-grid-community/src/validation/rules/gridOptionsValidations.ts\nvar GRID_OPTION_DEPRECATIONS = () => ({\n suppressLoadingOverlay: { version: \"32\", message: \"Use `loading`=false instead.\" },\n enableFillHandle: { version: \"32.2\", message: \"Use `cellSelection.handle` instead.\" },\n enableRangeHandle: { version: \"32.2\", message: \"Use `cellSelection.handle` instead.\" },\n enableRangeSelection: { version: \"32.2\", message: \"Use `cellSelection = true` instead.\" },\n suppressMultiRangeSelection: {\n version: \"32.2\",\n message: \"Use `cellSelection.suppressMultiRanges` instead.\"\n },\n suppressClearOnFillReduction: {\n version: \"32.2\",\n message: \"Use `cellSelection.handle.suppressClearOnFillReduction` instead.\"\n },\n fillHandleDirection: { version: \"32.2\", message: \"Use `cellSelection.handle.direction` instead.\" },\n fillOperation: { version: \"32.2\", message: \"Use `cellSelection.handle.setFillValue` instead.\" },\n suppressRowClickSelection: {\n version: \"32.2\",\n message: \"Use `rowSelection.enableClickSelection` instead.\"\n },\n suppressRowDeselection: { version: \"32.2\", message: \"Use `rowSelection.enableClickSelection` instead.\" },\n rowMultiSelectWithClick: {\n version: \"32.2\",\n message: \"Use `rowSelection.enableSelectionWithoutKeys` instead.\"\n },\n groupSelectsChildren: {\n version: \"32.2\",\n message: 'Use `rowSelection.groupSelects = \"descendants\"` instead.'\n },\n groupSelectsFiltered: {\n version: \"32.2\",\n message: 'Use `rowSelection.groupSelects = \"filteredDescendants\"` instead.'\n },\n isRowSelectable: { version: \"32.2\", message: \"Use `selectionOptions.isRowSelectable` instead.\" },\n suppressCopySingleCellRanges: { version: \"32.2\", message: \"Use `rowSelection.copySelectedRows` instead.\" },\n suppressCopyRowsToClipboard: { version: \"32.2\", message: \"Use `rowSelection.copySelectedRows` instead.\" },\n onRangeSelectionChanged: { version: \"32.2\", message: \"Use `onCellSelectionChanged` instead.\" },\n onRangeDeleteStart: { version: \"32.2\", message: \"Use `onCellSelectionDeleteStart` instead.\" },\n onRangeDeleteEnd: { version: \"32.2\", message: \"Use `onCellSelectionDeleteEnd` instead.\" },\n suppressBrowserResizeObserver: {\n version: \"32.2\",\n message: \"The grid always uses the browser's ResizeObserver, this grid option has no effect.\"\n },\n onColumnEverythingChanged: {\n version: \"32.2\",\n message: \"Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events.\"\n },\n groupRemoveSingleChildren: {\n version: \"33\",\n message: \"Use `groupHideParentOfSingleChild` instead.\"\n },\n groupRemoveLowestSingleChildren: {\n version: \"33\",\n message: 'Use `groupHideParentOfSingleChild: \"leafGroupsOnly\"` instead.'\n },\n suppressRowGroupHidesColumns: {\n version: \"33\",\n message: 'Use `suppressGroupChangesColumnVisibility: \"suppressHideOnGroup\"` instead.'\n },\n suppressMakeColumnVisibleAfterUnGroup: {\n version: \"33\",\n message: 'Use `suppressGroupChangesColumnVisibility: \"suppressShowOnUngroup\"` instead.'\n },\n unSortIcon: { version: \"33\", message: \"Use `defaultColDef.unSortIcon` instead.\" },\n sortingOrder: { version: \"33\", message: \"Use `defaultColDef.sortingOrder` instead.\" },\n suppressPropertyNamesCheck: {\n version: \"33\",\n message: \"`gridOptions` and `columnDefs` both have a `context` property that should be used for arbitrary user data. This means that column definitions and gridOptions should only contain valid properties making this property redundant.\"\n },\n suppressAdvancedFilterEval: {\n version: \"34\",\n message: \"Advanced filter no longer uses function evaluation, so this option has no effect.\"\n }\n});\nfunction toConstrainedNum(key, value, min) {\n if (typeof value === \"number\" || value == null) {\n if (value == null) {\n return null;\n }\n return value >= min ? null : `${key}: value should be greater than or equal to ${min}`;\n }\n return `${key}: value should be a number`;\n}\nvar GRID_OPTIONS_MODULES = {\n alignedGrids: \"AlignedGrids\",\n allowContextMenuWithControlKey: \"ContextMenu\",\n autoSizeStrategy: \"ColumnAutoSize\",\n cellSelection: \"CellSelection\",\n columnHoverHighlight: \"ColumnHover\",\n datasource: \"InfiniteRowModel\",\n doesExternalFilterPass: \"ExternalFilter\",\n editType: \"EditCore\",\n invalidEditValueMode: \"EditCore\",\n enableAdvancedFilter: \"AdvancedFilter\",\n enableCellSpan: \"CellSpan\",\n enableCharts: \"IntegratedCharts\",\n enableRangeSelection: \"CellSelection\",\n enableRowPinning: \"PinnedRow\",\n findSearchValue: \"Find\",\n getFullRowEditValidationErrors: \"EditCore\",\n getContextMenuItems: \"ContextMenu\",\n getLocaleText: \"Locale\",\n getMainMenuItems: \"ColumnMenu\",\n getRowClass: \"RowStyle\",\n getRowStyle: \"RowStyle\",\n groupTotalRow: \"SharedRowGrouping\",\n grandTotalRow: \"ClientSideRowModelHierarchy\",\n initialState: \"GridState\",\n isExternalFilterPresent: \"ExternalFilter\",\n isRowPinnable: \"PinnedRow\",\n isRowPinned: \"PinnedRow\",\n localeText: \"Locale\",\n masterDetail: \"SharedMasterDetail\",\n pagination: \"Pagination\",\n pinnedBottomRowData: \"PinnedRow\",\n pinnedTopRowData: \"PinnedRow\",\n pivotMode: \"SharedPivot\",\n pivotPanelShow: \"RowGroupingPanel\",\n quickFilterText: \"QuickFilter\",\n rowClass: \"RowStyle\",\n rowClassRules: \"RowStyle\",\n rowData: \"ClientSideRowModel\",\n rowDragManaged: \"RowDrag\",\n refreshAfterGroupEdit: [\"RowGrouping\", \"TreeData\"],\n rowGroupPanelShow: \"RowGroupingPanel\",\n rowNumbers: \"RowNumbers\",\n rowSelection: \"SharedRowSelection\",\n rowStyle: \"RowStyle\",\n serverSideDatasource: \"ServerSideRowModel\",\n sideBar: \"SideBar\",\n statusBar: \"StatusBar\",\n treeData: \"SharedTreeData\",\n undoRedoCellEditing: \"UndoRedoEdit\",\n valueCache: \"ValueCache\",\n viewportDatasource: \"ViewportRowModel\"\n};\nvar GRID_OPTION_VALIDATIONS = () => {\n const definedValidations = {\n autoSizePadding: {\n validate({ autoSizePadding }) {\n return toConstrainedNum(\"autoSizePadding\", autoSizePadding, 0);\n }\n },\n cacheBlockSize: {\n supportedRowModels: [\"serverSide\", \"infinite\"],\n validate({ cacheBlockSize }) {\n return toConstrainedNum(\"cacheBlockSize\", cacheBlockSize, 1);\n }\n },\n cacheOverflowSize: {\n validate({ cacheOverflowSize }) {\n return toConstrainedNum(\"cacheOverflowSize\", cacheOverflowSize, 1);\n }\n },\n datasource: {\n supportedRowModels: [\"infinite\"]\n },\n domLayout: {\n validate: (options) => {\n const domLayout = options.domLayout;\n const validLayouts = [\"autoHeight\", \"normal\", \"print\"];\n if (domLayout && !validLayouts.includes(domLayout)) {\n return `domLayout must be one of [${validLayouts.join()}], currently it's ${domLayout}`;\n }\n return null;\n }\n },\n enableFillHandle: {\n dependencies: {\n enableRangeSelection: { required: [true] }\n }\n },\n enableRangeHandle: {\n dependencies: {\n enableRangeSelection: { required: [true] }\n }\n },\n enableCellSpan: {\n supportedRowModels: [\"clientSide\", \"serverSide\"]\n },\n enableRangeSelection: {\n dependencies: {\n rowDragEntireRow: { required: [false, void 0] }\n }\n },\n enableRowPinning: {\n supportedRowModels: [\"clientSide\"],\n validate({ enableRowPinning, pinnedTopRowData, pinnedBottomRowData }) {\n if (enableRowPinning && (pinnedTopRowData || pinnedBottomRowData)) {\n return \"Manual row pinning cannot be used together with pinned row data. Either set `enableRowPinning` to `false`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.\";\n }\n return null;\n }\n },\n isRowPinnable: {\n supportedRowModels: [\"clientSide\"],\n validate({ enableRowPinning, isRowPinnable, pinnedTopRowData, pinnedBottomRowData }) {\n if (isRowPinnable && (pinnedTopRowData || pinnedBottomRowData)) {\n return \"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinnable`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.\";\n }\n if (!enableRowPinning && isRowPinnable) {\n return \"`isRowPinnable` requires `enableRowPinning` to be set.\";\n }\n return null;\n }\n },\n isRowPinned: {\n supportedRowModels: [\"clientSide\"],\n validate({ enableRowPinning, isRowPinned, pinnedTopRowData, pinnedBottomRowData }) {\n if (isRowPinned && (pinnedTopRowData || pinnedBottomRowData)) {\n return \"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinned`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.\";\n }\n if (!enableRowPinning && isRowPinned) {\n return \"`isRowPinned` requires `enableRowPinning` to be set.\";\n }\n return null;\n }\n },\n groupDefaultExpanded: {\n supportedRowModels: [\"clientSide\"]\n },\n groupHideColumnsUntilExpanded: {\n supportedRowModels: [\"clientSide\"],\n validate({ groupHideColumnsUntilExpanded, groupHideOpenParents, groupDisplayType }) {\n if (groupHideColumnsUntilExpanded && !groupHideOpenParents && groupDisplayType !== \"multipleColumns\") {\n return \"`groupHideColumnsUntilExpanded = true` requires either `groupDisplayType = 'multipleColumns'` or `groupHideOpenParents = true`\";\n }\n return null;\n }\n },\n groupHideOpenParents: {\n supportedRowModels: [\"clientSide\", \"serverSide\"],\n dependencies: {\n groupTotalRow: { required: [void 0, \"bottom\"] },\n treeData: {\n required: [void 0, false],\n reason: \"Tree Data has values at the group level so it doesn't make sense to hide them.\"\n }\n }\n },\n groupHideParentOfSingleChild: {\n dependencies: {\n groupHideOpenParents: { required: [void 0, false] }\n }\n },\n groupRemoveLowestSingleChildren: {\n dependencies: {\n groupHideOpenParents: { required: [void 0, false] },\n groupRemoveSingleChildren: { required: [void 0, false] }\n }\n },\n groupRemoveSingleChildren: {\n dependencies: {\n groupHideOpenParents: { required: [void 0, false] },\n groupRemoveLowestSingleChildren: { required: [void 0, false] }\n }\n },\n groupSelectsChildren: {\n dependencies: {\n rowSelection: { required: [\"multiple\"] }\n }\n },\n groupHierarchyConfig: {\n validate({ groupHierarchyConfig = {} }, gridOptions, beans) {\n for (const k of Object.keys(groupHierarchyConfig)) {\n beans.validation?.validateColDef(groupHierarchyConfig[k]);\n }\n return null;\n }\n },\n icons: {\n validate: ({ icons }) => {\n if (icons) {\n if (icons[\"smallDown\"]) {\n return _errMsg(262);\n }\n if (icons[\"smallLeft\"]) {\n return _errMsg(263);\n }\n if (icons[\"smallRight\"]) {\n return _errMsg(264);\n }\n }\n return null;\n }\n },\n infiniteInitialRowCount: {\n validate({ infiniteInitialRowCount }) {\n return toConstrainedNum(\"infiniteInitialRowCount\", infiniteInitialRowCount, 1);\n }\n },\n initialGroupOrderComparator: {\n supportedRowModels: [\"clientSide\"]\n },\n ssrmExpandAllAffectsAllRows: {\n validate: (options) => {\n if (typeof options.ssrmExpandAllAffectsAllRows === \"boolean\") {\n if (options.rowModelType !== \"serverSide\") {\n return \"'ssrmExpandAllAffectsAllRows' is only supported with the Server Side Row Model.\";\n }\n if (options.ssrmExpandAllAffectsAllRows && typeof options.getRowId !== \"function\") {\n return `'getRowId' callback must be provided for Server Side Row Model grouping to work correctly.`;\n }\n }\n return null;\n }\n },\n keepDetailRowsCount: {\n validate({ keepDetailRowsCount }) {\n return toConstrainedNum(\"keepDetailRowsCount\", keepDetailRowsCount, 1);\n }\n },\n paginationPageSize: {\n validate({ paginationPageSize }) {\n return toConstrainedNum(\"paginationPageSize\", paginationPageSize, 1);\n }\n },\n paginationPageSizeSelector: {\n validate: (options) => {\n const values = options.paginationPageSizeSelector;\n if (typeof values === \"boolean\" || values == null) {\n return null;\n }\n if (!values.length) {\n return `'paginationPageSizeSelector' cannot be an empty array.\n If you want to hide the page size selector, set paginationPageSizeSelector to false.`;\n }\n return null;\n }\n },\n pivotMode: {\n dependencies: {\n treeData: {\n required: [false, void 0],\n reason: \"Pivot Mode is not supported with Tree Data.\"\n }\n }\n },\n quickFilterText: {\n supportedRowModels: [\"clientSide\"]\n },\n rowBuffer: {\n validate({ rowBuffer }) {\n return toConstrainedNum(\"rowBuffer\", rowBuffer, 0);\n }\n },\n rowClass: {\n validate: (options) => {\n const rowClass = options.rowClass;\n if (typeof rowClass === \"function\") {\n return \"rowClass should not be a function, please use getRowClass instead\";\n }\n return null;\n }\n },\n rowData: {\n supportedRowModels: [\"clientSide\"]\n },\n rowDragManaged: {\n supportedRowModels: [\"clientSide\"],\n dependencies: {\n pagination: {\n required: [false, void 0]\n }\n }\n },\n rowSelection: {\n validate({ rowSelection }) {\n if (rowSelection && typeof rowSelection === \"string\") {\n return 'As of version 32.2.1, using `rowSelection` with the values \"single\" or \"multiple\" has been deprecated. Use the object value instead.';\n }\n if (rowSelection && typeof rowSelection !== \"object\") {\n return \"Expected `RowSelectionOptions` object for the `rowSelection` property.\";\n }\n if (rowSelection && rowSelection.mode !== \"multiRow\" && rowSelection.mode !== \"singleRow\") {\n return `Selection mode \"${rowSelection.mode}\" is invalid. Use one of 'singleRow' or 'multiRow'.`;\n }\n return null;\n }\n },\n rowStyle: {\n validate: (options) => {\n const rowStyle = options.rowStyle;\n if (rowStyle && typeof rowStyle === \"function\") {\n return \"rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead\";\n }\n return null;\n }\n },\n serverSideDatasource: {\n supportedRowModels: [\"serverSide\"]\n },\n serverSideInitialRowCount: {\n supportedRowModels: [\"serverSide\"],\n validate({ serverSideInitialRowCount }) {\n return toConstrainedNum(\"serverSideInitialRowCount\", serverSideInitialRowCount, 1);\n }\n },\n serverSideOnlyRefreshFilteredGroups: {\n supportedRowModels: [\"serverSide\"]\n },\n serverSideSortAllLevels: {\n supportedRowModels: [\"serverSide\"]\n },\n sortingOrder: {\n validate: (_options) => {\n const sortingOrder = _options.sortingOrder;\n if (Array.isArray(sortingOrder) && sortingOrder.length > 0) {\n const invalidItems = sortingOrder.filter((a) => !_getSortDefFromInput(a));\n if (invalidItems.length > 0) {\n return `sortingOrder must be an array of type (SortDirection | SortDef)[], incorrect items are: ${invalidItems.map(\n (item) => typeof item === \"string\" || item == null ? toStringWithNullUndefined(item) : JSON.stringify(item)\n )}]`;\n }\n } else if (!Array.isArray(sortingOrder) || !sortingOrder.length) {\n return `sortingOrder must be an array with at least one element, currently it's ${sortingOrder}`;\n }\n return null;\n }\n },\n tooltipHideDelay: {\n validate: (options) => {\n if (options.tooltipHideDelay && options.tooltipHideDelay < 0) {\n return \"tooltipHideDelay should not be lower than 0\";\n }\n return null;\n }\n },\n tooltipShowDelay: {\n validate: (options) => {\n if (options.tooltipShowDelay && options.tooltipShowDelay < 0) {\n return \"tooltipShowDelay should not be lower than 0\";\n }\n return null;\n }\n },\n tooltipSwitchShowDelay: {\n validate: (options) => {\n if (options.tooltipSwitchShowDelay && options.tooltipSwitchShowDelay < 0) {\n return \"tooltipSwitchShowDelay should not be lower than 0\";\n }\n return null;\n }\n },\n treeData: {\n supportedRowModels: [\"clientSide\", \"serverSide\"],\n validate: (options) => {\n const rowModel = options.rowModelType ?? \"clientSide\";\n switch (rowModel) {\n case \"clientSide\": {\n const { treeDataChildrenField, treeDataParentIdField, getDataPath, getRowId } = options;\n if (!treeDataChildrenField && !treeDataParentIdField && !getDataPath) {\n return \"treeData requires either 'treeDataChildrenField' or 'treeDataParentIdField' or 'getDataPath' in the clientSide row model.\";\n }\n if (treeDataChildrenField) {\n if (getDataPath) {\n return \"Cannot use both 'treeDataChildrenField' and 'getDataPath' at the same time.\";\n }\n if (treeDataParentIdField) {\n return \"Cannot use both 'treeDataChildrenField' and 'treeDataParentIdField' at the same time.\";\n }\n }\n if (treeDataParentIdField) {\n if (!getRowId) {\n return \"getRowId callback not provided, tree data with parent id cannot be built.\";\n }\n if (getDataPath) {\n return \"Cannot use both 'treeDataParentIdField' and 'getDataPath' at the same time.\";\n }\n }\n return null;\n }\n case \"serverSide\": {\n const ssrmWarning = `treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${rowModel} row model.`;\n return options.isServerSideGroup && options.getServerSideGroupKey ? null : ssrmWarning;\n }\n }\n return null;\n }\n },\n viewportDatasource: {\n supportedRowModels: [\"viewport\"]\n },\n viewportRowModelBufferSize: {\n validate({ viewportRowModelBufferSize }) {\n return toConstrainedNum(\"viewportRowModelBufferSize\", viewportRowModelBufferSize, 0);\n }\n },\n viewportRowModelPageSize: {\n validate({ viewportRowModelPageSize }) {\n return toConstrainedNum(\"viewportRowModelPageSize\", viewportRowModelPageSize, 1);\n }\n },\n rowDragEntireRow: {\n dependencies: {\n cellSelection: { required: [void 0] }\n }\n },\n autoGroupColumnDef: {\n validate({ autoGroupColumnDef, showOpenedGroup }) {\n if (autoGroupColumnDef?.field && showOpenedGroup) {\n return \"autoGroupColumnDef.field and showOpenedGroup are not supported when used together.\";\n }\n if (autoGroupColumnDef?.valueGetter && showOpenedGroup) {\n return \"autoGroupColumnDef.valueGetter and showOpenedGroup are not supported when used together.\";\n }\n return null;\n }\n },\n renderingMode: {\n validate: (options) => {\n const renderingMode = options.renderingMode;\n const validModes = [\"default\", \"legacy\"];\n if (renderingMode && !validModes.includes(renderingMode)) {\n return `renderingMode must be one of [${validModes.join()}], currently it's ${renderingMode}`;\n }\n return null;\n }\n },\n autoSizeStrategy: {\n validate: ({ autoSizeStrategy }) => {\n if (!autoSizeStrategy) {\n return null;\n }\n const validModes = [\n \"fitCellContents\",\n \"fitGridWidth\",\n \"fitProvidedWidth\"\n ];\n const type = autoSizeStrategy.type;\n if (type !== \"fitCellContents\" && type !== \"fitGridWidth\" && type !== \"fitProvidedWidth\") {\n return `Invalid Auto-size strategy. \\`autoSizeStrategy\\` must be one of ${validModes.map((m) => '\"' + m + '\"').join(\", \")}, currently it's ${type}`;\n }\n if (type === \"fitProvidedWidth\" && typeof autoSizeStrategy.width != \"number\") {\n return `When using the 'fitProvidedWidth' auto-size strategy, must provide a numeric \\`width\\`. You provided ${autoSizeStrategy.width}`;\n }\n return null;\n }\n }\n };\n const validations = {};\n for (const key of _BOOLEAN_GRID_OPTIONS) {\n validations[key] = { expectedType: \"boolean\" };\n }\n for (const key of _NUMBER_GRID_OPTIONS) {\n validations[key] = { expectedType: \"number\" };\n }\n _mergeDeep(validations, definedValidations);\n return validations;\n};\nvar GRID_OPTIONS_VALIDATORS = () => ({\n objectName: \"gridOptions\",\n allProperties: [..._GET_ALL_GRID_OPTIONS(), ...Object.values(_PUBLIC_EVENT_HANDLERS_MAP)],\n propertyExceptions: [\"api\"],\n docsUrl: \"grid-options/\",\n deprecations: GRID_OPTION_DEPRECATIONS(),\n validations: GRID_OPTION_VALIDATIONS()\n});\n\n// packages/ag-grid-community/src/gridOptionsService.ts\nvar changeSetId = 0;\nvar gridInstanceSequence = 0;\nvar GRID_DOM_KEY = \"__ag_grid_instance\";\nvar GridOptionsService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"gos\";\n this.domDataKey = \"__AG_\" + Math.random().toString();\n /** This is only used for the main DOM element */\n this.instanceId = gridInstanceSequence++;\n // Used to hold user events until the grid is ready\n // Required to support React 19 StrictMode. See IFrameworkOverrides.runWhenReadyAsync but also is likely a good idea that onGridReady is the first event fired.\n this.gridReadyFired = false;\n this.queueEvents = [];\n this.propEventSvc = new LocalEventService();\n // responsible for calling the onXXX functions on gridOptions\n // It forces events defined in GridOptionsService.alwaysSyncGlobalEvents to be fired synchronously.\n // This is required for events such as GridPreDestroyed.\n // Other events can be fired asynchronously or synchronously depending on config.\n this.globalEventHandlerFactory = (restrictToSyncOnly) => {\n return (eventName, event) => {\n if (!this.isAlive()) {\n return;\n }\n const alwaysSync = ALWAYS_SYNC_GLOBAL_EVENTS.has(eventName);\n if (alwaysSync && !restrictToSyncOnly || !alwaysSync && restrictToSyncOnly) {\n return;\n }\n if (!isPublicEventHandler(eventName)) {\n return;\n }\n const fireEvent = (name, e) => {\n const eventHandlerName = _PUBLIC_EVENT_HANDLERS_MAP[name];\n const eventHandler = this.gridOptions[eventHandlerName];\n if (typeof eventHandler === \"function\") {\n this.beans.frameworkOverrides.wrapOutgoing(() => eventHandler(e));\n }\n };\n if (this.gridReadyFired) {\n fireEvent(eventName, event);\n } else if (eventName === \"gridReady\") {\n fireEvent(eventName, event);\n this.gridReadyFired = true;\n for (const q of this.queueEvents) {\n fireEvent(q.eventName, q.event);\n }\n this.queueEvents = [];\n } else {\n this.queueEvents.push({ eventName, event });\n }\n };\n };\n }\n wireBeans(beans) {\n this.gridOptions = beans.gridOptions;\n this.validation = beans.validation;\n this.api = beans.gridApi;\n this.gridId = beans.context.getId();\n }\n // This is quicker then having code call gridOptionsService.get('context')\n get gridOptionsContext() {\n return this.gridOptions[\"context\"];\n }\n postConstruct() {\n this.validateGridOptions(this.gridOptions);\n this.eventSvc.addGlobalListener(this.globalEventHandlerFactory().bind(this), true);\n this.eventSvc.addGlobalListener(this.globalEventHandlerFactory(true).bind(this), false);\n this.propEventSvc.setFrameworkOverrides(this.beans.frameworkOverrides);\n this.addManagedEventListeners({\n gridOptionsChanged: ({ options }) => {\n this.updateGridOptions({ options, force: true, source: \"optionsUpdated\" });\n }\n });\n }\n destroy() {\n super.destroy();\n this.queueEvents = [];\n }\n /**\n * Get the raw value of the GridOptions property provided.\n * @param property\n */\n get(property) {\n return this.gridOptions[property] ?? GRID_OPTION_DEFAULTS[property];\n }\n /**\n * Get the GridOption callback but wrapped so that the common params of api and context are automatically applied to the params.\n * @param property GridOption callback properties based on the fact that this property has a callback with params extending AgGridCommon\n */\n getCallback(property) {\n return this.mergeGridCommonParams(this.gridOptions[property]);\n }\n /**\n * Returns `true` if a value has been specified for this GridOption.\n * @param property GridOption property\n */\n exists(property) {\n return _exists(this.gridOptions[property]);\n }\n /**\n * Wrap the user callback and attach the api and context to the params object on the way through.\n * @param callback User provided callback\n * @returns Wrapped callback where the params object not require api and context\n */\n mergeGridCommonParams(callback) {\n if (callback) {\n const wrapped = (callbackParams) => {\n return callback(this.addCommon(callbackParams));\n };\n return wrapped;\n }\n return callback;\n }\n updateGridOptions({\n options,\n force,\n source = \"api\"\n }) {\n const changeSet = { id: changeSetId++, properties: [] };\n const events = [];\n const { gridOptions, validation } = this;\n for (const key of Object.keys(options)) {\n const value = GlobalGridOptions.applyGlobalGridOption(key, options[key]);\n validation?.warnOnInitialPropertyUpdate(source, key);\n const shouldForce = force || typeof value === \"object\" && source === \"api\";\n const previousValue = gridOptions[key];\n if (shouldForce || previousValue !== value) {\n gridOptions[key] = value;\n const event = {\n type: key,\n currentValue: value,\n previousValue,\n changeSet,\n source\n };\n events.push(event);\n }\n }\n this.validateGridOptions(this.gridOptions);\n changeSet.properties = events.map((event) => event.type);\n for (const event of events) {\n _logIfDebug(this, `Updated property ${event.type} from`, event.previousValue, ` to `, event.currentValue);\n this.propEventSvc.dispatchEvent(event);\n }\n }\n addPropertyEventListener(key, listener) {\n this.propEventSvc.addEventListener(key, listener);\n }\n removePropertyEventListener(key, listener) {\n this.propEventSvc.removeEventListener(key, listener);\n }\n getDomDataKey() {\n return this.domDataKey;\n }\n /** Prefer _addGridCommonParams from gridOptionsUtils for bundle size savings */\n addCommon(params) {\n params.api = this.api;\n params.context = this.gridOptionsContext;\n return params;\n }\n validateOptions(options, modValidations) {\n for (const key of Object.keys(options)) {\n const value = options[key];\n if (value == null || value === false) {\n continue;\n }\n let moduleToCheck = modValidations[key];\n if (typeof moduleToCheck === \"function\") {\n moduleToCheck = moduleToCheck(options, this.gridOptions, this.beans);\n }\n if (moduleToCheck) {\n this.assertModuleRegistered(moduleToCheck, key);\n }\n }\n }\n validateGridOptions(gridOptions) {\n this.validateOptions(gridOptions, GRID_OPTIONS_MODULES);\n this.validation?.processGridOptions(gridOptions);\n }\n validateColDef(colDef, colId, skipInferenceCheck) {\n if (skipInferenceCheck || !this.beans.dataTypeSvc?.isColPendingInference(colId)) {\n this.validateOptions(colDef, COLUMN_DEFINITION_MOD_VALIDATIONS);\n this.validation?.validateColDef(colDef);\n }\n }\n assertModuleRegistered(moduleName, reasonOrId) {\n const registered = Array.isArray(moduleName) ? moduleName.some((modName) => this.isModuleRegistered(modName)) : this.isModuleRegistered(moduleName);\n if (!registered) {\n _error(200, {\n ...this.getModuleErrorParams(),\n moduleName,\n reasonOrId\n });\n }\n return registered;\n }\n getModuleErrorParams() {\n return {\n gridId: this.gridId,\n gridScoped: _areModulesGridScoped(),\n rowModelType: this.get(\"rowModelType\"),\n isUmd: _isUmd()\n };\n }\n isModuleRegistered(moduleName) {\n return _isModuleRegistered(moduleName, this.gridId, this.get(\"rowModelType\"));\n }\n setInstanceDomData(element) {\n element[GRID_DOM_KEY] = this.instanceId;\n }\n isElementInThisInstance(element) {\n let pointer = element;\n while (pointer) {\n const instanceId = pointer[GRID_DOM_KEY];\n if (_exists(instanceId)) {\n const eventFromThisGrid = instanceId === this.instanceId;\n return eventFromThisGrid;\n }\n pointer = pointer.parentElement;\n }\n return false;\n }\n};\nfunction isPublicEventHandler(eventName) {\n return !!_PUBLIC_EVENT_HANDLERS_MAP[eventName];\n}\n\n// packages/ag-grid-community/src/headerRendering/cells/column/headerCellMouseListenerFeature.ts\nvar HeaderCellMouseListenerFeature = class extends BeanStub {\n constructor(column, eGui) {\n super();\n this.column = column;\n this.eGui = eGui;\n this.lastMovingChanged = 0;\n }\n postConstruct() {\n this.addManagedElementListeners(this.eGui, {\n click: (e) => e && this.onClick(e)\n });\n this.addManagedListeners(this.column, {\n movingChanged: () => {\n this.lastMovingChanged = Date.now();\n }\n });\n }\n onClick(event) {\n const { sortSvc, rangeSvc, gos } = this.beans;\n const sortFromClick = _getEnableColumnSelection(gos) ? event.altKey : true;\n if (!sortFromClick) {\n rangeSvc?.handleColumnSelection(this.column, event);\n } else if (this.column.isSortable()) {\n const moving = this.column.isMoving();\n const nowTime = Date.now();\n const movedRecently = nowTime - this.lastMovingChanged < 50;\n const columnMoving = moving || movedRecently;\n if (!columnMoving) {\n sortSvc?.progressSortFromEvent(this.column, event);\n }\n }\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/cells/column/headerComp.ts\nfunction getHeaderCompElementParams(includeColumnRefIndicator, includeSortIndicator) {\n const hiddenAttrs = { \"aria-hidden\": \"true\" };\n return {\n tag: \"div\",\n cls: \"ag-cell-label-container\",\n role: \"presentation\",\n children: [\n {\n tag: \"span\",\n ref: \"eMenu\",\n cls: \"ag-header-icon ag-header-cell-menu-button\",\n attrs: hiddenAttrs\n },\n {\n tag: \"span\",\n ref: \"eFilterButton\",\n cls: \"ag-header-icon ag-header-cell-filter-button\",\n attrs: hiddenAttrs\n },\n {\n tag: \"div\",\n ref: \"eLabel\",\n cls: \"ag-header-cell-label\",\n role: \"presentation\",\n children: [\n includeColumnRefIndicator ? { tag: \"span\", ref: \"eColRef\", cls: \"ag-header-col-ref\" } : null,\n { tag: \"span\", ref: \"eText\", cls: \"ag-header-cell-text\" },\n {\n tag: \"span\",\n ref: \"eFilter\",\n cls: \"ag-header-icon ag-header-label-icon ag-filter-icon\",\n attrs: hiddenAttrs\n },\n includeSortIndicator ? { tag: \"ag-sort-indicator\", ref: \"eSortIndicator\" } : null\n ]\n }\n ]\n };\n}\nvar HeaderComp = class extends Component {\n constructor() {\n super(...arguments);\n // All the elements are optional, as they are not guaranteed to be present if the user provides a custom template\n this.eFilter = RefPlaceholder;\n this.eFilterButton = RefPlaceholder;\n this.eSortIndicator = RefPlaceholder;\n this.eMenu = RefPlaceholder;\n this.eLabel = RefPlaceholder;\n this.eText = RefPlaceholder;\n this.eColRef = RefPlaceholder;\n /**\n * Selectors for custom headers templates, i.e when the ag-sort-indicator is not present.\n */\n this.eSortOrder = RefPlaceholder;\n this.eSortAsc = RefPlaceholder;\n this.eSortDesc = RefPlaceholder;\n this.eSortMixed = RefPlaceholder;\n this.eSortNone = RefPlaceholder;\n this.eSortAbsoluteAsc = RefPlaceholder;\n this.eSortAbsoluteDesc = RefPlaceholder;\n this.isLoadingInnerComponent = false;\n }\n refresh(params) {\n const oldParams = this.params;\n this.params = params;\n if (this.workOutTemplate(params, !!this.beans?.sortSvc) != this.currentTemplate || this.workOutShowMenu() != this.currentShowMenu || params.enableSorting != this.currentSort || params.column.formulaRef != this.currentRef || this.currentSuppressMenuHide != null && this.shouldSuppressMenuHide() != this.currentSuppressMenuHide || oldParams.enableFilterButton != params.enableFilterButton || oldParams.enableFilterIcon != params.enableFilterIcon) {\n return false;\n }\n if (this.innerHeaderComponent) {\n const mergedParams = { ...params };\n _mergeDeep(mergedParams, params.innerHeaderComponentParams);\n this.innerHeaderComponent.refresh?.(mergedParams);\n } else {\n this.setDisplayName(params);\n }\n return true;\n }\n workOutTemplate(params, isSorting) {\n const { formula } = this.beans;\n const paramsTemplate = params.template;\n if (paramsTemplate) {\n return paramsTemplate?.trim ? paramsTemplate.trim() : paramsTemplate;\n }\n return getHeaderCompElementParams(!!formula?.active, isSorting);\n }\n init(params) {\n this.params = params;\n const { sortSvc, touchSvc, rowNumbersSvc, userCompFactory } = this.beans;\n const sortComp = sortSvc?.getSortIndicatorSelector();\n this.currentTemplate = this.workOutTemplate(params, !!sortComp);\n this.setTemplate(this.currentTemplate, sortComp ? [sortComp] : void 0);\n if (this.eLabel) {\n this.mouseListener ?? (this.mouseListener = this.createManagedBean(\n new HeaderCellMouseListenerFeature(params.column, this.eLabel)\n ));\n }\n touchSvc?.setupForHeader(this);\n this.setMenu();\n this.setupSort();\n this.setupColumnRefIndicator();\n rowNumbersSvc?.setupForHeader(this);\n this.setupFilterIcon();\n this.setupFilterButton();\n this.workOutInnerHeaderComponent(userCompFactory, params);\n this.setDisplayName(params);\n }\n workOutInnerHeaderComponent(userCompFactory, params) {\n const userCompDetails = _getInnerHeaderCompDetails(userCompFactory, params, params);\n if (!userCompDetails) {\n return;\n }\n this.isLoadingInnerComponent = true;\n userCompDetails.newAgStackInstance().then((comp) => {\n this.isLoadingInnerComponent = false;\n if (!comp) {\n return;\n }\n if (this.isAlive()) {\n this.innerHeaderComponent = comp;\n if (this.eText) {\n this.eText.appendChild(comp.getGui());\n }\n } else {\n this.destroyBean(comp);\n }\n });\n }\n setDisplayName(params) {\n const { displayName } = params;\n const oldDisplayName = this.currentDisplayName;\n this.currentDisplayName = displayName;\n if (!this.eText || oldDisplayName === displayName || this.innerHeaderComponent || this.isLoadingInnerComponent) {\n return;\n }\n this.eText.textContent = _toString(displayName);\n }\n addInIcon(iconName, eParent, column) {\n const eIcon = _createIconNoSpan(iconName, this.beans, column);\n if (eIcon) {\n eParent.appendChild(eIcon);\n }\n }\n workOutShowMenu() {\n return this.params.enableMenu && !!this.beans.menuSvc?.isHeaderMenuButtonEnabled();\n }\n shouldSuppressMenuHide() {\n return !!this.beans.menuSvc?.isHeaderMenuButtonAlwaysShowEnabled();\n }\n setMenu() {\n if (!this.eMenu) {\n return;\n }\n this.currentShowMenu = this.workOutShowMenu();\n if (!this.currentShowMenu) {\n _removeFromParent(this.eMenu);\n this.eMenu = void 0;\n return;\n }\n const { gos, eMenu, params } = this;\n const isLegacyMenu = _isLegacyMenuEnabled(gos);\n this.addInIcon(isLegacyMenu ? \"menu\" : \"menuAlt\", eMenu, params.column);\n eMenu.classList.toggle(\"ag-header-menu-icon\", !isLegacyMenu);\n const currentSuppressMenuHide = this.shouldSuppressMenuHide();\n this.currentSuppressMenuHide = currentSuppressMenuHide;\n this.addManagedElementListeners(eMenu, { click: () => this.showColumnMenu(this.eMenu) });\n this.toggleMenuAlwaysShow(currentSuppressMenuHide);\n }\n toggleMenuAlwaysShow(alwaysShow) {\n this.eMenu?.classList.toggle(\"ag-header-menu-always-show\", alwaysShow);\n }\n showColumnMenu(element) {\n const { currentSuppressMenuHide, params } = this;\n if (!currentSuppressMenuHide) {\n this.toggleMenuAlwaysShow(true);\n }\n params.showColumnMenu(element, () => {\n if (!currentSuppressMenuHide) {\n this.toggleMenuAlwaysShow(false);\n }\n });\n }\n onMenuKeyboardShortcut(isFilterShortcut) {\n const { params, gos, beans, eMenu, eFilterButton } = this;\n const column = params.column;\n const isLegacyMenuEnabled = _isLegacyMenuEnabled(gos);\n if (isFilterShortcut && !isLegacyMenuEnabled) {\n if (beans.menuSvc?.isFilterMenuInHeaderEnabled(column)) {\n params.showFilter(eFilterButton ?? eMenu ?? this.getGui());\n return true;\n }\n } else if (params.enableMenu) {\n this.showColumnMenu(eMenu ?? eFilterButton ?? this.getGui());\n return true;\n }\n return false;\n }\n setupSort() {\n const { sortSvc } = this.beans;\n if (!sortSvc) {\n return;\n }\n const { enableSorting, column } = this.params;\n this.currentSort = enableSorting;\n if (!this.eSortIndicator) {\n this.eSortIndicator = this.createBean(sortSvc.createSortIndicator(true));\n const {\n eSortIndicator,\n eSortOrder,\n eSortAsc,\n eSortDesc,\n eSortMixed,\n eSortNone,\n eSortAbsoluteAsc,\n eSortAbsoluteDesc\n } = this;\n eSortIndicator.attachCustomElements(\n eSortOrder,\n eSortAsc,\n eSortDesc,\n eSortMixed,\n eSortNone,\n eSortAbsoluteAsc,\n eSortAbsoluteDesc\n );\n }\n this.eSortIndicator.setupSort(column);\n if (!this.currentSort) {\n return;\n }\n sortSvc.setupHeader(this, column);\n }\n setupColumnRefIndicator() {\n const {\n eColRef,\n beans: { editModelSvc },\n params\n } = this;\n if (!eColRef) {\n return;\n }\n this.currentRef = params.column.formulaRef;\n eColRef.textContent = this.currentRef;\n _setDisplayed(eColRef, false);\n this.addManagedEventListeners({\n cellEditingStarted: () => {\n const editPositions = editModelSvc?.getEditPositions();\n const shouldDisplay = !!this.currentRef && !!editPositions?.some((position) => position.column.isAllowFormula());\n _setDisplayed(eColRef, shouldDisplay);\n },\n cellEditingStopped: () => {\n _setDisplayed(eColRef, false);\n }\n });\n }\n setupFilterIcon() {\n const { eFilter, params } = this;\n if (!eFilter) {\n return;\n }\n const onFilterChangedIcon = () => {\n const filterPresent = params.column.isFilterActive();\n _setDisplayed(eFilter, filterPresent, { skipAriaHidden: true });\n };\n this.configureFilter(params.enableFilterIcon, eFilter, onFilterChangedIcon, \"filterActive\");\n }\n setupFilterButton() {\n const { eFilterButton, params } = this;\n if (!eFilterButton) {\n return;\n }\n const configured = this.configureFilter(\n params.enableFilterButton,\n eFilterButton,\n this.onFilterChangedButton.bind(this),\n \"filter\"\n );\n if (configured) {\n this.addManagedElementListeners(eFilterButton, {\n click: () => params.showFilter(eFilterButton)\n });\n } else {\n this.eFilterButton = void 0;\n }\n }\n configureFilter(enabled, element, filterChangedCallback, icon) {\n if (!enabled) {\n _removeFromParent(element);\n return false;\n }\n const column = this.params.column;\n this.addInIcon(icon, element, column);\n this.addManagedListeners(column, { filterChanged: filterChangedCallback });\n filterChangedCallback();\n return true;\n }\n onFilterChangedButton() {\n const filterPresent = this.params.column.isFilterActive();\n this.eFilterButton.classList.toggle(\"ag-filter-active\", filterPresent);\n }\n getAnchorElementForMenu(isFilter) {\n const { eFilterButton, eMenu } = this;\n if (isFilter) {\n return eFilterButton ?? eMenu ?? this.getGui();\n }\n return eMenu ?? eFilterButton ?? this.getGui();\n }\n destroy() {\n super.destroy();\n this.innerHeaderComponent = this.destroyBean(this.innerHeaderComponent);\n this.mouseListener = this.destroyBean(this.mouseListener);\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/cells/columnGroup/groupStickyLabelFeature.ts\nvar GroupStickyLabelFeature = class extends BeanStub {\n constructor(eLabel, columnGroup) {\n super();\n this.eLabel = eLabel;\n this.columnGroup = columnGroup;\n this.isSticky = false;\n this.left = null;\n this.right = null;\n }\n postConstruct() {\n const { columnGroup, beans } = this;\n const { ctrlsSvc } = beans;\n ctrlsSvc.whenReady(this, () => {\n const refreshPosition = this.refreshPosition.bind(this);\n if (columnGroup.getPinned() == null) {\n this.addManagedEventListeners({\n bodyScroll: (event) => {\n if (event.direction === \"horizontal\") {\n this.updateSticky(event.left);\n }\n }\n });\n }\n this.addManagedListeners(columnGroup, {\n leftChanged: refreshPosition,\n displayedChildrenChanged: refreshPosition\n });\n this.addManagedEventListeners({\n columnResized: refreshPosition\n });\n this.refreshPosition();\n });\n }\n refreshPosition() {\n const { columnGroup, beans } = this;\n const left = columnGroup.getLeft();\n const width = columnGroup.getActualWidth();\n if (left == null || width === 0) {\n this.left = null;\n this.right = null;\n this.setSticky(false);\n return;\n }\n this.left = left;\n this.right = left + width;\n const scrollPosition = beans.colViewport.getScrollPosition();\n if (scrollPosition != null) {\n this.updateSticky(scrollPosition);\n }\n }\n updateSticky(scrollLeft) {\n const { beans, left, right } = this;\n if (left == null || right == null) {\n this.setSticky(false);\n return;\n }\n const { gos, visibleCols } = beans;\n const isRtl = gos.get(\"enableRtl\");\n const viewportEdge = isRtl ? visibleCols.bodyWidth - scrollLeft : scrollLeft;\n this.setSticky(left < viewportEdge && right > viewportEdge);\n }\n setSticky(value) {\n const { isSticky, eLabel } = this;\n if (isSticky === value) {\n return;\n }\n this.isSticky = value;\n eLabel.classList.toggle(\"ag-sticky-label\", value);\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/cells/columnGroup/headerGroupComp.ts\nvar HeaderGroupCompElement = {\n tag: \"div\",\n cls: \"ag-header-group-cell-label\",\n role: \"presentation\",\n children: [\n { tag: \"span\", ref: \"agLabel\", cls: \"ag-header-group-text\", role: \"presentation\" },\n { tag: \"span\", ref: \"agOpened\", cls: `ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded` },\n { tag: \"span\", ref: \"agClosed\", cls: `ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed` }\n ]\n};\nvar HeaderGroupComp = class extends Component {\n constructor() {\n super(HeaderGroupCompElement);\n this.agOpened = RefPlaceholder;\n this.agClosed = RefPlaceholder;\n this.agLabel = RefPlaceholder;\n this.isLoadingInnerComponent = false;\n }\n init(params) {\n const { userCompFactory, touchSvc } = this.beans;\n this.params = params;\n this.checkWarnings();\n this.workOutInnerHeaderGroupComponent(userCompFactory, params);\n this.setupLabel(params);\n this.addGroupExpandIcon(params);\n this.setupExpandIcons();\n touchSvc?.setupForHeaderGroup(this);\n }\n checkWarnings() {\n const paramsAny = this.params;\n if (paramsAny.template) {\n _warn(89);\n }\n }\n workOutInnerHeaderGroupComponent(userCompFactory, params) {\n const userCompDetails = _getInnerHeaderGroupCompDetails(userCompFactory, params, params);\n if (!userCompDetails) {\n return;\n }\n this.isLoadingInnerComponent = true;\n userCompDetails.newAgStackInstance().then((comp) => {\n this.isLoadingInnerComponent = false;\n if (!comp) {\n return;\n }\n if (this.isAlive()) {\n this.innerHeaderGroupComponent = comp;\n this.agLabel.appendChild(comp.getGui());\n } else {\n this.destroyBean(comp);\n }\n });\n }\n setupExpandIcons() {\n const {\n agOpened,\n agClosed,\n params: { columnGroup },\n beans: { colGroupSvc }\n } = this;\n this.addInIcon(\"columnGroupOpened\", agOpened);\n this.addInIcon(\"columnGroupClosed\", agClosed);\n const expandAction = (event) => {\n if (_isStopPropagationForAgGrid(event)) {\n return;\n }\n const newExpandedValue = !columnGroup.isExpanded();\n colGroupSvc.setColumnGroupOpened(\n columnGroup.getProvidedColumnGroup(),\n newExpandedValue,\n \"uiColumnExpanded\"\n );\n };\n this.addTouchAndClickListeners(agClosed, expandAction);\n this.addTouchAndClickListeners(agOpened, expandAction);\n const stopPropagationAction = (event) => {\n _stopPropagationForAgGrid(event);\n };\n this.addManagedElementListeners(agClosed, { dblclick: stopPropagationAction });\n this.addManagedElementListeners(agOpened, { dblclick: stopPropagationAction });\n this.addManagedElementListeners(this.getGui(), { dblclick: expandAction });\n this.updateIconVisibility();\n const providedColumnGroup = columnGroup.getProvidedColumnGroup();\n const updateIcon = this.updateIconVisibility.bind(this);\n this.addManagedListeners(providedColumnGroup, {\n expandedChanged: updateIcon,\n expandableChanged: updateIcon\n });\n }\n addTouchAndClickListeners(eElement, action) {\n this.beans.touchSvc?.setupForHeaderGroupElement(this, eElement, action);\n this.addManagedElementListeners(eElement, { click: action });\n }\n updateIconVisibility() {\n const {\n agOpened,\n agClosed,\n params: { columnGroup }\n } = this;\n if (columnGroup.isExpandable()) {\n const expanded = columnGroup.isExpanded();\n _setDisplayed(agOpened, expanded);\n _setDisplayed(agClosed, !expanded);\n } else {\n _setDisplayed(agOpened, false);\n _setDisplayed(agClosed, false);\n }\n }\n addInIcon(iconName, element) {\n const eIcon = _createIconNoSpan(iconName, this.beans, null);\n if (eIcon) {\n element.appendChild(eIcon);\n }\n }\n addGroupExpandIcon(params) {\n if (!params.columnGroup.isExpandable()) {\n const { agOpened, agClosed } = this;\n _setDisplayed(agOpened, false);\n _setDisplayed(agClosed, false);\n }\n }\n setupLabel(params) {\n const { displayName, columnGroup } = params;\n const { innerHeaderGroupComponent, isLoadingInnerComponent } = this;\n const hasInnerComponent = innerHeaderGroupComponent || isLoadingInnerComponent;\n if (_exists(displayName) && !hasInnerComponent) {\n this.agLabel.textContent = _toString(displayName);\n }\n if (!columnGroup.getColGroupDef()?.suppressStickyLabel) {\n this.createManagedBean(new GroupStickyLabelFeature(this.getGui(), columnGroup));\n }\n }\n destroy() {\n super.destroy();\n if (this.innerHeaderGroupComponent) {\n this.destroyBean(this.innerHeaderGroupComponent);\n this.innerHeaderGroupComponent = void 0;\n }\n }\n};\n\n// packages/ag-grid-community/src/headerRendering/cells/headerModule.ts\nvar ColumnHeaderCompModule = {\n moduleName: \"ColumnHeaderComp\",\n version: VERSION,\n userComponents: {\n agColumnHeader: HeaderComp\n },\n icons: {\n // button to launch legacy column menu\n menu: \"menu\",\n // button to launch new enterprise column menu\n menuAlt: \"menu-alt\"\n }\n};\nvar ColumnGroupHeaderCompModule = {\n moduleName: \"ColumnGroupHeaderComp\",\n version: VERSION,\n userComponents: {\n agColumnGroupHeader: HeaderGroupComp\n },\n icons: {\n // header column group shown when expanded (click to contract)\n columnGroupOpened: \"expanded\",\n // header column group shown when contracted (click to expand)\n columnGroupClosed: \"contracted\"\n }\n};\n\n// packages/ag-grid-community/src/misc/animationFrameService.ts\nvar AnimationFrameService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"animationFrameSvc\";\n // p1 and p2 are create tasks are to do with row and cell creation.\n // for them we want to execute according to row order, so we use\n // TaskItem so we know what index the item is for.\n this.p1 = { list: [], sorted: false };\n // eg drawing back-ground of rows\n this.p2 = { list: [], sorted: false };\n // eg cell renderers, adding hover functionality\n this.f1 = { list: [], sorted: false };\n // eg framework cell renderers\n // destroy tasks are to do with row removal. they are done after row creation as the user will need to see new\n // rows first (as blank is scrolled into view), when we remove the old rows (no longer in view) is not as\n // important.\n this.destroyTasks = [];\n this.ticking = false;\n // we need to know direction of scroll, to build up rows in the direction of\n // the scroll. eg if user scrolls down, we extend the rows by building down.\n this.scrollGoingDown = true;\n this.lastScrollTop = 0;\n this.taskCount = 0;\n }\n setScrollTop(scrollTop) {\n this.scrollGoingDown = scrollTop >= this.lastScrollTop;\n if (scrollTop === 0) {\n this.scrollGoingDown = true;\n }\n this.lastScrollTop = scrollTop;\n }\n postConstruct() {\n this.active = !this.gos.get(\"suppressAnimationFrame\");\n this.batchFrameworkComps = this.beans.frameworkOverrides.batchFrameworkComps;\n }\n // this method is for our AG Grid sanity only - if animation frames are turned off,\n // then no place in the code should be looking to add any work to be done in animation\n // frames. this stops bugs - where some code is asking for a frame to be executed\n // when it should not.\n verify() {\n if (this.active === false) {\n _warn(92);\n }\n }\n createTask(task, index, list, isFramework, isDeferred = false) {\n this.verify();\n let taskList = list;\n if (isFramework && this.batchFrameworkComps) {\n taskList = \"f1\";\n }\n const taskItem = { task, index, createOrder: ++this.taskCount, deferred: isDeferred };\n this.addTaskToList(this[taskList], taskItem);\n this.schedule();\n }\n addTaskToList(taskList, task) {\n taskList.list.push(task);\n taskList.sorted = false;\n }\n sortTaskList(taskList) {\n if (taskList.sorted) {\n return;\n }\n const sortDirection = this.scrollGoingDown ? 1 : -1;\n taskList.list.sort((a, b) => {\n if (a.deferred !== b.deferred) {\n return a.deferred ? -1 : 1;\n }\n if (a.index !== b.index) {\n return sortDirection * (b.index - a.index);\n }\n return b.createOrder - a.createOrder;\n });\n taskList.sorted = true;\n }\n addDestroyTask(task) {\n this.verify();\n this.destroyTasks.push(task);\n this.schedule();\n }\n executeFrame(millis) {\n const { p1, p2, f1, destroyTasks, beans } = this;\n const { ctrlsSvc, frameworkOverrides } = beans;\n const p1Tasks = p1.list;\n const p2Tasks = p2.list;\n const f1Tasks = f1.list;\n const frameStart = Date.now();\n let duration = 0;\n const noMaxMillis = millis <= 0;\n const scrollFeature = ctrlsSvc.getScrollFeature();\n while (noMaxMillis || duration < millis) {\n const gridBodyDidSomething = scrollFeature.scrollGridIfNeeded();\n if (!gridBodyDidSomething) {\n let task;\n if (p1Tasks.length) {\n this.sortTaskList(p1);\n task = p1Tasks.pop().task;\n } else if (p2Tasks.length) {\n this.sortTaskList(p2);\n task = p2Tasks.pop().task;\n } else if (f1Tasks.length) {\n frameworkOverrides.wrapOutgoing(() => {\n while (noMaxMillis || duration < millis) {\n const gridBodyDidSomething2 = scrollFeature.scrollGridIfNeeded();\n if (!gridBodyDidSomething2) {\n if (f1Tasks.length) {\n this.sortTaskList(f1);\n task = f1Tasks.pop().task;\n task();\n } else {\n break;\n }\n } else {\n break;\n }\n duration = Date.now() - frameStart;\n }\n });\n task = () => {\n };\n } else if (destroyTasks.length) {\n task = destroyTasks.pop();\n } else {\n break;\n }\n task();\n }\n duration = Date.now() - frameStart;\n }\n if (p1Tasks.length || p2Tasks.length || f1Tasks.length || destroyTasks.length) {\n this.requestFrame();\n } else {\n this.ticking = false;\n }\n }\n flushAllFrames() {\n if (!this.active) {\n return;\n }\n this.executeFrame(-1);\n }\n schedule() {\n if (!this.active) {\n return;\n }\n if (!this.ticking) {\n this.ticking = true;\n this.requestFrame();\n }\n }\n requestFrame() {\n const callback = this.executeFrame.bind(this, 60);\n _requestAnimationFrame(this.beans, callback);\n }\n isQueueEmpty() {\n return !this.ticking;\n }\n};\n\n// packages/ag-grid-community/src/misc/animationFrameModule.ts\nvar AnimationFrameModule = {\n moduleName: \"AnimationFrame\",\n version: VERSION,\n beans: [AnimationFrameService]\n};\n\n// packages/ag-grid-community/src/misc/iconService.ts\nvar IconService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"iconSvc\";\n }\n createIconNoSpan(iconName, params) {\n return _createIconNoSpan(iconName, this.beans, params?.column);\n }\n};\n\n// packages/ag-grid-community/src/misc/touchService.ts\nvar _shouldOpenHeaderMenuOnLongTap = (enableMenu, isHeaderContextMenuEnabled, isLegacyMenuEnabled) => isHeaderContextMenuEnabled || enableMenu && isLegacyMenuEnabled;\nvar TouchService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"touchSvc\";\n }\n mockBodyContextMenu(ctrl, listener) {\n this.mockContextMenu(ctrl, ctrl.eBodyViewport, listener);\n }\n mockHeaderContextMenu(ctrl, listener) {\n this.mockContextMenu(ctrl, ctrl.eGui, listener);\n }\n mockRowContextMenu(ctrl) {\n if (!_isIOSUserAgent()) {\n return;\n }\n const listener = (mouseListener, touch, touchEvent) => {\n const { rowCtrl, cellCtrl } = ctrl.getControlsForEventTarget(touchEvent?.target ?? null);\n if (cellCtrl?.column) {\n cellCtrl.dispatchCellContextMenuEvent(touchEvent ?? null);\n }\n this.beans.contextMenuSvc?.handleContextMenuMouseEvent(void 0, touchEvent, rowCtrl, cellCtrl);\n };\n this.mockContextMenu(ctrl, ctrl.element, listener);\n }\n handleCellDoubleClick(ctrl, mouseEvent) {\n const isDoubleClickOnIPad = () => {\n if (!_isIOSUserAgent() || _isEventSupported(\"dblclick\")) {\n return false;\n }\n const nowMillis = Date.now();\n const res = nowMillis - ctrl.lastIPadMouseClickEvent < 200;\n ctrl.lastIPadMouseClickEvent = nowMillis;\n return res;\n };\n if (isDoubleClickOnIPad()) {\n ctrl.onCellDoubleClicked(mouseEvent);\n mouseEvent.preventDefault();\n return true;\n }\n return false;\n }\n setupForHeader(comp) {\n const { gos, sortSvc, menuSvc } = this.beans;\n if (gos.get(\"suppressTouch\")) {\n return;\n }\n const { params, eMenu, eFilterButton } = comp;\n const touchListener = new TouchListener(comp.getGui(), true);\n comp.addDestroyFunc(() => touchListener.destroy());\n const suppressMenuHide = comp.shouldSuppressMenuHide();\n const tapMenuButton = suppressMenuHide && _exists(eMenu) && params.enableMenu;\n const isHeaderContextMenuEnabled = !!menuSvc?.isHeaderContextMenuEnabled(params.column);\n const shouldOpenMenuOnLongTap = _shouldOpenHeaderMenuOnLongTap(\n params.enableMenu,\n isHeaderContextMenuEnabled,\n _isLegacyMenuEnabled(gos)\n );\n let menuTouchListener = touchListener;\n if (tapMenuButton) {\n menuTouchListener = new TouchListener(eMenu, true);\n comp.addDestroyFunc(() => menuTouchListener.destroy());\n }\n const showMenuFn = (event) => params.showColumnMenuAfterMouseClick(event.touchStart);\n if (tapMenuButton && params.enableMenu) {\n comp.addManagedListeners(menuTouchListener, { tap: showMenuFn });\n }\n if (shouldOpenMenuOnLongTap) {\n comp.addManagedListeners(touchListener, { longTap: showMenuFn });\n }\n if (params.enableSorting) {\n const tapListener = (event) => {\n const target = event.touchStart.target;\n if (suppressMenuHide && (eMenu?.contains(target) || eFilterButton?.contains(target))) {\n return;\n }\n sortSvc?.progressSort(params.column, false, \"uiColumnSorted\");\n };\n comp.addManagedListeners(touchListener, { tap: tapListener });\n }\n if (params.enableFilterButton && eFilterButton) {\n const filterButtonTouchListener = new TouchListener(eFilterButton, true);\n comp.addManagedListeners(filterButtonTouchListener, {\n tap: () => params.showFilter(eFilterButton)\n });\n comp.addDestroyFunc(() => filterButtonTouchListener.destroy());\n }\n }\n setupForHeaderGroup(comp) {\n const params = comp.params;\n if (this.beans.menuSvc?.isHeaderContextMenuEnabled(\n params.columnGroup.getProvidedColumnGroup()\n )) {\n const touchListener = new TouchListener(params.eGridHeader, true);\n const showMenuFn = (event) => params.showColumnMenuAfterMouseClick(event.touchStart);\n comp.addManagedListeners(touchListener, { longTap: showMenuFn });\n comp.addDestroyFunc(() => touchListener.destroy());\n }\n }\n setupForHeaderGroupElement(comp, eElement, action) {\n const touchListener = new TouchListener(eElement, true);\n comp.addManagedListeners(touchListener, { tap: action });\n comp.addDestroyFunc(() => touchListener.destroy());\n }\n mockContextMenu(ctrl, element, listener) {\n if (!_isIOSUserAgent()) {\n return;\n }\n const touchListener = new TouchListener(element);\n const longTapListener = (event) => {\n if (!_isEventFromThisInstance(this.beans, event.touchEvent)) {\n return;\n }\n listener(void 0, event.touchStart, event.touchEvent);\n };\n ctrl.addManagedListeners(touchListener, { longTap: longTapListener });\n ctrl.addDestroyFunc(() => touchListener.destroy());\n }\n};\n\n// packages/ag-grid-community/src/misc/touchModule.ts\nvar TouchModule = {\n moduleName: \"Touch\",\n version: VERSION,\n beans: [TouchService]\n};\n\n// packages/ag-grid-community/src/navigation/cellNavigationService.ts\nvar CellNavigationService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"cellNavigation\";\n }\n wireBeans(beans) {\n this.rowSpanSvc = beans.rowSpanSvc;\n }\n // returns null if no cell to focus on, ie at the end of the grid\n getNextCellToFocus(key, focusedCell, ctrlPressed = false) {\n if (ctrlPressed) {\n return this.getNextCellToFocusWithCtrlPressed(key, focusedCell);\n }\n return this.getNextCellToFocusWithoutCtrlPressed(key, focusedCell);\n }\n getNextCellToFocusWithCtrlPressed(key, focusedCell) {\n const upKey = key === KeyCode.UP;\n const downKey = key === KeyCode.DOWN;\n const leftKey = key === KeyCode.LEFT;\n let column;\n let rowIndex;\n const { pageBounds, gos, visibleCols, pinnedRowModel } = this.beans;\n const { rowPinned } = focusedCell;\n if (upKey || downKey) {\n if (rowPinned && pinnedRowModel) {\n if (upKey) {\n rowIndex = 0;\n } else {\n rowIndex = rowPinned === \"top\" ? pinnedRowModel.getPinnedTopRowCount() - 1 : pinnedRowModel.getPinnedBottomRowCount() - 1;\n }\n } else {\n rowIndex = upKey ? pageBounds.getFirstRow() : pageBounds.getLastRow();\n }\n column = focusedCell.column;\n } else {\n const isRtl = gos.get(\"enableRtl\");\n rowIndex = focusedCell.rowIndex;\n const allColumns = leftKey !== isRtl ? visibleCols.allCols : [...visibleCols.allCols].reverse();\n column = allColumns.find(\n (col) => !isRowNumberCol(col) && this.isCellGoodToFocusOn({\n rowIndex,\n rowPinned: null,\n column: col\n })\n );\n }\n return column ? {\n rowIndex,\n rowPinned,\n column\n } : null;\n }\n getNextCellToFocusWithoutCtrlPressed(key, focusedCell) {\n let pointer = focusedCell;\n let finished = false;\n while (!finished) {\n switch (key) {\n case KeyCode.UP:\n pointer = this.getCellAbove(pointer);\n break;\n case KeyCode.DOWN:\n pointer = this.getCellBelow(pointer);\n break;\n case KeyCode.RIGHT:\n pointer = this.gos.get(\"enableRtl\") ? this.getCellToLeft(pointer) : this.getCellToRight(pointer);\n break;\n case KeyCode.LEFT:\n pointer = this.gos.get(\"enableRtl\") ? this.getCellToRight(pointer) : this.getCellToLeft(pointer);\n break;\n default:\n pointer = null;\n _warn(8, { key });\n break;\n }\n if (pointer) {\n finished = this.isCellGoodToFocusOn(pointer);\n } else {\n finished = true;\n }\n }\n return pointer;\n }\n isCellGoodToFocusOn(gridCell) {\n const column = gridCell.column;\n let rowNode;\n const { pinnedRowModel, rowModel } = this.beans;\n switch (gridCell.rowPinned) {\n case \"top\":\n rowNode = pinnedRowModel?.getPinnedTopRow(gridCell.rowIndex);\n break;\n case \"bottom\":\n rowNode = pinnedRowModel?.getPinnedBottomRow(gridCell.rowIndex);\n break;\n default:\n rowNode = rowModel.getRow(gridCell.rowIndex);\n break;\n }\n if (!rowNode) {\n return false;\n }\n const suppressNavigable = this.isSuppressNavigable(column, rowNode);\n return !suppressNavigable;\n }\n getCellToLeft(lastCell) {\n if (!lastCell) {\n return null;\n }\n const colToLeft = this.beans.visibleCols.getColBefore(lastCell.column);\n if (!colToLeft) {\n return null;\n }\n return {\n rowIndex: lastCell.rowIndex,\n column: colToLeft,\n rowPinned: lastCell.rowPinned\n };\n }\n getCellToRight(lastCell) {\n if (!lastCell) {\n return null;\n }\n const colToRight = this.beans.visibleCols.getColAfter(lastCell.column);\n if (!colToRight) {\n return null;\n }\n return {\n rowIndex: lastCell.rowIndex,\n column: colToRight,\n rowPinned: lastCell.rowPinned\n };\n }\n getCellBelow(lastCell) {\n if (!lastCell) {\n return null;\n }\n const adjustedLastCell = this.rowSpanSvc?.getCellEnd(lastCell) ?? lastCell;\n const rowBelow = _getRowBelow(this.beans, adjustedLastCell, true);\n if (rowBelow) {\n return {\n rowIndex: rowBelow.rowIndex,\n column: lastCell.column,\n rowPinned: rowBelow.rowPinned\n };\n }\n return null;\n }\n getCellAbove(lastCell) {\n if (!lastCell) {\n return null;\n }\n const adjustedLastCell = this.rowSpanSvc?.getCellStart(lastCell) ?? lastCell;\n const rowAbove = _getRowAbove(\n this.beans,\n {\n rowIndex: adjustedLastCell.rowIndex,\n rowPinned: adjustedLastCell.rowPinned\n },\n true\n );\n if (rowAbove) {\n return {\n rowIndex: rowAbove.rowIndex,\n column: lastCell.column,\n rowPinned: rowAbove.rowPinned\n };\n }\n return null;\n }\n getNextTabbedCell(gridCell, backwards) {\n if (backwards) {\n return this.getNextTabbedCellBackwards(gridCell);\n }\n return this.getNextTabbedCellForwards(gridCell);\n }\n getNextTabbedCellForwards(gridCell) {\n const { visibleCols, pagination } = this.beans;\n const displayedColumns = visibleCols.allCols;\n let newRowIndex = gridCell.rowIndex;\n let newFloating = gridCell.rowPinned;\n let newColumn = visibleCols.getColAfter(gridCell.column);\n if (!newColumn) {\n newColumn = displayedColumns[0];\n const rowBelow = _getRowBelow(this.beans, gridCell, true);\n if (_missing(rowBelow)) {\n return null;\n }\n if (!rowBelow.rowPinned && !(pagination?.isRowInPage(rowBelow.rowIndex) ?? true)) {\n return null;\n }\n newRowIndex = rowBelow ? rowBelow.rowIndex : null;\n newFloating = rowBelow ? rowBelow.rowPinned : null;\n }\n return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating };\n }\n getNextTabbedCellBackwards(gridCell) {\n const { beans } = this;\n const { visibleCols, pagination } = beans;\n const displayedColumns = visibleCols.allCols;\n let newRowIndex = gridCell.rowIndex;\n let newFloating = gridCell.rowPinned;\n let newColumn = visibleCols.getColBefore(gridCell.column);\n if (!newColumn) {\n newColumn = _last(displayedColumns);\n const rowAbove = _getRowAbove(beans, { rowIndex: gridCell.rowIndex, rowPinned: gridCell.rowPinned }, true);\n if (_missing(rowAbove)) {\n return null;\n }\n if (!rowAbove.rowPinned && !(pagination?.isRowInPage(rowAbove.rowIndex) ?? true)) {\n return null;\n }\n newRowIndex = rowAbove ? rowAbove.rowIndex : null;\n newFloating = rowAbove ? rowAbove.rowPinned : null;\n }\n return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating };\n }\n isSuppressNavigable(column, rowNode) {\n const { suppressNavigable } = column.colDef;\n if (typeof suppressNavigable === \"boolean\") {\n return suppressNavigable;\n }\n if (typeof suppressNavigable === \"function\") {\n const params = column.createColumnFunctionCallbackParams(rowNode);\n const userFunc = suppressNavigable;\n return userFunc(params);\n }\n return false;\n }\n};\n\n// packages/ag-grid-community/src/navigation/navigationApi.ts\nfunction getFocusedCell(beans) {\n return beans.focusSvc.getFocusedCell();\n}\nfunction clearFocusedCell(beans) {\n return beans.focusSvc.clearFocusedCell();\n}\nfunction setFocusedCell(beans, rowIndex, colKey, rowPinned) {\n beans.focusSvc.setFocusedCell({ rowIndex, column: colKey, rowPinned, forceBrowserFocus: true });\n}\nfunction tabToNextCell(beans, event) {\n return beans.navigation?.tabToNextCell(false, event) ?? false;\n}\nfunction tabToPreviousCell(beans, event) {\n return beans.navigation?.tabToNextCell(true, event) ?? false;\n}\nfunction setFocusedHeader(beans, colKey, floatingFilter = false) {\n const headerPosition = beans.headerNavigation?.getHeaderPositionForColumn(colKey, floatingFilter);\n if (!headerPosition) {\n return;\n }\n beans.focusSvc.focusHeaderPosition({ headerPosition });\n}\n\n// packages/ag-grid-community/src/components/framework/unwrapUserComp.ts\nfunction _unwrapUserComp(comp) {\n const compAsAny = comp;\n const isProxy = compAsAny?.getFrameworkComponentInstance != null;\n return isProxy ? compAsAny.getFrameworkComponentInstance() : comp;\n}\n\n// packages/ag-grid-community/src/edit/editModelService.ts\nvar EditModelService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"editModelSvc\";\n this.edits = /* @__PURE__ */ new Map();\n this.cellValidations = new EditCellValidationModel();\n this.rowValidations = new EditRowValidationModel();\n // during some operations, we want to always return false from `hasEdits`\n this.suspendEdits = false;\n }\n suspend(suspend) {\n this.suspendEdits = suspend;\n }\n removeEdits({ rowNode, column }) {\n if (!this.hasEdits({ rowNode }) || !rowNode) {\n return;\n }\n const editRow = this.getEditRow(rowNode);\n if (column) {\n editRow.delete(column);\n } else {\n editRow.clear();\n }\n if (editRow.size === 0) {\n this.edits.delete(rowNode);\n }\n }\n getEditRow(rowNode, params = {}) {\n if (this.suspendEdits) {\n return void 0;\n }\n if (this.edits.size === 0) {\n return void 0;\n }\n const edits = rowNode && this.edits.get(rowNode);\n if (edits) {\n return edits;\n }\n if (params.checkSiblings) {\n const pinnedSibling = rowNode.pinnedSibling;\n if (pinnedSibling) {\n return this.getEditRow(pinnedSibling);\n }\n }\n return void 0;\n }\n getEditRowDataValue(rowNode, { checkSiblings } = {}) {\n if (!rowNode || this.edits.size === 0) {\n return void 0;\n }\n const editRow = this.getEditRow(rowNode);\n const pinnedSibling = rowNode.pinnedSibling;\n const siblingRow = checkSiblings && pinnedSibling && this.getEditRow(pinnedSibling);\n if (!editRow && !siblingRow) {\n return void 0;\n }\n const data = { ...rowNode.data };\n const applyEdits = (edits, data2) => edits.forEach(({ editorValue, pendingValue }, column) => {\n const value = editorValue === void 0 ? pendingValue : editorValue;\n if (value !== UNEDITED) {\n data2[column.getColId()] = value;\n }\n });\n if (editRow) {\n applyEdits(editRow, data);\n }\n if (siblingRow) {\n applyEdits(siblingRow, data);\n }\n return data;\n }\n getEdit(position = {}, params) {\n const { rowNode, column } = position;\n const edits = this.edits;\n if (this.suspendEdits || edits.size === 0 || !rowNode || !column) {\n return void 0;\n }\n const edit = edits.get(rowNode)?.get(column);\n if (edit) {\n return edit;\n }\n if (params?.checkSiblings) {\n const pinnedSibling = rowNode.pinnedSibling;\n if (pinnedSibling) {\n return edits.get(pinnedSibling)?.get(column);\n }\n }\n return void 0;\n }\n getEditMap(copy = true) {\n if (this.suspendEdits || this.edits.size === 0) {\n return /* @__PURE__ */ new Map();\n }\n if (!copy) {\n return this.edits;\n }\n const map = /* @__PURE__ */ new Map();\n this.edits.forEach((editRow, rowNode) => {\n const newEditRow = /* @__PURE__ */ new Map();\n editRow.forEach(\n ({ editorState: _, ...cellData }, column) => (\n // Ensure we copy the cell data to avoid reference issues\n newEditRow.set(column, { ...cellData })\n )\n );\n map.set(rowNode, newEditRow);\n });\n return map;\n }\n setEditMap(newEdits) {\n this.edits.clear();\n newEdits.forEach((editRow, rowNode) => {\n const newRow = /* @__PURE__ */ new Map();\n editRow.forEach(\n (cellData, column) => (\n // Ensure we copy the cell data to avoid reference issues\n newRow.set(column, { ...cellData })\n )\n );\n this.edits.set(rowNode, newRow);\n });\n }\n setEdit(position, edit) {\n const edits = this.edits;\n if (edits.size === 0 || !edits.has(position.rowNode)) {\n edits.set(position.rowNode, /* @__PURE__ */ new Map());\n }\n const currentEdit = this.getEdit(position);\n const updatedEdit = {\n editorState: {\n isCancelAfterEnd: void 0,\n isCancelBeforeStart: void 0\n },\n ...currentEdit,\n ...edit\n };\n this.getEditRow(position.rowNode).set(position.column, updatedEdit);\n return updatedEdit;\n }\n clearEditValue(position) {\n const { rowNode, column } = position;\n if (!rowNode) {\n return;\n }\n const update = (edit2) => {\n edit2.editorValue = void 0;\n edit2.pendingValue = edit2.sourceValue;\n edit2.state = \"changed\";\n };\n if (!column) {\n this.getEditRow(rowNode)?.forEach(update);\n return;\n }\n const edit = this.getEdit(position);\n if (edit) {\n update(edit);\n }\n }\n getState(position) {\n if (this.suspendEdits) {\n return void 0;\n }\n return this.getEdit(position)?.state;\n }\n getEditPositions(editMap) {\n if (this.suspendEdits || (editMap ?? this.edits).size === 0) {\n return [];\n }\n const positions = [];\n (editMap ?? this.edits).forEach((editRow, rowNode) => {\n for (const column of editRow.keys()) {\n const { editorState: _, ...rest } = editRow.get(column);\n positions.push({\n rowNode,\n column,\n ...rest\n });\n }\n });\n return positions;\n }\n hasRowEdits(rowNode, params) {\n if (this.suspendEdits) {\n return false;\n }\n if (this.edits.size === 0) {\n return false;\n }\n const rowEdits = this.getEditRow(rowNode, params);\n return !!rowEdits;\n }\n hasEdits(position = {}, params = {}) {\n if (this.suspendEdits) {\n return false;\n }\n if (this.edits.size === 0) {\n return false;\n }\n const { rowNode, column } = position;\n const { withOpenEditor } = params;\n if (rowNode) {\n const rowEdits = this.getEditRow(rowNode, params);\n if (!rowEdits) {\n return false;\n }\n if (column) {\n if (withOpenEditor) {\n return this.getEdit(position)?.state === \"editing\";\n }\n return rowEdits.has(column);\n }\n if (rowEdits.size !== 0) {\n if (withOpenEditor) {\n return Array.from(rowEdits.values()).some(({ state }) => state === \"editing\");\n }\n return true;\n }\n return false;\n }\n if (withOpenEditor) {\n return this.getEditPositions().some(({ state }) => state === \"editing\");\n }\n return this.edits.size > 0;\n }\n start(position) {\n const map = this.getEditRow(position.rowNode) ?? /* @__PURE__ */ new Map();\n const { rowNode, column } = position;\n if (column && !map.has(column)) {\n map.set(column, {\n editorValue: void 0,\n pendingValue: UNEDITED,\n sourceValue: this.beans.valueSvc.getValue(column, rowNode, \"data\"),\n state: \"editing\",\n editorState: {\n isCancelAfterEnd: void 0,\n isCancelBeforeStart: void 0\n }\n });\n }\n this.edits.set(rowNode, map);\n }\n stop(position, preserveBatch, cancel) {\n if (!this.hasEdits(position)) {\n return;\n }\n if (preserveBatch) {\n const edit = this.getEditRow(position.rowNode)?.get(position.column);\n if (edit && (edit.pendingValue === UNEDITED || edit.pendingValue === edit.sourceValue)) {\n this.removeEdits(position);\n } else if (edit && cancel) {\n edit.editorValue = void 0;\n }\n } else {\n this.removeEdits(position);\n }\n }\n clear() {\n for (const pendingRowEdits of this.edits.values()) {\n pendingRowEdits.clear();\n }\n this.edits.clear();\n }\n getCellValidationModel() {\n return this.cellValidations;\n }\n getRowValidationModel() {\n return this.rowValidations;\n }\n setCellValidationModel(model) {\n this.cellValidations = model;\n }\n setRowValidationModel(model) {\n this.rowValidations = model;\n }\n destroy() {\n super.destroy();\n this.clear();\n }\n};\nvar EditCellValidationModel = class {\n constructor() {\n this.cellValidations = /* @__PURE__ */ new Map();\n }\n getCellValidation(position) {\n const { rowNode, column } = position || {};\n return this.cellValidations?.get(rowNode)?.get(column);\n }\n hasCellValidation(position) {\n if (!position?.rowNode || !position.column) {\n return this.cellValidations.size > 0;\n }\n return !!this.getCellValidation(position);\n }\n setCellValidation(position, validation) {\n const { rowNode, column } = position;\n if (!this.cellValidations.has(rowNode)) {\n this.cellValidations.set(rowNode, /* @__PURE__ */ new Map());\n }\n this.cellValidations.get(rowNode).set(column, validation);\n }\n clearCellValidation(position) {\n const { rowNode, column } = position;\n this.cellValidations.get(rowNode)?.delete(column);\n }\n setCellValidationMap(validationMap) {\n this.cellValidations = validationMap;\n }\n getCellValidationMap() {\n return this.cellValidations;\n }\n clearCellValidationMap() {\n this.cellValidations.clear();\n }\n};\nvar EditRowValidationModel = class {\n constructor() {\n this.rowValidations = /* @__PURE__ */ new Map();\n }\n getRowValidation(position) {\n const { rowNode } = position || {};\n return this.rowValidations.get(rowNode);\n }\n hasRowValidation(position) {\n if (!position?.rowNode) {\n return this.rowValidations.size > 0;\n }\n return !!this.getRowValidation(position);\n }\n setRowValidation({ rowNode }, rowValidation) {\n this.rowValidations.set(rowNode, rowValidation);\n }\n clearRowValidation({ rowNode }) {\n this.rowValidations.delete(rowNode);\n }\n setRowValidationMap(validationMap) {\n this.rowValidations = validationMap;\n }\n getRowValidationMap() {\n return this.rowValidations;\n }\n clearRowValidationMap() {\n this.rowValidations.clear();\n }\n};\n\n// packages/ag-grid-community/src/edit/utils/controllers.ts\nfunction _getRowCtrl(beans, inputs = {}) {\n const { rowIndex, rowId, rowCtrl, rowPinned } = inputs;\n if (rowCtrl) {\n return rowCtrl;\n }\n const { rowModel, rowRenderer } = beans;\n let { rowNode } = inputs;\n if (!rowNode) {\n if (rowId) {\n rowNode = _getRowById(beans, rowId, rowPinned);\n } else if (rowIndex != null) {\n rowNode = rowModel.getRow(rowIndex);\n }\n }\n return rowNode ? rowRenderer.getRowCtrlByNode(rowNode) : void 0;\n}\nfunction _getCellCtrl(beans, inputs = {}) {\n const { cellCtrl, colId, columnId, column } = inputs;\n if (cellCtrl) {\n return cellCtrl;\n }\n const actualColumn = beans.colModel.getCol(colId ?? columnId ?? _getColId(column));\n const rowCtrl = inputs.rowCtrl ?? _getRowCtrl(beans, inputs);\n const result = rowCtrl?.getCellCtrl(actualColumn) ?? void 0;\n if (result) {\n return result;\n }\n const rowNode = inputs.rowNode ?? rowCtrl?.rowNode;\n if (rowNode) {\n return beans.rowRenderer.getCellCtrls([rowNode], [actualColumn])?.[0];\n }\n return void 0;\n}\nfunction _stopEditing(beans) {\n const { editSvc } = beans;\n if (editSvc?.isBatchEditing()) {\n _syncFromEditors(beans, { persist: true });\n _destroyEditors(beans);\n } else {\n editSvc?.stopEditing(void 0, { source: \"api\" });\n }\n}\nfunction _addStopEditingWhenGridLosesFocus(bean, beans, viewports) {\n const { gos, popupSvc } = beans;\n if (!gos.get(\"stopEditingWhenCellsLoseFocus\")) {\n return;\n }\n const focusOutListener = (event) => {\n const elementWithFocus = event.relatedTarget;\n if (_getTabIndex(elementWithFocus) === null) {\n _stopEditing(beans);\n return;\n }\n let clickInsideGrid = (\n // see if click came from inside the viewports\n viewports.some((viewport) => viewport.contains(elementWithFocus)) && // and also that it's not from a detail grid\n gos.isElementInThisInstance(elementWithFocus)\n );\n if (!clickInsideGrid) {\n clickInsideGrid = !!popupSvc && (popupSvc.getActivePopups().some((popup) => popup.contains(elementWithFocus)) || popupSvc.isElementWithinCustomPopup(elementWithFocus));\n }\n if (!clickInsideGrid) {\n _stopEditing(beans);\n }\n };\n for (const viewport of viewports) {\n bean.addManagedElementListeners(viewport, { focusout: focusOutListener });\n }\n}\nfunction _getColId(column) {\n if (!column) {\n return void 0;\n }\n if (typeof column === \"string\") {\n return column;\n }\n return column.getColId();\n}\n\n// packages/ag-grid-community/src/edit/utils/editors.ts\nvar UNEDITED = Symbol(\"unedited\");\nvar getCellEditorInstances = (beans, params = {}) => {\n const ctrls = beans.rowRenderer.getCellCtrls(params.rowNodes, params.columns);\n const editors = new Array(ctrls.length);\n let count = 0;\n for (let i = 0, len = ctrls.length; i < len; ++i) {\n const ctrl = ctrls[i];\n const cellEditor = ctrl.comp?.getCellEditor();\n if (cellEditor) {\n editors[count++] = _unwrapUserComp(cellEditor);\n }\n }\n editors.length = count;\n return editors;\n};\nfunction _setupEditors(beans, editingCells, position, key, event, cellStartedEdit) {\n if (editingCells.length === 0 && position?.rowNode && position?.column) {\n _setupEditor(beans, position, { key, event, cellStartedEdit });\n }\n const { valueSvc, editSvc, editModelSvc } = beans;\n const { rowNode, column } = position ?? {};\n for (const cellPosition of editingCells) {\n const { rowNode: cellRowNode, column: cellColumn } = cellPosition;\n const curCellCtrl = _getCellCtrl(beans, cellPosition);\n if (!curCellCtrl) {\n if (cellRowNode && cellColumn) {\n const oldValue = valueSvc.getValue(cellColumn, cellRowNode, \"data\");\n const isNewValueCell = position?.rowNode === cellRowNode && position?.column === cellColumn;\n const cellStartValue = isNewValueCell && key || void 0;\n const newValue = cellStartValue ?? editSvc?.getCellDataValue(cellPosition) ?? valueSvc.getValueForDisplay({\n column: cellColumn,\n node: cellRowNode,\n from: \"edit\"\n })?.value ?? oldValue ?? UNEDITED;\n editModelSvc?.setEdit(cellPosition, {\n pendingValue: getNormalisedFormula(beans, newValue, false, cellColumn),\n sourceValue: oldValue,\n state: \"editing\"\n });\n }\n continue;\n }\n const shouldStartEditing2 = cellStartedEdit && rowNode === curCellCtrl.rowNode && curCellCtrl.column === column;\n _setupEditor(\n beans,\n { rowNode, column: curCellCtrl.column },\n {\n key: shouldStartEditing2 ? key : null,\n event: shouldStartEditing2 ? event : null,\n cellStartedEdit: shouldStartEditing2 && cellStartedEdit\n }\n );\n }\n}\nfunction _sourceAndPendingDiffer({\n pendingValue,\n sourceValue\n}) {\n if (pendingValue === UNEDITED) {\n pendingValue = sourceValue;\n }\n return pendingValue !== sourceValue;\n}\nfunction _filterChangedEdits(edits) {\n const result = /* @__PURE__ */ new Map();\n for (const [rowNode, editRow] of edits) {\n const filtered = /* @__PURE__ */ new Map();\n for (const [column, editValue] of editRow) {\n if (_sourceAndPendingDiffer(editValue)) {\n filtered.set(column, editValue);\n }\n }\n if (filtered.size > 0) {\n result.set(rowNode, filtered);\n }\n }\n return result;\n}\nfunction _setupEditor(beans, position, params) {\n const { key, event, cellStartedEdit, silent } = params ?? {};\n const { editModelSvc, gos, userCompFactory } = beans;\n const cellCtrl = _getCellCtrl(beans, position);\n const editorComp = cellCtrl?.comp?.getCellEditor();\n const editorParams = _createEditorParams(beans, position, key, cellStartedEdit && !silent);\n const previousEdit = editModelSvc?.getEdit(position);\n const newValue = editorParams.value ?? previousEdit?.sourceValue;\n if (editorComp) {\n editModelSvc?.setEdit(position, {\n editorValue: getNormalisedFormula(beans, newValue, true, position.column),\n state: \"editing\"\n });\n editorComp.refresh?.(editorParams);\n return;\n }\n const colDef = position.column.getColDef();\n const compDetails = _getCellEditorDetails(userCompFactory, colDef, editorParams);\n if (!compDetails) {\n return;\n }\n const { popupFromSelector, popupPositionFromSelector } = compDetails;\n const popup = popupFromSelector ?? !!colDef.cellEditorPopup;\n const popupLocation = popupPositionFromSelector ?? colDef.cellEditorPopupPosition;\n checkAndPreventDefault(compDetails.params, event);\n if (!cellCtrl) {\n return;\n }\n const { rangeFeature, rowCtrl, comp, onEditorAttachedFuncs } = cellCtrl;\n editModelSvc?.setEdit(position, {\n editorValue: getNormalisedFormula(beans, newValue, true, position.column),\n state: \"editing\",\n // Reset lifecycle flags for this new editor session. Previous sessions may have left\n // cellStartedEditing/cellStoppedEditing set on a reused row node.\n editorState: { cellStartedEditing: void 0, cellStoppedEditing: void 0 }\n });\n cellCtrl.editCompDetails = compDetails;\n onEditorAttachedFuncs.push(() => rangeFeature?.unsetComp());\n comp?.setEditDetails(compDetails, popup, popupLocation, gos.get(\"reactiveCustomComponents\"));\n rowCtrl?.refreshRow({ suppressFlash: true });\n dispatchEditingStarted(beans, position, event, newValue, silent);\n}\nfunction dispatchEditingStarted(beans, position, event, value, silent) {\n const { editSvc, editModelSvc } = beans;\n const edit = editModelSvc?.getEdit(position);\n if (!silent && edit?.state === \"editing\" && !edit?.editorState?.cellStartedEditing) {\n editSvc?.dispatchCellEvent(position, event, \"cellEditingStarted\", { value });\n editModelSvc?.setEdit(position, { editorState: { cellStartedEditing: true } });\n }\n}\nfunction _valueFromEditor(beans, cellEditor, params) {\n const noValueResult = { editorValueExists: false };\n if (_hasValidationRules(beans)) {\n const validationErrors = cellEditor.getValidationErrors?.();\n if ((validationErrors?.length ?? 0) > 0) {\n return noValueResult;\n }\n }\n if (params?.isCancelling) {\n return noValueResult;\n }\n if (params?.isStopping) {\n const isCancelAfterEnd = cellEditor?.isCancelAfterEnd?.();\n if (isCancelAfterEnd) {\n return { ...noValueResult, isCancelAfterEnd };\n }\n }\n const editorValue = cellEditor.getValue();\n return {\n editorValue,\n editorValueExists: true\n };\n}\nfunction _createEditorParams(beans, position, key, cellStartedEdit) {\n const { valueSvc, gos, editSvc } = beans;\n const enableGroupEditing = beans.gos.get(\"enableGroupEdit\");\n const cellCtrl = _getCellCtrl(beans, position);\n const rowIndex = position.rowNode?.rowIndex ?? void 0;\n const batchEdit = editSvc?.isBatchEditing();\n const agColumn = beans.colModel.getCol(position.column.getId());\n const { rowNode, column } = position;\n const editor = cellCtrl.comp?.getCellEditor();\n const cellDataValue = editSvc?.getCellDataValue(position);\n const initialNewValue = cellDataValue === void 0 ? editor ? _valueFromEditor(beans, editor)?.editorValue : void 0 : cellDataValue;\n const value = initialNewValue === UNEDITED ? valueSvc.getValueForDisplay({ column: agColumn, node: rowNode, from: \"edit\" })?.value : initialNewValue;\n let paramsValue = enableGroupEditing ? initialNewValue : value;\n if (column.isAllowFormula() && beans.formula?.isFormula(paramsValue)) {\n paramsValue = beans.formula?.normaliseFormula(paramsValue, true) ?? paramsValue;\n }\n return _addGridCommonParams(gos, {\n value: paramsValue,\n eventKey: key ?? null,\n column,\n colDef: column.getColDef(),\n rowIndex,\n node: rowNode,\n data: rowNode.data,\n cellStartedEdit: !!cellStartedEdit,\n onKeyDown: cellCtrl?.onKeyDown.bind(cellCtrl),\n stopEditing: (suppressNavigateAfterEdit) => {\n editSvc.stopEditing(position, { source: batchEdit ? \"ui\" : \"api\", suppressNavigateAfterEdit });\n _destroyEditor(beans, position, {});\n },\n eGridCell: cellCtrl?.eGui,\n parseValue: (newValue) => valueSvc.parseValue(agColumn, rowNode, newValue, cellCtrl?.value),\n formatValue: cellCtrl?.formatValue.bind(cellCtrl),\n validate: () => {\n editSvc?.validateEdit();\n }\n });\n}\nfunction _purgeUnchangedEdits(beans, includeEditing) {\n const { editModelSvc } = beans;\n editModelSvc?.getEditMap().forEach((editRow, rowNode) => {\n editRow.forEach((edit, column) => {\n if (!includeEditing && (edit.state === \"editing\" || edit.pendingValue === UNEDITED)) {\n return;\n }\n if (!_sourceAndPendingDiffer(edit) && (edit.state !== \"editing\" || includeEditing)) {\n editModelSvc?.removeEdits({ rowNode, column });\n }\n });\n });\n}\nfunction _refreshEditorOnColDefChanged(beans, cellCtrl) {\n const editor = cellCtrl.comp?.getCellEditor();\n if (!editor?.refresh) {\n return;\n }\n const { eventKey, cellStartedEdit } = cellCtrl.editCompDetails.params;\n const { column } = cellCtrl;\n const editorParams = _createEditorParams(beans, cellCtrl, eventKey, cellStartedEdit);\n const colDef = column.getColDef();\n const compDetails = _getCellEditorDetails(beans.userCompFactory, colDef, editorParams);\n editor.refresh(checkAndPreventDefault(compDetails.params, eventKey));\n}\nfunction checkAndPreventDefault(params, event) {\n if (event instanceof KeyboardEvent && params.column.getColDef().cellEditor === \"agNumberCellEditor\") {\n params.suppressPreventDefault = [\"-\", \"+\", \".\", \"e\"].includes(event?.key ?? \"\") || params.suppressPreventDefault;\n } else {\n event?.preventDefault?.();\n }\n return params;\n}\nfunction _syncFromEditors(beans, params) {\n for (const cellId of beans.editModelSvc?.getEditPositions() ?? []) {\n const cellCtrl = _getCellCtrl(beans, cellId);\n if (!cellCtrl) {\n continue;\n }\n const editor = cellCtrl.comp?.getCellEditor();\n if (!editor) {\n continue;\n }\n const { editorValue, editorValueExists, isCancelAfterEnd } = _valueFromEditor(beans, editor, params);\n if (isCancelAfterEnd) {\n const { cellStartedEditing, cellStoppedEditing } = beans.editModelSvc?.getEdit(cellId)?.editorState || {};\n beans.editModelSvc?.setEdit(cellId, {\n editorState: { isCancelAfterEnd, cellStartedEditing, cellStoppedEditing }\n });\n }\n _syncFromEditor(beans, cellId, editorValue, void 0, !editorValueExists, params);\n }\n}\nfunction _syncFromEditor(beans, position, editorValue, _source, valueSameAsSource, params) {\n const { editModelSvc, valueSvc } = beans;\n if (!editModelSvc) {\n return;\n }\n const { rowNode, column } = position;\n if (!(rowNode && column)) {\n return;\n }\n let edit = editModelSvc.getEdit(position);\n if (edit?.sourceValue === void 0) {\n const pendingValue = edit ? getNormalisedFormula(beans, edit.editorValue, false, column) : UNEDITED;\n const editValue = {\n sourceValue: valueSvc.getValue(column, rowNode, \"data\"),\n pendingValue\n };\n if (params?.persist) {\n editValue.state = \"changed\";\n }\n edit = editModelSvc.setEdit(position, editValue);\n }\n editModelSvc.setEdit(position, {\n editorValue: valueSameAsSource ? getNormalisedFormula(beans, edit.sourceValue, true, column) : editorValue\n });\n if (params?.persist) {\n _persistEditorValue(beans, position);\n }\n}\nfunction getNormalisedFormula(beans, value, forEditing, column) {\n const { formula } = beans;\n if (column.isAllowFormula() && formula?.isFormula(value)) {\n return formula?.normaliseFormula(value, forEditing) ?? value;\n }\n return value;\n}\nfunction _persistEditorValue(beans, position) {\n const { editModelSvc } = beans;\n const edit = editModelSvc?.getEdit(position);\n const pendingValue = getNormalisedFormula(beans, edit?.editorValue, false, position.column);\n const editValue = { pendingValue };\n if (!edit?.editorState?.cellStoppedEditing && edit?.state !== \"editing\") {\n editValue.state = \"changed\";\n }\n editModelSvc?.setEdit(position, editValue);\n}\nfunction _destroyEditors(beans, edits, params = {}) {\n if (!edits) {\n edits = beans.editModelSvc?.getEditPositions();\n }\n if (edits) {\n for (const cellPosition of edits) {\n _destroyEditor(beans, cellPosition, params);\n }\n }\n}\nfunction _destroyEditor(beans, position, params, cellCtrl = _getCellCtrl(beans, position)) {\n const editModelSvc = beans.editModelSvc;\n const edit = editModelSvc?.getEdit(position);\n let state;\n if (edit && edit.state !== \"editing\" && edit.editorState?.cellStoppedEditing) {\n state = edit.state;\n } else {\n state = \"changed\";\n }\n if (!cellCtrl) {\n if (edit) {\n editModelSvc?.setEdit(position, { state });\n }\n return;\n }\n const comp = cellCtrl.comp;\n const cellEditor = comp?.getCellEditor();\n if (comp && !cellEditor) {\n cellCtrl?.refreshCell();\n if (edit) {\n editModelSvc?.setEdit(position, { state });\n const args = beans.gos.get(\"enableGroupEdit\") ? _enabledGroupEditStoppedArgs(edit, params?.cancel) : {\n valueChanged: false,\n newValue: void 0,\n oldValue: edit.sourceValue\n };\n dispatchEditingStopped(beans, position, args, params);\n }\n return;\n }\n if (_hasValidationRules(beans)) {\n const errorMessages = edit && cellEditor?.getValidationErrors?.();\n const cellValidationModel = editModelSvc?.getCellValidationModel();\n if (errorMessages?.length) {\n cellValidationModel?.setCellValidation(position, { errorMessages });\n } else {\n cellValidationModel?.clearCellValidation(position);\n }\n }\n if (edit) {\n editModelSvc?.setEdit(position, { state });\n }\n comp?.setEditDetails();\n comp?.refreshEditStyles(false, false);\n cellCtrl?.refreshCell({ force: true, suppressFlash: true });\n const latest = editModelSvc?.getEdit(position);\n if (latest && latest.state !== \"editing\") {\n const cancel = params?.cancel;\n const args = beans.gos.get(\"enableGroupEdit\") ? _enabledGroupEditStoppedArgs(latest, cancel) : _cellEditStoppedArgs(latest, edit, cancel);\n dispatchEditingStopped(beans, position, args, params);\n }\n}\nfunction _enabledGroupEditStoppedArgs(latest, cancel) {\n const { sourceValue, pendingValue } = latest;\n let newValue;\n if (!cancel && pendingValue !== UNEDITED) {\n newValue = pendingValue;\n }\n return {\n valueChanged: !cancel && _sourceAndPendingDiffer(latest),\n newValue,\n oldValue: sourceValue,\n value: sourceValue\n };\n}\nfunction _cellEditStoppedArgs(latest, edit, cancel) {\n if (cancel || latest.editorState.isCancelAfterEnd) {\n return {\n valueChanged: false,\n newValue: void 0,\n oldValue: latest.sourceValue\n };\n }\n let newValue = latest.editorValue;\n if (newValue == null || newValue === UNEDITED) {\n newValue = edit?.pendingValue;\n }\n if (newValue === UNEDITED) {\n newValue = void 0;\n }\n return {\n valueChanged: _sourceAndPendingDiffer(latest),\n newValue,\n oldValue: latest.sourceValue\n };\n}\nfunction dispatchEditingStopped(beans, position, args, { silent, event } = {}) {\n const { editSvc, editModelSvc } = beans;\n const latest = editModelSvc?.getEdit(position);\n const { editorState } = latest || {};\n const { isCancelBeforeStart, cellStartedEditing, cellStoppedEditing } = editorState || {};\n if (!silent && !isCancelBeforeStart && cellStartedEditing && !cellStoppedEditing) {\n editSvc?.dispatchCellEvent(position, event, \"cellEditingStopped\", args);\n editModelSvc?.setEdit(position, { editorState: { cellStoppedEditing: true } });\n }\n}\nfunction _columnDefsRequireValidation(columnDefs) {\n if (!columnDefs) {\n return false;\n }\n for (let i = 0, len = columnDefs.length; i < len; ++i) {\n const colDef = columnDefs[i];\n const params = colDef.cellEditorParams;\n if (!params || !colDef.editable && !colDef.groupRowEditable) {\n continue;\n }\n if (params.minLength !== void 0 || params.maxLength !== void 0 || params.getValidationErrors !== void 0 || params.min !== void 0 || params.max !== void 0) {\n return true;\n }\n }\n return false;\n}\nfunction _editorsRequireValidation(beans) {\n const ctrls = beans.rowRenderer.getCellCtrls();\n for (let i = 0, len = ctrls.length; i < len; ++i) {\n const ctrl = ctrls[i];\n const cellEditor = ctrl.comp?.getCellEditor();\n if (cellEditor) {\n const editor = _unwrapUserComp(cellEditor);\n if (editor.getValidationElement || editor.getValidationErrors) {\n return true;\n }\n }\n }\n return false;\n}\nfunction _hasValidationRules(beans) {\n return !!beans.gos.get(\"getFullRowEditValidationErrors\") || _columnDefsRequireValidation(beans.colModel.getColumnDefs()) || _editorsRequireValidation(beans);\n}\nfunction _populateModelValidationErrors(beans, force) {\n if (!(force || _hasValidationRules(beans))) {\n return;\n }\n const cellValidationModel = new EditCellValidationModel();\n const { ariaAnnounce, localeSvc, editModelSvc, gos } = beans;\n const includeRows = gos.get(\"editType\") === \"fullRow\";\n const translate = _getLocaleTextFunc(localeSvc);\n const ariaValidationErrorPrefix = translate(\"ariaValidationErrorPrefix\", \"Cell Editor Validation\");\n const rowCtrlSet = /* @__PURE__ */ new Set();\n for (const ctrl of beans.rowRenderer.getCellCtrls()) {\n const cellEditorComp = ctrl.comp?.getCellEditor();\n if (!cellEditorComp) {\n continue;\n }\n const editor = _unwrapUserComp(cellEditorComp);\n const { rowNode, column } = ctrl;\n const errorMessages = editor.getValidationErrors?.() ?? [];\n const el = editor.getValidationElement?.(false) || !editor.isPopup?.() && ctrl.eGui;\n if (el) {\n const isInvalid = errorMessages != null && errorMessages.length > 0;\n const invalidMessage = isInvalid ? errorMessages.join(\". \") : \"\";\n _setAriaInvalid(el, isInvalid);\n if (isInvalid) {\n ariaAnnounce.announceValue(`${ariaValidationErrorPrefix} ${errorMessages}`, \"editorValidation\");\n }\n if (el instanceof HTMLInputElement) {\n el.setCustomValidity(invalidMessage);\n } else {\n el.classList.toggle(\"invalid\", isInvalid);\n }\n }\n if (errorMessages?.length > 0) {\n cellValidationModel.setCellValidation(\n {\n rowNode,\n column\n },\n {\n errorMessages\n }\n );\n }\n rowCtrlSet.add(ctrl.rowCtrl);\n }\n _syncFromEditors(beans, { persist: false });\n editModelSvc?.setCellValidationModel(cellValidationModel);\n if (includeRows) {\n const rowValidations = _generateRowValidationErrors(beans);\n editModelSvc?.setRowValidationModel(rowValidations);\n }\n for (const rowCtrl of rowCtrlSet.values()) {\n rowCtrl.rowEditStyleFeature?.applyRowStyles();\n for (const cellCtrl of rowCtrl.getAllCellCtrls()) {\n cellCtrl.tooltipFeature?.refreshTooltip(true);\n cellCtrl.editorTooltipFeature?.refreshTooltip(true);\n cellCtrl.editStyleFeature?.applyCellStyles?.();\n }\n }\n}\nvar _generateRowValidationErrors = (beans) => {\n const rowValidationModel = new EditRowValidationModel();\n const getFullRowEditValidationErrors = beans.gos.get(\"getFullRowEditValidationErrors\");\n const editMap = beans.editModelSvc?.getEditMap();\n if (!editMap) {\n return rowValidationModel;\n }\n for (const rowNode of editMap.keys()) {\n const rowEditMap = editMap.get(rowNode);\n if (!rowEditMap) {\n continue;\n }\n const editorsState = [];\n const { rowIndex, rowPinned } = rowNode;\n for (const column of rowEditMap.keys()) {\n const editValue = rowEditMap.get(column);\n if (!editValue) {\n continue;\n }\n const { editorValue, pendingValue, sourceValue } = editValue;\n const newValue = editorValue ?? (pendingValue === UNEDITED ? void 0 : pendingValue) ?? sourceValue;\n editorsState.push({\n column,\n colId: column.getColId(),\n rowIndex,\n rowPinned,\n oldValue: sourceValue,\n newValue\n });\n }\n const errorMessages = getFullRowEditValidationErrors?.({ editorsState }) ?? [];\n if (errorMessages.length > 0) {\n rowValidationModel.setRowValidation(\n {\n rowNode\n },\n { errorMessages }\n );\n }\n }\n return rowValidationModel;\n};\nfunction _validateEdit(beans) {\n _populateModelValidationErrors(beans, true);\n const map = beans.editModelSvc?.getCellValidationModel().getCellValidationMap();\n if (!map) {\n return null;\n }\n const validations = [];\n map.forEach((rowValidations, rowNode) => {\n rowValidations.forEach(({ errorMessages }, column) => {\n validations.push({\n column,\n rowIndex: rowNode.rowIndex,\n rowPinned: rowNode.rowPinned,\n messages: errorMessages ?? null\n });\n });\n });\n return validations;\n}\n\n// packages/ag-grid-community/src/pinnedRowModel/pinnedRowUtils.ts\nfunction _isManualPinnedRow(rowNode) {\n return !!(rowNode.rowPinned && rowNode.pinnedSibling);\n}\nfunction _getNodesInRangeForSelection(rowModel, float, start, end) {\n const isTop = float === \"top\";\n if (!start) {\n return _getNodesInRangeForSelection(\n rowModel,\n float,\n isTop ? rowModel.getPinnedTopRow(0) : rowModel.getPinnedBottomRow(0),\n end\n );\n }\n if (!end) {\n const count = isTop ? rowModel.getPinnedTopRowCount() : rowModel.getPinnedBottomRowCount();\n return _getNodesInRangeForSelection(\n rowModel,\n float,\n start,\n isTop ? rowModel.getPinnedTopRow(count - 1) : rowModel.getPinnedBottomRow(count - 1)\n );\n }\n let started = false;\n let finished = false;\n const range = [];\n rowModel.forEachPinnedRow(float, (node) => {\n if (node === start && !started) {\n started = true;\n range.push(node);\n return;\n }\n if (started && node === end) {\n finished = true;\n range.push(node);\n return;\n }\n if (started && !finished) {\n range.push(node);\n }\n });\n return range;\n}\n\n// packages/ag-grid-community/src/rendering/cell/cellEvent.ts\nfunction _createCellEvent(beans, domEvent, eventType, { rowNode, column }, value) {\n const event = _addGridCommonParams(beans.gos, {\n type: eventType,\n node: rowNode,\n data: rowNode.data,\n value,\n column,\n colDef: column.getColDef(),\n rowPinned: rowNode.rowPinned,\n event: domEvent,\n rowIndex: rowNode.rowIndex\n });\n return event;\n}\n\n// packages/ag-grid-community/src/rendering/cell/cellKeyboardListenerFeature.ts\nfunction _isDeleteKey(key, alwaysReturnFalseOnBackspace = false) {\n if (key === KeyCode.DELETE) {\n return true;\n }\n if (!alwaysReturnFalseOnBackspace && key === KeyCode.BACKSPACE) {\n return _isMacOsUserAgent();\n }\n return false;\n}\nvar CellKeyboardListenerFeature = class extends BeanStub {\n constructor(cellCtrl, beans, rowNode, rowCtrl) {\n super();\n this.cellCtrl = cellCtrl;\n this.rowNode = rowNode;\n this.rowCtrl = rowCtrl;\n this.beans = beans;\n }\n init() {\n this.eGui = this.cellCtrl.eGui;\n }\n onKeyDown(event) {\n const key = event.key;\n if (key === KeyCode.ENTER && isRowNumberCol(this.cellCtrl.column) && this.beans.rowNumbersSvc?.handleKeyDownOnCell(this.cellCtrl.cellPosition, event)) {\n return;\n }\n switch (key) {\n case KeyCode.ENTER:\n this.onEnterKeyDown(event);\n break;\n case KeyCode.F2:\n this.onF2KeyDown(event);\n break;\n case KeyCode.ESCAPE:\n this.onEscapeKeyDown(event);\n break;\n case KeyCode.TAB:\n this.onTabKeyDown(event);\n break;\n case KeyCode.BACKSPACE:\n case KeyCode.DELETE:\n this.onBackspaceOrDeleteKeyDown(key, event);\n break;\n case KeyCode.DOWN:\n case KeyCode.UP:\n case KeyCode.RIGHT:\n case KeyCode.LEFT:\n this.onNavigationKeyDown(event, key);\n break;\n }\n }\n onNavigationKeyDown(event, key) {\n const { cellCtrl, beans } = this;\n if (beans.editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {\n return;\n }\n if (event.shiftKey && cellCtrl.isRangeSelectionEnabled()) {\n this.onShiftRangeSelect(event);\n } else {\n const currentCellPosition = cellCtrl.getFocusedCellPosition();\n beans.navigation?.navigateToNextCell(event, key, currentCellPosition, true);\n }\n event.preventDefault();\n }\n onShiftRangeSelect(event) {\n const { rangeSvc, navigation } = this.beans;\n if (!rangeSvc) {\n return;\n }\n const endCell = rangeSvc.extendLatestRangeInDirection(event);\n if (!endCell) {\n return;\n }\n if (event.key === KeyCode.LEFT || event.key === KeyCode.RIGHT) {\n navigation?.ensureColumnVisible(endCell.column);\n } else {\n navigation?.ensureRowVisible(endCell.rowIndex);\n }\n }\n onTabKeyDown(event) {\n this.beans.navigation?.onTabKeyDown(this.cellCtrl, event);\n }\n onBackspaceOrDeleteKeyDown(key, event) {\n const { cellCtrl, beans, rowNode } = this;\n const { gos, rangeSvc, eventSvc, editSvc } = beans;\n eventSvc.dispatchEvent({ type: \"keyShortcutChangedCellStart\" });\n if (_isDeleteKey(key, gos.get(\"enableCellEditingOnBackspace\")) && !editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {\n if (rangeSvc && _isCellSelectionEnabled(gos)) {\n rangeSvc.clearCellRangeCellValues({\n dispatchWrapperEvents: true,\n wrapperEventSource: \"deleteKey\"\n });\n } else if (cellCtrl.isCellEditable()) {\n const deleteValue = beans.valueSvc.getDeleteValue(cellCtrl.column, rowNode);\n rowNode.setDataValue(cellCtrl.column, deleteValue, \"cellClear\");\n }\n } else if (!editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {\n beans.editSvc?.startEditing(cellCtrl, { startedEdit: true, event });\n }\n eventSvc.dispatchEvent({ type: \"keyShortcutChangedCellEnd\" });\n }\n onEnterKeyDown(event) {\n const { cellCtrl, beans } = this;\n const { editSvc, navigation } = beans;\n const cellEditing = editSvc?.isEditing(cellCtrl, { withOpenEditor: true });\n const rowNode = cellCtrl.rowNode;\n const rowEditing = editSvc?.isRowEditing(rowNode, { withOpenEditor: true });\n const startEditingAction = (cellCtrl2) => {\n const started = editSvc?.startEditing(cellCtrl2, {\n startedEdit: true,\n event,\n source: \"edit\"\n });\n if (started) {\n event.preventDefault();\n }\n };\n if (cellEditing || rowEditing) {\n if (this.isCtrlEnter(event)) {\n editSvc?.applyBulkEdit(cellCtrl, beans?.rangeSvc?.getCellRanges() || []);\n return;\n }\n _populateModelValidationErrors(beans);\n if (editSvc?.checkNavWithValidation(void 0, event) === \"block-stop\") {\n return;\n }\n if (editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {\n editSvc?.stopEditing(cellCtrl, {\n event,\n source: \"edit\"\n });\n } else if (rowEditing && !cellCtrl.isCellEditable()) {\n editSvc?.stopEditing({ rowNode }, { event, source: \"edit\" });\n } else {\n startEditingAction(cellCtrl);\n }\n } else if (beans.gos.get(\"enterNavigatesVertically\")) {\n const key = event.shiftKey ? KeyCode.UP : KeyCode.DOWN;\n navigation?.navigateToNextCell(null, key, cellCtrl.cellPosition, false);\n } else {\n if (editSvc?.hasValidationErrors()) {\n return;\n }\n if (editSvc?.hasValidationErrors(cellCtrl)) {\n editSvc.revertSingleCellEdit(cellCtrl, true);\n }\n startEditingAction(cellCtrl);\n }\n }\n isCtrlEnter(e) {\n return (e.ctrlKey || e.metaKey) && e.key === KeyCode.ENTER;\n }\n onF2KeyDown(event) {\n const {\n cellCtrl,\n beans: { editSvc }\n } = this;\n const editing = editSvc?.isEditing();\n if (editing) {\n _populateModelValidationErrors(this.beans);\n if (editSvc?.checkNavWithValidation(void 0, event) === \"block-stop\") {\n return;\n }\n }\n editSvc?.startEditing(cellCtrl, { startedEdit: true, event });\n }\n onEscapeKeyDown(event) {\n const {\n cellCtrl,\n beans: { editSvc }\n } = this;\n if (editSvc?.checkNavWithValidation(cellCtrl, event) === \"block-stop\") {\n editSvc.revertSingleCellEdit(cellCtrl);\n }\n setTimeout(() => {\n editSvc?.stopEditing(cellCtrl, {\n event,\n cancel: true\n });\n });\n }\n processCharacter(event) {\n const eventTarget = event.target;\n const eventOnChildComponent = eventTarget !== this.eGui;\n const {\n beans: { editSvc },\n cellCtrl\n } = this;\n if (eventOnChildComponent) {\n return;\n }\n if (editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {\n return;\n }\n const key = event.key;\n if (key === KeyCode.SPACE) {\n this.onSpaceKeyDown(event);\n } else if (editSvc?.isCellEditable(cellCtrl, \"ui\")) {\n if (editSvc?.hasValidationErrors() && !editSvc?.hasValidationErrors(cellCtrl)) {\n return;\n }\n editSvc?.startEditing(cellCtrl, { startedEdit: true, event, source: \"api\", editable: true });\n const compDetails = cellCtrl.editCompDetails;\n const shouldPreventDefault = !compDetails?.params?.suppressPreventDefault;\n if (shouldPreventDefault) {\n event.preventDefault();\n }\n }\n }\n onSpaceKeyDown(event) {\n const { gos, editSvc } = this.beans;\n const { rowNode } = this.cellCtrl;\n if (!editSvc?.isEditing(this.cellCtrl, { withOpenEditor: true }) && _isRowSelection(gos)) {\n this.beans.selectionSvc?.handleSelectionEvent(event, rowNode, \"spaceKey\");\n }\n event.preventDefault();\n }\n};\n\n// packages/ag-grid-community/src/rendering/cell/cellMouseListenerFeature.ts\nvar CellMouseListenerFeature = class extends BeanStub {\n constructor(cellCtrl, beans, column) {\n super();\n this.cellCtrl = cellCtrl;\n this.column = column;\n this.beans = beans;\n }\n onMouseEvent(eventName, mouseEvent) {\n if (_isStopPropagationForAgGrid(mouseEvent)) {\n return;\n }\n switch (eventName) {\n case \"click\":\n this.onCellClicked(mouseEvent);\n break;\n case \"pointerdown\":\n case \"mousedown\":\n case \"touchstart\":\n this.onMouseDown(mouseEvent);\n break;\n case \"dblclick\":\n this.onCellDoubleClicked(mouseEvent);\n break;\n case \"mouseout\":\n this.onMouseOut(mouseEvent);\n break;\n case \"mouseover\":\n this.onMouseOver(mouseEvent);\n break;\n }\n }\n onCellClicked(event) {\n if (this.beans.touchSvc?.handleCellDoubleClick(this, event)) {\n return;\n }\n const { eventSvc, rangeSvc, editSvc, editModelSvc, frameworkOverrides, gos } = this.beans;\n const isMultiKey = event.ctrlKey || event.metaKey;\n const { cellCtrl } = this;\n const { column, cellPosition, rowNode } = cellCtrl;\n const suppressMouseEvent2 = _suppressCellMouseEvent(gos, column, rowNode, event);\n if (rangeSvc && isMultiKey && !suppressMouseEvent2) {\n if (rangeSvc.getCellRangeCount(cellPosition) > 1) {\n rangeSvc.intersectLastRange(true);\n }\n }\n const cellClickedEvent = cellCtrl.createEvent(event, \"cellClicked\");\n cellClickedEvent.isEventHandlingSuppressed = suppressMouseEvent2;\n eventSvc.dispatchEvent(cellClickedEvent);\n const colDef = column.getColDef();\n if (colDef.onCellClicked) {\n window.setTimeout(() => {\n frameworkOverrides.wrapOutgoing(() => {\n colDef.onCellClicked(cellClickedEvent);\n });\n }, 0);\n }\n if (suppressMouseEvent2) {\n return;\n }\n if (editModelSvc?.getState(cellCtrl) !== \"editing\") {\n const editing = editSvc?.isEditing();\n const isRangeSelectionEnabledWhileEditing = editSvc?.isRangeSelectionEnabledWhileEditing();\n const cellValidations = editModelSvc?.getCellValidationModel().getCellValidationMap().size ?? 0;\n const rowValidations = editModelSvc?.getRowValidationModel().getRowValidationMap().size ?? 0;\n if (editing && (isRangeSelectionEnabledWhileEditing || cellValidations > 0 || rowValidations > 0)) {\n return;\n }\n if (editSvc?.shouldStartEditing(cellCtrl, event)) {\n editSvc?.startEditing(cellCtrl, { event });\n } else if (editSvc?.shouldStopEditing(cellCtrl, event)) {\n if (this.beans.gos.get(\"editType\") === \"fullRow\") {\n editSvc?.stopEditing(cellCtrl, {\n event,\n source: \"edit\"\n });\n } else {\n editSvc?.stopEditing(void 0, {\n event,\n source: \"edit\"\n });\n }\n }\n }\n }\n onCellDoubleClicked(event) {\n const { column, beans, cellCtrl } = this;\n const { eventSvc, frameworkOverrides, editSvc, editModelSvc, gos } = beans;\n const suppressMouseEvent2 = _suppressCellMouseEvent(gos, cellCtrl.column, cellCtrl.rowNode, event);\n const colDef = column.getColDef();\n const cellDoubleClickedEvent = cellCtrl.createEvent(\n event,\n \"cellDoubleClicked\"\n );\n cellDoubleClickedEvent.isEventHandlingSuppressed = suppressMouseEvent2;\n eventSvc.dispatchEvent(cellDoubleClickedEvent);\n if (typeof colDef.onCellDoubleClicked === \"function\") {\n window.setTimeout(() => {\n frameworkOverrides.wrapOutgoing(() => {\n colDef.onCellDoubleClicked(cellDoubleClickedEvent);\n });\n }, 0);\n }\n if (suppressMouseEvent2) {\n return;\n }\n if (editSvc?.shouldStartEditing(cellCtrl, event) && editModelSvc?.getState(cellCtrl) !== \"editing\") {\n const editing = editSvc?.isEditing();\n const isRangeSelectionEnabledWhileEditing = editSvc?.isRangeSelectionEnabledWhileEditing();\n const cellValidations = editModelSvc?.getCellValidationModel().getCellValidationMap().size ?? 0;\n const rowValidations = editModelSvc?.getRowValidationModel().getRowValidationMap().size ?? 0;\n if (editing && (isRangeSelectionEnabledWhileEditing || cellValidations > 0 || rowValidations > 0)) {\n return;\n }\n editSvc?.startEditing(cellCtrl, { event });\n }\n }\n onMouseDown(mouseEvent) {\n const { shiftKey } = mouseEvent;\n const target = mouseEvent.target;\n const { cellCtrl, beans } = this;\n const { eventSvc, rangeSvc, rowNumbersSvc, focusSvc, gos, editSvc } = beans;\n const { column, rowNode, cellPosition } = cellCtrl;\n const suppressMouseEvent2 = _suppressCellMouseEvent(gos, column, rowNode, mouseEvent);\n const fireMouseDownEvent = () => {\n const cellMouseDownEvent = cellCtrl.createEvent(mouseEvent, \"cellMouseDown\");\n cellMouseDownEvent.isEventHandlingSuppressed = suppressMouseEvent2;\n eventSvc.dispatchEvent(cellMouseDownEvent);\n };\n if (suppressMouseEvent2) {\n fireMouseDownEvent();\n return;\n }\n if (this.isRightClickInExistingRange(mouseEvent)) {\n return;\n }\n const hasRanges = rangeSvc && !rangeSvc.isEmpty();\n const containsWidget = this.containsWidget(target);\n const isRowNumberColumn = isRowNumberCol(column);\n if (rowNumbersSvc && isRowNumberColumn && !rowNumbersSvc.handleMouseDownOnCell(cellPosition, mouseEvent)) {\n return;\n }\n if (!shiftKey || !hasRanges) {\n const editing = editSvc?.isEditing(cellCtrl);\n const isEnableCellTextSelection = gos.get(\"enableCellTextSelection\");\n const shouldFocus = isEnableCellTextSelection && mouseEvent.defaultPrevented;\n const forceBrowserFocus = (_isBrowserSafari() || shouldFocus) && !editing && !_isFocusableFormField(target) && !containsWidget;\n cellCtrl.focusCell(forceBrowserFocus, mouseEvent);\n }\n if (shiftKey && hasRanges && !focusSvc.isCellFocused(cellPosition)) {\n mouseEvent.preventDefault();\n const focusedCell = focusSvc.getFocusedCell();\n if (focusedCell) {\n const { column: column2, rowIndex, rowPinned } = focusedCell;\n const allowRangesWhileEditing = !!editSvc?.isRangeSelectionEnabledWhileEditing?.();\n if (editSvc?.isEditing(focusedCell) && !allowRangesWhileEditing) {\n editSvc?.stopEditing(focusedCell);\n }\n if (!allowRangesWhileEditing) {\n focusSvc.setFocusedCell({\n column: column2,\n rowIndex,\n rowPinned,\n forceBrowserFocus: true,\n preventScrollOnBrowserFocus: true,\n sourceEvent: mouseEvent\n });\n }\n }\n }\n if (containsWidget) {\n return;\n }\n rangeSvc?.handleCellMouseDown(mouseEvent, cellPosition);\n fireMouseDownEvent();\n }\n isRightClickInExistingRange(mouseEvent) {\n const { rangeSvc } = this.beans;\n if (rangeSvc) {\n const cellInRange = rangeSvc.isCellInAnyRange(this.cellCtrl.cellPosition);\n const isRightClick = _interpretAsRightClick(this.beans, mouseEvent);\n if (cellInRange && isRightClick) {\n return true;\n }\n }\n return false;\n }\n containsWidget(target) {\n return _isElementChildOfClass(target, \"ag-selection-checkbox\", 3) || _isElementChildOfClass(target, \"ag-drag-handle\", 3);\n }\n onMouseOut(mouseEvent) {\n if (this.mouseStayingInsideCell(mouseEvent)) {\n return;\n }\n const { eventSvc, colHover } = this.beans;\n eventSvc.dispatchEvent(this.cellCtrl.createEvent(mouseEvent, \"cellMouseOut\"));\n colHover?.clearMouseOver();\n }\n onMouseOver(mouseEvent) {\n if (this.mouseStayingInsideCell(mouseEvent)) {\n return;\n }\n const { eventSvc, colHover } = this.beans;\n eventSvc.dispatchEvent(this.cellCtrl.createEvent(mouseEvent, \"cellMouseOver\"));\n colHover?.setMouseOver([this.column]);\n }\n mouseStayingInsideCell(e) {\n if (!e.target || !e.relatedTarget) {\n return false;\n }\n const eCell = this.cellCtrl.eGui;\n const cellContainsTarget = eCell.contains(e.target);\n const cellContainsRelatedTarget = eCell.contains(e.relatedTarget);\n return cellContainsTarget && cellContainsRelatedTarget;\n }\n};\n\n// packages/ag-grid-community/src/rendering/cell/cellPositionFeature.ts\nvar CellPositionFeature = class extends BeanStub {\n constructor(cellCtrl, beans) {\n super();\n this.cellCtrl = cellCtrl;\n this.beans = beans;\n this.column = cellCtrl.column;\n this.rowNode = cellCtrl.rowNode;\n }\n setupRowSpan() {\n this.rowSpan = this.column.getRowSpan(this.rowNode);\n this.addManagedListeners(this.beans.eventSvc, { newColumnsLoaded: () => this.onNewColumnsLoaded() });\n }\n init() {\n this.eSetLeft = this.cellCtrl.getRootElement();\n this.eContent = this.cellCtrl.eGui;\n const cellSpan = this.cellCtrl.getCellSpan();\n if (!cellSpan) {\n this.setupColSpan();\n this.setupRowSpan();\n }\n this.onLeftChanged();\n this.onWidthChanged();\n if (!cellSpan) {\n this._legacyApplyRowSpan();\n }\n if (cellSpan) {\n const refreshSpanHeight = this.refreshSpanHeight.bind(this, cellSpan);\n refreshSpanHeight();\n this.addManagedListeners(this.beans.eventSvc, {\n paginationChanged: refreshSpanHeight,\n recalculateRowBounds: refreshSpanHeight,\n pinnedHeightChanged: refreshSpanHeight\n });\n }\n }\n refreshSpanHeight(cellSpan) {\n const spanHeight = cellSpan.getCellHeight();\n if (spanHeight != null) {\n this.eContent.style.height = `${spanHeight}px`;\n }\n }\n onNewColumnsLoaded() {\n const rowSpan = this.column.getRowSpan(this.rowNode);\n if (this.rowSpan === rowSpan) {\n return;\n }\n this.rowSpan = rowSpan;\n this._legacyApplyRowSpan(true);\n }\n onDisplayColumnsChanged() {\n const colsSpanning = this.getColSpanningList();\n if (!_areEqual(this.colsSpanning, colsSpanning)) {\n this.colsSpanning = colsSpanning;\n this.onWidthChanged();\n this.onLeftChanged();\n }\n }\n setupColSpan() {\n if (this.column.getColDef().colSpan == null) {\n return;\n }\n this.colsSpanning = this.getColSpanningList();\n this.addManagedListeners(this.beans.eventSvc, {\n // because we are col spanning, a reorder of the cols can change what cols we are spanning over\n displayedColumnsChanged: this.onDisplayColumnsChanged.bind(this),\n // because we are spanning over multiple cols, we check for width any time any cols width changes.\n // this is expensive - really we should be explicitly checking only the cols we are spanning over\n // instead of every col, however it would be tricky code to track the cols we are spanning over, so\n // because hardly anyone will be using colSpan, am favouring this easier way for more maintainable code.\n displayedColumnsWidthChanged: this.onWidthChanged.bind(this)\n });\n }\n onWidthChanged() {\n if (!this.eContent) {\n return;\n }\n const width = this.getCellWidth();\n this.eContent.style.width = `${width}px`;\n }\n getCellWidth() {\n if (!this.colsSpanning) {\n return this.column.getActualWidth();\n }\n return this.colsSpanning.reduce((width, col) => width + col.getActualWidth(), 0);\n }\n getColSpanningList() {\n const { column, rowNode } = this;\n const colSpan = column.getColSpan(rowNode);\n const colsSpanning = [];\n if (colSpan === 1) {\n colsSpanning.push(column);\n } else {\n let pointer = column;\n const pinned = column.getPinned();\n for (let i = 0; pointer && i < colSpan; i++) {\n colsSpanning.push(pointer);\n pointer = this.beans.visibleCols.getColAfter(pointer);\n if (!pointer || _missing(pointer)) {\n break;\n }\n if (pinned !== pointer.getPinned()) {\n break;\n }\n }\n }\n return colsSpanning;\n }\n onLeftChanged() {\n if (!this.eSetLeft) {\n return;\n }\n const left = this.modifyLeftForPrintLayout(this.getCellLeft());\n this.eSetLeft.style.left = left + \"px\";\n }\n getCellLeft() {\n let mostLeftCol;\n if (this.beans.gos.get(\"enableRtl\") && this.colsSpanning) {\n mostLeftCol = _last(this.colsSpanning);\n } else {\n mostLeftCol = this.column;\n }\n return mostLeftCol.getLeft();\n }\n modifyLeftForPrintLayout(leftPosition) {\n if (!this.cellCtrl.printLayout || this.column.getPinned() === \"left\") {\n return leftPosition;\n }\n const { visibleCols } = this.beans;\n const leftWidth = visibleCols.getColsLeftWidth();\n if (this.column.getPinned() === \"right\") {\n const bodyWidth = visibleCols.bodyWidth;\n return leftWidth + bodyWidth + (leftPosition || 0);\n }\n return leftWidth + (leftPosition || 0);\n }\n _legacyApplyRowSpan(force) {\n if (this.rowSpan === 1 && !force) {\n return;\n }\n const singleRowHeight = _getRowHeightAsNumber(this.beans);\n const totalRowHeight = singleRowHeight * this.rowSpan;\n this.eContent.style.height = `${totalRowHeight}px`;\n this.eContent.style.zIndex = \"1\";\n }\n // overriding to make public, as we don't dispose this bean via context\n destroy() {\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/rendering/cell/cellCtrl.ts\nvar CSS_CELL = \"ag-cell\";\nvar CSS_AUTO_HEIGHT = \"ag-cell-auto-height\";\nvar CSS_NORMAL_HEIGHT = \"ag-cell-normal-height\";\nvar CSS_CELL_FOCUS = \"ag-cell-focus\";\nvar CSS_CELL_FIRST_RIGHT_PINNED = \"ag-cell-first-right-pinned\";\nvar CSS_CELL_LAST_LEFT_PINNED = \"ag-cell-last-left-pinned\";\nvar CSS_CELL_NOT_INLINE_EDITING = \"ag-cell-not-inline-editing\";\nvar CSS_CELL_WRAP_TEXT = \"ag-cell-wrap-text\";\nvar instanceIdSequence4 = 0;\nvar CellCtrl = class extends BeanStub {\n constructor(column, rowNode, beans, rowCtrl) {\n super();\n this.column = column;\n this.rowNode = rowNode;\n this.rowCtrl = rowCtrl;\n this.rangeFeature = void 0;\n this.rowResizeFeature = void 0;\n this.positionFeature = void 0;\n this.customStyleFeature = void 0;\n this.editStyleFeature = void 0;\n this.mouseListener = void 0;\n this.keyboardListener = void 0;\n this.suppressRefreshCell = false;\n this.onCompAttachedFuncs = [];\n this.onEditorAttachedFuncs = [];\n this.focusEventWhileNotReady = null;\n // if cell has been focused, check if it's focused when destroyed\n this.hasBeenFocused = false;\n this.hasEdit = false;\n this.tooltipFeature = void 0;\n this.editorTooltipFeature = void 0;\n this.beans = beans;\n this.gos = beans.gos;\n this.editSvc = beans.editSvc;\n this.hasEdit = !!beans.editSvc;\n const { colId } = column;\n this.instanceId = colId + \"-\" + instanceIdSequence4++;\n this.createCellPosition();\n this.updateAndFormatValue(false);\n }\n addFeatures() {\n const { beans } = this;\n this.positionFeature = new CellPositionFeature(this, beans);\n this.customStyleFeature = beans.cellStyles?.createCellCustomStyleFeature(this);\n this.editStyleFeature = beans.editSvc?.createCellStyleFeature(this);\n this.mouseListener = new CellMouseListenerFeature(this, beans, this.column);\n this.keyboardListener = new CellKeyboardListenerFeature(this, beans, this.rowNode, this.rowCtrl);\n this.enableTooltipFeature();\n const { rangeSvc } = beans;\n const cellSelectionEnabled = rangeSvc && _isCellSelectionEnabled(beans.gos);\n if (cellSelectionEnabled) {\n this.rangeFeature = rangeSvc.createCellRangeFeature(this);\n }\n if (isRowNumberCol(this.column)) {\n this.rowResizeFeature = this.beans.rowNumbersSvc.createRowNumbersRowResizerFeature(this);\n }\n }\n isCellSpanning() {\n return false;\n }\n getCellSpan() {\n return void 0;\n }\n removeFeatures() {\n const context = this.beans.context;\n this.positionFeature = context.destroyBean(this.positionFeature);\n this.editorTooltipFeature = context.destroyBean(this.editorTooltipFeature);\n this.customStyleFeature = context.destroyBean(this.customStyleFeature);\n this.editStyleFeature = context.destroyBean(this.editStyleFeature);\n this.mouseListener = context.destroyBean(this.mouseListener);\n this.keyboardListener = context.destroyBean(this.keyboardListener);\n this.rangeFeature = context.destroyBean(this.rangeFeature);\n this.rowResizeFeature = context.destroyBean(this.rowResizeFeature);\n this.disableTooltipFeature();\n }\n enableTooltipFeature(value, shouldDisplayTooltip) {\n this.tooltipFeature = this.beans.tooltipSvc?.enableCellTooltipFeature(this, value, shouldDisplayTooltip);\n }\n disableTooltipFeature() {\n this.tooltipFeature = this.beans.context.destroyBean(this.tooltipFeature);\n }\n enableEditorTooltipFeature(editor) {\n if (this.editorTooltipFeature) {\n this.disableEditorTooltipFeature();\n }\n this.editorTooltipFeature = this.beans.tooltipSvc?.setupCellEditorTooltip(this, editor);\n _populateModelValidationErrors(this.beans);\n }\n disableEditorTooltipFeature() {\n this.editorTooltipFeature = this.beans.context.destroyBean(this.editorTooltipFeature);\n }\n setComp(comp, eCell, _eWrapper, eCellWrapper, printLayout, startEditing, compBean) {\n this.comp = comp;\n this.eGui = eCell;\n this.printLayout = printLayout;\n compBean ?? (compBean = this);\n this.addDomData(compBean);\n this.addFeatures();\n compBean.addDestroyFunc(() => this.removeFeatures());\n this.onSuppressCellFocusChanged(this.beans.gos.get(\"suppressCellFocus\"));\n this.setupFocus();\n this.applyStaticCssClasses();\n this.setWrapText();\n this.onFirstRightPinnedChanged();\n this.onLastLeftPinnedChanged();\n this.onColumnHover();\n this.setupControlComps();\n this.setupAutoHeight(eCellWrapper, compBean);\n this.refreshFirstAndLastStyles();\n this.checkFormulaError();\n this.refreshAriaRowIndex();\n this.refreshAriaColIndex();\n this.positionFeature?.init();\n this.customStyleFeature?.setComp(comp);\n this.editStyleFeature?.setComp(comp);\n this.tooltipFeature?.refreshTooltip();\n this.keyboardListener?.init();\n this.rangeFeature?.setComp(comp);\n this.rowResizeFeature?.refreshRowResizer();\n const editable = startEditing ? this.isCellEditable() : void 0;\n const continuingEdit = !editable && this.hasEdit && this.editSvc?.isEditing(this, { withOpenEditor: true });\n if (editable || continuingEdit) {\n this.editSvc?.startEditing(this, {\n startedEdit: false,\n source: \"api\",\n silent: true,\n continueEditing: true,\n editable\n });\n } else {\n this.showValue(false, true);\n }\n if (this.onCompAttachedFuncs.length) {\n for (const func of this.onCompAttachedFuncs) {\n func();\n }\n this.onCompAttachedFuncs = [];\n }\n }\n checkFormulaError() {\n const isFormulaError = !!this.beans.formula?.getFormulaError(this.column, this.rowNode);\n this.eGui.classList.toggle(\"formula-error\", isFormulaError);\n }\n setupAutoHeight(eCellWrapper, compBean) {\n this.isAutoHeight = this.beans.rowAutoHeight?.setupCellAutoHeight(this, eCellWrapper, compBean) ?? false;\n }\n getCellAriaRole() {\n return this.column.getColDef().cellAriaRole ?? \"gridcell\";\n }\n isCellRenderer() {\n const colDef = this.column.getColDef();\n return colDef.cellRenderer != null || colDef.cellRendererSelector != null;\n }\n getValueToDisplay() {\n return this.valueFormatted ?? this.value;\n }\n getDeferLoadingCellRenderer() {\n const { beans, column } = this;\n const { userCompFactory, ctrlsSvc, eventSvc } = beans;\n const colDef = column.getColDef();\n const params = this.createCellRendererParams();\n params.deferRender = true;\n const loadingDetails = _getLoadingCellRendererDetails(userCompFactory, colDef, params);\n if (ctrlsSvc.getGridBodyCtrl()?.scrollFeature?.isScrolling()) {\n let resolver;\n const onReady = new AgPromise((resolve) => {\n resolver = resolve;\n });\n const [removeBodyScrollEnd] = this.addManagedListeners(eventSvc, {\n bodyScrollEnd: () => {\n resolver();\n removeBodyScrollEnd();\n }\n });\n return { loadingComp: loadingDetails, onReady };\n }\n return { loadingComp: loadingDetails, onReady: AgPromise.resolve() };\n }\n showValue(forceNewCellRendererInstance, skipRangeHandleRefresh) {\n const { beans, column, rowNode, rangeFeature } = this;\n const { userCompFactory } = beans;\n let valueToDisplay = this.getValueToDisplay();\n let compDetails;\n const isSsrmLoading = rowNode.stub && rowNode.groupData?.[column.getId()] == null;\n const colDef = column.getColDef();\n if (isSsrmLoading || this.isCellRenderer()) {\n const params = this.createCellRendererParams();\n if (!isSsrmLoading || isRowNumberCol(column)) {\n compDetails = _getCellRendererDetails(userCompFactory, colDef, params);\n } else {\n compDetails = _getLoadingCellRendererDetails(userCompFactory, colDef, params);\n }\n }\n if (!compDetails && !isSsrmLoading && beans.findSvc?.isMatch(rowNode, column)) {\n const params = this.createCellRendererParams();\n compDetails = _getCellRendererDetails(\n userCompFactory,\n { ...column.getColDef(), cellRenderer: \"agFindCellRenderer\" },\n params\n );\n }\n if (this.hasEdit && this.editSvc.isBatchEditing() && this.editSvc.isRowEditing(rowNode, { checkSiblings: true })) {\n const result = this.editSvc.prepDetailsDuringBatch(this, { compDetails, valueToDisplay });\n if (result) {\n if (result.compDetails) {\n compDetails = result.compDetails;\n } else if (result.valueToDisplay) {\n valueToDisplay = result.valueToDisplay;\n }\n }\n }\n this.comp.setRenderDetails(compDetails, valueToDisplay, forceNewCellRendererInstance);\n this.customRowDragComp?.refreshVisibility();\n if (!skipRangeHandleRefresh && rangeFeature) {\n _requestAnimationFrame(beans, () => rangeFeature?.refreshRangeStyleAndHandle());\n }\n this.rowResizeFeature?.refreshRowResizer();\n }\n setupControlComps() {\n const colDef = this.column.getColDef();\n this.includeSelection = this.isIncludeControl(this.isCheckboxSelection(colDef), true);\n this.includeRowDrag = this.isIncludeControl(colDef.rowDrag);\n this.includeDndSource = this.isIncludeControl(colDef.dndSource);\n this.comp.setIncludeSelection(this.includeSelection);\n this.comp.setIncludeDndSource(this.includeDndSource);\n this.comp.setIncludeRowDrag(this.includeRowDrag);\n }\n isForceWrapper() {\n return this.beans.gos.get(\"enableCellTextSelection\") || this.column.isAutoHeight();\n }\n getCellValueClass() {\n const prefix = \"ag-cell-value\";\n const isCheckboxRenderer = this.column.getColDef().cellRenderer === \"agCheckboxCellRenderer\";\n let suffix = \"\";\n if (isCheckboxRenderer) {\n suffix = \" ag-allow-overflow\";\n }\n return `${prefix}${suffix}`;\n }\n /**\n * Wrapper providing general conditions under which control elements (e.g. checkboxes and drag handles)\n * are rendered for a particular cell.\n * @param value Whether to render the control in the specific context of the caller\n * @param allowManuallyPinned Whether manually pinned rows are permitted this form of control element\n */\n // eslint-disable-next-line @typescript-eslint/ban-types\n isIncludeControl(value, allowManuallyPinned = false) {\n const rowUnpinned = this.rowNode.rowPinned == null;\n return (rowUnpinned || allowManuallyPinned && _isManualPinnedRow(this.rowNode)) && !!value;\n }\n isCheckboxSelection(colDef) {\n const { rowSelection, groupDisplayType } = this.beans.gridOptions;\n const checkboxLocation = _getCheckboxLocation(rowSelection);\n const isSelectionColumn = isColumnSelectionCol(this.column);\n if (groupDisplayType === \"custom\" && checkboxLocation !== \"selectionColumn\" && isSelectionColumn) {\n return false;\n }\n return colDef.checkboxSelection || isSelectionColumn && typeof rowSelection === \"object\" && _getCheckboxes(rowSelection);\n }\n refreshShouldDestroy() {\n const colDef = this.column.getColDef();\n const selectionChanged = this.includeSelection != this.isIncludeControl(this.isCheckboxSelection(colDef), true);\n const rowDragChanged = this.includeRowDrag != this.isIncludeControl(colDef.rowDrag);\n const dndSourceChanged = this.includeDndSource != this.isIncludeControl(colDef.dndSource);\n const autoHeightChanged = this.isAutoHeight != this.column.isAutoHeight();\n return selectionChanged || rowDragChanged || dndSourceChanged || autoHeightChanged;\n }\n onPopupEditorClosed(e) {\n const { editSvc } = this.beans;\n if (!editSvc?.isEditing(this, { withOpenEditor: true })) {\n return;\n }\n const isKeyboardEvent = e instanceof KeyboardEvent;\n const isMouseEvent = e instanceof MouseEvent;\n const isEscape = isKeyboardEvent && e.key === KeyCode.ESCAPE;\n editSvc.stopEditing(this, {\n source: editSvc.isBatchEditing() ? \"ui\" : \"api\",\n cancel: isEscape,\n event: isKeyboardEvent || isMouseEvent ? e : void 0\n });\n if (isEscape) {\n this.focusCell(true, e);\n }\n }\n /**\n * Ends the Cell Editing\n * @param cancel `True` if the edit process is being canceled.\n * @returns `True` if the value of the `GridCell` has been updated, otherwise `False`.\n */\n stopEditing(cancel = false) {\n const { editSvc } = this.beans;\n return editSvc?.stopEditing(this, { cancel, source: editSvc?.isBatchEditing() ? \"ui\" : \"api\" }) ?? false;\n }\n createCellRendererParams() {\n const {\n value,\n valueFormatted,\n column,\n rowNode,\n comp,\n eGui,\n beans: { valueSvc, gos, editSvc }\n } = this;\n const res = _addGridCommonParams(gos, {\n value,\n valueFormatted,\n getValue: () => valueSvc.getValueForDisplay({ column, node: rowNode, from: \"edit\" }).value,\n setValue: (value2) => editSvc?.setDataValue({ rowNode, column }, value2) || rowNode.setDataValue(column, value2),\n formatValue: this.formatValue.bind(this),\n data: rowNode.data,\n node: rowNode,\n pinned: column.getPinned(),\n colDef: column.getColDef(),\n column,\n refreshCell: this.refreshCell.bind(this),\n eGridCell: eGui,\n eParentOfValue: comp.getParentOfValue(),\n registerRowDragger: (rowDraggerElement, dragStartPixels, value2, suppressVisibilityChange) => this.registerRowDragger(rowDraggerElement, dragStartPixels, suppressVisibilityChange),\n setTooltip: (value2, shouldDisplayTooltip) => {\n gos.assertModuleRegistered(\"Tooltip\", 3);\n if (this.tooltipFeature) {\n this.disableTooltipFeature();\n }\n this.enableTooltipFeature(value2, shouldDisplayTooltip);\n this.tooltipFeature?.refreshTooltip();\n }\n });\n return res;\n }\n onCellChanged(event) {\n const eventImpactsThisCell = event.column === this.column;\n if (eventImpactsThisCell) {\n this.refreshCell();\n }\n }\n refreshOrDestroyCell(params) {\n if (this.refreshShouldDestroy()) {\n this.rowCtrl?.recreateCell(this);\n } else {\n this.refreshCell(params);\n }\n if (this.hasEdit && this.editCompDetails) {\n const { editSvc, comp } = this;\n if (!comp?.getCellEditor() && editSvc.isEditing(this, { withOpenEditor: true })) {\n editSvc.startEditing(this, { startedEdit: false, source: \"api\", silent: true });\n }\n }\n }\n // + stop editing {force: true, suppressFlash: true}\n // + event cellChanged {}\n // + cellRenderer.params.refresh() {} -> method passes 'as is' to the cellRenderer, so params could be anything\n // + rowCtrl: event dataChanged {suppressFlash: !update, newData: !update}\n // + rowCtrl: api refreshCells() {animate: true/false}\n // + rowRenderer: api softRefreshView() {}\n refreshCell(params) {\n const {\n editStyleFeature,\n customStyleFeature,\n rowCtrl: { rowEditStyleFeature },\n beans: { cellFlashSvc, filterManager },\n column,\n comp,\n suppressRefreshCell,\n tooltipFeature\n } = this;\n if (suppressRefreshCell) {\n return;\n }\n const { field, valueGetter, showRowGroup, enableCellChangeFlash } = column.getColDef();\n const noValueProvided = field == null && valueGetter == null && showRowGroup == null;\n const newData = params?.newData ?? false;\n const forceRefresh = noValueProvided || params && (params.force || newData);\n const isCellCompReady = !!comp;\n const valuesDifferent = this.updateAndFormatValue(isCellCompReady);\n const dataNeedsUpdating = forceRefresh || valuesDifferent;\n if (!isCellCompReady) {\n return;\n }\n if (dataNeedsUpdating) {\n this.showValue(!!newData, false);\n const processingFilterChange = filterManager?.isSuppressFlashingCellsBecauseFiltering();\n const flashCell = !params?.suppressFlash && !processingFilterChange && enableCellChangeFlash;\n if (flashCell) {\n cellFlashSvc?.flashCell(this);\n }\n editStyleFeature?.applyCellStyles?.();\n customStyleFeature?.applyUserStyles();\n customStyleFeature?.applyClassesFromColDef();\n rowEditStyleFeature?.applyRowStyles();\n this.checkFormulaError();\n }\n tooltipFeature?.refreshTooltip();\n customStyleFeature?.applyCellClassRules();\n }\n isCellEditable() {\n return this.column.isCellEditable(this.rowNode);\n }\n formatValue(value) {\n return this.callValueFormatter(value) ?? value;\n }\n callValueFormatter(value) {\n return this.beans.valueSvc.formatValue(this.column, this.rowNode, value);\n }\n updateAndFormatValue(compareValues) {\n const oldValue = this.value;\n const oldValueFormatted = this.valueFormatted;\n const { value, valueFormatted } = this.beans.valueSvc.getValueForDisplay({\n column: this.column,\n node: this.rowNode,\n includeValueFormatted: true,\n from: \"edit\"\n });\n this.value = value;\n this.valueFormatted = valueFormatted;\n if (compareValues) {\n return !this.valuesAreEqual(oldValue, this.value) || this.valueFormatted != oldValueFormatted;\n }\n return true;\n }\n valuesAreEqual(val1, val2) {\n const colDef = this.column.getColDef();\n return colDef.equals ? colDef.equals(val1, val2) : val1 === val2;\n }\n addDomData(compBean) {\n const element = this.eGui;\n _setDomData(this.beans.gos, element, DOM_DATA_KEY_CELL_CTRL, this);\n compBean.addDestroyFunc(() => _setDomData(this.beans.gos, element, DOM_DATA_KEY_CELL_CTRL, null));\n }\n createEvent(domEvent, eventType) {\n const { rowNode, column, value, beans } = this;\n return _createCellEvent(beans, domEvent, eventType, { rowNode, column }, value);\n }\n processCharacter(event) {\n this.keyboardListener?.processCharacter(event);\n }\n onKeyDown(event) {\n this.keyboardListener?.onKeyDown(event);\n }\n onMouseEvent(eventName, mouseEvent) {\n this.mouseListener?.onMouseEvent(eventName, mouseEvent);\n }\n getColSpanningList() {\n return this.positionFeature?.getColSpanningList() ?? [];\n }\n onLeftChanged() {\n if (!this.comp) {\n return;\n }\n this.positionFeature?.onLeftChanged();\n }\n onDisplayedColumnsChanged() {\n if (!this.eGui) {\n return;\n }\n this.refreshAriaColIndex();\n this.refreshFirstAndLastStyles();\n }\n refreshFirstAndLastStyles() {\n const { comp, column, beans } = this;\n refreshFirstAndLastStyles(comp, column, beans.visibleCols);\n }\n refreshAriaColIndex() {\n const colIdx = this.beans.visibleCols.getAriaColIndex(this.column);\n _setAriaColIndex(this.eGui, colIdx);\n }\n onWidthChanged() {\n return this.positionFeature?.onWidthChanged();\n }\n getRowPosition() {\n const { rowIndex, rowPinned } = this.cellPosition;\n return {\n rowIndex,\n rowPinned\n };\n }\n updateRangeBordersIfRangeCount() {\n if (!this.comp) {\n return;\n }\n this.rangeFeature?.updateRangeBordersIfRangeCount();\n }\n onCellSelectionChanged() {\n if (!this.comp) {\n return;\n }\n this.rangeFeature?.onCellSelectionChanged();\n }\n isRangeSelectionEnabled() {\n return this.rangeFeature != null;\n }\n focusCell(forceBrowserFocus = false, sourceEvent) {\n const allowedTarget = this.editSvc?.allowedFocusTargetOnValidation(this);\n if (allowedTarget && allowedTarget !== this) {\n return;\n }\n this.beans.focusSvc.setFocusedCell({\n ...this.getFocusedCellPosition(),\n forceBrowserFocus,\n sourceEvent\n });\n }\n /**\n * Restores focus to the cell, if it should have it\n * @param waitForRender if the cell has just setComp, it may not be rendered yet, so we wait for the next render\n */\n restoreFocus(waitForRender = false) {\n const {\n beans: { editSvc, focusSvc },\n comp\n } = this;\n if (!comp || editSvc?.isEditing(this) || !this.isCellFocused() || !focusSvc.shouldTakeFocus()) {\n return;\n }\n const focus = () => {\n if (!this.isAlive()) {\n return;\n }\n const focusableElement = comp.getFocusableElement();\n if (this.isCellFocused()) {\n focusableElement.focus({ preventScroll: true });\n }\n };\n if (waitForRender) {\n setTimeout(focus, 0);\n return;\n }\n focus();\n }\n onRowIndexChanged() {\n this.createCellPosition();\n this.refreshAriaRowIndex();\n this.onCellFocused();\n this.restoreFocus();\n this.rangeFeature?.onCellSelectionChanged();\n this.rowResizeFeature?.refreshRowResizer();\n }\n onSuppressCellFocusChanged(suppressCellFocus) {\n const element = this.eGui;\n if (!element) {\n return;\n }\n _addOrRemoveAttribute(element, \"tabindex\", suppressCellFocus ? void 0 : -1);\n }\n onFirstRightPinnedChanged() {\n if (!this.comp) {\n return;\n }\n const firstRightPinned = this.column.isFirstRightPinned();\n this.comp.toggleCss(CSS_CELL_FIRST_RIGHT_PINNED, firstRightPinned);\n }\n onLastLeftPinnedChanged() {\n if (!this.comp) {\n return;\n }\n const lastLeftPinned = this.column.isLastLeftPinned();\n this.comp.toggleCss(CSS_CELL_LAST_LEFT_PINNED, lastLeftPinned);\n }\n /**\n * Returns whether cell is focused by the focusSvc, overridden by spannedCellCtrl\n */\n checkCellFocused() {\n return this.beans.focusSvc.isCellFocused(this.cellPosition);\n }\n isCellFocused() {\n const isFocused = this.checkCellFocused();\n this.hasBeenFocused || (this.hasBeenFocused = isFocused);\n return isFocused;\n }\n setupFocus() {\n this.restoreFocus(true);\n this.onCellFocused(this.focusEventWhileNotReady ?? void 0);\n }\n onCellFocused(event) {\n const { beans } = this;\n if (_isCellFocusSuppressed(beans)) {\n return;\n }\n if (!this.comp) {\n if (event) {\n this.focusEventWhileNotReady = event;\n }\n return;\n }\n const cellFocused = this.isCellFocused();\n const editing = beans.editSvc?.isEditing(this) ?? false;\n this.comp.toggleCss(CSS_CELL_FOCUS, cellFocused);\n if (cellFocused && (event?.forceBrowserFocus || !this.hasBrowserFocus() && this.beans.focusSvc.shouldTakeFocus())) {\n let focusEl = this.comp.getFocusableElement();\n if (editing) {\n const focusableEls = _findFocusableElements(focusEl, null, true);\n if (focusableEls.length) {\n focusEl = focusableEls[0];\n }\n }\n const preventScroll = event ? event.preventScrollOnBrowserFocus : true;\n focusEl.focus({ preventScroll });\n _placeCaretAtEnd(beans, focusEl);\n }\n if (cellFocused && this.focusEventWhileNotReady) {\n this.focusEventWhileNotReady = null;\n }\n if (cellFocused && event) {\n this.rowCtrl.announceDescription();\n }\n }\n createCellPosition() {\n const { rowIndex, rowPinned } = this.rowNode;\n this.cellPosition = {\n rowIndex,\n rowPinned: _makeNull(rowPinned),\n column: this.column\n };\n }\n // CSS Classes that only get applied once, they never change\n applyStaticCssClasses() {\n const { comp } = this;\n comp.toggleCss(CSS_CELL, true);\n comp.toggleCss(CSS_CELL_NOT_INLINE_EDITING, true);\n const autoHeight = this.column.isAutoHeight() == true;\n comp.toggleCss(CSS_AUTO_HEIGHT, autoHeight);\n comp.toggleCss(CSS_NORMAL_HEIGHT, !autoHeight);\n }\n onColumnHover() {\n this.beans.colHover?.onCellColumnHover(this.column, this.comp);\n }\n onColDefChanged() {\n if (!this.comp) {\n return;\n }\n if (this.column.isTooltipEnabled()) {\n this.disableTooltipFeature();\n this.enableTooltipFeature();\n } else {\n this.disableTooltipFeature();\n }\n this.setWrapText();\n if (this.editSvc?.isEditing(this)) {\n this.editSvc?.handleColDefChanged(this);\n } else {\n this.refreshOrDestroyCell({ force: true, suppressFlash: true });\n }\n }\n setWrapText() {\n const value = this.column.getColDef().wrapText == true;\n this.comp.toggleCss(CSS_CELL_WRAP_TEXT, value);\n }\n dispatchCellContextMenuEvent(event) {\n const colDef = this.column.getColDef();\n const cellContextMenuEvent = this.createEvent(event, \"cellContextMenu\");\n const { beans } = this;\n beans.eventSvc.dispatchEvent(cellContextMenuEvent);\n if (colDef.onCellContextMenu) {\n window.setTimeout(() => {\n beans.frameworkOverrides.wrapOutgoing(() => {\n colDef.onCellContextMenu(cellContextMenuEvent);\n });\n }, 0);\n }\n }\n getCellRenderer() {\n return this.comp?.getCellRenderer() ?? null;\n }\n destroy() {\n this.onCompAttachedFuncs = [];\n this.onEditorAttachedFuncs = [];\n if (this.isCellFocused() && this.hasBrowserFocus()) {\n this.beans.focusSvc.attemptToRecoverFocus();\n }\n super.destroy();\n }\n hasBrowserFocus() {\n return this.eGui?.contains(_getActiveDomElement(this.beans)) ?? false;\n }\n createSelectionCheckbox() {\n const cbSelectionComponent = this.beans.selectionSvc?.createCheckboxSelectionComponent();\n if (!cbSelectionComponent) {\n return void 0;\n }\n this.beans.context.createBean(cbSelectionComponent);\n cbSelectionComponent.init({ rowNode: this.rowNode, column: this.column });\n return cbSelectionComponent;\n }\n createDndSource() {\n const dndSourceComp = this.beans.registry.createDynamicBean(\n \"dndSourceComp\",\n false,\n this.rowNode,\n this.column,\n this.eGui\n );\n if (dndSourceComp) {\n this.beans.context.createBean(dndSourceComp);\n }\n return dndSourceComp;\n }\n registerRowDragger(customElement, dragStartPixels, alwaysVisible) {\n if (this.customRowDragComp) {\n this.customRowDragComp.setDragElement(customElement, dragStartPixels);\n return;\n }\n const newComp = this.createRowDragComp(customElement, dragStartPixels, alwaysVisible);\n if (newComp) {\n this.customRowDragComp = newComp;\n this.addDestroyFunc(() => {\n this.beans.context.destroyBean(newComp);\n this.customRowDragComp = null;\n });\n newComp.refreshVisibility();\n }\n }\n createRowDragComp(customElement, dragStartPixels, alwaysVisible) {\n const rowDragComp = this.beans.rowDragSvc?.createRowDragCompForCell(\n this.rowNode,\n this.column,\n () => this.value,\n customElement,\n dragStartPixels,\n alwaysVisible\n );\n if (!rowDragComp) {\n return void 0;\n }\n this.beans.context.createBean(rowDragComp);\n return rowDragComp;\n }\n cellEditorAttached() {\n for (const func of this.onEditorAttachedFuncs) {\n func();\n }\n this.onEditorAttachedFuncs = [];\n }\n setFocusedCellPosition(_cellPosition) {\n }\n getFocusedCellPosition() {\n return this.cellPosition;\n }\n refreshAriaRowIndex() {\n if (!isRowNumberCol(this.column) || !this.eGui) {\n return;\n }\n const { ariaRowIndex } = this.rowCtrl;\n if (ariaRowIndex != null) {\n _setAriaRowIndex(this.eGui, ariaRowIndex);\n }\n }\n /**\n * Returns the root element of the cell, could be a span container rather than the cell element.\n * @returns The root element of the cell.\n */\n getRootElement() {\n return this.eGui;\n }\n};\n\n// packages/ag-grid-community/src/styling/stylingUtils.ts\nfunction processClassRules(expressionSvc, previousClassRules, classRules, params, onApplicableClass, onNotApplicableClass) {\n if (classRules == null && previousClassRules == null) {\n return;\n }\n const classesToApply = {};\n const classesToRemove = {};\n const forEachSingleClass = (className, callback) => {\n for (const singleClass of className.split(\" \")) {\n if (singleClass.trim() == \"\") {\n continue;\n }\n callback(singleClass);\n }\n };\n if (classRules) {\n const classNames = Object.keys(classRules);\n for (let i = 0; i < classNames.length; i++) {\n const className = classNames[i];\n const rule = classRules[className];\n let resultOfRule;\n if (typeof rule === \"string\") {\n resultOfRule = expressionSvc ? expressionSvc.evaluate(rule, params) : true;\n } else if (typeof rule === \"function\") {\n resultOfRule = rule(params);\n }\n forEachSingleClass(className, (singleClass) => {\n if (resultOfRule) {\n classesToApply[singleClass] = true;\n } else {\n classesToRemove[singleClass] = true;\n }\n });\n }\n }\n if (previousClassRules && onNotApplicableClass) {\n for (const className of Object.keys(previousClassRules)) {\n forEachSingleClass(className, (singleClass) => {\n if (!classesToApply[singleClass]) {\n classesToRemove[singleClass] = true;\n }\n });\n }\n }\n if (onNotApplicableClass) {\n Object.keys(classesToRemove).forEach(onNotApplicableClass);\n }\n Object.keys(classesToApply).forEach(onApplicableClass);\n}\n\n// packages/ag-grid-community/src/styling/rowStyleService.ts\nfunction calculateRowLevel(rowNode) {\n if (rowNode.group) {\n return rowNode.level;\n }\n const parent = rowNode.parent;\n return parent ? parent.level + 1 : 0;\n}\nvar RowStyleService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"rowStyleSvc\";\n }\n processClassesFromGridOptions(classes, rowNode) {\n const gos = this.gos;\n const process = (rowCls) => {\n if (typeof rowCls === \"string\") {\n classes.push(rowCls);\n } else if (Array.isArray(rowCls)) {\n for (const e of rowCls) {\n classes.push(e);\n }\n }\n };\n const rowClass = gos.get(\"rowClass\");\n if (rowClass) {\n process(rowClass);\n }\n const rowClassFunc = gos.getCallback(\"getRowClass\");\n if (rowClassFunc) {\n const params = {\n data: rowNode.data,\n node: rowNode,\n rowIndex: rowNode.rowIndex\n };\n const rowClassFuncResult = rowClassFunc(params);\n process(rowClassFuncResult);\n }\n }\n preProcessRowClassRules(classes, rowNode) {\n this.processRowClassRules(\n rowNode,\n (className) => {\n classes.push(className);\n },\n () => {\n }\n );\n }\n processRowClassRules(rowNode, onApplicableClass, onNotApplicableClass) {\n const { gos, expressionSvc } = this.beans;\n const rowClassParams = _addGridCommonParams(gos, {\n data: rowNode.data,\n node: rowNode,\n rowIndex: rowNode.rowIndex\n });\n processClassRules(\n expressionSvc,\n void 0,\n gos.get(\"rowClassRules\"),\n rowClassParams,\n onApplicableClass,\n onNotApplicableClass\n );\n }\n processStylesFromGridOptions(rowNode) {\n const gos = this.gos;\n const rowStyle = gos.get(\"rowStyle\");\n const rowStyleFunc = gos.getCallback(\"getRowStyle\");\n let rowStyleFuncResult;\n if (rowStyleFunc) {\n const params = {\n data: rowNode.data,\n node: rowNode,\n rowIndex: rowNode.rowIndex\n };\n rowStyleFuncResult = rowStyleFunc(params);\n }\n if (rowStyleFuncResult || rowStyle) {\n return Object.assign({}, rowStyle, rowStyleFuncResult);\n }\n return void 0;\n }\n};\n\n// packages/ag-grid-community/src/rendering/row/rowCtrl.ts\nvar instanceIdSequence5 = 0;\nvar RowCtrl = class extends BeanStub {\n constructor(rowNode, beans, animateIn, useAnimationFrameForCreate, printLayout) {\n super();\n this.rowNode = rowNode;\n this.useAnimationFrameForCreate = useAnimationFrameForCreate;\n this.printLayout = printLayout;\n this.focusEventWhileNotReady = null;\n this.allRowGuis = [];\n this.active = true;\n this.centerCellCtrls = { list: [], map: {} };\n this.leftCellCtrls = { list: [], map: {} };\n this.rightCellCtrls = { list: [], map: {} };\n this.slideInAnimation = {\n left: false,\n center: false,\n right: false,\n fullWidth: false\n };\n this.fadeInAnimation = {\n left: false,\n center: false,\n right: false,\n fullWidth: false\n };\n this.rowDragComps = [];\n this.lastMouseDownOnDragger = false;\n this.emptyStyle = {};\n this.updateColumnListsPending = false;\n this.rowId = null;\n this.ariaRowIndex = null;\n /** sanitised */\n this.businessKey = null;\n this.beans = beans;\n this.gos = beans.gos;\n this.paginationPage = beans.pagination?.getCurrentPage() ?? 0;\n this.suppressRowTransform = this.gos.get(\"suppressRowTransform\");\n this.instanceId = rowNode.id + \"-\" + instanceIdSequence5++;\n this.rowId = _escapeString(rowNode.id);\n this.initRowBusinessKey();\n this.rowFocused = beans.focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);\n this.rowLevel = calculateRowLevel(this.rowNode);\n this.setRowType();\n this.setAnimateFlags(animateIn);\n this.rowStyles = this.processStylesFromGridOptions();\n this.rowEditStyleFeature = beans.editSvc?.createRowStyleFeature(this);\n this.addListeners();\n }\n initRowBusinessKey() {\n this.businessKeyForNodeFunc = this.gos.get(\"getBusinessKeyForNode\");\n this.updateRowBusinessKey();\n }\n updateRowBusinessKey() {\n if (typeof this.businessKeyForNodeFunc !== \"function\") {\n return;\n }\n const businessKey = this.businessKeyForNodeFunc(this.rowNode);\n this.businessKey = _escapeString(businessKey);\n }\n updateGui(containerType, gui) {\n if (containerType === \"left\") {\n this.leftGui = gui;\n } else if (containerType === \"right\") {\n this.rightGui = gui;\n } else if (containerType === \"fullWidth\") {\n this.fullWidthGui = gui;\n } else {\n this.centerGui = gui;\n }\n }\n setComp(rowComp, element, containerType, compBean) {\n const { context, rowRenderer } = this.beans;\n compBean = setupCompBean(this, context, compBean);\n const gui = { rowComp, element, containerType, compBean };\n this.allRowGuis.push(gui);\n this.updateGui(containerType, gui);\n this.initialiseRowComp(gui);\n const rowNode = this.rowNode;\n const isSsrmLoadingRow = this.rowType === \"FullWidthLoading\" || rowNode.stub;\n const isIrmLoadingRow = !rowNode.data && this.beans.rowModel.getType() === \"infinite\";\n if (!isSsrmLoadingRow && !isIrmLoadingRow && !rowNode.rowPinned) {\n rowRenderer.dispatchFirstDataRenderedEvent();\n }\n this.setupFocus();\n }\n unsetComp(containerType) {\n this.allRowGuis = this.allRowGuis.filter((rowGui) => rowGui.containerType !== containerType);\n this.updateGui(containerType, void 0);\n }\n isCacheable() {\n return this.rowType === \"FullWidthDetail\" && this.gos.get(\"keepDetailRows\");\n }\n setCached(cached) {\n const displayValue = cached ? \"none\" : \"\";\n for (const rg of this.allRowGuis) {\n rg.element.style.display = displayValue;\n }\n }\n initialiseRowComp(gui) {\n const gos = this.gos;\n this.onSuppressCellFocusChanged(this.beans.gos.get(\"suppressCellFocus\"));\n this.listenOnDomOrder(gui);\n this.onRowHeightChanged(gui);\n this.updateRowIndexes(gui);\n this.setFocusedClasses(gui);\n this.setStylesFromGridOptions(false, gui);\n if (_isRowSelection(gos) && this.rowNode.selectable) {\n this.onRowSelected(gui);\n }\n this.updateColumnLists(!this.useAnimationFrameForCreate);\n const comp = gui.rowComp;\n const initialRowClasses = this.getInitialRowClasses(gui.containerType);\n for (const name of initialRowClasses) {\n comp.toggleCss(name, true);\n }\n this.executeSlideAndFadeAnimations(gui);\n if (this.rowNode.group) {\n _setAriaExpanded(gui.element, !!this.rowNode.expanded);\n }\n this.setRowCompRowId(comp);\n this.setRowCompRowBusinessKey(comp);\n _setDomData(gos, gui.element, DOM_DATA_KEY_ROW_CTRL, this);\n gui.compBean.addDestroyFunc(() => _setDomData(gos, gui.element, DOM_DATA_KEY_ROW_CTRL, null));\n if (this.useAnimationFrameForCreate) {\n this.beans.animationFrameSvc.createTask(\n this.addHoverFunctionality.bind(this, gui),\n this.rowNode.rowIndex,\n \"p2\",\n false\n );\n } else {\n this.addHoverFunctionality(gui);\n }\n if (this.isFullWidth()) {\n this.setupFullWidth(gui);\n }\n if (gos.get(\"rowDragEntireRow\")) {\n this.addRowDraggerToRow(gui);\n }\n if (this.useAnimationFrameForCreate) {\n this.beans.animationFrameSvc.addDestroyTask(() => {\n if (!this.isAlive()) {\n return;\n }\n gui.rowComp.toggleCss(\"ag-after-created\", true);\n });\n }\n this.executeProcessRowPostCreateFunc();\n }\n setRowCompRowBusinessKey(comp) {\n if (this.businessKey == null) {\n return;\n }\n comp.setRowBusinessKey(this.businessKey);\n }\n setRowCompRowId(comp) {\n const rowId = _escapeString(this.rowNode.id);\n this.rowId = rowId;\n if (rowId == null) {\n return;\n }\n comp.setRowId(rowId);\n }\n executeSlideAndFadeAnimations(gui) {\n const { containerType } = gui;\n const shouldSlide = this.slideInAnimation[containerType];\n if (shouldSlide) {\n _batchCall(() => {\n this.onTopChanged();\n });\n this.slideInAnimation[containerType] = false;\n }\n const shouldFade = this.fadeInAnimation[containerType];\n if (shouldFade) {\n _batchCall(() => {\n gui.rowComp.toggleCss(\"ag-opacity-zero\", false);\n });\n this.fadeInAnimation[containerType] = false;\n }\n }\n addRowDraggerToRow(gui) {\n const rowDragComp = this.beans.rowDragSvc?.createRowDragCompForRow(this.rowNode, gui.element);\n if (!rowDragComp) {\n return;\n }\n const rowDragBean = this.createBean(rowDragComp, this.beans.context);\n this.rowDragComps.push(rowDragBean);\n gui.compBean.addDestroyFunc(() => {\n this.rowDragComps = this.rowDragComps.filter((r) => r !== rowDragBean);\n this.rowEditStyleFeature = this.destroyBean(this.rowEditStyleFeature, this.beans.context);\n this.destroyBean(rowDragBean, this.beans.context);\n });\n }\n setupFullWidth(gui) {\n const pinned = this.getPinnedForContainer(gui.containerType);\n const compDetails = this.createFullWidthCompDetails(gui.element, pinned);\n gui.rowComp.showFullWidth(compDetails);\n }\n getFullWidthCellRenderers() {\n if (this.gos.get(\"embedFullWidthRows\")) {\n return this.allRowGuis.map((gui) => gui?.rowComp?.getFullWidthCellRenderer());\n }\n return [this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()];\n }\n executeProcessRowPostCreateFunc() {\n const func = this.gos.getCallback(\"processRowPostCreate\");\n if (!func || !this.areAllContainersReady()) {\n return;\n }\n const params = {\n // areAllContainersReady asserts that centerGui is not null\n eRow: this.centerGui.element,\n ePinnedLeftRow: this.leftGui ? this.leftGui.element : void 0,\n ePinnedRightRow: this.rightGui ? this.rightGui.element : void 0,\n node: this.rowNode,\n rowIndex: this.rowNode.rowIndex,\n addRenderedRowListener: this.addEventListener.bind(this)\n };\n func(params);\n }\n areAllContainersReady() {\n const {\n leftGui,\n centerGui,\n rightGui,\n beans: { visibleCols }\n } = this;\n const isLeftReady = !!leftGui || !visibleCols.isPinningLeft();\n const isCenterReady = !!centerGui;\n const isRightReady = !!rightGui || !visibleCols.isPinningRight();\n return isLeftReady && isCenterReady && isRightReady;\n }\n isNodeFullWidthCell() {\n if (this.rowNode.detail) {\n return true;\n }\n const isFullWidthCellFunc = this.beans.gos.getCallback(\"isFullWidthRow\");\n return isFullWidthCellFunc ? isFullWidthCellFunc({ rowNode: this.rowNode }) : false;\n }\n setRowType() {\n const {\n rowNode,\n gos,\n beans: { colModel }\n } = this;\n const isStub = rowNode.stub && !gos.get(\"suppressServerSideFullWidthLoadingRow\") && !gos.get(\"groupHideOpenParents\");\n const isFullWidthCell = this.isNodeFullWidthCell();\n const isDetailCell = gos.get(\"masterDetail\") && rowNode.detail;\n const pivotMode = colModel.isPivotMode();\n const isFullWidthGroup = _isFullWidthGroupRow(gos, rowNode, pivotMode);\n if (isStub) {\n this.rowType = \"FullWidthLoading\";\n } else if (isDetailCell) {\n this.rowType = \"FullWidthDetail\";\n } else if (isFullWidthCell) {\n this.rowType = \"FullWidth\";\n } else if (isFullWidthGroup) {\n this.rowType = \"FullWidthGroup\";\n } else {\n this.rowType = \"Normal\";\n }\n }\n updateColumnLists(suppressAnimationFrame = false, useFlushSync = false) {\n if (this.isFullWidth()) {\n return;\n }\n const { animationFrameSvc } = this.beans;\n const noAnimation = !animationFrameSvc?.active || suppressAnimationFrame || this.printLayout;\n if (noAnimation) {\n this.updateColumnListsImpl(useFlushSync);\n return;\n }\n if (this.updateColumnListsPending) {\n return;\n }\n animationFrameSvc.createTask(\n () => {\n if (!this.active) {\n return;\n }\n this.updateColumnListsImpl(true);\n },\n this.rowNode.rowIndex,\n \"p1\",\n false\n );\n this.updateColumnListsPending = true;\n }\n /**\n * Overridden by SpannedRowCtrl\n */\n getNewCellCtrl(col) {\n const isCellSpan = this.beans.rowSpanSvc?.isCellSpanning(col, this.rowNode);\n if (isCellSpan) {\n return void 0;\n }\n return new CellCtrl(col, this.rowNode, this.beans, this);\n }\n /**\n * Overridden by SpannedRowCtrl, if span context changes cell needs rebuilt\n */\n isCorrectCtrlForSpan(cell) {\n return !this.beans.rowSpanSvc?.isCellSpanning(cell.column, this.rowNode);\n }\n createCellCtrls(prev, cols, pinned = null) {\n const res = {\n list: [],\n map: {}\n };\n const addCell = (colInstanceId, cellCtrl, index) => {\n if (index != null) {\n res.list.splice(index, 0, cellCtrl);\n } else {\n res.list.push(cellCtrl);\n }\n res.map[colInstanceId] = cellCtrl;\n };\n const colsFromPrev = [];\n for (const col of cols) {\n const colInstanceId = col.getInstanceId();\n let cellCtrl = prev.map[colInstanceId];\n if (cellCtrl && !this.isCorrectCtrlForSpan(cellCtrl)) {\n cellCtrl.destroy();\n cellCtrl = void 0;\n }\n if (!cellCtrl) {\n cellCtrl = this.getNewCellCtrl(col);\n }\n if (!cellCtrl) {\n continue;\n }\n addCell(colInstanceId, cellCtrl);\n }\n for (const prevCellCtrl of prev.list) {\n const colInstanceId = prevCellCtrl.column.getInstanceId();\n const cellInResult = res.map[colInstanceId] != null;\n if (cellInResult) {\n continue;\n }\n const keepCell = !this.isCellEligibleToBeRemoved(prevCellCtrl, pinned);\n if (keepCell) {\n colsFromPrev.push([colInstanceId, prevCellCtrl]);\n } else {\n prevCellCtrl.destroy();\n }\n }\n if (colsFromPrev.length) {\n for (const [colInstanceId, cellCtrl] of colsFromPrev) {\n const index = res.list.findIndex((ctrl) => ctrl.column.getLeft() > cellCtrl.column.getLeft());\n const normalisedIndex = index === -1 ? void 0 : Math.max(index - 1, 0);\n addCell(colInstanceId, cellCtrl, normalisedIndex);\n }\n }\n const { focusSvc, visibleCols } = this.beans;\n const focusedCell = focusSvc.getFocusedCell();\n if (focusedCell && focusedCell.column.getPinned() == pinned) {\n const focusedColInstanceId = focusedCell.column.getInstanceId();\n const focusedCellCtrl = res.map[focusedColInstanceId];\n if (!focusedCellCtrl && visibleCols.allCols.includes(focusedCell.column)) {\n const cellCtrl = this.createFocusedCellCtrl();\n if (cellCtrl) {\n const index = res.list.findIndex((ctrl) => ctrl.column.getLeft() > cellCtrl.column.getLeft());\n const normalisedIndex = index === -1 ? void 0 : Math.max(index - 1, 0);\n addCell(focusedColInstanceId, cellCtrl, normalisedIndex);\n }\n }\n }\n return res;\n }\n /**\n * Creates a new cell ctrl for the focused cell, if this is the correct row ctrl.\n * @returns a CellCtrl for the focused cell, if required.\n */\n createFocusedCellCtrl() {\n const { focusSvc, rowSpanSvc } = this.beans;\n const focusedCell = focusSvc.getFocusedCell();\n if (!focusedCell) {\n return void 0;\n }\n const focusedSpan = rowSpanSvc?.getCellSpan(focusedCell.column, this.rowNode);\n if (focusedSpan) {\n if (focusedSpan.firstNode !== this.rowNode || !focusedSpan.doesSpanContain(focusedCell)) {\n return void 0;\n }\n } else if (!focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned)) {\n return void 0;\n }\n return this.getNewCellCtrl(focusedCell.column);\n }\n updateColumnListsImpl(useFlushSync) {\n this.updateColumnListsPending = false;\n this.createAllCellCtrls();\n this.setCellCtrls(useFlushSync);\n }\n setCellCtrls(useFlushSync) {\n for (const item of this.allRowGuis) {\n const cellControls = this.getCellCtrlsForContainer(item.containerType);\n item.rowComp.setCellCtrls(cellControls, useFlushSync);\n }\n }\n getCellCtrlsForContainer(containerType) {\n switch (containerType) {\n case \"left\":\n return this.leftCellCtrls.list;\n case \"right\":\n return this.rightCellCtrls.list;\n case \"fullWidth\":\n return [];\n case \"center\":\n return this.centerCellCtrls.list;\n }\n }\n createAllCellCtrls() {\n const colViewport = this.beans.colViewport;\n const presentedColsService = this.beans.visibleCols;\n if (this.printLayout) {\n this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, presentedColsService.allCols);\n this.leftCellCtrls = { list: [], map: {} };\n this.rightCellCtrls = { list: [], map: {} };\n } else {\n const centerCols = colViewport.getColsWithinViewport(this.rowNode);\n this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, centerCols);\n const leftCols = presentedColsService.getLeftColsForRow(this.rowNode);\n this.leftCellCtrls = this.createCellCtrls(this.leftCellCtrls, leftCols, \"left\");\n const rightCols = presentedColsService.getRightColsForRow(this.rowNode);\n this.rightCellCtrls = this.createCellCtrls(this.rightCellCtrls, rightCols, \"right\");\n }\n }\n isCellEligibleToBeRemoved(cellCtrl, nextContainerPinned) {\n const REMOVE_CELL = true;\n const KEEP_CELL = false;\n const { column } = cellCtrl;\n if (column.getPinned() != nextContainerPinned) {\n return REMOVE_CELL;\n }\n if (!this.isCorrectCtrlForSpan(cellCtrl)) {\n return REMOVE_CELL;\n }\n const { visibleCols, editSvc } = this.beans;\n const editing = editSvc?.isEditing(cellCtrl);\n const focused = cellCtrl.isCellFocused();\n const mightWantToKeepCell = editing || focused;\n if (mightWantToKeepCell) {\n const displayedColumns = visibleCols.allCols;\n const cellStillDisplayed = displayedColumns.indexOf(column) >= 0;\n return cellStillDisplayed ? KEEP_CELL : REMOVE_CELL;\n }\n return REMOVE_CELL;\n }\n getDomOrder() {\n const isEnsureDomOrder = this.gos.get(\"ensureDomOrder\");\n return isEnsureDomOrder || _isDomLayout(this.gos, \"print\");\n }\n listenOnDomOrder(gui) {\n const listener = () => {\n gui.rowComp.setDomOrder(this.getDomOrder());\n };\n gui.compBean.addManagedPropertyListeners([\"domLayout\", \"ensureDomOrder\"], listener);\n }\n setAnimateFlags(animateIn) {\n if (this.rowNode.sticky || !animateIn) {\n return;\n }\n const oldRowTopExists = _exists(this.rowNode.oldRowTop);\n const { visibleCols } = this.beans;\n const pinningLeft = visibleCols.isPinningLeft();\n const pinningRight = visibleCols.isPinningRight();\n if (oldRowTopExists) {\n const { slideInAnimation } = this;\n if (this.isFullWidth() && !this.gos.get(\"embedFullWidthRows\")) {\n slideInAnimation.fullWidth = true;\n return;\n }\n slideInAnimation.center = true;\n slideInAnimation.left = pinningLeft;\n slideInAnimation.right = pinningRight;\n } else {\n const { fadeInAnimation } = this;\n if (this.isFullWidth() && !this.gos.get(\"embedFullWidthRows\")) {\n fadeInAnimation.fullWidth = true;\n return;\n }\n fadeInAnimation.center = true;\n fadeInAnimation.left = pinningLeft;\n fadeInAnimation.right = pinningRight;\n }\n }\n isFullWidth() {\n return this.rowType !== \"Normal\";\n }\n refreshFullWidth() {\n const tryRefresh = (gui, pinned) => {\n if (!gui) {\n return true;\n }\n return gui.rowComp.refreshFullWidth(() => {\n const compDetails = this.createFullWidthCompDetails(gui.element, pinned);\n return compDetails.params;\n });\n };\n const fullWidthSuccess = tryRefresh(this.fullWidthGui, null);\n const centerSuccess = tryRefresh(this.centerGui, null);\n const leftSuccess = tryRefresh(this.leftGui, \"left\");\n const rightSuccess = tryRefresh(this.rightGui, \"right\");\n const allFullWidthRowsRefreshed = fullWidthSuccess && centerSuccess && leftSuccess && rightSuccess;\n return allFullWidthRowsRefreshed;\n }\n addListeners() {\n const { beans, gos, rowNode } = this;\n const { expansionSvc, eventSvc, context, rowSpanSvc } = beans;\n this.addManagedListeners(this.rowNode, {\n heightChanged: () => this.onRowHeightChanged(),\n rowSelected: () => this.onRowSelected(),\n rowIndexChanged: this.onRowIndexChanged.bind(this),\n topChanged: this.onTopChanged.bind(this),\n ...expansionSvc?.getRowExpandedListeners(this) ?? {}\n });\n if (rowNode.detail) {\n this.addManagedListeners(rowNode.parent, { dataChanged: this.onRowNodeDataChanged.bind(this) });\n }\n this.addManagedListeners(rowNode, {\n dataChanged: this.onRowNodeDataChanged.bind(this),\n cellChanged: this.postProcessCss.bind(this),\n rowHighlightChanged: this.onRowNodeHighlightChanged.bind(this),\n draggingChanged: this.postProcessRowDragging.bind(this),\n uiLevelChanged: this.onUiLevelChanged.bind(this),\n rowPinned: this.onRowPinned.bind(this)\n });\n this.addManagedListeners(eventSvc, {\n paginationPixelOffsetChanged: this.onPaginationPixelOffsetChanged.bind(this),\n heightScaleChanged: this.onTopChanged.bind(this),\n displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this),\n virtualColumnsChanged: this.onVirtualColumnsChanged.bind(this),\n cellFocused: this.onCellFocusChanged.bind(this),\n cellFocusCleared: this.onCellFocusChanged.bind(this),\n paginationChanged: this.onPaginationChanged.bind(this),\n modelUpdated: this.refreshFirstAndLastRowStyles.bind(this),\n columnMoved: () => this.updateColumnLists()\n });\n if (rowSpanSvc) {\n this.addManagedListeners(rowSpanSvc, {\n spannedCellsUpdated: ({ pinned }) => {\n if (pinned && !rowNode.rowPinned) {\n return;\n }\n this.updateColumnLists();\n }\n });\n }\n this.addDestroyFunc(() => {\n this.rowDragComps = this.destroyBeans(this.rowDragComps, context);\n this.tooltipFeature = this.destroyBean(this.tooltipFeature, context);\n this.rowEditStyleFeature = this.destroyBean(this.rowEditStyleFeature, context);\n });\n this.addManagedPropertyListeners(\n [\"rowStyle\", \"getRowStyle\", \"rowClass\", \"getRowClass\", \"rowClassRules\"],\n this.postProcessCss.bind(this)\n );\n this.addManagedPropertyListener(\"rowDragEntireRow\", () => {\n const useRowDragEntireRow = gos.get(\"rowDragEntireRow\");\n if (useRowDragEntireRow) {\n for (const gui of this.allRowGuis) {\n this.addRowDraggerToRow(gui);\n }\n return;\n }\n this.rowDragComps = this.destroyBeans(this.rowDragComps, context);\n });\n this.addListenersForCellComps();\n }\n addListenersForCellComps() {\n this.addManagedListeners(this.rowNode, {\n rowIndexChanged: () => {\n for (const cellCtrl of this.getAllCellCtrls()) {\n cellCtrl.onRowIndexChanged();\n }\n },\n cellChanged: (event) => {\n for (const cellCtrl of this.getAllCellCtrls()) {\n cellCtrl.onCellChanged(event);\n }\n }\n });\n }\n /** Should only ever be triggered on source rows (i.e. not on pinned siblings) */\n onRowPinned() {\n for (const gui of this.allRowGuis) {\n gui.rowComp.toggleCss(\"ag-row-pinned-source\", !!this.rowNode.pinnedSibling);\n }\n }\n onRowNodeDataChanged(event) {\n this.refreshRow({\n suppressFlash: !event.update,\n newData: !event.update\n });\n }\n refreshRow(params) {\n const fullWidthChanged = this.isFullWidth() !== !!this.isNodeFullWidthCell();\n if (fullWidthChanged) {\n this.beans.rowRenderer.redrawRow(this.rowNode);\n return;\n }\n if (this.isFullWidth()) {\n const refresh = this.refreshFullWidth();\n if (!refresh) {\n this.beans.rowRenderer.redrawRow(this.rowNode);\n }\n return;\n }\n for (const cellCtrl of this.getAllCellCtrls()) {\n cellCtrl.refreshCell(params);\n }\n for (const gui of this.allRowGuis) {\n this.setRowCompRowId(gui.rowComp);\n this.updateRowBusinessKey();\n this.setRowCompRowBusinessKey(gui.rowComp);\n }\n this.onRowSelected();\n this.postProcessCss();\n }\n postProcessCss() {\n this.setStylesFromGridOptions(true);\n this.postProcessClassesFromGridOptions();\n this.postProcessRowClassRules();\n this.rowEditStyleFeature?.applyRowStyles();\n this.postProcessRowDragging();\n }\n onRowNodeHighlightChanged() {\n const rowDropHighlightSvc = this.beans.rowDropHighlightSvc;\n const highlighted = rowDropHighlightSvc?.row === this.rowNode ? rowDropHighlightSvc.position : \"none\";\n const aboveOn = highlighted === \"above\";\n const insideOn = highlighted === \"inside\";\n const belowOn = highlighted === \"below\";\n const highlightActive = highlighted !== \"none\";\n const dropEdge = aboveOn || belowOn;\n const uiLevel = this.rowNode.uiLevel;\n const shouldIndent = dropEdge && uiLevel > 0;\n const highlightLevel = shouldIndent ? uiLevel.toString() : \"0\";\n for (const gui of this.allRowGuis) {\n const rowComp = gui.rowComp;\n rowComp.toggleCss(\"ag-row-highlight-above\", aboveOn);\n rowComp.toggleCss(\"ag-row-highlight-inside\", insideOn);\n rowComp.toggleCss(\"ag-row-highlight-below\", belowOn);\n rowComp.toggleCss(\"ag-row-highlight-indent\", shouldIndent);\n if (highlightActive) {\n gui.element.style.setProperty(\"--ag-row-highlight-level\", highlightLevel);\n } else {\n gui.element.style.removeProperty(\"--ag-row-highlight-level\");\n }\n }\n }\n postProcessRowDragging() {\n const dragging = this.rowNode.dragging;\n for (const gui of this.allRowGuis) {\n gui.rowComp.toggleCss(\"ag-row-dragging\", dragging);\n }\n }\n onDisplayedColumnsChanged() {\n this.updateColumnLists(true);\n this.beans.rowAutoHeight?.requestCheckAutoHeight();\n }\n onVirtualColumnsChanged() {\n this.updateColumnLists(false, true);\n }\n getRowPosition() {\n return {\n rowPinned: _makeNull(this.rowNode.rowPinned),\n rowIndex: this.rowNode.rowIndex\n };\n }\n onKeyboardNavigate(keyboardEvent) {\n const groupInfo = this.findFullWidthInfoForEvent(keyboardEvent);\n if (!groupInfo) {\n return;\n }\n const { rowGui, column } = groupInfo;\n const currentFullWidthContainer = rowGui.element;\n const isFullWidthContainerFocused = currentFullWidthContainer === keyboardEvent.target;\n if (!isFullWidthContainerFocused) {\n return;\n }\n const node = this.rowNode;\n const { focusSvc, navigation } = this.beans;\n const lastFocusedCell = focusSvc.getFocusedCell();\n const cellPosition = {\n rowIndex: node.rowIndex,\n rowPinned: node.rowPinned,\n column: lastFocusedCell?.column ?? column\n };\n navigation?.navigateToNextCell(keyboardEvent, keyboardEvent.key, cellPosition, true);\n keyboardEvent.preventDefault();\n }\n onTabKeyDown(keyboardEvent) {\n if (keyboardEvent.defaultPrevented || _isStopPropagationForAgGrid(keyboardEvent)) {\n return;\n }\n const currentFullWidthComp = this.allRowGuis.find(\n (c) => c.element.contains(keyboardEvent.target)\n );\n const currentFullWidthContainer = currentFullWidthComp ? currentFullWidthComp.element : null;\n const isFullWidthContainerFocused = currentFullWidthContainer === keyboardEvent.target;\n const activeEl = _getActiveDomElement(this.beans);\n let isDetailGridCellFocused = false;\n if (currentFullWidthContainer && activeEl) {\n isDetailGridCellFocused = currentFullWidthContainer.contains(activeEl) && activeEl.classList.contains(\"ag-cell\");\n }\n let nextEl = null;\n if (!isFullWidthContainerFocused && !isDetailGridCellFocused) {\n nextEl = _findNextFocusableElement(this.beans, currentFullWidthContainer, false, keyboardEvent.shiftKey);\n }\n if (this.isFullWidth() && isFullWidthContainerFocused || !nextEl) {\n this.beans.navigation?.onTabKeyDown(this, keyboardEvent);\n }\n }\n getFullWidthElement() {\n if (this.fullWidthGui) {\n return this.fullWidthGui.element;\n }\n return null;\n }\n getRowYPosition() {\n const displayedEl = this.allRowGuis.find((el) => _isVisible(el.element))?.element;\n if (displayedEl) {\n return displayedEl.getBoundingClientRect().top;\n }\n return 0;\n }\n onSuppressCellFocusChanged(suppressCellFocus) {\n const tabIndex = this.isFullWidth() && suppressCellFocus ? void 0 : this.gos.get(\"tabIndex\");\n for (const gui of this.allRowGuis) {\n _addOrRemoveAttribute(gui.element, \"tabindex\", tabIndex);\n }\n }\n setupFocus() {\n if (!this.isFullWidth()) {\n return;\n }\n this.restoreFullWidthFocus(true);\n this.onFullWidthRowFocused(this.focusEventWhileNotReady ?? void 0);\n }\n restoreFullWidthFocus(waitForRender = false) {\n const { focusSvc, editSvc } = this.beans;\n if (editSvc?.isEditing(this)) {\n return;\n }\n if (!focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned) || !focusSvc.shouldTakeFocus()) {\n return;\n }\n const targetGui = this.getFullWidthRowGuiForFocus();\n if (!targetGui) {\n return;\n }\n const focus = () => {\n if (!this.isAlive()) {\n return;\n }\n if (focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned)) {\n targetGui.element.focus({ preventScroll: true });\n }\n };\n if (waitForRender) {\n setTimeout(focus, 0);\n return;\n }\n focus();\n }\n getFullWidthRowGuiForFocus(event) {\n if (this.fullWidthGui) {\n return this.fullWidthGui;\n }\n const focusedCell = this.beans.focusSvc.getFocusedCell();\n const column = this.beans.colModel.getCol(event?.column ?? focusedCell?.column);\n if (!column) {\n return;\n }\n const pinned = column?.pinned;\n if (pinned === \"right\") {\n return this.rightGui;\n }\n if (pinned === \"left\") {\n return this.leftGui;\n }\n return this.centerGui;\n }\n setFullWidthRowFocusedClass(targetGui, isFocused) {\n this.forEachGui(void 0, (gui) => {\n gui.element.classList.toggle(\"ag-full-width-focus\", isFocused && gui === targetGui);\n });\n }\n onFullWidthRowFocused(event) {\n const { focusSvc } = this.beans;\n const isFocused = this.isFullWidth() && focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);\n if (!isFocused) {\n this.setFullWidthRowFocusedClass(void 0, false);\n return;\n }\n const targetGui = this.getFullWidthRowGuiForFocus(event);\n if (!targetGui) {\n if (event) {\n this.focusEventWhileNotReady = event;\n }\n this.setFullWidthRowFocusedClass(void 0, false);\n return;\n }\n this.setFullWidthRowFocusedClass(targetGui, true);\n this.focusEventWhileNotReady = null;\n if (event?.forceBrowserFocus) {\n targetGui.element.focus({ preventScroll: true });\n }\n }\n recreateCell(cellCtrl) {\n this.centerCellCtrls = this.removeCellCtrl(this.centerCellCtrls, cellCtrl);\n this.leftCellCtrls = this.removeCellCtrl(this.leftCellCtrls, cellCtrl);\n this.rightCellCtrls = this.removeCellCtrl(this.rightCellCtrls, cellCtrl);\n cellCtrl.destroy();\n this.updateColumnLists();\n }\n removeCellCtrl(prev, cellCtrlToRemove) {\n const res = {\n list: [],\n map: {}\n };\n for (const cellCtrl of prev.list) {\n if (cellCtrl === cellCtrlToRemove) {\n continue;\n }\n res.list.push(cellCtrl);\n res.map[cellCtrl.column.getInstanceId()] = cellCtrl;\n }\n return res;\n }\n onMouseEvent(eventName, mouseEvent) {\n switch (eventName) {\n case \"dblclick\":\n this.onRowDblClick(mouseEvent);\n break;\n case \"click\":\n this.onRowClick(mouseEvent);\n break;\n case \"pointerdown\":\n case \"touchstart\":\n case \"mousedown\":\n this.onRowMouseDown(mouseEvent);\n break;\n }\n }\n createRowEvent(type, domEvent) {\n const { rowNode } = this;\n return _addGridCommonParams(this.gos, {\n type,\n node: rowNode,\n data: rowNode.data,\n rowIndex: rowNode.rowIndex,\n rowPinned: rowNode.rowPinned,\n event: domEvent\n });\n }\n createRowEventWithSource(type, domEvent) {\n const event = this.createRowEvent(type, domEvent);\n event.source = this;\n return event;\n }\n onRowDblClick(mouseEvent) {\n if (_isStopPropagationForAgGrid(mouseEvent)) {\n return;\n }\n const rowEvent = this.createRowEventWithSource(\"rowDoubleClicked\", mouseEvent);\n rowEvent.isEventHandlingSuppressed = this.isSuppressMouseEvent(mouseEvent);\n this.beans.eventSvc.dispatchEvent(rowEvent);\n }\n findFullWidthInfoForEvent(event) {\n if (!event) {\n return;\n }\n const rowGui = this.findFullWidthRowGui(event.target);\n const column = this.getColumnForFullWidth(rowGui);\n if (!rowGui || !column) {\n return;\n }\n return { rowGui, column };\n }\n findFullWidthRowGui(target) {\n return this.allRowGuis.find((c) => c.element.contains(target));\n }\n getColumnForFullWidth(fullWidthRowGui) {\n const { visibleCols } = this.beans;\n switch (fullWidthRowGui?.containerType) {\n case \"center\":\n return visibleCols.centerCols[0];\n case \"left\":\n return visibleCols.leftCols[0];\n case \"right\":\n return visibleCols.rightCols[0];\n default:\n return visibleCols.allCols[0];\n }\n }\n onRowMouseDown(mouseEvent) {\n this.lastMouseDownOnDragger = _isElementChildOfClass(mouseEvent.target, \"ag-row-drag\", 3);\n if (!this.isFullWidth() || this.isSuppressMouseEvent(mouseEvent)) {\n return;\n }\n const { rangeSvc, focusSvc } = this.beans;\n rangeSvc?.removeAllCellRanges();\n const groupInfo = this.findFullWidthInfoForEvent(mouseEvent);\n if (!groupInfo) {\n return;\n }\n const { rowGui, column } = groupInfo;\n const element = rowGui.element;\n const target = mouseEvent.target;\n const node = this.rowNode;\n let forceBrowserFocus = mouseEvent.defaultPrevented || _isBrowserSafari();\n if (element && element.contains(target) && _isFocusableFormField(target)) {\n forceBrowserFocus = false;\n }\n focusSvc.setFocusedCell({\n rowIndex: node.rowIndex,\n column,\n rowPinned: node.rowPinned,\n forceBrowserFocus\n });\n }\n isSuppressMouseEvent(mouseEvent) {\n const { gos, rowNode } = this;\n if (this.isFullWidth()) {\n const fullWidthRowGui = this.findFullWidthRowGui(mouseEvent.target);\n return _suppressFullWidthMouseEvent(\n gos,\n fullWidthRowGui?.rowComp.getFullWidthCellRendererParams(),\n rowNode,\n mouseEvent\n );\n }\n const cellCtrl = _getCellCtrlForEventTarget(gos, mouseEvent.target);\n return cellCtrl != null && _suppressCellMouseEvent(gos, cellCtrl.column, rowNode, mouseEvent);\n }\n onRowClick(mouseEvent) {\n const stop = _isStopPropagationForAgGrid(mouseEvent) || this.lastMouseDownOnDragger;\n if (stop) {\n return;\n }\n const isSuppressMouseEvent = this.isSuppressMouseEvent(mouseEvent);\n const { eventSvc, selectionSvc } = this.beans;\n const rowEvent = this.createRowEventWithSource(\"rowClicked\", mouseEvent);\n rowEvent.isEventHandlingSuppressed = isSuppressMouseEvent;\n eventSvc.dispatchEvent(rowEvent);\n if (isSuppressMouseEvent) {\n return;\n }\n selectionSvc?.handleSelectionEvent(mouseEvent, this.rowNode, \"rowClicked\");\n }\n setupDetailRowAutoHeight(eDetailGui) {\n if (this.rowType !== \"FullWidthDetail\") {\n return;\n }\n this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this, eDetailGui);\n }\n createFullWidthCompDetails(eRow, pinned) {\n const { gos, rowNode } = this;\n const params = _addGridCommonParams(gos, {\n fullWidth: true,\n data: rowNode.data,\n node: rowNode,\n value: rowNode.key,\n valueFormatted: rowNode.key,\n // these need to be taken out, as part of 'afterAttached' now\n eGridCell: eRow,\n eParentOfValue: eRow,\n pinned,\n addRenderedRowListener: this.addEventListener.bind(this),\n // This is not on the type of ICellRendererParams\n registerRowDragger: (rowDraggerElement, dragStartPixels, value, rowDragEntireRow) => this.addFullWidthRowDragging(rowDraggerElement, dragStartPixels, value, rowDragEntireRow),\n setTooltip: (value, shouldDisplayTooltip) => {\n gos.assertModuleRegistered(\"Tooltip\", 3);\n this.setupFullWidthRowTooltip(value, shouldDisplayTooltip);\n }\n });\n const compFactory = this.beans.userCompFactory;\n switch (this.rowType) {\n case \"FullWidthDetail\":\n return _getFullWidthDetailCellRendererDetails(compFactory, params);\n case \"FullWidthGroup\": {\n const { value, valueFormatted } = this.beans.valueSvc.getValueForDisplay({\n node: this.rowNode,\n includeValueFormatted: true,\n from: \"edit\"\n });\n params.value = value;\n params.valueFormatted = valueFormatted;\n return _getFullWidthGroupCellRendererDetails(compFactory, params);\n }\n case \"FullWidthLoading\":\n return _getFullWidthLoadingCellRendererDetails(compFactory, params);\n default:\n return _getFullWidthCellRendererDetails(compFactory, params);\n }\n }\n setupFullWidthRowTooltip(value, shouldDisplayTooltip) {\n if (!this.fullWidthGui) {\n return;\n }\n this.tooltipFeature = this.beans.tooltipSvc?.setupFullWidthRowTooltip(\n this.tooltipFeature,\n this,\n value,\n shouldDisplayTooltip\n );\n }\n addFullWidthRowDragging(rowDraggerElement, dragStartPixels, value = \"\", alwaysVisible) {\n const { rowDragSvc, context } = this.beans;\n if (!rowDragSvc || !this.isFullWidth()) {\n return;\n }\n const rowDragComp = rowDragSvc.createRowDragComp(\n () => value,\n this.rowNode,\n void 0,\n rowDraggerElement,\n dragStartPixels,\n alwaysVisible\n );\n this.createBean(rowDragComp, context);\n this.addDestroyFunc(() => {\n this.destroyBean(rowDragComp, context);\n });\n }\n onUiLevelChanged() {\n const newLevel = calculateRowLevel(this.rowNode);\n if (this.rowLevel != newLevel) {\n const classToAdd = \"ag-row-level-\" + newLevel;\n const classToRemove = \"ag-row-level-\" + this.rowLevel;\n for (const gui of this.allRowGuis) {\n gui.rowComp.toggleCss(classToAdd, true);\n gui.rowComp.toggleCss(classToRemove, false);\n }\n }\n this.rowLevel = newLevel;\n }\n isFirstRowOnPage() {\n return this.rowNode.rowIndex === this.beans.pageBounds.getFirstRow();\n }\n isLastRowOnPage() {\n return this.rowNode.rowIndex === this.beans.pageBounds.getLastRow();\n }\n refreshFirstAndLastRowStyles() {\n const newFirst = this.isFirstRowOnPage();\n const newLast = this.isLastRowOnPage();\n if (this.firstRowOnPage !== newFirst) {\n this.firstRowOnPage = newFirst;\n for (const gui of this.allRowGuis) {\n gui.rowComp.toggleCss(\"ag-row-first\", newFirst);\n }\n }\n if (this.lastRowOnPage !== newLast) {\n this.lastRowOnPage = newLast;\n for (const gui of this.allRowGuis) {\n gui.rowComp.toggleCss(\"ag-row-last\", newLast);\n }\n }\n }\n getAllCellCtrls() {\n if (this.leftCellCtrls.list.length === 0 && this.rightCellCtrls.list.length === 0) {\n return this.centerCellCtrls.list;\n }\n const res = [...this.centerCellCtrls.list, ...this.leftCellCtrls.list, ...this.rightCellCtrls.list];\n return res;\n }\n postProcessClassesFromGridOptions() {\n const cssClasses = [];\n this.beans.rowStyleSvc?.processClassesFromGridOptions(cssClasses, this.rowNode);\n if (!cssClasses.length) {\n return;\n }\n for (const classStr of cssClasses) {\n for (const c of this.allRowGuis) {\n c.rowComp.toggleCss(classStr, true);\n }\n }\n }\n postProcessRowClassRules() {\n this.beans.rowStyleSvc?.processRowClassRules(\n this.rowNode,\n (className) => {\n for (const gui of this.allRowGuis) {\n gui.rowComp.toggleCss(className, true);\n }\n },\n (className) => {\n for (const gui of this.allRowGuis) {\n gui.rowComp.toggleCss(className, false);\n }\n }\n );\n }\n setStylesFromGridOptions(updateStyles, gui) {\n if (updateStyles) {\n this.rowStyles = this.processStylesFromGridOptions();\n }\n this.forEachGui(gui, (gui2) => gui2.rowComp.setUserStyles(this.rowStyles));\n }\n getPinnedForContainer(rowContainerType) {\n if (rowContainerType === \"left\" || rowContainerType === \"right\") {\n return rowContainerType;\n }\n return null;\n }\n getInitialRowClasses(rowContainerType) {\n const pinned = this.getPinnedForContainer(rowContainerType);\n const fullWidthRow = this.isFullWidth();\n const { rowNode, beans } = this;\n const classes = [];\n classes.push(\"ag-row\");\n classes.push(this.rowFocused ? \"ag-row-focus\" : \"ag-row-no-focus\");\n if (this.fadeInAnimation[rowContainerType]) {\n classes.push(\"ag-opacity-zero\");\n }\n classes.push(rowNode.rowIndex % 2 === 0 ? \"ag-row-even\" : \"ag-row-odd\");\n if (rowNode.isRowPinned()) {\n classes.push(\"ag-row-pinned\");\n if (beans.pinnedRowModel?.isManual()) {\n classes.push(\"ag-row-pinned-manual\");\n }\n }\n if (!rowNode.isRowPinned() && rowNode.pinnedSibling) {\n classes.push(\"ag-row-pinned-source\");\n }\n if (rowNode.isSelected()) {\n classes.push(\"ag-row-selected\");\n }\n if (rowNode.footer) {\n classes.push(\"ag-row-footer\");\n }\n classes.push(\"ag-row-level-\" + this.rowLevel);\n if (rowNode.stub) {\n classes.push(\"ag-row-loading\");\n }\n if (fullWidthRow) {\n classes.push(\"ag-full-width-row\");\n }\n beans.expansionSvc?.addExpandedCss(classes, rowNode);\n if (rowNode.dragging) {\n classes.push(\"ag-row-dragging\");\n }\n const { rowStyleSvc } = beans;\n if (rowStyleSvc) {\n rowStyleSvc.processClassesFromGridOptions(classes, rowNode);\n rowStyleSvc.preProcessRowClassRules(classes, rowNode);\n }\n classes.push(this.printLayout ? \"ag-row-position-relative\" : \"ag-row-position-absolute\");\n if (this.isFirstRowOnPage()) {\n classes.push(\"ag-row-first\");\n }\n if (this.isLastRowOnPage()) {\n classes.push(\"ag-row-last\");\n }\n if (fullWidthRow) {\n if (pinned === \"left\") {\n classes.push(\"ag-cell-last-left-pinned\");\n }\n if (pinned === \"right\") {\n classes.push(\"ag-cell-first-right-pinned\");\n }\n }\n return classes;\n }\n processStylesFromGridOptions() {\n return this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode) ?? this.emptyStyle;\n }\n onRowSelected(gui) {\n this.beans.selectionSvc?.onRowCtrlSelected(\n this,\n (gui2) => {\n if (gui2 === this.centerGui || gui2 === this.fullWidthGui) {\n this.announceDescription();\n }\n },\n gui\n );\n }\n announceDescription() {\n this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode);\n }\n addHoverFunctionality(eGui) {\n if (!this.active) {\n return;\n }\n const { element, compBean } = eGui;\n const { rowNode, beans, gos } = this;\n compBean.addManagedListeners(element, {\n // We use pointer events here instead of mouse events, as pointer events\n // are more reliable for hover detection, especially with touch devices\n // or hybrid touch + mouse devices.\n pointerenter: (e) => {\n if (e.pointerType === \"mouse\") {\n rowNode.dispatchRowEvent(\"mouseEnter\");\n }\n },\n pointerleave: (e) => {\n if (e.pointerType === \"mouse\") {\n rowNode.dispatchRowEvent(\"mouseLeave\");\n }\n }\n });\n compBean.addManagedListeners(rowNode, {\n mouseEnter: () => {\n if (!beans.dragSvc?.dragging && !gos.get(\"suppressRowHoverHighlight\")) {\n element.classList.add(\"ag-row-hover\");\n rowNode.setHovered(true);\n }\n },\n mouseLeave: () => {\n this.resetHoveredStatus(element);\n }\n });\n }\n resetHoveredStatus(el) {\n const elements = el ? [el] : this.allRowGuis.map((gui) => gui.element);\n for (const element of elements) {\n element.classList.remove(\"ag-row-hover\");\n }\n this.rowNode.setHovered(false);\n }\n // for animation, we don't want to animate entry or exit to a very far away pixel,\n // otherwise the row would move so fast, it would appear to disappear. so this method\n // moves the row closer to the viewport if it is far away, so the row slide in / out\n // at a speed the user can see.\n roundRowTopToBounds(rowTop) {\n const range = this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition();\n const minPixel = this.applyPaginationOffset(range.top, true) - 100;\n const maxPixel = this.applyPaginationOffset(range.bottom, true) + 100;\n return Math.min(Math.max(minPixel, rowTop), maxPixel);\n }\n forEachGui(gui, callback) {\n if (gui) {\n callback(gui);\n } else {\n for (const gui2 of this.allRowGuis) {\n callback(gui2);\n }\n }\n }\n isRowRendered() {\n return this.allRowGuis.length > 0;\n }\n onRowHeightChanged(gui) {\n if (this.rowNode.rowHeight == null) {\n return;\n }\n const rowHeight = this.rowNode.rowHeight;\n const defaultRowHeight = this.beans.environment.getDefaultRowHeight();\n const isHeightFromFunc = _isGetRowHeightFunction(this.gos);\n const heightFromFunc = isHeightFromFunc ? _getRowHeightForNode(this.beans, this.rowNode).height : void 0;\n const lineHeight = heightFromFunc ? `${Math.min(defaultRowHeight, heightFromFunc) - 2}px` : void 0;\n this.forEachGui(gui, (gui2) => {\n gui2.element.style.height = `${rowHeight}px`;\n if (lineHeight) {\n gui2.element.style.setProperty(\"--ag-line-height\", lineHeight);\n }\n });\n }\n // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons.\n destroyFirstPass(suppressAnimation = false) {\n this.active = false;\n const { rowNode } = this;\n if (!suppressAnimation && _isAnimateRows(this.gos) && !rowNode.sticky) {\n const rowStillVisibleJustNotInViewport = rowNode.rowTop != null;\n if (rowStillVisibleJustNotInViewport) {\n const rowTop = this.roundRowTopToBounds(rowNode.rowTop);\n this.setRowTop(rowTop);\n } else {\n for (const gui of this.allRowGuis) {\n gui.rowComp.toggleCss(\"ag-opacity-zero\", true);\n }\n }\n }\n if (this.fullWidthGui?.element.contains(_getActiveDomElement(this.beans))) {\n this.beans.focusSvc.attemptToRecoverFocus();\n }\n rowNode.setHovered(false);\n const event = this.createRowEvent(\"virtualRowRemoved\");\n this.dispatchLocalEvent(event);\n this.beans.eventSvc.dispatchEvent(event);\n super.destroy();\n }\n destroySecondPass() {\n this.allRowGuis.length = 0;\n const destroyCellCtrls = (ctrls) => {\n for (const c of ctrls.list) {\n c.destroy();\n }\n return { list: [], map: {} };\n };\n this.centerCellCtrls = destroyCellCtrls(this.centerCellCtrls);\n this.leftCellCtrls = destroyCellCtrls(this.leftCellCtrls);\n this.rightCellCtrls = destroyCellCtrls(this.rightCellCtrls);\n }\n setFocusedClasses(gui) {\n this.forEachGui(gui, (gui2) => {\n gui2.rowComp.toggleCss(\"ag-row-focus\", this.rowFocused);\n gui2.rowComp.toggleCss(\"ag-row-no-focus\", !this.rowFocused);\n });\n }\n onCellFocusChanged() {\n const { focusSvc } = this.beans;\n const rowFocused = focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);\n if (rowFocused !== this.rowFocused) {\n this.rowFocused = rowFocused;\n this.setFocusedClasses();\n }\n }\n onPaginationChanged() {\n const currentPage = this.beans.pagination?.getCurrentPage() ?? 0;\n if (this.paginationPage !== currentPage) {\n this.paginationPage = currentPage;\n this.onTopChanged();\n }\n this.refreshFirstAndLastRowStyles();\n }\n onTopChanged() {\n this.setRowTop(this.rowNode.rowTop);\n }\n onPaginationPixelOffsetChanged() {\n this.onTopChanged();\n }\n // applies pagination offset, eg if on second page, and page height is 500px, then removes\n // 500px from the top position, so a row with rowTop 600px is displayed at location 100px.\n // reverse will take the offset away rather than add.\n applyPaginationOffset(topPx, reverse = false) {\n if (this.rowNode.isRowPinned() || this.rowNode.sticky) {\n return topPx;\n }\n const pixelOffset = this.beans.pageBounds.getPixelOffset();\n const multiplier = reverse ? 1 : -1;\n return topPx + pixelOffset * multiplier;\n }\n setRowTop(pixels) {\n if (this.printLayout) {\n return;\n }\n if (_exists(pixels)) {\n const afterPaginationPixels = this.applyPaginationOffset(pixels);\n const skipScaling = this.rowNode.isRowPinned() || this.rowNode.sticky;\n const afterScalingPixels = skipScaling ? afterPaginationPixels : this.beans.rowContainerHeight.getRealPixelPosition(afterPaginationPixels);\n const topPx = `${afterScalingPixels}px`;\n this.setRowTopStyle(topPx);\n }\n }\n // the top needs to be set into the DOM element when the element is created, not updated afterwards.\n // otherwise the transition would not work, as it would be transitioning from zero (the unset value).\n // for example, suppose a row that is outside the viewport, then user does a filter to remove other rows\n // and this row now appears in the viewport, and the row moves up (ie it was under the viewport and not rendered,\n // but now is in the viewport) then a new RowComp is created, however it should have it's position initialised\n // to below the viewport, so the row will appear to animate up. if we didn't set the initial position at creation\n // time, the row would animate down (ie from position zero).\n getInitialRowTop(rowContainerType) {\n return this.suppressRowTransform ? this.getInitialRowTopShared(rowContainerType) : void 0;\n }\n getInitialTransform(rowContainerType) {\n return this.suppressRowTransform ? void 0 : `translateY(${this.getInitialRowTopShared(rowContainerType)})`;\n }\n getInitialRowTopShared(rowContainerType) {\n if (this.printLayout) {\n return \"\";\n }\n const rowNode = this.rowNode;\n let rowTop;\n if (rowNode.sticky) {\n rowTop = rowNode.stickyRowTop;\n } else {\n const pixels = this.slideInAnimation[rowContainerType] ? this.roundRowTopToBounds(rowNode.oldRowTop) : rowNode.rowTop;\n const afterPaginationPixels = this.applyPaginationOffset(pixels);\n rowTop = rowNode.isRowPinned() ? afterPaginationPixels : this.beans.rowContainerHeight.getRealPixelPosition(afterPaginationPixels);\n }\n return rowTop + \"px\";\n }\n setRowTopStyle(topPx) {\n for (const gui of this.allRowGuis) {\n if (this.suppressRowTransform) {\n gui.rowComp.setTop(topPx);\n } else {\n gui.rowComp.setTransform(`translateY(${topPx})`);\n }\n }\n }\n getCellCtrl(column, skipColSpanSearch = false) {\n let res = null;\n for (const cellCtrl of this.getAllCellCtrls()) {\n if (cellCtrl.column == column) {\n res = cellCtrl;\n }\n }\n if (res != null || skipColSpanSearch) {\n return res;\n }\n for (const cellCtrl of this.getAllCellCtrls()) {\n if (cellCtrl?.getColSpanningList().indexOf(column) >= 0) {\n res = cellCtrl;\n }\n }\n return res;\n }\n onRowIndexChanged() {\n if (this.rowNode.rowIndex != null) {\n this.onCellFocusChanged();\n this.updateRowIndexes();\n this.postProcessCss();\n }\n }\n updateRowIndexes(gui) {\n const rowIndexStr = this.rowNode.getRowIndexString();\n if (rowIndexStr === null) {\n return;\n }\n const headerRowCount = (this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0) + (this.beans.filterManager?.getHeaderRowCount() ?? 0);\n const rowIsEven = this.rowNode.rowIndex % 2 === 0;\n const ariaRowIndex = this.ariaRowIndex = headerRowCount + this.rowNode.rowIndex + 1;\n this.forEachGui(gui, (c) => {\n c.rowComp.setRowIndex(rowIndexStr);\n c.rowComp.toggleCss(\"ag-row-even\", rowIsEven);\n c.rowComp.toggleCss(\"ag-row-odd\", !rowIsEven);\n _setAriaRowIndex(c.element, ariaRowIndex);\n });\n }\n};\n\n// packages/ag-grid-community/src/navigation/navigationService.ts\nvar NavigationService = class extends BeanStub {\n constructor() {\n super();\n this.beanName = \"navigation\";\n this.onPageDown = _throttle(this.onPageDown, 100);\n this.onPageUp = _throttle(this.onPageUp, 100);\n }\n postConstruct() {\n this.beans.ctrlsSvc.whenReady(this, (p) => {\n this.gridBodyCon = p.gridBodyCtrl;\n });\n }\n handlePageScrollingKey(event, fromFullWidth = false) {\n const key = event.key;\n const alt = event.altKey;\n const ctrl = event.ctrlKey || event.metaKey;\n const rangeServiceShouldHandleShift = !!this.beans.rangeSvc && event.shiftKey;\n const currentCell = _getCellPositionForEvent(this.gos, event);\n let processed = false;\n switch (key) {\n case KeyCode.PAGE_HOME:\n case KeyCode.PAGE_END:\n if (!ctrl && !alt) {\n this.onHomeOrEndKey(key);\n processed = true;\n }\n break;\n case KeyCode.LEFT:\n case KeyCode.RIGHT:\n case KeyCode.UP:\n case KeyCode.DOWN:\n if (!currentCell) {\n return false;\n }\n if (ctrl && !alt && !rangeServiceShouldHandleShift) {\n this.onCtrlUpDownLeftRight(key, currentCell);\n processed = true;\n }\n break;\n case KeyCode.PAGE_DOWN:\n case KeyCode.PAGE_UP:\n if (!ctrl && !alt) {\n processed = this.handlePageUpDown(key, currentCell, fromFullWidth);\n }\n break;\n }\n if (processed) {\n event.preventDefault();\n }\n return processed;\n }\n handlePageUpDown(key, currentCell, fromFullWidth) {\n if (fromFullWidth) {\n currentCell = this.beans.focusSvc.getFocusedCell();\n }\n if (!currentCell) {\n return false;\n }\n if (key === KeyCode.PAGE_UP) {\n this.onPageUp(currentCell);\n } else {\n this.onPageDown(currentCell);\n }\n return true;\n }\n navigateTo({\n scrollIndex,\n scrollType,\n scrollColumn,\n focusIndex,\n focusColumn,\n isAsync,\n rowPinned\n }) {\n const { scrollFeature } = this.gridBodyCon;\n if (_exists(scrollColumn) && !scrollColumn.isPinned()) {\n scrollFeature.ensureColumnVisible(scrollColumn);\n }\n if (_exists(scrollIndex)) {\n scrollFeature.ensureIndexVisible(scrollIndex, scrollType);\n }\n if (!isAsync) {\n scrollFeature.ensureIndexVisible(focusIndex);\n }\n const { focusSvc } = this.beans;\n focusSvc.setFocusedCell({\n rowIndex: focusIndex,\n column: focusColumn,\n rowPinned,\n forceBrowserFocus: true\n });\n this.setRangeToCellIfSupported({ rowIndex: focusIndex, rowPinned, column: focusColumn });\n }\n // this method is throttled, see the `constructor`\n onPageDown(gridCell) {\n const beans = this.beans;\n const scrollPosition = getVScroll(beans);\n const pixelsInOnePage = this.getViewportHeight();\n const { pageBounds, rowModel, rowAutoHeight } = beans;\n const pagingPixelOffset = pageBounds.getPixelOffset();\n const currentPageBottomPixel = scrollPosition.top + pixelsInOnePage;\n const currentPageBottomRow = rowModel.getRowIndexAtPixel(currentPageBottomPixel + pagingPixelOffset);\n if (rowAutoHeight?.active) {\n this.navigateToNextPageWithAutoHeight(gridCell, currentPageBottomRow);\n } else {\n this.navigateToNextPage(gridCell, currentPageBottomRow);\n }\n }\n // this method is throttled, see the `constructor`\n onPageUp(gridCell) {\n const beans = this.beans;\n const scrollPosition = getVScroll(beans);\n const { pageBounds, rowModel, rowAutoHeight } = beans;\n const pagingPixelOffset = pageBounds.getPixelOffset();\n const currentPageTopPixel = scrollPosition.top;\n const currentPageTopRow = rowModel.getRowIndexAtPixel(currentPageTopPixel + pagingPixelOffset);\n if (rowAutoHeight?.active) {\n this.navigateToNextPageWithAutoHeight(gridCell, currentPageTopRow, true);\n } else {\n this.navigateToNextPage(gridCell, currentPageTopRow, true);\n }\n }\n navigateToNextPage(gridCell, scrollIndex, up = false) {\n const { pageBounds, rowModel } = this.beans;\n const pixelsInOnePage = this.getViewportHeight();\n const firstRow = pageBounds.getFirstRow();\n const lastRow = pageBounds.getLastRow();\n const pagingPixelOffset = pageBounds.getPixelOffset();\n const currentRowNode = rowModel.getRow(gridCell.rowIndex);\n const rowPixelDiff = up ? (\n // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain\n currentRowNode?.rowHeight - pixelsInOnePage - pagingPixelOffset\n ) : pixelsInOnePage - pagingPixelOffset;\n const nextCellPixel = currentRowNode?.rowTop + rowPixelDiff;\n let focusIndex = rowModel.getRowIndexAtPixel(nextCellPixel + pagingPixelOffset);\n if (focusIndex === gridCell.rowIndex) {\n const diff = up ? -1 : 1;\n scrollIndex = focusIndex = gridCell.rowIndex + diff;\n }\n let scrollType;\n if (up) {\n scrollType = \"bottom\";\n if (focusIndex < firstRow) {\n focusIndex = firstRow;\n }\n if (scrollIndex < firstRow) {\n scrollIndex = firstRow;\n }\n } else {\n scrollType = \"top\";\n if (focusIndex > lastRow) {\n focusIndex = lastRow;\n }\n if (scrollIndex > lastRow) {\n scrollIndex = lastRow;\n }\n }\n if (this.isRowTallerThanView(rowModel.getRow(focusIndex))) {\n scrollIndex = focusIndex;\n scrollType = \"top\";\n }\n this.navigateTo({\n scrollIndex,\n scrollType,\n scrollColumn: null,\n focusIndex,\n focusColumn: gridCell.column\n });\n }\n navigateToNextPageWithAutoHeight(gridCell, scrollIndex, up = false) {\n this.navigateTo({\n scrollIndex,\n scrollType: up ? \"bottom\" : \"top\",\n scrollColumn: null,\n focusIndex: scrollIndex,\n focusColumn: gridCell.column\n });\n setTimeout(() => {\n const focusIndex = this.getNextFocusIndexForAutoHeight(gridCell, up);\n this.navigateTo({\n scrollIndex,\n scrollType: up ? \"bottom\" : \"top\",\n scrollColumn: null,\n focusIndex,\n focusColumn: gridCell.column,\n isAsync: true\n });\n }, 50);\n }\n getNextFocusIndexForAutoHeight(gridCell, up = false) {\n const step = up ? -1 : 1;\n const pixelsInOnePage = this.getViewportHeight();\n const { pageBounds, rowModel } = this.beans;\n const lastRowIndex = pageBounds.getLastRow();\n let pixelSum = 0;\n let currentIndex = gridCell.rowIndex;\n while (currentIndex >= 0 && currentIndex <= lastRowIndex) {\n const currentCell = rowModel.getRow(currentIndex);\n if (currentCell) {\n const currentCellHeight = currentCell.rowHeight ?? 0;\n if (pixelSum + currentCellHeight > pixelsInOnePage) {\n break;\n }\n pixelSum += currentCellHeight;\n }\n currentIndex += step;\n }\n return Math.max(0, Math.min(currentIndex, lastRowIndex));\n }\n getViewportHeight() {\n const beans = this.beans;\n const scrollPosition = getVScroll(beans);\n const scrollbarWidth = this.beans.scrollVisibleSvc.getScrollbarWidth();\n let pixelsInOnePage = scrollPosition.bottom - scrollPosition.top;\n if (beans.ctrlsSvc.get(\"center\").isHorizontalScrollShowing()) {\n pixelsInOnePage -= scrollbarWidth;\n }\n return pixelsInOnePage;\n }\n isRowTallerThanView(rowNode) {\n if (!rowNode) {\n return false;\n }\n const rowHeight = rowNode.rowHeight;\n if (typeof rowHeight !== \"number\") {\n return false;\n }\n return rowHeight > this.getViewportHeight();\n }\n onCtrlUpDownLeftRight(key, gridCell) {\n const cellToFocus = this.beans.cellNavigation.getNextCellToFocus(key, gridCell, true);\n if (!cellToFocus) {\n return;\n }\n const normalisedPosition = this.getNormalisedPosition(cellToFocus);\n const { rowIndex, rowPinned, column } = normalisedPosition ?? cellToFocus;\n const col = column;\n this.navigateTo({\n scrollIndex: rowIndex,\n scrollType: null,\n scrollColumn: col,\n focusIndex: rowIndex,\n focusColumn: col,\n rowPinned\n });\n }\n // home brings focus to top left cell, end brings focus to bottom right, grid scrolled to bring\n // same cell into view (which means either scroll all the way up, or all the way down).\n onHomeOrEndKey(key) {\n const homeKey = key === KeyCode.PAGE_HOME;\n const { visibleCols, pageBounds, rowModel } = this.beans;\n const allColumns = visibleCols.allCols;\n const scrollIndex = homeKey ? pageBounds.getFirstRow() : pageBounds.getLastRow();\n const rowNode = rowModel.getRow(scrollIndex);\n if (!rowNode) {\n return;\n }\n const columnToSelect = (homeKey ? allColumns : [...allColumns].reverse()).find(\n (col) => !col.isSuppressNavigable(rowNode) && !isRowNumberCol(col)\n );\n if (!columnToSelect) {\n return;\n }\n this.navigateTo({\n scrollIndex,\n scrollType: null,\n scrollColumn: columnToSelect,\n focusIndex: scrollIndex,\n focusColumn: columnToSelect\n });\n }\n // result of keyboard event\n onTabKeyDown(previous, keyboardEvent) {\n const backwards = keyboardEvent.shiftKey;\n const movedToNextCell = this.tabToNextCellCommon(previous, backwards, keyboardEvent);\n const beans = this.beans;\n const { ctrlsSvc, pageBounds, focusSvc, gos } = beans;\n if (movedToNextCell !== false) {\n if (movedToNextCell) {\n keyboardEvent.preventDefault();\n } else if (movedToNextCell === null) {\n ctrlsSvc.get(\"gridCtrl\").allowFocusForNextCoreContainer(backwards);\n }\n return;\n }\n if (backwards) {\n const { rowIndex, rowPinned } = previous.getRowPosition();\n const firstRow = rowPinned ? rowIndex === 0 : rowIndex === pageBounds.getFirstRow();\n if (firstRow) {\n if (gos.get(\"headerHeight\") === 0 || _isHeaderFocusSuppressed(beans)) {\n _focusNextGridCoreContainer(beans, true, true);\n } else {\n keyboardEvent.preventDefault();\n focusSvc.focusPreviousFromFirstCell(keyboardEvent);\n }\n }\n } else {\n if (previous instanceof CellCtrl) {\n previous.focusCell(true);\n }\n if (focusSvc.focusOverlay(false) || _focusNextGridCoreContainer(beans, backwards)) {\n keyboardEvent.preventDefault();\n }\n }\n }\n // comes from API\n tabToNextCell(backwards, event) {\n const beans = this.beans;\n const { focusSvc, rowRenderer } = beans;\n const focusedCell = focusSvc.getFocusedCell();\n if (!focusedCell) {\n return false;\n }\n let cellOrRow = _getCellByPosition(beans, focusedCell);\n if (!cellOrRow) {\n cellOrRow = rowRenderer.getRowByPosition(focusedCell);\n if (!cellOrRow?.isFullWidth()) {\n return false;\n }\n }\n return !!this.tabToNextCellCommon(cellOrRow, backwards, event, \"api\");\n }\n tabToNextCellCommon(previous, backwards, event, source = \"ui\") {\n const { editSvc, focusSvc } = this.beans;\n let res = void 0;\n const cellCtrl = previous instanceof CellCtrl ? previous : previous.getAllCellCtrls()?.[0];\n if (editSvc?.isEditing()) {\n res = editSvc?.moveToNextCell(cellCtrl, backwards, event, source);\n } else {\n res = this.moveToNextCellNotEditing(previous, backwards, event);\n }\n if (res === null) {\n return res;\n }\n return res || !!focusSvc.focusedHeader;\n }\n // returns null if no navigation should be performed\n moveToNextCellNotEditing(previousCell, backwards, event) {\n const displayedColumns = this.beans.visibleCols.allCols;\n let cellPos;\n if (previousCell instanceof RowCtrl) {\n cellPos = {\n ...previousCell.getRowPosition(),\n column: backwards ? displayedColumns[0] : _last(displayedColumns)\n };\n if (this.gos.get(\"embedFullWidthRows\") && event) {\n const focusedContainer = previousCell.findFullWidthInfoForEvent(event);\n if (focusedContainer) {\n cellPos.column = focusedContainer.column;\n }\n }\n } else {\n cellPos = previousCell.getFocusedCellPosition();\n }\n const nextCell = this.findNextCellToFocusOn(cellPos, { backwards, startEditing: false });\n if (nextCell === false) {\n return null;\n }\n if (nextCell instanceof CellCtrl) {\n nextCell.focusCell(true);\n } else if (nextCell) {\n return this.tryToFocusFullWidthRow(nextCell, backwards);\n }\n return _exists(nextCell);\n }\n /**\n * called by the cell, when tab is pressed while editing.\n * @returns RenderedCell when navigation successful, false if navigation should not be performed, otherwise null\n */\n findNextCellToFocusOn(previousPosition, { backwards, startEditing, skipToNextEditableCell }) {\n let nextPosition = previousPosition;\n const beans = this.beans;\n const { cellNavigation, gos, focusSvc, rowRenderer } = beans;\n while (true) {\n if (previousPosition !== nextPosition) {\n previousPosition = nextPosition;\n }\n if (!backwards) {\n nextPosition = this.getLastCellOfColSpan(nextPosition);\n }\n nextPosition = cellNavigation.getNextTabbedCell(nextPosition, backwards);\n const userFunc = gos.getCallback(\"tabToNextCell\");\n if (_exists(userFunc)) {\n const params = {\n backwards,\n editing: startEditing,\n previousCellPosition: previousPosition,\n nextCellPosition: nextPosition ? nextPosition : null\n };\n const userResult = userFunc(params);\n if (userResult === true) {\n nextPosition = previousPosition;\n } else if (userResult === false) {\n return false;\n } else {\n nextPosition = {\n rowIndex: userResult.rowIndex,\n column: userResult.column,\n rowPinned: userResult.rowPinned\n };\n }\n }\n if (!nextPosition) {\n return null;\n }\n if (nextPosition.rowIndex < 0) {\n const headerLen = getFocusHeaderRowCount(beans);\n focusSvc.focusHeaderPosition({\n headerPosition: {\n headerRowIndex: headerLen + nextPosition.rowIndex,\n column: nextPosition.column\n },\n fromCell: true\n });\n return null;\n }\n const fullRowEdit = gos.get(\"editType\") === \"fullRow\";\n if (startEditing && (!fullRowEdit || skipToNextEditableCell)) {\n const cellIsEditable = this.isCellEditable(nextPosition);\n if (!cellIsEditable) {\n continue;\n }\n }\n this.ensureCellVisible(nextPosition);\n const nextCell = _getCellByPosition(beans, nextPosition);\n if (!nextCell) {\n const row = rowRenderer.getRowByPosition(nextPosition);\n if (!row || !row.isFullWidth() || startEditing) {\n continue;\n }\n return { ...row.getRowPosition(), column: nextPosition?.column };\n }\n if (cellNavigation.isSuppressNavigable(nextCell.column, nextCell.rowNode)) {\n continue;\n }\n nextCell.setFocusedCellPosition(nextPosition);\n this.setRangeToCellIfSupported(nextPosition);\n return nextCell;\n }\n }\n isCellEditable(cell) {\n const rowNode = this.lookupRowNodeForCell(cell);\n if (rowNode) {\n return cell.column.isCellEditable(rowNode);\n }\n return false;\n }\n lookupRowNodeForCell({ rowIndex, rowPinned }) {\n const { pinnedRowModel, rowModel } = this.beans;\n if (rowPinned === \"top\") {\n return pinnedRowModel?.getPinnedTopRow(rowIndex);\n }\n if (rowPinned === \"bottom\") {\n return pinnedRowModel?.getPinnedBottomRow(rowIndex);\n }\n return rowModel.getRow(rowIndex);\n }\n // we use index for rows, but column object for columns, as the next column (by index) might not\n // be visible (header grouping) so it's not reliable, so using the column object instead.\n navigateToNextCell(event, key, currentCell, allowUserOverride) {\n let nextCell = currentCell;\n let hitEdgeOfGrid = false;\n const beans = this.beans;\n const { cellNavigation, focusSvc, gos } = beans;\n while (nextCell && (nextCell === currentCell || !this.isValidNavigateCell(nextCell))) {\n if (gos.get(\"enableRtl\")) {\n if (key === KeyCode.LEFT) {\n nextCell = this.getLastCellOfColSpan(nextCell);\n }\n } else if (key === KeyCode.RIGHT) {\n nextCell = this.getLastCellOfColSpan(nextCell);\n }\n nextCell = cellNavigation.getNextCellToFocus(key, nextCell);\n hitEdgeOfGrid = _missing(nextCell);\n }\n if (hitEdgeOfGrid && event && event.key === KeyCode.UP) {\n nextCell = {\n rowIndex: -1,\n rowPinned: null,\n column: currentCell.column\n };\n }\n if (allowUserOverride) {\n const userFunc = gos.getCallback(\"navigateToNextCell\");\n if (_exists(userFunc)) {\n const params = {\n key,\n previousCellPosition: currentCell,\n nextCellPosition: nextCell ? nextCell : null,\n event\n };\n const userCell = userFunc(params);\n if (_exists(userCell)) {\n nextCell = {\n rowPinned: userCell.rowPinned,\n rowIndex: userCell.rowIndex,\n column: userCell.column\n };\n } else {\n nextCell = null;\n }\n }\n }\n if (!nextCell) {\n return;\n }\n if (nextCell.rowIndex < 0) {\n const headerLen = getFocusHeaderRowCount(beans);\n focusSvc.focusHeaderPosition({\n headerPosition: {\n headerRowIndex: headerLen + nextCell.rowIndex,\n column: nextCell.column ?? currentCell.column\n },\n event: event || void 0,\n fromCell: true\n });\n return;\n }\n const normalisedPosition = this.getNormalisedPosition(nextCell);\n if (normalisedPosition) {\n this.focusPosition(normalisedPosition);\n } else {\n this.tryToFocusFullWidthRow(nextCell);\n }\n }\n getNormalisedPosition(cellPosition) {\n const isSpannedCell = !!this.beans.spannedRowRenderer?.getCellByPosition(cellPosition);\n if (isSpannedCell) {\n return cellPosition;\n }\n this.ensureCellVisible(cellPosition);\n const cellCtrl = _getCellByPosition(this.beans, cellPosition);\n if (!cellCtrl) {\n return null;\n }\n cellPosition = cellCtrl.getFocusedCellPosition();\n this.ensureCellVisible(cellPosition);\n return cellPosition;\n }\n tryToFocusFullWidthRow(position, backwards) {\n const { visibleCols, rowRenderer, focusSvc, eventSvc } = this.beans;\n const displayedColumns = visibleCols.allCols;\n const rowComp = rowRenderer.getRowByPosition(position);\n if (!rowComp?.isFullWidth()) {\n return false;\n }\n const currentCellFocused = focusSvc.getFocusedCell();\n const cellPosition = {\n rowIndex: position.rowIndex,\n rowPinned: position.rowPinned,\n column: position.column || (backwards ? _last(displayedColumns) : displayedColumns[0])\n };\n this.focusPosition(cellPosition);\n const fromBelow = backwards == null ? currentCellFocused != null && _isRowBefore(cellPosition, currentCellFocused) : backwards;\n eventSvc.dispatchEvent({\n type: \"fullWidthRowFocused\",\n rowIndex: cellPosition.rowIndex,\n rowPinned: cellPosition.rowPinned,\n column: cellPosition.column,\n isFullWidthCell: true,\n fromBelow\n });\n return true;\n }\n focusPosition(cellPosition) {\n const { focusSvc } = this.beans;\n focusSvc.setFocusedCell({\n rowIndex: cellPosition.rowIndex,\n column: cellPosition.column,\n rowPinned: cellPosition.rowPinned,\n forceBrowserFocus: true\n });\n this.setRangeToCellIfSupported(cellPosition);\n }\n setRangeToCellIfSupported(cellPosition) {\n if (isRowNumberCol(cellPosition.column)) {\n return;\n }\n this.beans.rangeSvc?.setRangeToCell(cellPosition);\n }\n isValidNavigateCell(cell) {\n const rowNode = _getRowNode(this.beans, cell);\n return !!rowNode;\n }\n getLastCellOfColSpan(cell) {\n const cellCtrl = _getCellByPosition(this.beans, cell);\n if (!cellCtrl) {\n return cell;\n }\n const colSpanningList = cellCtrl.getColSpanningList();\n if (colSpanningList.length === 1) {\n return cell;\n }\n return {\n rowIndex: cell.rowIndex,\n column: _last(colSpanningList),\n rowPinned: cell.rowPinned\n };\n }\n ensureCellVisible(gridCell) {\n const isGroupStickyEnabled = _isGroupRowsSticky(this.gos);\n const rowNode = this.beans.rowModel.getRow(gridCell.rowIndex);\n const skipScrollToRow = isGroupStickyEnabled && rowNode?.sticky;\n const { scrollFeature } = this.gridBodyCon;\n if (!skipScrollToRow && _missing(gridCell.rowPinned)) {\n scrollFeature.ensureIndexVisible(gridCell.rowIndex);\n }\n if (!gridCell.column.isPinned()) {\n scrollFeature.ensureColumnVisible(gridCell.column);\n }\n }\n ensureColumnVisible(column) {\n const scrollFeature = this.gridBodyCon.scrollFeature;\n if (!column.isPinned()) {\n scrollFeature.ensureColumnVisible(column);\n }\n }\n ensureRowVisible(rowIndex) {\n const scrollFeature = this.gridBodyCon.scrollFeature;\n scrollFeature.ensureIndexVisible(rowIndex);\n }\n};\nfunction getVScroll(beans) {\n return beans.ctrlsSvc.getScrollFeature().getVScrollPosition();\n}\n\n// packages/ag-grid-community/src/navigation/navigationModule.ts\nvar KeyboardNavigationModule = {\n moduleName: \"KeyboardNavigation\",\n version: VERSION,\n beans: [NavigationService, CellNavigationService, HeaderNavigationService],\n apiFunctions: {\n getFocusedCell,\n clearFocusedCell,\n setFocusedCell,\n setFocusedHeader,\n tabToNextCell,\n tabToPreviousCell\n }\n};\n\n// packages/ag-grid-community/src/pagination/pageBoundsListener.ts\nvar PageBoundsListener = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"pageBoundsListener\";\n }\n postConstruct() {\n this.addManagedEventListeners({\n modelUpdated: this.onModelUpdated.bind(this),\n recalculateRowBounds: this.calculatePages.bind(this)\n });\n this.onModelUpdated();\n }\n onModelUpdated(modelUpdatedEvent) {\n this.calculatePages();\n this.eventSvc.dispatchEvent({\n type: \"paginationChanged\",\n animate: modelUpdatedEvent?.animate ?? false,\n newData: modelUpdatedEvent?.newData ?? false,\n newPage: modelUpdatedEvent?.newPage ?? false,\n newPageSize: modelUpdatedEvent?.newPageSize ?? false,\n keepRenderedRows: modelUpdatedEvent?.keepRenderedRows ?? false\n });\n }\n calculatePages() {\n const { pageBounds, pagination, rowModel } = this.beans;\n if (pagination) {\n pagination.calculatePages();\n } else {\n pageBounds.calculateBounds(0, rowModel.getRowCount() - 1);\n }\n }\n};\n\n// packages/ag-grid-community/src/pagination/pageBoundsService.ts\nvar PageBoundsService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"pageBounds\";\n this.pixelOffset = 0;\n }\n getFirstRow() {\n return this.topRowBounds?.rowIndex ?? -1;\n }\n getLastRow() {\n return this.bottomRowBounds?.rowIndex ?? -1;\n }\n getCurrentPageHeight() {\n const { topRowBounds, bottomRowBounds } = this;\n if (!topRowBounds || !bottomRowBounds) {\n return 0;\n }\n return Math.max(bottomRowBounds.rowTop + bottomRowBounds.rowHeight - topRowBounds.rowTop, 0);\n }\n getCurrentPagePixelRange() {\n const { topRowBounds, bottomRowBounds } = this;\n const pageFirstPixel = topRowBounds?.rowTop ?? 0;\n const pageLastPixel = bottomRowBounds ? bottomRowBounds.rowTop + bottomRowBounds.rowHeight : 0;\n return { pageFirstPixel, pageLastPixel };\n }\n calculateBounds(topDisplayedRowIndex, bottomDisplayedRowIndex) {\n const { rowModel } = this.beans;\n const topRowBounds = rowModel.getRowBounds(topDisplayedRowIndex);\n if (topRowBounds) {\n topRowBounds.rowIndex = topDisplayedRowIndex;\n }\n this.topRowBounds = topRowBounds;\n const bottomRowBounds = rowModel.getRowBounds(bottomDisplayedRowIndex);\n if (bottomRowBounds) {\n bottomRowBounds.rowIndex = bottomDisplayedRowIndex;\n }\n this.bottomRowBounds = bottomRowBounds;\n this.calculatePixelOffset();\n }\n getPixelOffset() {\n return this.pixelOffset;\n }\n calculatePixelOffset() {\n const value = this.topRowBounds?.rowTop ?? 0;\n if (this.pixelOffset === value) {\n return;\n }\n this.pixelOffset = value;\n this.eventSvc.dispatchEvent({ type: \"paginationPixelOffsetChanged\" });\n }\n};\n\n// packages/ag-grid-community/src/pinnedColumns/pinnedColumnModule.css\nvar pinnedColumnModule_default = \".ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top{min-width:0;overflow:hidden;position:relative}.ag-pinned-left-sticky-top,.ag-pinned-right-sticky-top{height:100%;overflow:hidden;position:relative}.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{height:100%;overflow:hidden;width:100%}.ag-pinned-left-header,.ag-pinned-right-header{display:inline-block;height:100%;overflow:hidden;position:relative}.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible){.ag-horizontal-left-spacer:not(.ag-scroller-corner){border-right:var(--ag-pinned-column-border)}.ag-horizontal-right-spacer:not(.ag-scroller-corner){border-left:var(--ag-pinned-column-border)}}.ag-pinned-right-header{border-left:var(--ag-pinned-column-border)}.ag-pinned-left-header{border-right:var(--ag-pinned-column-border)}.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-left:var(--ag-pinned-column-border)}.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-right:var(--ag-pinned-column-border)}.ag-pinned-left-header .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}.ag-pinned-right-header .ag-header-cell-resize:after{left:50%}.ag-pinned-left-header .ag-header-cell-resize{right:-3px}.ag-pinned-right-header .ag-header-cell-resize{left:-3px}\";\n\n// packages/ag-grid-community/src/gridBodyComp/rowContainer/setPinnedWidthFeature.ts\nvar SetPinnedWidthFeature = class extends BeanStub {\n constructor(isLeft, elements) {\n super();\n this.isLeft = isLeft;\n this.elements = elements;\n this.getWidth = isLeft ? () => this.beans.pinnedCols.leftWidth : () => this.beans.pinnedCols.rightWidth;\n }\n postConstruct() {\n this.addManagedEventListeners({\n [`${this.isLeft ? \"left\" : \"right\"}PinnedWidthChanged`]: this.onPinnedWidthChanged.bind(this)\n });\n }\n onPinnedWidthChanged() {\n const width = this.getWidth();\n const displayed = width > 0;\n for (const element of this.elements) {\n if (element) {\n _setDisplayed(element, displayed);\n _setFixedWidth(element, width);\n }\n }\n }\n};\n\n// packages/ag-grid-community/src/pinnedColumns/pinnedColumnService.ts\nvar PinnedColumnService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"pinnedCols\";\n }\n postConstruct() {\n this.beans.ctrlsSvc.whenReady(this, (p) => {\n this.gridBodyCtrl = p.gridBodyCtrl;\n });\n const listener = this.checkContainerWidths.bind(this);\n this.addManagedEventListeners({\n displayedColumnsChanged: listener,\n displayedColumnsWidthChanged: listener\n });\n this.addManagedPropertyListener(\"domLayout\", listener);\n }\n checkContainerWidths() {\n const { gos, visibleCols, eventSvc } = this.beans;\n const printLayout = _isDomLayout(gos, \"print\");\n const newLeftWidth = printLayout ? 0 : visibleCols.getColsLeftWidth();\n const newRightWidth = printLayout ? 0 : visibleCols.getDisplayedColumnsRightWidth();\n if (newLeftWidth != this.leftWidth) {\n this.leftWidth = newLeftWidth;\n eventSvc.dispatchEvent({ type: \"leftPinnedWidthChanged\" });\n }\n if (newRightWidth != this.rightWidth) {\n this.rightWidth = newRightWidth;\n eventSvc.dispatchEvent({ type: \"rightPinnedWidthChanged\" });\n }\n }\n keepPinnedColumnsNarrowerThanViewport() {\n const eBodyViewport = this.gridBodyCtrl.eBodyViewport;\n const bodyWidth = _getInnerWidth(eBodyViewport);\n if (bodyWidth <= 50) {\n return;\n }\n const processedColumnsToRemove = this.getPinnedColumnsOverflowingViewport(bodyWidth - 50);\n const processUnpinnedColumns = this.gos.getCallback(\"processUnpinnedColumns\");\n const { columns, hasLockedPinned } = processedColumnsToRemove;\n let columnsToRemove = columns;\n if (!columnsToRemove.length && !hasLockedPinned) {\n return;\n }\n if (processUnpinnedColumns) {\n const params = {\n columns: columnsToRemove,\n viewportWidth: bodyWidth\n };\n columnsToRemove = processUnpinnedColumns(params);\n }\n if (!columnsToRemove?.length) {\n return;\n }\n columnsToRemove = columnsToRemove.filter((col) => !isRowNumberCol(col));\n this.setColsPinned(columnsToRemove, null, \"viewportSizeFeature\");\n }\n createPinnedWidthFeature(isLeft, ...elements) {\n return new SetPinnedWidthFeature(isLeft, elements);\n }\n setColsPinned(keys, pinned, source) {\n const { colModel, colAnimation, visibleCols, gos } = this.beans;\n if (!colModel.cols) {\n return;\n }\n if (!keys?.length) {\n return;\n }\n if (_isDomLayout(gos, \"print\")) {\n _warn(37);\n return;\n }\n colAnimation?.start();\n let actualPinned;\n if (pinned === true || pinned === \"left\") {\n actualPinned = \"left\";\n } else if (pinned === \"right\") {\n actualPinned = \"right\";\n } else {\n actualPinned = null;\n }\n const updatedCols = [];\n for (const key of keys) {\n if (!key) {\n continue;\n }\n const column = colModel.getCol(key);\n if (!column) {\n continue;\n }\n if (column.getPinned() !== actualPinned) {\n this.setColPinned(column, actualPinned);\n updatedCols.push(column);\n }\n }\n if (updatedCols.length) {\n visibleCols.refresh(source);\n dispatchColumnPinnedEvent(this.eventSvc, updatedCols, source);\n }\n colAnimation?.finish();\n }\n initCol(column) {\n const { pinned, initialPinned } = column.colDef;\n if (pinned !== void 0) {\n this.setColPinned(column, pinned);\n } else {\n this.setColPinned(column, initialPinned);\n }\n }\n setColPinned(column, pinned) {\n if (pinned === true || pinned === \"left\") {\n column.pinned = \"left\";\n } else if (pinned === \"right\") {\n column.pinned = \"right\";\n } else {\n column.pinned = null;\n }\n column.dispatchStateUpdatedEvent(\"pinned\");\n }\n setupHeaderPinnedWidth(ctrl) {\n const { scrollVisibleSvc } = this.beans;\n if (ctrl.pinned == null) {\n return;\n }\n const pinningLeft = ctrl.pinned === \"left\";\n const pinningRight = ctrl.pinned === \"right\";\n ctrl.hidden = true;\n const listener = () => {\n const width = pinningLeft ? this.leftWidth : this.rightWidth;\n if (width == null) {\n return;\n }\n const hidden = width == 0;\n const hiddenChanged = ctrl.hidden !== hidden;\n const isRtl = this.gos.get(\"enableRtl\");\n const scrollbarWidth = scrollVisibleSvc.getScrollbarWidth();\n const addPaddingForScrollbar = scrollVisibleSvc.verticalScrollShowing && (isRtl && pinningLeft || !isRtl && pinningRight);\n const widthWithPadding = addPaddingForScrollbar ? width + scrollbarWidth : width;\n ctrl.comp.setPinnedContainerWidth(`${widthWithPadding}px`);\n ctrl.comp.setDisplayed(!hidden);\n if (hiddenChanged) {\n ctrl.hidden = hidden;\n ctrl.refresh();\n }\n };\n ctrl.addManagedEventListeners({\n leftPinnedWidthChanged: listener,\n rightPinnedWidthChanged: listener,\n scrollVisibilityChanged: listener,\n scrollbarWidthChanged: listener\n });\n }\n getHeaderResizeDiff(diff, column) {\n const pinned = column.getPinned();\n if (pinned) {\n const { leftWidth, rightWidth } = this;\n const bodyWidth = _getInnerWidth(this.beans.ctrlsSvc.getGridBodyCtrl().eBodyViewport) - 50;\n if (leftWidth + rightWidth + diff > bodyWidth) {\n if (bodyWidth > leftWidth + rightWidth) {\n diff = bodyWidth - leftWidth - rightWidth;\n } else {\n return 0;\n }\n }\n }\n return diff;\n }\n getPinnedColumnsOverflowingViewport(viewportWidth) {\n const pinnedRightWidth = this.rightWidth ?? 0;\n const pinnedLeftWidth = this.leftWidth ?? 0;\n const totalPinnedWidth = pinnedRightWidth + pinnedLeftWidth;\n let hasLockedPinned = false;\n if (totalPinnedWidth < viewportWidth) {\n return { columns: [], hasLockedPinned };\n }\n const { visibleCols } = this.beans;\n const pinnedLeftColumns = [...visibleCols.leftCols];\n const pinnedRightColumns = [...visibleCols.rightCols];\n let indexRight = 0;\n let indexLeft = 0;\n const totalWidthRemoved = 0;\n const columnsToRemove = [];\n let spaceNecessary = totalPinnedWidth - totalWidthRemoved - viewportWidth;\n while ((indexLeft < pinnedLeftColumns.length || indexRight < pinnedRightColumns.length) && spaceNecessary > 0) {\n if (indexRight < pinnedRightColumns.length) {\n const currentColumn = pinnedRightColumns[indexRight++];\n if (currentColumn.colDef.lockPinned) {\n hasLockedPinned = true;\n continue;\n }\n spaceNecessary -= currentColumn.getActualWidth();\n columnsToRemove.push(currentColumn);\n }\n if (indexLeft < pinnedLeftColumns.length && spaceNecessary > 0) {\n const currentColumn = pinnedLeftColumns[indexLeft++];\n if (currentColumn.colDef.lockPinned) {\n hasLockedPinned = true;\n continue;\n }\n spaceNecessary -= currentColumn.getActualWidth();\n columnsToRemove.push(currentColumn);\n }\n }\n return { columns: columnsToRemove, hasLockedPinned };\n }\n};\n\n// packages/ag-grid-community/src/pinnedColumns/pinnedColumnModule.ts\nvar PinnedColumnModule = {\n moduleName: \"PinnedColumn\",\n version: VERSION,\n beans: [PinnedColumnService],\n css: [pinnedColumnModule_default]\n};\n\n// packages/ag-grid-community/src/agStack/core/baseAriaAnnouncementService.ts\nvar BaseAriaAnnouncementService = class extends AgBeanStub {\n constructor() {\n super();\n this.beanName = \"ariaAnnounce\";\n this.descriptionContainer = null;\n this.pendingAnnouncements = /* @__PURE__ */ new Map();\n this.lastAnnouncement = \"\";\n this.updateAnnouncement = _debounce(this, this.updateAnnouncement.bind(this), 200);\n }\n postConstruct() {\n const beans = this.beans;\n const eDocument = _getDocument(beans);\n const div = this.descriptionContainer = eDocument.createElement(\"div\");\n div.classList.add(\"ag-aria-description-container\");\n _setAriaLive(div, \"polite\");\n _setAriaRelevant(div, \"additions text\");\n _setAriaAtomic(div, true);\n beans.eRootDiv.appendChild(div);\n }\n /**\n * @param key used for debouncing calls\n */\n announceValue(value, key) {\n this.pendingAnnouncements.set(key, value);\n this.updateAnnouncement();\n }\n updateAnnouncement() {\n if (!this.descriptionContainer) {\n return;\n }\n const value = Array.from(this.pendingAnnouncements.values()).join(\". \");\n this.pendingAnnouncements.clear();\n this.descriptionContainer.textContent = \"\";\n setTimeout(() => {\n this.handleAnnouncementUpdate(value);\n }, 50);\n }\n handleAnnouncementUpdate(value) {\n if (!this.isAlive() || !this.descriptionContainer) {\n return;\n }\n let valueToAnnounce = value;\n if (valueToAnnounce == null || valueToAnnounce.replace(/[ .]/g, \"\") == \"\") {\n this.lastAnnouncement = \"\";\n return;\n }\n if (this.lastAnnouncement === valueToAnnounce) {\n valueToAnnounce = `${valueToAnnounce}\\u200B`;\n }\n this.lastAnnouncement = valueToAnnounce;\n this.descriptionContainer.textContent = valueToAnnounce;\n }\n destroy() {\n super.destroy();\n const { descriptionContainer } = this;\n if (descriptionContainer) {\n _clearElement(descriptionContainer);\n descriptionContainer.remove();\n }\n this.descriptionContainer = null;\n this.pendingAnnouncements.clear();\n }\n};\n\n// packages/ag-grid-community/src/rendering/ariaAnnouncementService.ts\nvar AriaAnnouncementService = class extends BaseAriaAnnouncementService {\n};\n\n// packages/ag-grid-community/src/rendering/ariaModule.ts\nvar AriaModule = {\n moduleName: \"Aria\",\n version: VERSION,\n beans: [AriaAnnouncementService]\n};\n\n// packages/ag-grid-community/src/rendering/column-delay-render.css\nvar column_delay_render_default = \":where(.ag-delay-render){.ag-cell,.ag-header-cell,.ag-header-group-cell,.ag-row,.ag-spanned-cell-wrapper{visibility:hidden}}\";\n\n// packages/ag-grid-community/src/rendering/columnDelayRenderService.ts\nvar HideClass = \"ag-delay-render\";\nvar ColumnDelayRenderService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colDelayRenderSvc\";\n this.hideRequested = false;\n this.alreadyRevealed = false;\n this.timesRetried = 0;\n this.requesters = /* @__PURE__ */ new Set();\n }\n hideColumns(key) {\n if (this.alreadyRevealed || this.requesters.has(key)) {\n return;\n }\n this.requesters.add(key);\n if (!this.hideRequested) {\n this.beans.ctrlsSvc.whenReady(this, (p) => {\n p.gridBodyCtrl.eGridBody.classList.add(HideClass);\n });\n this.hideRequested = true;\n }\n }\n revealColumns(key) {\n if (this.alreadyRevealed || !this.isAlive()) {\n return;\n }\n this.requesters.delete(key);\n if (this.requesters.size > 0) {\n return;\n }\n const { renderStatus, ctrlsSvc } = this.beans;\n if (renderStatus) {\n if (!renderStatus.areHeaderCellsRendered() && this.timesRetried < 5) {\n this.timesRetried++;\n setTimeout(() => this.revealColumns(key));\n return;\n }\n this.timesRetried = 0;\n }\n ctrlsSvc.getGridBodyCtrl().eGridBody.classList.remove(HideClass);\n this.alreadyRevealed = true;\n }\n};\nvar ColumnDelayRenderModule = {\n moduleName: \"ColumnDelayRender\",\n version: VERSION,\n beans: [ColumnDelayRenderService],\n css: [column_delay_render_default]\n};\n\n// packages/ag-grid-community/src/rendering/overlays/overlayComponent.ts\nvar OverlayComponent = class extends Component {\n constructor() {\n super();\n }\n};\n\n// packages/ag-grid-community/src/rendering/overlays/exportingOverlayComponent.ts\nvar ExportingOverlayElement = {\n tag: \"div\",\n cls: \"ag-overlay-exporting-center\",\n children: [\n { tag: \"span\", ref: \"eExportingIcon\", cls: \"ag-loading-icon\" },\n { tag: \"span\", ref: \"eExportingText\", cls: \"ag-exporting-text\" }\n ]\n};\nvar ExportingOverlayComponent = class extends OverlayComponent {\n constructor() {\n super(...arguments);\n this.eExportingIcon = RefPlaceholder;\n this.eExportingText = RefPlaceholder;\n }\n init(params) {\n const { beans } = this;\n this.setTemplate(ExportingOverlayElement);\n const eExportingIcon = _createIconNoSpan(\"overlayExporting\", beans, null);\n if (eExportingIcon) {\n this.eExportingIcon.appendChild(eExportingIcon);\n }\n const exportingText = params.exporting?.overlayText ?? this.getLocaleTextFunc()(\"exportingOoo\", \"Exporting...\");\n this.eExportingText.textContent = exportingText;\n beans.ariaAnnounce.announceValue(exportingText, \"overlay\");\n }\n};\n\n// packages/ag-grid-community/src/rendering/overlays/loadingOverlayComponent.ts\nvar LoadingOverlayElement = {\n tag: \"div\",\n cls: \"ag-overlay-loading-center\",\n children: [\n { tag: \"span\", ref: \"eLoadingIcon\", cls: \"ag-loading-icon\" },\n { tag: \"span\", ref: \"eLoadingText\", cls: \"ag-loading-text\" }\n ]\n};\nvar LoadingOverlayComponent = class extends OverlayComponent {\n constructor() {\n super(...arguments);\n this.eLoadingIcon = RefPlaceholder;\n this.eLoadingText = RefPlaceholder;\n }\n init(params) {\n const { beans, gos } = this;\n const customTemplate = _makeNull(gos.get(\"overlayLoadingTemplate\")?.trim());\n this.setTemplate(customTemplate ?? LoadingOverlayElement);\n if (!customTemplate) {\n const eLoadingIcon = _createIconNoSpan(\"overlayLoading\", beans, null);\n if (eLoadingIcon) {\n this.eLoadingIcon.appendChild(eLoadingIcon);\n }\n const loadingText = params.loading?.overlayText ?? this.getLocaleTextFunc()(\"loadingOoo\", \"Loading...\");\n this.eLoadingText.textContent = loadingText;\n beans.ariaAnnounce.announceValue(loadingText, \"overlay\");\n }\n }\n};\n\n// packages/ag-grid-community/src/rendering/overlays/noMatchingRowsOverlayComponent.ts\nvar NoMatchingRowsOverlayElement = { tag: \"span\", cls: \"ag-overlay-no-matching-rows-center\" };\nvar NoMatchingRowsOverlayComponent = class extends OverlayComponent {\n init(params) {\n const { beans } = this;\n this.setTemplate(NoMatchingRowsOverlayElement);\n const noRowsText = params.noMatchingRows?.overlayText ?? this.getLocaleTextFunc()(\"noMatchingRows\", \"No Matching Rows\");\n this.getGui().textContent = noRowsText;\n beans.ariaAnnounce.announceValue(noRowsText, \"overlay\");\n }\n};\n\n// packages/ag-grid-community/src/rendering/overlays/noRowsOverlayComponent.ts\nvar NoRowsOverlayElement = { tag: \"span\", cls: \"ag-overlay-no-rows-center\" };\nvar NoRowsOverlayComponent = class extends OverlayComponent {\n init(params) {\n const { beans, gos } = this;\n const customTemplate = _makeNull(gos.get(\"overlayNoRowsTemplate\")?.trim());\n this.setTemplate(customTemplate ?? NoRowsOverlayElement);\n if (!customTemplate) {\n const noRowsText = params.noRows?.overlayText ?? this.getLocaleTextFunc()(\"noRowsToShow\", \"No Rows To Show\");\n this.getGui().textContent = noRowsText;\n beans.ariaAnnounce.announceValue(noRowsText, \"overlay\");\n }\n }\n};\n\n// packages/ag-grid-community/src/rendering/overlays/overlayApi.ts\nfunction showLoadingOverlay(beans) {\n beans.overlays?.showLoadingOverlay();\n}\nfunction showNoRowsOverlay(beans) {\n beans.overlays?.showNoRowsOverlay();\n}\nfunction hideOverlay(beans) {\n beans.overlays?.hideOverlay();\n}\n\n// packages/ag-grid-community/src/rendering/overlays/overlayWrapperComponent.css\nvar overlayWrapperComponent_default = \".ag-overlay{inset:0;pointer-events:none;position:absolute;z-index:2}.ag-overlay-panel,.ag-overlay-wrapper{display:flex;height:100%;width:100%}.ag-overlay-wrapper{align-items:center;flex:none;justify-content:center;text-align:center}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{pointer-events:all}.ag-overlay-exporting-center,.ag-overlay-loading-center{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-popup-shadow);display:flex;padding:var(--ag-spacing)}\";\n\n// packages/ag-grid-community/src/rendering/overlays/overlayWrapperComponent.ts\nvar OverlayWrapperElement = {\n tag: \"div\",\n cls: \"ag-overlay\",\n role: \"presentation\",\n children: [\n {\n tag: \"div\",\n cls: \"ag-overlay-panel\",\n role: \"presentation\",\n children: [{ tag: \"div\", ref: \"eOverlayWrapper\", cls: \"ag-overlay-wrapper\", role: \"presentation\" }]\n }\n ]\n};\nvar OverlayWrapperComponent = class extends Component {\n constructor() {\n super(OverlayWrapperElement);\n this.eOverlayWrapper = RefPlaceholder;\n this.activeOverlay = null;\n this.activePromise = null;\n this.activeCssClass = null;\n this.elToFocusAfter = null;\n this.overlayExclusive = false;\n this.oldWrapperPadding = null;\n this.registerCSS(overlayWrapperComponent_default);\n }\n handleKeyDown(e) {\n if (e.key !== KeyCode.TAB || e.defaultPrevented || _isStopPropagationForAgGrid(e)) {\n return;\n }\n const { beans, eOverlayWrapper } = this;\n const nextEl = eOverlayWrapper && _findNextFocusableElement(beans, eOverlayWrapper, false, e.shiftKey);\n if (nextEl) {\n return;\n }\n let isFocused = false;\n if (e.shiftKey) {\n isFocused = beans.focusSvc.focusGridView({\n column: _last(beans.visibleCols.allCols),\n backwards: true,\n canFocusOverlay: false\n });\n } else {\n isFocused = _focusNextGridCoreContainer(beans, false);\n }\n if (isFocused) {\n e.preventDefault();\n }\n }\n updateLayoutClasses(cssClass, params) {\n const eOverlayWrapper = this.eOverlayWrapper;\n if (!eOverlayWrapper) {\n return;\n }\n const overlayWrapperClassList = eOverlayWrapper.classList;\n const { AUTO_HEIGHT, NORMAL, PRINT } = LayoutCssClasses;\n overlayWrapperClassList.toggle(AUTO_HEIGHT, params.autoHeight);\n overlayWrapperClassList.toggle(NORMAL, params.normal);\n overlayWrapperClassList.toggle(PRINT, params.print);\n }\n postConstruct() {\n this.createManagedBean(new LayoutFeature(this));\n this.setDisplayed(false, { skipAriaHidden: true });\n this.beans.overlays.setWrapperComp(this, false);\n this.addManagedElementListeners(this.getFocusableElement(), { keydown: this.handleKeyDown.bind(this) });\n this.addManagedEventListeners({ gridSizeChanged: this.refreshWrapperPadding.bind(this) });\n }\n setWrapperTypeClass(overlayWrapperCssClass) {\n const overlayWrapperClassList = this.eOverlayWrapper?.classList;\n if (!overlayWrapperClassList) {\n this.activeCssClass = null;\n return;\n }\n if (this.activeCssClass) {\n overlayWrapperClassList.toggle(this.activeCssClass, false);\n }\n this.activeCssClass = overlayWrapperCssClass;\n overlayWrapperClassList.toggle(overlayWrapperCssClass, true);\n }\n showOverlay(overlayComponentPromise, overlayWrapperCssClass, exclusive) {\n this.destroyActiveOverlay();\n this.elToFocusAfter = null;\n this.activePromise = overlayComponentPromise;\n this.overlayExclusive = exclusive;\n if (!overlayComponentPromise) {\n this.refreshWrapperPadding();\n return AgPromise.resolve();\n }\n this.setWrapperTypeClass(overlayWrapperCssClass);\n this.setDisplayed(true, { skipAriaHidden: true });\n this.refreshWrapperPadding();\n if (exclusive && this.isGridFocused()) {\n const activeElement = _getActiveDomElement(this.beans);\n if (activeElement && !_isNothingFocused(this.beans)) {\n this.elToFocusAfter = activeElement;\n }\n }\n overlayComponentPromise.then((comp) => {\n const eOverlayWrapper = this.eOverlayWrapper;\n if (!eOverlayWrapper) {\n this.destroyBean(comp);\n return;\n }\n if (this.activePromise !== overlayComponentPromise) {\n if (this.activeOverlay !== comp) {\n this.destroyBean(comp);\n comp = null;\n }\n return;\n }\n this.activePromise = null;\n if (!comp) {\n return;\n }\n if (this.activeOverlay !== comp) {\n eOverlayWrapper.appendChild(comp.getGui());\n this.activeOverlay = comp;\n }\n if (exclusive && this.isGridFocused()) {\n _focusInto(eOverlayWrapper);\n }\n });\n return overlayComponentPromise;\n }\n refreshWrapperPadding() {\n if (!this.eOverlayWrapper) {\n this.oldWrapperPadding = null;\n return;\n }\n const overlayActive = !!this.activeOverlay || !!this.activePromise;\n let padding = 0;\n if (overlayActive && !this.overlayExclusive) {\n padding = this.beans.ctrlsSvc.get(\"gridHeaderCtrl\")?.headerHeight || 0;\n }\n if (padding !== this.oldWrapperPadding) {\n this.oldWrapperPadding = padding;\n this.eOverlayWrapper.style.setProperty(\"padding-top\", `${padding}px`);\n }\n }\n destroyActiveOverlay() {\n this.activePromise = null;\n const activeOverlay = this.activeOverlay;\n if (!activeOverlay) {\n this.overlayExclusive = false;\n this.elToFocusAfter = null;\n this.refreshWrapperPadding();\n return;\n }\n let elementToFocus = this.elToFocusAfter;\n this.elToFocusAfter = null;\n this.activeOverlay = null;\n this.overlayExclusive = false;\n if (elementToFocus && !this.isGridFocused()) {\n elementToFocus = null;\n }\n this.destroyBean(activeOverlay);\n const eOverlayWrapper = this.eOverlayWrapper;\n if (eOverlayWrapper) {\n _clearElement(eOverlayWrapper);\n }\n elementToFocus?.focus?.({ preventScroll: true });\n this.refreshWrapperPadding();\n }\n hideOverlay() {\n this.destroyActiveOverlay();\n this.setDisplayed(false, { skipAriaHidden: true });\n }\n isGridFocused() {\n const activeEl = _getActiveDomElement(this.beans);\n return !!activeEl && this.beans.eGridDiv.contains(activeEl);\n }\n destroy() {\n this.elToFocusAfter = null;\n this.destroyActiveOverlay();\n this.beans.overlays.setWrapperComp(this, true);\n super.destroy();\n this.eOverlayWrapper = null;\n }\n};\nvar OverlayWrapperSelector = {\n selector: \"AG-OVERLAY-WRAPPER\",\n component: OverlayWrapperComponent\n};\n\n// packages/ag-grid-community/src/rendering/overlays/overlayService.ts\nvar overlayCompTypeOptionalMethods = [\"refresh\"];\nvar overlayCompType = (name) => ({ name, optionalMethods: overlayCompTypeOptionalMethods });\nvar LoadingOverlayDef = {\n id: \"agLoadingOverlay\",\n overlayType: \"loading\",\n comp: overlayCompType(\"loadingOverlayComponent\"),\n wrapperCls: \"ag-overlay-loading-wrapper\",\n exclusive: true,\n compKey: \"loadingOverlayComponent\",\n paramsKey: \"loadingOverlayComponentParams\",\n isSuppressed: (gos) => {\n const isLoading = gos.get(\"loading\");\n return isLoading === false || gos.get(\"suppressLoadingOverlay\") === true && isLoading !== true;\n }\n};\nvar NoRowsOverlayDef = {\n id: \"agNoRowsOverlay\",\n overlayType: \"noRows\",\n comp: overlayCompType(\"noRowsOverlayComponent\"),\n wrapperCls: \"ag-overlay-no-rows-wrapper\",\n compKey: \"noRowsOverlayComponent\",\n paramsKey: \"noRowsOverlayComponentParams\",\n isSuppressed: (gos) => gos.get(\"suppressNoRowsOverlay\")\n};\nvar NoMatchingRowsOverlayDef = {\n id: \"agNoMatchingRowsOverlay\",\n overlayType: \"noMatchingRows\",\n comp: overlayCompType(\"noMatchingRowsOverlayComponent\"),\n wrapperCls: \"ag-overlay-no-matching-rows-wrapper\"\n};\nvar ExportingOverlayDef = {\n id: \"agExportingOverlay\",\n overlayType: \"exporting\",\n comp: overlayCompType(\"exportingOverlayComponent\"),\n wrapperCls: \"ag-overlay-exporting-wrapper\",\n exclusive: true\n};\nvar CustomOverlayDef = {\n id: \"activeOverlay\",\n comp: overlayCompType(\"activeOverlay\"),\n wrapperCls: \"ag-overlay-modal-wrapper\",\n exclusive: true\n};\nvar getActiveOverlayDef = (activeOverlay) => {\n if (!activeOverlay) {\n return null;\n }\n return {\n agLoadingOverlay: LoadingOverlayDef,\n agNoRowsOverlay: NoRowsOverlayDef,\n agNoMatchingRowsOverlay: NoMatchingRowsOverlayDef,\n agExportingOverlay: ExportingOverlayDef\n }[activeOverlay] ?? CustomOverlayDef;\n};\nvar getOverlayDefForType = (overlayType) => {\n if (!overlayType) {\n return null;\n }\n return {\n loading: LoadingOverlayDef,\n noRows: NoRowsOverlayDef,\n noMatchingRows: NoMatchingRowsOverlayDef,\n exporting: ExportingOverlayDef\n }[overlayType];\n};\nvar OverlayService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"overlays\";\n this.eWrapper = void 0;\n this.exclusive = false;\n this.oldExclusive = false;\n this.currentDef = null;\n this.showInitialOverlay = true;\n this.userForcedNoRows = false;\n this.exportsInProgress = 0;\n this.newColumnsLoadedCleanup = null;\n }\n postConstruct() {\n const gos = this.gos;\n this.showInitialOverlay = _isClientSideRowModel(gos);\n const updateOverlayVisibility = () => {\n if (this.userForcedNoRows) {\n return;\n }\n this.updateOverlay(false);\n };\n const [newColumnsLoadedCleanup, rowCountReadyCleanup, _, __] = this.addManagedEventListeners({\n newColumnsLoaded: updateOverlayVisibility,\n rowCountReady: () => {\n this.disableInitialOverlay();\n updateOverlayVisibility();\n rowCountReadyCleanup();\n },\n rowDataUpdated: updateOverlayVisibility,\n modelUpdated: updateOverlayVisibility\n });\n this.newColumnsLoadedCleanup = newColumnsLoadedCleanup;\n this.addManagedPropertyListeners(\n [\n \"loading\",\n \"activeOverlay\",\n \"activeOverlayParams\",\n \"overlayComponentParams\",\n \"loadingOverlayComponentParams\",\n \"noRowsOverlayComponentParams\"\n ],\n (params) => this.onPropChange(new Set(params.changeSet?.properties))\n );\n }\n destroy() {\n this.doHideOverlay();\n super.destroy();\n this.eWrapper = void 0;\n }\n setWrapperComp(overlayWrapperComp, destroyed) {\n if (!this.isAlive()) {\n return;\n }\n if (!destroyed) {\n this.eWrapper = overlayWrapperComp;\n } else if (this.eWrapper === overlayWrapperComp) {\n this.eWrapper = void 0;\n }\n this.updateOverlay(false);\n }\n /** Returns true if the overlay is visible. */\n isVisible() {\n return !!this.currentDef;\n }\n showLoadingOverlay() {\n this.showInitialOverlay = false;\n const gos = this.gos;\n if (!this.eWrapper || gos.get(\"activeOverlay\")) {\n return;\n }\n if (this.isDisabled(LoadingOverlayDef)) {\n return;\n }\n const loading = gos.get(\"loading\");\n if (!loading && loading !== void 0) {\n return;\n }\n this.doShowOverlay(LoadingOverlayDef);\n }\n showNoRowsOverlay() {\n this.showInitialOverlay = false;\n const gos = this.gos;\n if (!this.eWrapper || gos.get(\"activeOverlay\") || gos.get(\"loading\") || this.isDisabled(NoRowsOverlayDef)) {\n return;\n }\n this.userForcedNoRows = true;\n this.doShowOverlay(NoRowsOverlayDef);\n }\n async showExportOverlay(heavyOperation) {\n const { gos, beans } = this;\n if (!this.eWrapper || gos.get(\"activeOverlay\") || gos.get(\"loading\") || this.isDisabled(ExportingOverlayDef) || this.userForcedNoRows && this.currentDef === NoRowsOverlayDef) {\n heavyOperation();\n return;\n }\n const desiredDef = this.getDesiredDefWithOverride(ExportingOverlayDef);\n if (!desiredDef) {\n heavyOperation();\n return;\n }\n this.exportsInProgress++;\n this.focusedCell = beans.focusSvc.getFocusedCell();\n await this.doShowOverlay(desiredDef);\n await new Promise((resolve) => setTimeout(() => resolve()));\n const shownAt = Date.now();\n try {\n heavyOperation();\n } finally {\n const elapsed = Date.now() - shownAt;\n const remaining = Math.max(0, 300 - elapsed);\n const clearExportOverlay = () => {\n this.exportsInProgress--;\n if (this.exportsInProgress === 0) {\n this.updateOverlay(false);\n _attemptToRestoreCellFocus(beans, this.focusedCell);\n this.focusedCell = null;\n }\n };\n if (remaining > 0) {\n setTimeout(() => clearExportOverlay(), remaining);\n } else {\n clearExportOverlay();\n }\n }\n }\n hideOverlay() {\n const gos = this.gos;\n this.showInitialOverlay = false;\n const userHadForced = this.userForcedNoRows;\n this.userForcedNoRows = false;\n if (gos.get(\"loading\")) {\n _warn(99);\n return;\n }\n if (gos.get(\"activeOverlay\")) {\n _warn(296);\n return;\n }\n if (this.currentDef === NoMatchingRowsOverlayDef) {\n _warn(297);\n return;\n }\n this.doHideOverlay();\n if (userHadForced) {\n if (this.getOverlayDef() !== NoRowsOverlayDef) {\n this.updateOverlay(false);\n }\n }\n }\n getOverlayWrapperSelector() {\n return OverlayWrapperSelector;\n }\n getOverlayWrapperCompClass() {\n return OverlayWrapperComponent;\n }\n onPropChange(changedProps) {\n const activeOverlayChanged = changedProps.has(\"activeOverlay\");\n if (activeOverlayChanged || changedProps.has(\"loading\")) {\n if (this.updateOverlay(activeOverlayChanged)) {\n return;\n }\n }\n const currentDef = this.currentDef;\n const currOverlayComp = this.eWrapper?.activeOverlay;\n if (currOverlayComp && currentDef) {\n const activeOverlayParamsChanged = changedProps.has(\"activeOverlayParams\");\n if (currentDef === CustomOverlayDef) {\n if (activeOverlayParamsChanged) {\n currOverlayComp.refresh?.(this.makeCompParams(true));\n }\n } else {\n const paramsKey = currentDef.paramsKey;\n if (changedProps.has(\"overlayComponentParams\") || paramsKey && changedProps.has(paramsKey)) {\n currOverlayComp.refresh?.(this.makeCompParams(false, paramsKey, currentDef.overlayType));\n }\n }\n }\n }\n updateOverlay(activeOverlayChanged) {\n const eWrapper = this.eWrapper;\n if (!eWrapper) {\n this.currentDef = null;\n return false;\n }\n const desiredDef = this.getDesiredDefWithOverride();\n const currentDef = this.currentDef;\n const shouldReload = desiredDef === CustomOverlayDef && activeOverlayChanged;\n if (desiredDef !== currentDef) {\n if (!desiredDef) {\n this.disableInitialOverlay();\n return this.doHideOverlay();\n }\n this.doShowOverlay(desiredDef);\n return true;\n }\n if (shouldReload && desiredDef) {\n eWrapper.hideOverlay();\n this.doShowOverlay(desiredDef);\n return true;\n }\n if (!desiredDef) {\n this.disableInitialOverlay();\n }\n return false;\n }\n getDesiredDefWithOverride(defaultDef) {\n const { gos } = this;\n let desiredDef = getActiveOverlayDef(gos.get(\"activeOverlay\"));\n if (!desiredDef) {\n desiredDef = defaultDef ?? this.getOverlayDef();\n if (desiredDef && this.isDisabled(desiredDef)) {\n desiredDef = null;\n }\n }\n return desiredDef;\n }\n getOverlayDef() {\n const { gos, beans } = this;\n const { rowModel } = beans;\n const loading = gos.get(\"loading\");\n const loadingDefined = loading !== void 0;\n if (loadingDefined) {\n this.disableInitialOverlay();\n if (loading) {\n return LoadingOverlayDef;\n }\n } else if (this.showInitialOverlay) {\n if (!this.isDisabled(LoadingOverlayDef) && (!gos.get(\"columnDefs\") || !gos.get(\"rowData\"))) {\n return LoadingOverlayDef;\n }\n this.disableInitialOverlay();\n } else {\n this.disableInitialOverlay();\n }\n const overlayType = rowModel.getOverlayType();\n return getOverlayDefForType(overlayType);\n }\n disableInitialOverlay() {\n this.showInitialOverlay = false;\n this.newColumnsLoadedCleanup?.();\n this.newColumnsLoadedCleanup = null;\n }\n /**\n * Show an overlay requested by name or by built-in types.\n * This single function replaces the previous three helpers and handles\n * param selection and wrapper class choice for loading / no-rows and custom overlays.\n */\n doShowOverlay(componentDef) {\n const { gos, beans } = this;\n const { userCompFactory } = beans;\n this.currentDef = componentDef;\n const isProvidedOverlay = componentDef !== CustomOverlayDef;\n const exclusive = !!componentDef.exclusive;\n this.exclusive = exclusive;\n let legacyParamsKey;\n if (componentDef.paramsKey && gos.get(componentDef.paramsKey) || componentDef.compKey && gos.get(componentDef.compKey)) {\n legacyParamsKey = componentDef.paramsKey;\n }\n let compDetails = void 0;\n if (isProvidedOverlay) {\n if (gos.get(\"overlayComponent\") || gos.get(\"overlayComponentSelector\")) {\n compDetails = userCompFactory.getCompDetailsFromGridOptions(\n { name: \"overlayComponent\", optionalMethods: [\"refresh\"] },\n void 0,\n this.makeCompParams(false, componentDef.paramsKey, componentDef.overlayType)\n );\n }\n }\n compDetails ?? (compDetails = userCompFactory.getCompDetailsFromGridOptions(\n componentDef.comp,\n isProvidedOverlay ? componentDef.id : void 0,\n this.makeCompParams(!isProvidedOverlay, legacyParamsKey, componentDef.overlayType),\n false\n ));\n const promise = compDetails?.newAgStackInstance() ?? null;\n const mountedPromise = this.eWrapper ? this.eWrapper.showOverlay(promise, componentDef.wrapperCls, exclusive) : AgPromise.resolve();\n this.eWrapper?.refreshWrapperPadding();\n this.setExclusive(exclusive);\n return mountedPromise;\n }\n makeCompParams(includeActiveOverlayParams, legacyParamsKey, overlayType) {\n const { gos } = this;\n const params = includeActiveOverlayParams ? gos.get(\"activeOverlayParams\") : {\n ...gos.get(\"overlayComponentParams\"),\n ...legacyParamsKey && gos.get(legacyParamsKey) || null,\n overlayType\n };\n return _addGridCommonParams(gos, params ?? {});\n }\n doHideOverlay() {\n let changed = false;\n if (this.currentDef) {\n this.currentDef = null;\n changed = true;\n }\n this.exclusive = false;\n const eWrapper = this.eWrapper;\n if (eWrapper) {\n eWrapper.hideOverlay();\n eWrapper.refreshWrapperPadding();\n this.setExclusive(false);\n }\n return changed;\n }\n setExclusive(exclusive) {\n if (this.oldExclusive !== exclusive) {\n this.oldExclusive = exclusive;\n this.eventSvc.dispatchEvent({ type: \"overlayExclusiveChanged\" });\n }\n }\n isDisabled(def) {\n const { gos } = this;\n return def.overlayType && gos.get(\"suppressOverlays\")?.includes(def.overlayType) || def.isSuppressed?.(gos) === true;\n }\n};\n\n// packages/ag-grid-community/src/rendering/overlays/overlayModule.ts\nvar OverlayModule = {\n moduleName: \"Overlay\",\n version: VERSION,\n userComponents: {\n agLoadingOverlay: LoadingOverlayComponent,\n agNoRowsOverlay: NoRowsOverlayComponent,\n agNoMatchingRowsOverlay: NoMatchingRowsOverlayComponent,\n agExportingOverlay: ExportingOverlayComponent\n },\n apiFunctions: {\n showLoadingOverlay,\n showNoRowsOverlay,\n hideOverlay\n },\n icons: {\n // rotating spinner shown by the loading overlay\n overlayLoading: \"loading\",\n overlayExporting: \"loading\"\n },\n beans: [OverlayService]\n};\n\n// packages/ag-grid-community/src/rendering/rowContainerHeightService.ts\nvar RowContainerHeightService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"rowContainerHeight\";\n // the scrollY position\n this.scrollY = 0;\n // how tall the body is\n this.uiBodyHeight = 0;\n }\n postConstruct() {\n this.addManagedEventListeners({ bodyHeightChanged: this.updateOffset.bind(this) });\n this.maxDivHeight = _getMaxDivHeight();\n _logIfDebug(this.gos, \"RowContainerHeightService - maxDivHeight = \" + this.maxDivHeight);\n }\n updateOffset() {\n if (!this.stretching) {\n return;\n }\n const newScrollY = this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition().top;\n const newBodyHeight = this.getUiBodyHeight();\n const atLeastOneChanged = newScrollY !== this.scrollY || newBodyHeight !== this.uiBodyHeight;\n if (atLeastOneChanged) {\n this.scrollY = newScrollY;\n this.uiBodyHeight = newBodyHeight;\n this.calculateOffset();\n }\n }\n calculateOffset() {\n this.setUiContainerHeight(this.maxDivHeight);\n this.pixelsToShave = this.modelHeight - this.uiContainerHeight;\n this.maxScrollY = this.uiContainerHeight - this.uiBodyHeight;\n const scrollPercent = this.scrollY / this.maxScrollY;\n const divStretchOffset = scrollPercent * this.pixelsToShave;\n _logIfDebug(\n this.gos,\n `RowContainerHeightService - Div Stretch Offset = ${divStretchOffset} (${this.pixelsToShave} * ${scrollPercent})`\n );\n this.setDivStretchOffset(divStretchOffset);\n }\n setUiContainerHeight(height) {\n if (height !== this.uiContainerHeight) {\n this.uiContainerHeight = height;\n this.eventSvc.dispatchEvent({ type: \"rowContainerHeightChanged\" });\n }\n }\n clearOffset() {\n this.setUiContainerHeight(this.modelHeight);\n this.pixelsToShave = 0;\n this.setDivStretchOffset(0);\n }\n setDivStretchOffset(newOffset) {\n const newOffsetFloor = typeof newOffset === \"number\" ? Math.floor(newOffset) : null;\n if (this.divStretchOffset === newOffsetFloor) {\n return;\n }\n this.divStretchOffset = newOffsetFloor;\n this.eventSvc.dispatchEvent({ type: \"heightScaleChanged\" });\n }\n setModelHeight(modelHeight) {\n this.modelHeight = modelHeight;\n this.stretching = modelHeight != null && // null happens when in print layout\n this.maxDivHeight > 0 && modelHeight > this.maxDivHeight;\n if (this.stretching) {\n this.calculateOffset();\n } else {\n this.clearOffset();\n }\n }\n getRealPixelPosition(modelPixel) {\n return modelPixel - this.divStretchOffset;\n }\n getUiBodyHeight() {\n const pos = this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition();\n return pos.bottom - pos.top;\n }\n getScrollPositionForPixel(rowTop) {\n if (this.pixelsToShave <= 0) {\n return rowTop;\n }\n const modelMaxScroll = this.modelHeight - this.getUiBodyHeight();\n const scrollPercent = rowTop / modelMaxScroll;\n const scrollPixel = this.maxScrollY * scrollPercent;\n return scrollPixel;\n }\n};\n\n// packages/ag-grid-community/src/rendering/rowRenderer.ts\nvar ROW_ANIMATION_TIMEOUT = 400;\nvar RowRenderer = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"rowRenderer\";\n this.destroyFuncsForColumnListeners = [];\n // map of row ids to row objects. keeps track of which elements\n // are rendered for which rows in the dom.\n this.rowCtrlsByRowIndex = {};\n this.zombieRowCtrls = {};\n this.allRowCtrls = [];\n this.topRowCtrls = [];\n this.bottomRowCtrls = [];\n // we only allow one refresh at a time, otherwise the internal memory structure here\n // will get messed up. this can happen if the user has a cellRenderer, and inside the\n // renderer they call an API method that results in another pass of the refresh,\n // then it will be trying to draw rows in the middle of a refresh.\n this.refreshInProgress = false;\n this.dataFirstRenderedFired = false;\n this.setupRangeSelectionListeners = () => {\n const onCellSelectionChanged = () => {\n for (const cellCtrl of this.getAllCellCtrls()) {\n cellCtrl.onCellSelectionChanged();\n }\n };\n const onColumnMovedPinnedVisible = () => {\n for (const cellCtrl of this.getAllCellCtrls()) {\n cellCtrl.updateRangeBordersIfRangeCount();\n }\n };\n const addCellSelectionListeners = () => {\n this.eventSvc.addListener(\"cellSelectionChanged\", onCellSelectionChanged);\n this.eventSvc.addListener(\"columnMoved\", onColumnMovedPinnedVisible);\n this.eventSvc.addListener(\"columnPinned\", onColumnMovedPinnedVisible);\n this.eventSvc.addListener(\"columnVisible\", onColumnMovedPinnedVisible);\n };\n const removeCellSelectionListeners = () => {\n this.eventSvc.removeListener(\"cellSelectionChanged\", onCellSelectionChanged);\n this.eventSvc.removeListener(\"columnMoved\", onColumnMovedPinnedVisible);\n this.eventSvc.removeListener(\"columnPinned\", onColumnMovedPinnedVisible);\n this.eventSvc.removeListener(\"columnVisible\", onColumnMovedPinnedVisible);\n };\n this.addDestroyFunc(() => removeCellSelectionListeners());\n this.addManagedPropertyListeners([\"enableRangeSelection\", \"cellSelection\"], () => {\n const isEnabled = _isCellSelectionEnabled(this.gos);\n if (isEnabled) {\n addCellSelectionListeners();\n } else {\n removeCellSelectionListeners();\n }\n });\n const cellSelectionEnabled = _isCellSelectionEnabled(this.gos);\n if (cellSelectionEnabled) {\n addCellSelectionListeners();\n }\n };\n }\n wireBeans(beans) {\n this.pageBounds = beans.pageBounds;\n this.colModel = beans.colModel;\n this.pinnedRowModel = beans.pinnedRowModel;\n this.rowModel = beans.rowModel;\n this.focusSvc = beans.focusSvc;\n this.rowContainerHeight = beans.rowContainerHeight;\n this.ctrlsSvc = beans.ctrlsSvc;\n this.editSvc = beans.editSvc;\n }\n postConstruct() {\n this.ctrlsSvc.whenReady(this, (p) => {\n this.gridBodyCtrl = p.gridBodyCtrl;\n this.initialise();\n });\n }\n initialise() {\n this.addManagedEventListeners({\n paginationChanged: this.onPageLoaded.bind(this),\n pinnedRowDataChanged: this.onPinnedRowDataChanged.bind(this),\n pinnedRowsChanged: this.onPinnedRowsChanged.bind(this),\n displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this),\n bodyScroll: this.onBodyScroll.bind(this),\n bodyHeightChanged: this.redraw.bind(this, {})\n });\n this.addManagedPropertyListeners([\"domLayout\", \"embedFullWidthRows\"], () => this.onDomLayoutChanged());\n this.addManagedPropertyListeners([\"suppressMaxRenderedRowRestriction\", \"rowBuffer\"], () => this.redraw());\n this.addManagedPropertyListener(\"suppressCellFocus\", (e) => this.onSuppressCellFocusChanged(e.currentValue));\n this.addManagedPropertyListeners(\n [\n \"groupSuppressBlankHeader\",\n \"getBusinessKeyForNode\",\n \"fullWidthCellRenderer\",\n \"fullWidthCellRendererParams\",\n \"suppressStickyTotalRow\",\n \"groupRowRenderer\",\n \"groupRowRendererParams\",\n // maybe only needs to refresh FW rows...\n \"loadingCellRenderer\",\n \"loadingCellRendererParams\",\n \"detailCellRenderer\",\n \"detailCellRendererParams\",\n \"enableRangeSelection\",\n \"enableCellTextSelection\"\n ],\n () => this.redrawRows()\n );\n this.addManagedPropertyListener(\"cellSelection\", ({ currentValue, previousValue }) => {\n if (!previousValue && currentValue || previousValue && !currentValue) {\n this.redrawRows();\n }\n });\n const { stickyRowSvc, gos, showRowGroupCols } = this.beans;\n if (showRowGroupCols) {\n this.addManagedPropertyListener(\"showOpenedGroup\", () => {\n const columns = showRowGroupCols.columns;\n if (columns.length) {\n this.refreshCells({ columns, force: true });\n }\n });\n }\n if (stickyRowSvc) {\n this.stickyRowFeature = stickyRowSvc.createStickyRowFeature(\n this,\n this.createRowCon.bind(this),\n this.destroyRowCtrls.bind(this)\n );\n } else {\n const gridBodyCtrl = this.gridBodyCtrl;\n gridBodyCtrl.setStickyTopHeight(0);\n gridBodyCtrl.setStickyBottomHeight(0);\n }\n this.registerCellEventListeners();\n this.initialiseCache();\n this.printLayout = _isDomLayout(gos, \"print\");\n this.embedFullWidthRows = this.printLayout || gos.get(\"embedFullWidthRows\");\n this.redrawAfterModelUpdate();\n }\n initialiseCache() {\n if (this.gos.get(\"keepDetailRows\")) {\n const countProp = this.getKeepDetailRowsCount();\n const count = countProp != null ? countProp : 3;\n this.cachedRowCtrls = new RowCtrlCache(count);\n }\n }\n getKeepDetailRowsCount() {\n return this.gos.get(\"keepDetailRowsCount\");\n }\n getStickyTopRowCtrls() {\n return this.stickyRowFeature?.stickyTopRowCtrls ?? [];\n }\n getStickyBottomRowCtrls() {\n return this.stickyRowFeature?.stickyBottomRowCtrls ?? [];\n }\n updateAllRowCtrls() {\n const liveList = Object.values(this.rowCtrlsByRowIndex);\n const zombieList = Object.values(this.zombieRowCtrls);\n const cachedList = this.cachedRowCtrls?.getEntries() ?? [];\n if (zombieList.length > 0 || cachedList.length > 0) {\n this.allRowCtrls = [...liveList, ...zombieList, ...cachedList];\n } else {\n this.allRowCtrls = liveList;\n }\n }\n /**\n * Checks if the cell is rendered or not. Also returns true if row ctrl is present but has not rendered\n * cells yet.\n * @returns true if cellCtrl is present, or if the row is present but has not rendered rows yet\n */\n isCellBeingRendered(rowIndex, column) {\n const rowCtrl = this.rowCtrlsByRowIndex[rowIndex];\n if (!column || !rowCtrl) {\n return !!rowCtrl;\n }\n if (rowCtrl.isFullWidth()) {\n return true;\n }\n const spannedCell = this.beans.spannedRowRenderer?.getCellByPosition({ rowIndex, column, rowPinned: null });\n return !!spannedCell || !!rowCtrl.getCellCtrl(column) || !rowCtrl.isRowRendered();\n }\n /**\n * Notifies all row and cell controls of any change in focused cell.\n * @param event cell focused event\n */\n updateCellFocus(event) {\n for (const cellCtrl of this.getAllCellCtrls()) {\n cellCtrl.onCellFocused(event);\n }\n for (const rowCtrl of this.getFullWidthRowCtrls()) {\n rowCtrl.onFullWidthRowFocused(event);\n }\n }\n /**\n * Called when a new cell is focused in the grid\n * - if the focused cell isn't rendered; re-draw rows to dry to render it\n * - subsequently updates all cell and row controls with the new focused cell\n * @param event cell focused event\n */\n onCellFocusChanged(event) {\n if (event?.rowIndex != null && !event.rowPinned) {\n const col = this.beans.colModel.getCol(event.column) ?? void 0;\n if (!this.isCellBeingRendered(event.rowIndex, col)) {\n this.redraw();\n }\n }\n this.updateCellFocus(event);\n }\n onSuppressCellFocusChanged(suppressCellFocus) {\n for (const cellCtrl of this.getAllCellCtrls()) {\n cellCtrl.onSuppressCellFocusChanged(suppressCellFocus);\n }\n for (const rowCtrl of this.getFullWidthRowCtrls()) {\n rowCtrl.onSuppressCellFocusChanged(suppressCellFocus);\n }\n }\n // in a clean design, each cell would register for each of these events. however when scrolling, all the cells\n // registering and de-registering for events is a performance bottleneck. so we register here once and inform\n // all active cells.\n registerCellEventListeners() {\n this.addManagedEventListeners({\n cellFocused: (event) => this.onCellFocusChanged(event),\n cellFocusCleared: () => this.updateCellFocus(),\n flashCells: (event) => {\n const { cellFlashSvc } = this.beans;\n if (cellFlashSvc) {\n for (const cellCtrl of this.getAllCellCtrls()) {\n cellFlashSvc.onFlashCells(cellCtrl, event);\n }\n }\n },\n columnHoverChanged: () => {\n for (const cellCtrl of this.getAllCellCtrls()) {\n cellCtrl.onColumnHover();\n }\n },\n displayedColumnsChanged: () => {\n for (const cellCtrl of this.getAllCellCtrls()) {\n cellCtrl.onDisplayedColumnsChanged();\n }\n },\n displayedColumnsWidthChanged: () => {\n if (this.printLayout) {\n for (const cellCtrl of this.getAllCellCtrls()) {\n cellCtrl.onLeftChanged();\n }\n }\n }\n });\n this.setupRangeSelectionListeners();\n this.refreshListenersToColumnsForCellComps();\n this.addManagedEventListeners({\n gridColumnsChanged: this.refreshListenersToColumnsForCellComps.bind(this)\n });\n this.addDestroyFunc(this.removeGridColumnListeners.bind(this));\n }\n // executes all functions in destroyFuncsForColumnListeners and then clears the list\n removeGridColumnListeners() {\n for (const func of this.destroyFuncsForColumnListeners) {\n func();\n }\n this.destroyFuncsForColumnListeners.length = 0;\n }\n // this function adds listeners onto all the grid columns, which are the column that we could have cellComps for.\n // when the grid columns change, we add listeners again. in an ideal design, each CellComp would just register to\n // the column it belongs to on creation, however this was a bottleneck with the number of cells, so do it here\n // once instead.\n refreshListenersToColumnsForCellComps() {\n this.removeGridColumnListeners();\n const cols = this.colModel.getCols();\n for (const col of cols) {\n const forEachCellWithThisCol = (callback) => {\n for (const cellCtrl of this.getAllCellCtrls()) {\n if (cellCtrl.column === col) {\n callback(cellCtrl);\n }\n }\n };\n const leftChangedListener = () => {\n forEachCellWithThisCol((cellCtrl) => cellCtrl.onLeftChanged());\n };\n const widthChangedListener = () => {\n forEachCellWithThisCol((cellCtrl) => cellCtrl.onWidthChanged());\n };\n const firstRightPinnedChangedListener = () => {\n forEachCellWithThisCol((cellCtrl) => cellCtrl.onFirstRightPinnedChanged());\n };\n const lastLeftPinnedChangedListener = () => {\n forEachCellWithThisCol((cellCtrl) => cellCtrl.onLastLeftPinnedChanged());\n };\n const colDefChangedListener = () => {\n forEachCellWithThisCol((cellCtrl) => cellCtrl.onColDefChanged());\n };\n col.__addEventListener(\"leftChanged\", leftChangedListener);\n col.__addEventListener(\"widthChanged\", widthChangedListener);\n col.__addEventListener(\"firstRightPinnedChanged\", firstRightPinnedChangedListener);\n col.__addEventListener(\"lastLeftPinnedChanged\", lastLeftPinnedChangedListener);\n col.__addEventListener(\"colDefChanged\", colDefChangedListener);\n this.destroyFuncsForColumnListeners.push(() => {\n col.__removeEventListener(\"leftChanged\", leftChangedListener);\n col.__removeEventListener(\"widthChanged\", widthChangedListener);\n col.__removeEventListener(\"firstRightPinnedChanged\", firstRightPinnedChangedListener);\n col.__removeEventListener(\"lastLeftPinnedChanged\", lastLeftPinnedChangedListener);\n col.__removeEventListener(\"colDefChanged\", colDefChangedListener);\n });\n }\n }\n onDomLayoutChanged() {\n const printLayout = _isDomLayout(this.gos, \"print\");\n const embedFullWidthRows = printLayout || this.gos.get(\"embedFullWidthRows\");\n const destroyRows = embedFullWidthRows !== this.embedFullWidthRows || this.printLayout !== printLayout;\n this.printLayout = printLayout;\n this.embedFullWidthRows = embedFullWidthRows;\n if (destroyRows) {\n this.redrawAfterModelUpdate({ domLayoutChanged: true });\n }\n }\n // for row models that have datasources, when we update the datasource, we need to force the rowRenderer\n // to redraw all rows. otherwise the old rows from the old datasource will stay displayed.\n datasourceChanged() {\n this.firstRenderedRow = 0;\n this.lastRenderedRow = -1;\n const rowIndexesToRemove = Object.keys(this.rowCtrlsByRowIndex);\n this.removeRowCtrls(rowIndexesToRemove);\n }\n onPageLoaded(event) {\n const params = {\n recycleRows: event.keepRenderedRows,\n animate: event.animate,\n newData: event.newData,\n newPage: event.newPage,\n // because this is a model updated event (not pinned rows), we\n // can skip updating the pinned rows. this is needed so that if user\n // is doing transaction updates, the pinned rows are not getting constantly\n // trashed - or editing cells in pinned rows are not refreshed and put into read mode\n onlyBody: true\n };\n this.redrawAfterModelUpdate(params);\n }\n /**\n * @param column AgColumn\n * @returns An array with HTMLElement for every cell of the column passed as param.\n * If the cell is spanning across multiple columns, it only returns the html element\n * if the column passed is the first column of the span (used for auto width calculation).\n */\n getAllCellsNotSpanningForColumn(column) {\n const res = [];\n for (const rowCtrl of this.getAllRowCtrls()) {\n const eCell = rowCtrl.getCellCtrl(column, true)?.eGui;\n if (eCell) {\n res.push(eCell);\n }\n }\n return res;\n }\n refreshFloatingRowComps(recycleRows = true) {\n this.refreshFloatingRows(this.topRowCtrls, \"top\", recycleRows);\n this.refreshFloatingRows(this.bottomRowCtrls, \"bottom\", recycleRows);\n }\n /**\n * Determines which row controllers need to be destroyed and re-created vs which ones can\n * be re-used.\n *\n * This is operation is to pinned/floating rows as `this.recycleRows` is to normal/body rows.\n *\n * All `RowCtrl` instances in `rowCtrls` that don't correspond to `RowNode` instances in `rowNodes` are destroyed.\n * All `RowNode` instances in `rowNodes` that don't correspond to `RowCtrl` instances in `rowCtrls` are created.\n * All instances in `rowCtrls` must be in the same order as their corresponding nodes in `rowNodes`.\n *\n * @param rowCtrls The list of existing row controllers\n * @param rowNodes The canonical list of row nodes that should have associated controllers\n */\n refreshFloatingRows(rowCtrls, floating, recycleRows) {\n const { pinnedRowModel, beans, printLayout } = this;\n const rowCtrlMap = Object.fromEntries(rowCtrls.map((ctrl) => [ctrl.rowNode.id, ctrl]));\n pinnedRowModel?.forEachPinnedRow(floating, (node, i) => {\n const rowCtrl = rowCtrls[i];\n const rowCtrlDoesNotExist = rowCtrl && pinnedRowModel.getPinnedRowById(rowCtrl.rowNode.id, floating) === void 0;\n if (rowCtrlDoesNotExist) {\n rowCtrl.destroyFirstPass();\n rowCtrl.destroySecondPass();\n }\n if (node.id in rowCtrlMap && recycleRows) {\n rowCtrls[i] = rowCtrlMap[node.id];\n delete rowCtrlMap[node.id];\n } else {\n rowCtrls[i] = new RowCtrl(node, beans, false, false, printLayout);\n }\n });\n const rowNodeCount = (floating === \"top\" ? pinnedRowModel?.getPinnedTopRowCount() : pinnedRowModel?.getPinnedBottomRowCount()) ?? 0;\n rowCtrls.length = rowNodeCount;\n }\n onPinnedRowDataChanged() {\n const params = {\n recycleRows: true\n };\n this.redrawAfterModelUpdate(params);\n }\n onPinnedRowsChanged() {\n this.redrawAfterModelUpdate({ recycleRows: true });\n }\n redrawRow(rowNode, suppressEvent = false) {\n if (rowNode.sticky) {\n this.stickyRowFeature?.refreshStickyNode(rowNode);\n } else if (this.cachedRowCtrls?.has(rowNode)) {\n this.cachedRowCtrls.removeRow(rowNode);\n return;\n } else {\n const destroyAndRecreateCtrl = (dataStruct) => {\n const ctrl = dataStruct[rowNode.rowIndex];\n if (!ctrl) {\n return;\n }\n if (ctrl.rowNode !== rowNode) {\n return;\n }\n ctrl.destroyFirstPass();\n ctrl.destroySecondPass();\n dataStruct[rowNode.rowIndex] = this.createRowCon(rowNode, false, false);\n };\n switch (rowNode.rowPinned) {\n case \"top\":\n destroyAndRecreateCtrl(this.topRowCtrls);\n break;\n case \"bottom\":\n destroyAndRecreateCtrl(this.bottomRowCtrls);\n break;\n default:\n destroyAndRecreateCtrl(this.rowCtrlsByRowIndex);\n this.updateAllRowCtrls();\n }\n }\n if (!suppressEvent) {\n this.dispatchDisplayedRowsChanged(false);\n }\n }\n redrawRows(rowNodes) {\n const { editSvc } = this.beans;\n if (editSvc?.isEditing()) {\n if (editSvc.isBatchEditing()) {\n editSvc.cleanupEditors();\n } else {\n editSvc.stopEditing(void 0, { source: \"api\" });\n }\n }\n const partialRefresh = rowNodes != null;\n if (partialRefresh) {\n for (const node of rowNodes ?? []) {\n this.redrawRow(node, true);\n }\n this.dispatchDisplayedRowsChanged(false);\n return;\n }\n this.redrawAfterModelUpdate();\n }\n // gets called from:\n // +) initialisation (in registerGridComp) params = null\n // +) onDomLayoutChanged, params = null\n // +) onPageLoaded, recycleRows, animate, newData, newPage from event, onlyBody=true\n // +) onPinnedRowDataChanged, recycleRows = true\n // +) redrawRows (from Grid API), recycleRows = true/false\n redrawAfterModelUpdate(params = {}) {\n this.getLockOnRefresh();\n const focusedCell = this.beans.focusSvc?.getFocusCellToUseAfterRefresh();\n this.updateContainerHeights();\n this.scrollToTopIfNewData(params);\n const recycleRows = !params.domLayoutChanged && !!params.recycleRows;\n const animate = params.animate && _isAnimateRows(this.gos);\n const rowsToRecycle = recycleRows ? this.getRowsToRecycle() : null;\n if (!recycleRows) {\n this.removeAllRowComps();\n }\n this.workOutFirstAndLastRowsToRender();\n const { stickyRowFeature, gos } = this;\n if (stickyRowFeature) {\n stickyRowFeature.checkStickyRows();\n const extraHeight = stickyRowFeature.extraTopHeight + stickyRowFeature.extraBottomHeight;\n if (extraHeight) {\n this.updateContainerHeights(extraHeight);\n }\n }\n this.recycleRows(rowsToRecycle, animate);\n this.gridBodyCtrl.updateRowCount();\n if (!params.onlyBody) {\n this.refreshFloatingRowComps(gos.get(\"enableRowPinning\") ? recycleRows : void 0);\n }\n this.dispatchDisplayedRowsChanged();\n if (focusedCell != null) {\n this.restoreFocusedCell(focusedCell);\n }\n this.releaseLockOnRefresh();\n }\n scrollToTopIfNewData(params) {\n const scrollToTop = params.newData || params.newPage;\n const suppressScrollToTop = this.gos.get(\"suppressScrollOnNewData\");\n if (scrollToTop && !suppressScrollToTop) {\n this.gridBodyCtrl.scrollFeature.scrollToTop();\n this.stickyRowFeature?.resetOffsets();\n }\n }\n updateContainerHeights(additionalHeight = 0) {\n const { rowContainerHeight } = this;\n if (this.printLayout) {\n rowContainerHeight.setModelHeight(null);\n return;\n }\n let containerHeight = this.pageBounds.getCurrentPageHeight();\n if (containerHeight === 0) {\n containerHeight = 1;\n }\n rowContainerHeight.setModelHeight(containerHeight + additionalHeight);\n }\n getLockOnRefresh() {\n if (this.refreshInProgress) {\n throw new Error(_errMsg(252));\n }\n this.refreshInProgress = true;\n this.beans.frameworkOverrides.getLockOnRefresh?.();\n }\n releaseLockOnRefresh() {\n this.refreshInProgress = false;\n this.beans.frameworkOverrides.releaseLockOnRefresh?.();\n }\n isRefreshInProgress() {\n return this.refreshInProgress;\n }\n // sets the focus to the provided cell, if the cell is provided. this way, the user can call refresh without\n // worry about the focus been lost. this is important when the user is using keyboard navigation to do edits\n // and the cellEditor is calling 'refresh' to get other cells to update (as other cells might depend on the\n // edited cell).\n restoreFocusedCell(cellPosition) {\n if (!cellPosition) {\n return;\n }\n const focusSvc = this.beans.focusSvc;\n const cellToFocus = this.findPositionToFocus(cellPosition);\n if (!cellToFocus) {\n focusSvc.focusHeaderPosition({\n headerPosition: {\n headerRowIndex: getFocusHeaderRowCount(this.beans) - 1,\n column: cellPosition.column\n }\n });\n return;\n }\n if (cellPosition.rowIndex !== cellToFocus.rowIndex || cellPosition.rowPinned != cellToFocus.rowPinned) {\n focusSvc.setFocusedCell({\n ...cellToFocus,\n preventScrollOnBrowserFocus: true,\n forceBrowserFocus: true\n });\n return;\n }\n if (!focusSvc.doesRowOrCellHaveBrowserFocus()) {\n this.updateCellFocus(\n _addGridCommonParams(this.gos, {\n ...cellToFocus,\n forceBrowserFocus: true,\n preventScrollOnBrowserFocus: true,\n type: \"cellFocused\"\n })\n );\n }\n }\n findPositionToFocus(cellPosition) {\n const { pagination, pageBounds } = this.beans;\n let rowPosition = cellPosition;\n if (rowPosition.rowPinned == null && pagination && pageBounds && !pagination.isRowInPage(rowPosition.rowIndex)) {\n rowPosition = { rowPinned: null, rowIndex: pageBounds.getFirstRow() };\n }\n while (rowPosition) {\n if (rowPosition.rowPinned == null && pageBounds) {\n if (rowPosition.rowIndex < pageBounds.getFirstRow()) {\n rowPosition = _getRowAbove(this.beans, { rowPinned: null, rowIndex: 0 });\n if (!rowPosition) {\n return null;\n }\n } else if (rowPosition.rowIndex > pageBounds.getLastRow()) {\n rowPosition = { rowPinned: null, rowIndex: pageBounds.getLastRow() };\n }\n }\n const row = this.getRowByPosition(rowPosition);\n if (row?.isAlive()) {\n return { ...row.getRowPosition(), column: cellPosition.column };\n }\n rowPosition = _getRowAbove(this.beans, rowPosition);\n }\n return null;\n }\n getAllCellCtrls() {\n const res = [];\n const rowCtrls = this.getAllRowCtrls();\n const rowCtrlsLength = rowCtrls.length;\n for (let i = 0; i < rowCtrlsLength; i++) {\n const cellCtrls = rowCtrls[i].getAllCellCtrls();\n const cellCtrlsLength = cellCtrls.length;\n for (let j = 0; j < cellCtrlsLength; j++) {\n res.push(cellCtrls[j]);\n }\n }\n return res;\n }\n getAllRowCtrls() {\n const { spannedRowRenderer } = this.beans;\n const stickyTopRowCtrls = this.getStickyTopRowCtrls();\n const stickyBottomRowCtrls = this.getStickyBottomRowCtrls();\n const res = [\n ...this.topRowCtrls,\n ...this.bottomRowCtrls,\n ...stickyTopRowCtrls,\n ...stickyBottomRowCtrls,\n ...spannedRowRenderer?.getCtrls(\"top\") ?? [],\n ...spannedRowRenderer?.getCtrls(\"bottom\") ?? [],\n ...spannedRowRenderer?.getCtrls(\"center\") ?? [],\n ...Object.values(this.rowCtrlsByRowIndex)\n ];\n return res;\n }\n addRenderedRowListener(eventName, rowIndex, callback) {\n const rowComp = this.rowCtrlsByRowIndex[rowIndex];\n if (rowComp) {\n rowComp.addEventListener(eventName, callback);\n }\n }\n refreshCells({ rowNodes, columns, force, suppressFlash } = {}) {\n const refreshCellParams = {\n force,\n newData: false,\n suppressFlash\n };\n for (const cellCtrl of this.getCellCtrls(rowNodes, columns)) {\n cellCtrl.refreshOrDestroyCell(refreshCellParams);\n }\n this.refreshFullWidth(rowNodes);\n }\n refreshRows(params = {}) {\n for (const rowCtrl of this.getRowCtrls(params.rowNodes)) {\n rowCtrl.refreshRow(params);\n }\n this.refreshFullWidth(params.rowNodes);\n }\n /** O(1) lookup of a RowCtrl by its RowNode (O(k) for sticky rows, where k is the sticky row count). */\n getRowCtrlByNode(node) {\n const rowIndex = node.rowIndex;\n if (rowIndex == null) {\n return void 0;\n }\n const rowPinned = node.rowPinned;\n if (rowPinned === \"top\") {\n const ctrl2 = this.topRowCtrls[rowIndex];\n return ctrl2?.rowNode === node ? ctrl2 : void 0;\n }\n if (rowPinned === \"bottom\") {\n const ctrl2 = this.bottomRowCtrls[rowIndex];\n return ctrl2?.rowNode === node ? ctrl2 : void 0;\n }\n const ctrl = this.rowCtrlsByRowIndex[rowIndex];\n if (ctrl?.rowNode === node) {\n return ctrl;\n }\n return this.getStickyRowCtrlByNode(node);\n }\n getStickyRowCtrlByNode(node) {\n const stickyRowFeature = this.stickyRowFeature;\n if (!stickyRowFeature) {\n return void 0;\n }\n for (const c of stickyRowFeature.stickyTopRowCtrls) {\n if (c.rowNode === node) {\n return c;\n }\n }\n for (const c of stickyRowFeature.stickyBottomRowCtrls) {\n if (c.rowNode === node) {\n return c;\n }\n }\n return void 0;\n }\n /** Refreshes the rendered row for the given node if it is currently in the viewport. Null-safe: no-op when node is null or undefined. */\n refreshRowByNode(node) {\n if (node) {\n this.getRowCtrlByNode(node)?.refreshRow();\n }\n }\n refreshFullWidth(rowNodes) {\n if (!rowNodes) {\n return;\n }\n let rowRedrawn = false;\n for (const rowCtrl of this.getRowCtrls(rowNodes)) {\n if (!rowCtrl.isFullWidth()) {\n continue;\n }\n const refreshed = rowCtrl.refreshFullWidth();\n if (!refreshed) {\n rowRedrawn = true;\n this.redrawRow(rowCtrl.rowNode, true);\n }\n }\n if (rowRedrawn) {\n this.dispatchDisplayedRowsChanged(false);\n }\n }\n /**\n * @param rowNodes if provided, returns the RowCtrls for the provided rowNodes. otherwise returns all RowCtrls.\n */\n getRowCtrls(rowNodes) {\n const rowIdsMap = mapRowNodes(rowNodes);\n const allRowCtrls = this.getAllRowCtrls();\n if (!rowNodes || !rowIdsMap) {\n return allRowCtrls;\n }\n return allRowCtrls.filter((rowCtrl) => {\n const rowNode = rowCtrl.rowNode;\n return isRowInMap(rowNode, rowIdsMap);\n });\n }\n // returns CellCtrl's that match the provided rowNodes and columns. eg if one row node\n // and two columns provided, that identifies 4 cells, so 4 CellCtrl's returned.\n getCellCtrls(rowNodes, columns) {\n let colIdsMap;\n if (_exists(columns)) {\n colIdsMap = {};\n columns.forEach((colKey) => {\n const column = this.colModel.getCol(colKey);\n if (_exists(column)) {\n colIdsMap[column.getId()] = true;\n }\n });\n }\n const res = [];\n for (const rowCtrl of this.getRowCtrls(rowNodes)) {\n for (const cellCtrl of rowCtrl.getAllCellCtrls()) {\n const colId = cellCtrl.column.getId();\n const excludeColFromRefresh = colIdsMap && !colIdsMap[colId];\n if (excludeColFromRefresh) {\n continue;\n }\n res.push(cellCtrl);\n }\n }\n return res;\n }\n destroy() {\n this.removeAllRowComps(true);\n super.destroy();\n }\n removeAllRowComps(suppressAnimation = false) {\n const rowIndexesToRemove = Object.keys(this.rowCtrlsByRowIndex);\n this.removeRowCtrls(rowIndexesToRemove, suppressAnimation);\n this.stickyRowFeature?.destroyStickyCtrls();\n }\n getRowsToRecycle() {\n const stubNodeIndexes = [];\n for (const index of Object.keys(this.rowCtrlsByRowIndex)) {\n const rowCtrl = this.rowCtrlsByRowIndex[index];\n const stubNode = rowCtrl.rowNode.id == null;\n if (stubNode) {\n stubNodeIndexes.push(index);\n }\n }\n this.removeRowCtrls(stubNodeIndexes);\n const ctrlsByIdMap = {};\n for (const rowCtrl of Object.values(this.rowCtrlsByRowIndex)) {\n const rowNode = rowCtrl.rowNode;\n ctrlsByIdMap[rowNode.id] = rowCtrl;\n }\n this.rowCtrlsByRowIndex = {};\n return ctrlsByIdMap;\n }\n // takes array of row indexes\n removeRowCtrls(rowsToRemove, suppressAnimation = false) {\n for (const indexToRemove of rowsToRemove) {\n const rowCtrl = this.rowCtrlsByRowIndex[indexToRemove];\n if (rowCtrl) {\n rowCtrl.destroyFirstPass(suppressAnimation);\n rowCtrl.destroySecondPass();\n }\n delete this.rowCtrlsByRowIndex[indexToRemove];\n }\n }\n onBodyScroll(e) {\n if (e.direction !== \"vertical\") {\n return;\n }\n this.redraw({ afterScroll: true });\n }\n // gets called when rows don't change, but viewport does, so after:\n // 1) height of grid body changes, ie number of displayed rows has changed\n // 2) grid scrolled to new position\n // 3) ensure index visible (which is a scroll)\n redraw(params = {}) {\n const { focusSvc, animationFrameSvc } = this.beans;\n const { afterScroll } = params;\n let cellFocused;\n const stickyRowFeature = this.stickyRowFeature;\n if (stickyRowFeature) {\n cellFocused = focusSvc?.getFocusCellToUseAfterRefresh() || void 0;\n }\n const oldFirstRow = this.firstRenderedRow;\n const oldLastRow = this.lastRenderedRow;\n this.workOutFirstAndLastRowsToRender();\n let hasStickyRowChanges = false;\n if (stickyRowFeature) {\n hasStickyRowChanges = stickyRowFeature.checkStickyRows();\n const extraHeight = stickyRowFeature.extraTopHeight + stickyRowFeature.extraBottomHeight;\n if (extraHeight) {\n this.updateContainerHeights(extraHeight);\n }\n }\n const rangeChanged = this.firstRenderedRow !== oldFirstRow || this.lastRenderedRow !== oldLastRow;\n if (afterScroll && !hasStickyRowChanges && !rangeChanged) {\n return;\n }\n this.getLockOnRefresh();\n this.recycleRows(null, false, afterScroll);\n this.releaseLockOnRefresh();\n this.dispatchDisplayedRowsChanged(afterScroll && !hasStickyRowChanges);\n if (cellFocused != null) {\n const newFocusedCell = focusSvc?.getFocusCellToUseAfterRefresh();\n if (cellFocused != null && newFocusedCell == null) {\n animationFrameSvc?.flushAllFrames();\n this.restoreFocusedCell(cellFocused);\n }\n }\n }\n removeRowCompsNotToDraw(indexesToDraw, suppressAnimation) {\n const indexesToDrawMap = {};\n for (const index of indexesToDraw) {\n indexesToDrawMap[index] = true;\n }\n const existingIndexes = Object.keys(this.rowCtrlsByRowIndex);\n const indexesNotToDraw = existingIndexes.filter((index) => !indexesToDrawMap[index]);\n this.removeRowCtrls(indexesNotToDraw, suppressAnimation);\n }\n calculateIndexesToDraw(rowsToRecycle) {\n const indexesToDraw = [];\n for (let i = this.firstRenderedRow; i <= this.lastRenderedRow; i++) {\n indexesToDraw.push(i);\n }\n const pagination = this.beans.pagination;\n const focusedRowIndex = this.beans.focusSvc?.getFocusedCell()?.rowIndex;\n if (focusedRowIndex != null && (focusedRowIndex < this.firstRenderedRow || focusedRowIndex > this.lastRenderedRow) && (!pagination || pagination.isRowInPage(focusedRowIndex)) && focusedRowIndex < this.rowModel.getRowCount()) {\n indexesToDraw.push(focusedRowIndex);\n }\n const checkRowToDraw = (rowComp) => {\n const index = rowComp.rowNode.rowIndex;\n if (index == null || index === focusedRowIndex) {\n return;\n }\n if (index < this.firstRenderedRow || index > this.lastRenderedRow) {\n if (this.doNotUnVirtualiseRow(rowComp)) {\n indexesToDraw.push(index);\n }\n }\n };\n for (const rowCtrl of Object.values(this.rowCtrlsByRowIndex)) {\n checkRowToDraw(rowCtrl);\n }\n if (rowsToRecycle) {\n for (const rowCtrl of Object.values(rowsToRecycle)) {\n checkRowToDraw(rowCtrl);\n }\n }\n indexesToDraw.sort((a, b) => a - b);\n const ret = [];\n for (let i = 0; i < indexesToDraw.length; i++) {\n const currRow = indexesToDraw[i];\n const rowNode = this.rowModel.getRow(currRow);\n if (rowNode && !rowNode.sticky) {\n ret.push(currRow);\n }\n }\n return ret;\n }\n recycleRows(rowsToRecycle, animate = false, afterScroll = false) {\n const indexesToDraw = this.calculateIndexesToDraw(rowsToRecycle);\n if (this.printLayout || afterScroll) {\n animate = false;\n }\n this.removeRowCompsNotToDraw(indexesToDraw, !animate);\n for (const rowIndex of indexesToDraw) {\n this.createOrUpdateRowCtrl(rowIndex, rowsToRecycle, animate, afterScroll);\n }\n if (rowsToRecycle) {\n const { animationFrameSvc } = this.beans;\n const useAnimationFrame = animationFrameSvc?.active && afterScroll && !this.printLayout;\n if (useAnimationFrame) {\n animationFrameSvc.addDestroyTask(() => {\n this.destroyRowCtrls(rowsToRecycle, animate);\n this.updateAllRowCtrls();\n this.dispatchDisplayedRowsChanged();\n });\n } else {\n this.destroyRowCtrls(rowsToRecycle, animate);\n }\n }\n this.updateAllRowCtrls();\n }\n dispatchDisplayedRowsChanged(afterScroll = false) {\n this.eventSvc.dispatchEvent({\n type: \"displayedRowsChanged\",\n afterScroll\n });\n }\n onDisplayedColumnsChanged() {\n const { visibleCols } = this.beans;\n const pinningLeft = visibleCols.isPinningLeft();\n const pinningRight = visibleCols.isPinningRight();\n const atLeastOneChanged = this.pinningLeft !== pinningLeft || pinningRight !== this.pinningRight;\n if (atLeastOneChanged) {\n this.pinningLeft = pinningLeft;\n this.pinningRight = pinningRight;\n if (this.embedFullWidthRows) {\n this.redrawFullWidthEmbeddedRows();\n }\n }\n }\n // when embedding, what gets showed in each section depends on what is pinned. eg if embedding group expand / collapse,\n // then it should go into the pinned left area if pinning left, or the center area if not pinning.\n redrawFullWidthEmbeddedRows() {\n const rowsToRemove = [];\n for (const fullWidthCtrl of this.getFullWidthRowCtrls()) {\n const rowIndex = fullWidthCtrl.rowNode.rowIndex;\n rowsToRemove.push(rowIndex.toString());\n }\n this.refreshFloatingRowComps();\n this.removeRowCtrls(rowsToRemove);\n this.redraw({ afterScroll: true });\n }\n getFullWidthRowCtrls(rowNodes) {\n const rowNodesMap = mapRowNodes(rowNodes);\n return this.getAllRowCtrls().filter((rowCtrl) => {\n if (!rowCtrl.isFullWidth()) {\n return false;\n }\n const rowNode = rowCtrl.rowNode;\n if (rowNodesMap != null && !isRowInMap(rowNode, rowNodesMap)) {\n return false;\n }\n return true;\n });\n }\n createOrUpdateRowCtrl(rowIndex, rowsToRecycle, animate, afterScroll) {\n let rowNode;\n let rowCtrl = this.rowCtrlsByRowIndex[rowIndex];\n if (!rowCtrl) {\n rowNode = this.rowModel.getRow(rowIndex);\n if (_exists(rowNode) && _exists(rowsToRecycle) && rowsToRecycle[rowNode.id] && rowNode.alreadyRendered) {\n rowCtrl = rowsToRecycle[rowNode.id];\n rowsToRecycle[rowNode.id] = null;\n }\n }\n const creatingNewRowCtrl = !rowCtrl;\n if (creatingNewRowCtrl) {\n if (!rowNode) {\n rowNode = this.rowModel.getRow(rowIndex);\n }\n if (_exists(rowNode)) {\n rowCtrl = this.createRowCon(rowNode, animate, afterScroll);\n } else {\n return;\n }\n }\n if (rowNode) {\n rowNode.alreadyRendered = true;\n }\n this.rowCtrlsByRowIndex[rowIndex] = rowCtrl;\n }\n destroyRowCtrls(rowCtrlsMap, animate) {\n const executeInAWhileFuncs = [];\n if (rowCtrlsMap) {\n for (const rowCtrl of Object.values(rowCtrlsMap)) {\n if (!rowCtrl) {\n continue;\n }\n if (this.cachedRowCtrls && rowCtrl.isCacheable()) {\n this.cachedRowCtrls.addRow(rowCtrl);\n continue;\n }\n rowCtrl.destroyFirstPass(!animate);\n if (animate) {\n const instanceId = rowCtrl.instanceId;\n this.zombieRowCtrls[instanceId] = rowCtrl;\n executeInAWhileFuncs.push(() => {\n rowCtrl.destroySecondPass();\n delete this.zombieRowCtrls[instanceId];\n });\n } else {\n rowCtrl.destroySecondPass();\n }\n }\n }\n if (animate) {\n executeInAWhileFuncs.push(() => {\n if (this.isAlive()) {\n this.updateAllRowCtrls();\n this.dispatchDisplayedRowsChanged();\n }\n });\n window.setTimeout(() => {\n for (const func of executeInAWhileFuncs) {\n func();\n }\n }, ROW_ANIMATION_TIMEOUT);\n }\n }\n getRowBuffer() {\n return this.gos.get(\"rowBuffer\");\n }\n getRowBufferInPixels() {\n const rowsToBuffer = this.getRowBuffer();\n const defaultRowHeight = _getRowHeightAsNumber(this.beans);\n return rowsToBuffer * defaultRowHeight;\n }\n workOutFirstAndLastRowsToRender() {\n const { rowContainerHeight, pageBounds, rowModel } = this;\n rowContainerHeight.updateOffset();\n let newFirst;\n let newLast;\n if (!rowModel.isRowsToRender()) {\n newFirst = 0;\n newLast = -1;\n } else if (this.printLayout) {\n this.beans.environment.refreshRowHeightVariable();\n newFirst = pageBounds.getFirstRow();\n newLast = pageBounds.getLastRow();\n } else {\n const bufferPixels = this.getRowBufferInPixels();\n const scrollFeature = this.ctrlsSvc.getScrollFeature();\n const suppressRowVirtualisation = this.gos.get(\"suppressRowVirtualisation\");\n let rowHeightsChanged = false;\n let firstPixel;\n let lastPixel;\n do {\n const paginationOffset = pageBounds.getPixelOffset();\n const { pageFirstPixel, pageLastPixel } = pageBounds.getCurrentPagePixelRange();\n const divStretchOffset = rowContainerHeight.divStretchOffset;\n const bodyVRange = scrollFeature.getVScrollPosition();\n const bodyTopPixel = bodyVRange.top;\n const bodyBottomPixel = bodyVRange.bottom;\n if (suppressRowVirtualisation) {\n firstPixel = pageFirstPixel + divStretchOffset;\n lastPixel = pageLastPixel + divStretchOffset;\n } else {\n firstPixel = Math.max(bodyTopPixel + paginationOffset - bufferPixels, pageFirstPixel) + divStretchOffset;\n lastPixel = Math.min(bodyBottomPixel + paginationOffset + bufferPixels, pageLastPixel) + divStretchOffset;\n }\n this.firstVisibleVPixel = Math.max(bodyTopPixel + paginationOffset, pageFirstPixel) + divStretchOffset;\n this.lastVisibleVPixel = Math.min(bodyBottomPixel + paginationOffset, pageLastPixel) + divStretchOffset;\n rowHeightsChanged = this.ensureAllRowsInRangeHaveHeightsCalculated(firstPixel, lastPixel);\n } while (rowHeightsChanged);\n let firstRowIndex = rowModel.getRowIndexAtPixel(firstPixel);\n let lastRowIndex = rowModel.getRowIndexAtPixel(lastPixel);\n const pageFirstRow = pageBounds.getFirstRow();\n const pageLastRow = pageBounds.getLastRow();\n if (firstRowIndex < pageFirstRow) {\n firstRowIndex = pageFirstRow;\n }\n if (lastRowIndex > pageLastRow) {\n lastRowIndex = pageLastRow;\n }\n newFirst = firstRowIndex;\n newLast = lastRowIndex;\n }\n const rowLayoutNormal = _isDomLayout(this.gos, \"normal\");\n const suppressRowCountRestriction = this.gos.get(\"suppressMaxRenderedRowRestriction\");\n const rowBufferMaxSize = Math.max(this.getRowBuffer(), 500);\n if (rowLayoutNormal && !suppressRowCountRestriction) {\n if (newLast - newFirst > rowBufferMaxSize) {\n newLast = newFirst + rowBufferMaxSize;\n }\n }\n const firstDiffers = newFirst !== this.firstRenderedRow;\n const lastDiffers = newLast !== this.lastRenderedRow;\n if (firstDiffers || lastDiffers) {\n this.firstRenderedRow = newFirst;\n this.lastRenderedRow = newLast;\n this.eventSvc.dispatchEvent({\n type: \"viewportChanged\",\n firstRow: newFirst,\n lastRow: newLast\n });\n }\n }\n /**\n * This event will only be fired once, and is queued until after the browser next renders.\n * This allows us to fire an event during the start of the render cycle, when we first see data being rendered\n * but not execute the event until all of the data has finished being rendered to the dom.\n */\n dispatchFirstDataRenderedEvent() {\n if (this.dataFirstRenderedFired) {\n return;\n }\n this.dataFirstRenderedFired = true;\n _requestAnimationFrame(this.beans, () => {\n this.beans.eventSvc.dispatchEvent({\n type: \"firstDataRendered\",\n firstRow: this.firstRenderedRow,\n lastRow: this.lastRenderedRow\n });\n });\n }\n ensureAllRowsInRangeHaveHeightsCalculated(topPixel, bottomPixel) {\n const pinnedRowHeightsChanged = this.pinnedRowModel?.ensureRowHeightsValid();\n const stickyHeightsChanged = this.stickyRowFeature?.ensureRowHeightsValid();\n const { pageBounds, rowModel } = this;\n const rowModelHeightsChanged = rowModel.ensureRowHeightsValid(\n topPixel,\n bottomPixel,\n pageBounds.getFirstRow(),\n pageBounds.getLastRow()\n );\n if (rowModelHeightsChanged || stickyHeightsChanged) {\n this.eventSvc.dispatchEvent({\n type: \"recalculateRowBounds\"\n });\n }\n if (stickyHeightsChanged || rowModelHeightsChanged || pinnedRowHeightsChanged) {\n this.updateContainerHeights();\n return true;\n }\n return false;\n }\n // check that none of the rows to remove are editing or focused as:\n // a) if editing, we want to keep them, otherwise the user will loose the context of the edit,\n // eg user starts editing, enters some text, then scrolls down and then up, next time row rendered\n // the edit is reset - so we want to keep it rendered.\n // b) if focused, we want ot keep keyboard focus, so if user ctrl+c, it goes to clipboard,\n // otherwise the user can range select and drag (with focus cell going out of the viewport)\n // and then ctrl+c, nothing will happen if cell is removed from dom.\n // c) if detail record of master detail, as users complained that the context of detail rows\n // was getting lost when detail row out of view. eg user expands to show detail row,\n // then manipulates the detail panel (eg sorts the detail grid), then context is lost\n // after detail panel is scrolled out of / into view.\n doNotUnVirtualiseRow(rowCtrl) {\n const REMOVE_ROW = false;\n const KEEP_ROW = true;\n const rowNode = rowCtrl.rowNode;\n const rowHasFocus = this.focusSvc.isRowFocused(rowNode.rowIndex, rowNode.rowPinned);\n const rowIsEditing = this.editSvc?.isEditing(rowCtrl);\n const rowIsDetail = rowNode.detail;\n const mightWantToKeepRow = rowHasFocus || rowIsEditing || rowIsDetail;\n if (!mightWantToKeepRow) {\n return REMOVE_ROW;\n }\n const rowNodePresent = this.isRowPresent(rowNode);\n return rowNodePresent ? KEEP_ROW : REMOVE_ROW;\n }\n isRowPresent(rowNode) {\n if (!this.rowModel.isRowPresent(rowNode)) {\n return false;\n }\n return this.beans.pagination?.isRowInPage(rowNode.rowIndex) ?? true;\n }\n createRowCon(rowNode, animate, afterScroll) {\n const rowCtrlFromCache = this.cachedRowCtrls?.getRow(rowNode) ?? null;\n if (rowCtrlFromCache) {\n return rowCtrlFromCache;\n }\n const useAnimationFrameForCreate = afterScroll && !this.printLayout && !!this.beans.animationFrameSvc?.active;\n const res = new RowCtrl(rowNode, this.beans, animate, useAnimationFrameForCreate, this.printLayout);\n return res;\n }\n getRenderedNodes() {\n const viewportRows = Object.values(this.rowCtrlsByRowIndex).map((rowCtrl) => rowCtrl.rowNode);\n const stickyTopRows = this.getStickyTopRowCtrls().map((rowCtrl) => rowCtrl.rowNode);\n const stickyBottomRows = this.getStickyBottomRowCtrls().map((rowCtrl) => rowCtrl.rowNode);\n return [...stickyTopRows, ...viewportRows, ...stickyBottomRows];\n }\n getRowByPosition(rowPosition) {\n let rowCtrl;\n const { rowIndex } = rowPosition;\n switch (rowPosition.rowPinned) {\n case \"top\":\n rowCtrl = this.topRowCtrls[rowIndex];\n break;\n case \"bottom\":\n rowCtrl = this.bottomRowCtrls[rowIndex];\n break;\n default:\n rowCtrl = this.rowCtrlsByRowIndex[rowIndex];\n if (!rowCtrl) {\n rowCtrl = this.getStickyTopRowCtrls().find((ctrl) => ctrl.rowNode.rowIndex === rowIndex) || null;\n if (!rowCtrl) {\n rowCtrl = this.getStickyBottomRowCtrls().find((ctrl) => ctrl.rowNode.rowIndex === rowIndex) || null;\n }\n }\n break;\n }\n return rowCtrl;\n }\n // returns true if any row between startIndex and endIndex is rendered. used by\n // SSRM or IRM, as they don't want to purge visible blocks from cache.\n isRangeInRenderedViewport(startIndex, endIndex) {\n const parentClosed = startIndex == null || endIndex == null;\n if (parentClosed) {\n return false;\n }\n const blockAfterViewport = startIndex > this.lastRenderedRow;\n const blockBeforeViewport = endIndex < this.firstRenderedRow;\n const blockInsideViewport = !blockBeforeViewport && !blockAfterViewport;\n return blockInsideViewport;\n }\n};\nvar RowCtrlCache = class {\n constructor(maxCount) {\n // map for fast access\n this.entriesMap = {};\n // list for keeping order\n this.entriesList = [];\n this.maxCount = maxCount;\n }\n addRow(rowCtrl) {\n this.entriesMap[rowCtrl.rowNode.id] = rowCtrl;\n this.entriesList.push(rowCtrl);\n rowCtrl.setCached(true);\n if (this.entriesList.length > this.maxCount) {\n const rowCtrlToDestroy = this.entriesList[0];\n rowCtrlToDestroy.destroyFirstPass();\n rowCtrlToDestroy.destroySecondPass();\n this.removeFromCache(rowCtrlToDestroy);\n }\n }\n getRow(rowNode) {\n if (rowNode?.id == null) {\n return null;\n }\n const res = this.entriesMap[rowNode.id];\n if (!res) {\n return null;\n }\n this.removeFromCache(res);\n res.setCached(false);\n const rowNodeMismatch = res.rowNode != rowNode;\n return rowNodeMismatch ? null : res;\n }\n has(rowNode) {\n return this.entriesMap[rowNode.id] != null;\n }\n removeRow(rowNode) {\n const rowNodeId = rowNode.id;\n const ctrl = this.entriesMap[rowNodeId];\n delete this.entriesMap[rowNodeId];\n _removeFromArray(this.entriesList, ctrl);\n }\n removeFromCache(rowCtrl) {\n const rowNodeId = rowCtrl.rowNode.id;\n delete this.entriesMap[rowNodeId];\n _removeFromArray(this.entriesList, rowCtrl);\n }\n getEntries() {\n return this.entriesList;\n }\n};\nfunction mapRowNodes(rowNodes) {\n if (!rowNodes) {\n return;\n }\n const res = {\n top: {},\n bottom: {},\n normal: {}\n };\n for (const rowNode of rowNodes) {\n const id = rowNode.id;\n switch (rowNode.rowPinned) {\n case \"top\":\n res.top[id] = rowNode;\n break;\n case \"bottom\":\n res.bottom[id] = rowNode;\n break;\n default:\n res.normal[id] = rowNode;\n break;\n }\n }\n return res;\n}\nfunction isRowInMap(rowNode, rowIdsMap) {\n const id = rowNode.id;\n const floating = rowNode.rowPinned;\n switch (floating) {\n case \"top\":\n return rowIdsMap.top[id] != null;\n case \"bottom\":\n return rowIdsMap.bottom[id] != null;\n default:\n return rowIdsMap.normal[id] != null;\n }\n}\n\n// packages/ag-grid-community/src/sort/rowNodeSorter.ts\nvar RowNodeSorter = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"rowNodeSorter\";\n this.accentedSort = false;\n this.primaryColumnsSortGroups = false;\n this.pivotActive = false;\n }\n postConstruct() {\n this.firstLeaf = _isClientSideRowModel(this.gos) ? _csrmFirstLeaf : defaultGetLeaf;\n this.addManagedPropertyListeners(\n [\"accentedSort\", \"autoGroupColumnDef\", \"treeData\"],\n this.updateOptions.bind(this)\n );\n const updatePivotModeState = this.updatePivotModeState.bind(this);\n this.addManagedEventListeners({\n columnPivotModeChanged: updatePivotModeState,\n columnPivotChanged: updatePivotModeState\n });\n this.updateOptions();\n updatePivotModeState();\n }\n updateOptions() {\n this.accentedSort = !!this.gos.get(\"accentedSort\");\n this.primaryColumnsSortGroups = _isColumnsSortingCoupledToGroup(this.gos);\n }\n updatePivotModeState() {\n this.pivotActive = this.beans.colModel.isPivotActive();\n }\n doFullSortInPlace(rowNodes, sortOptions) {\n return rowNodes.sort((a, b) => this.compareRowNodes(sortOptions, a, b));\n }\n compareRowNodes(sortOptions, nodeA, nodeB) {\n if (nodeA === nodeB) {\n return 0;\n }\n const accentedCompare = this.accentedSort;\n for (let i = 0, len = sortOptions.length; i < len; ++i) {\n const sortOption = sortOptions[i];\n const isDescending = sortOption.sort === \"desc\";\n let valueA = this.getValue(nodeA, sortOption.column);\n let valueB = this.getValue(nodeB, sortOption.column);\n let comparatorResult;\n const providedComparator = this.getComparator(sortOption, nodeA);\n if (providedComparator) {\n comparatorResult = providedComparator(valueA, valueB, nodeA, nodeB, isDescending);\n } else {\n if (sortOption.type === \"absolute\") {\n valueA = absoluteValueTransformer(valueA);\n valueB = absoluteValueTransformer(valueB);\n }\n comparatorResult = _defaultComparator(valueA, valueB, accentedCompare);\n }\n if (comparatorResult) {\n return sortOption.sort === \"asc\" ? comparatorResult : -comparatorResult;\n }\n }\n return 0;\n }\n /**\n * if user defines a comparator as a function then use that.\n * if user defines a dictionary of comparators, then use the one matching the sort type.\n * if no comparator provided, or no matching comparator found in dictionary, then return undefined.\n *\n * grid checks later if undefined is returned here and falls back to a default comparator corresponding to sort type on the coldef.\n * @private\n */\n getComparator(sortOption, rowNode) {\n const colDef = sortOption.column.getColDef();\n const comparatorOnCol = this.getComparatorFromColDef(colDef, sortOption);\n if (comparatorOnCol) {\n return comparatorOnCol;\n }\n if (!colDef.showRowGroup) {\n return;\n }\n const groupLeafField = !rowNode.group && colDef.field;\n if (!groupLeafField) {\n return;\n }\n const primaryColumn = this.beans.colModel.getColDefCol(groupLeafField);\n if (!primaryColumn) {\n return;\n }\n return this.getComparatorFromColDef(primaryColumn.getColDef(), sortOption);\n }\n getComparatorFromColDef(colDef, sortOption) {\n const comparator = colDef.comparator;\n if (comparator == null) {\n return;\n }\n if (typeof comparator === \"object\") {\n return comparator[_normalizeSortType(sortOption.type)];\n }\n return comparator;\n }\n getValue(node, column) {\n const beans = this.beans;\n if (this.primaryColumnsSortGroups) {\n if (node.rowGroupColumn === column) {\n return this.getGroupDataValue(node, column);\n }\n if (node.group && column.getColDef().showRowGroup) {\n return void 0;\n }\n }\n const value = beans.valueSvc.getValue(column, node, \"data\");\n if (column.isAllowFormula()) {\n const formula = beans.formula;\n if (formula?.isFormula(value)) {\n return formula.resolveValue(column, node);\n }\n }\n return value;\n }\n getGroupDataValue(node, column) {\n if (_isGroupUseEntireRow(this.gos, this.pivotActive)) {\n const leafChild = this.firstLeaf(node);\n return leafChild && this.beans.valueSvc.getValue(column, leafChild, \"data\");\n }\n const displayCol = this.beans.showRowGroupCols?.getShowRowGroupCol(column.getId());\n return displayCol ? node.groupData?.[displayCol.getId()] : void 0;\n }\n};\nvar defaultGetLeaf = (row) => {\n if (row.data) {\n return row;\n }\n let childrenAfterGroup = row.childrenAfterGroup;\n while (childrenAfterGroup?.length) {\n const node = childrenAfterGroup[0];\n if (node.data) {\n return node;\n }\n childrenAfterGroup = node.childrenAfterGroup;\n }\n};\nvar absoluteValueTransformer = (value) => {\n if (!value) {\n return value;\n }\n if (typeof value === \"bigint\") {\n return value < 0n ? -value : value;\n }\n const numberValue = Number(value);\n return isNaN(numberValue) ? value : Math.abs(numberValue);\n};\n\n// packages/ag-grid-community/src/sort/sortApi.ts\nfunction onSortChanged(beans) {\n beans.sortSvc?.onSortChanged(\"api\");\n}\n\n// packages/ag-grid-community/src/sort/sortIndicatorComp.ts\nvar makeIconParams = (dataRefSuffix, classSuffix) => ({\n tag: \"span\",\n ref: `eSort${dataRefSuffix}`,\n cls: `ag-sort-indicator-icon ag-sort-${classSuffix} ag-hidden`,\n attrs: { \"aria-hidden\": \"true\" }\n});\nvar SortIndicatorElement = {\n tag: \"span\",\n cls: \"ag-sort-indicator-container\",\n children: [\n makeIconParams(\"Order\", \"order\"),\n makeIconParams(\"Asc\", \"ascending-icon\"),\n makeIconParams(\"Desc\", \"descending-icon\"),\n makeIconParams(\"Mixed\", \"mixed-icon\"),\n makeIconParams(\"AbsoluteAsc\", \"absolute-ascending-icon\"),\n makeIconParams(\"AbsoluteDesc\", \"absolute-descending-icon\"),\n makeIconParams(\"None\", \"none-icon\")\n ]\n};\nvar SortIndicatorComp = class extends Component {\n constructor(skipTemplate) {\n super();\n // Elements might by undefined when the user provides a custom template\n this.eSortOrder = RefPlaceholder;\n this.eSortAsc = RefPlaceholder;\n this.eSortDesc = RefPlaceholder;\n this.eSortMixed = RefPlaceholder;\n this.eSortNone = RefPlaceholder;\n this.eSortAbsoluteAsc = RefPlaceholder;\n this.eSortAbsoluteDesc = RefPlaceholder;\n if (!skipTemplate) {\n this.setTemplate(SortIndicatorElement);\n }\n }\n attachCustomElements(eSortOrder, eSortAsc, eSortDesc, eSortMixed, eSortNone, eSortAbsoluteAsc, eSortAbsoluteDesc) {\n this.eSortOrder = eSortOrder;\n this.eSortAsc = eSortAsc;\n this.eSortDesc = eSortDesc;\n this.eSortMixed = eSortMixed;\n this.eSortNone = eSortNone;\n this.eSortAbsoluteAsc = eSortAbsoluteAsc;\n this.eSortAbsoluteDesc = eSortAbsoluteDesc;\n }\n setupSort(column, suppressOrder = false, getSortDefOverride) {\n this.column = column;\n this.suppressOrder = suppressOrder;\n this.getSortDefOverride = getSortDefOverride;\n this.setupMultiSortIndicator();\n if (!column.isSortable() && !column.getColDef().showRowGroup) {\n return;\n }\n this.addInIcon(\"sortAscending\", this.eSortAsc, column);\n this.addInIcon(\"sortDescending\", this.eSortDesc, column);\n this.addInIcon(\"sortUnSort\", this.eSortNone, column);\n this.addInIcon(\"sortAbsoluteAscending\", this.eSortAbsoluteAsc, column);\n this.addInIcon(\"sortAbsoluteDescending\", this.eSortAbsoluteDesc, column);\n const updateIcons = this.updateIcons.bind(this);\n const sortUpdated = this.onSortChanged.bind(this);\n this.addManagedPropertyListener(\"unSortIcon\", updateIcons);\n this.addManagedEventListeners({\n newColumnsLoaded: updateIcons,\n // Watch global events, as row group columns can effect their display column.\n sortChanged: sortUpdated,\n // when grouping changes so can sort indexes and icons\n columnRowGroupChanged: sortUpdated\n });\n this.onSortChanged();\n }\n addInIcon(iconName, eParent, column) {\n if (eParent == null) {\n return;\n }\n const eIcon = _createIconNoSpan(iconName, this.beans, column);\n if (eIcon) {\n eParent.appendChild(eIcon);\n }\n }\n onSortChanged() {\n this.updateIcons();\n if (!this.suppressOrder) {\n this.updateSortOrder();\n }\n }\n updateIcons() {\n const { eSortAsc, eSortDesc, eSortAbsoluteAsc, eSortAbsoluteDesc, eSortNone, column, gos, beans } = this;\n const displaySort = _getDisplaySortForColumn(column, beans, this.getSortDefOverride);\n const isDefaultSortAllowed = displaySort.isDefaultSortAllowed;\n const isAbsoluteSortAllowed = displaySort.isAbsoluteSortAllowed;\n const { isAbsoluteSort, isDefaultSort, isAscending, isDescending, direction } = displaySort;\n if (eSortAsc) {\n _setDisplayed(eSortAsc, isAscending && isDefaultSort && isDefaultSortAllowed, { skipAriaHidden: true });\n }\n if (eSortDesc) {\n _setDisplayed(eSortDesc, isDescending && isDefaultSort && isDefaultSortAllowed, { skipAriaHidden: true });\n }\n if (eSortNone) {\n const alwaysHideNoSort = !column.getColDef().unSortIcon && !gos.get(\"unSortIcon\");\n _setDisplayed(eSortNone, !alwaysHideNoSort && !direction, { skipAriaHidden: true });\n }\n if (eSortAbsoluteAsc) {\n _setDisplayed(eSortAbsoluteAsc, isAscending && isAbsoluteSort && isAbsoluteSortAllowed, {\n skipAriaHidden: true\n });\n }\n if (eSortAbsoluteDesc) {\n _setDisplayed(eSortAbsoluteDesc, isDescending && isAbsoluteSort && isAbsoluteSortAllowed, {\n skipAriaHidden: true\n });\n }\n }\n setupMultiSortIndicator() {\n const { eSortMixed, column, gos } = this;\n this.addInIcon(\"sortUnSort\", eSortMixed, column);\n const isColumnShowingRowGroup = column.getColDef().showRowGroup;\n const areGroupsCoupled = _isColumnsSortingCoupledToGroup(gos);\n if (areGroupsCoupled && isColumnShowingRowGroup) {\n this.addManagedEventListeners({\n // Watch global events, as row group columns can effect their display column.\n sortChanged: this.updateMultiSortIndicator.bind(this),\n // when grouping changes so can sort indexes and icons\n columnRowGroupChanged: this.updateMultiSortIndicator.bind(this)\n });\n this.updateMultiSortIndicator();\n }\n }\n updateMultiSortIndicator() {\n const { eSortMixed, beans, column } = this;\n if (eSortMixed) {\n const isMixedSort = beans.sortSvc.getDisplaySortForColumn(column)?.direction === \"mixed\";\n _setDisplayed(eSortMixed, isMixedSort, { skipAriaHidden: true });\n }\n }\n // we listen here for global sort events, NOT column sort events, as we want to do this\n // when sorting has been set on all column (if we listened just for our col (where we\n // set the asc / desc icons) then it's possible other cols are yet to get their sorting state.\n updateSortOrder() {\n const {\n eSortOrder,\n column,\n beans: { sortSvc }\n } = this;\n if (!eSortOrder) {\n return;\n }\n const allColumnsWithSorting = sortSvc.getColumnsWithSortingOrdered();\n const indexThisCol = sortSvc.getDisplaySortIndexForColumn(column) ?? -1;\n const moreThanOneColSorting = allColumnsWithSorting.some(\n (col) => sortSvc.getDisplaySortIndexForColumn(col) ?? -1 >= 1\n );\n const showIndex = indexThisCol >= 0 && moreThanOneColSorting;\n _setDisplayed(eSortOrder, showIndex, { skipAriaHidden: true });\n if (indexThisCol >= 0) {\n eSortOrder.textContent = (indexThisCol + 1).toString();\n } else {\n _clearElement(eSortOrder);\n }\n }\n refresh() {\n this.onSortChanged();\n }\n};\nvar SortIndicatorSelector = {\n selector: \"AG-SORT-INDICATOR\",\n component: SortIndicatorComp\n};\n\n// packages/ag-grid-community/src/sort/sortService.ts\nvar SortService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"sortSvc\";\n }\n progressSort(column, multiSort, source) {\n const nextDirection = this.getNextSortDirection(column);\n this.setSortForColumn(column, nextDirection, multiSort, source);\n }\n progressSortFromEvent(column, event) {\n const sortUsingCtrl = this.gos.get(\"multiSortKey\") === \"ctrl\";\n const multiSort = sortUsingCtrl ? event.ctrlKey || event.metaKey : event.shiftKey;\n this.progressSort(column, multiSort, \"uiColumnSorted\");\n }\n setSortForColumn(column, sortDef, multiSort, source) {\n const { gos, showRowGroupCols } = this.beans;\n const isColumnsSortingCoupledToGroup = _isColumnsSortingCoupledToGroup(gos);\n let columnsToUpdate = [column];\n if (isColumnsSortingCoupledToGroup) {\n if (column.getColDef().showRowGroup) {\n const rowGroupColumns = showRowGroupCols?.getSourceColumnsForGroupColumn?.(column);\n const sortableRowGroupColumns = rowGroupColumns?.filter((col) => col.isSortable());\n if (sortableRowGroupColumns) {\n columnsToUpdate = [column, ...sortableRowGroupColumns];\n }\n }\n }\n for (const col of columnsToUpdate) {\n this.setColSort(col, sortDef, source);\n }\n const doingMultiSort = (multiSort || gos.get(\"alwaysMultiSort\")) && !gos.get(\"suppressMultiSort\");\n const updatedColumns = [];\n if (!doingMultiSort) {\n const clearedColumns = this.clearSortBarTheseColumns(columnsToUpdate, source);\n updatedColumns.push(...clearedColumns);\n }\n this.updateSortIndex(column);\n updatedColumns.push(...columnsToUpdate);\n this.dispatchSortChangedEvents(source, updatedColumns);\n }\n updateSortIndex(lastColToChange) {\n const { gos, colModel, showRowGroupCols } = this.beans;\n const isCoupled = _isColumnsSortingCoupledToGroup(gos);\n const groupParent = showRowGroupCols?.getShowRowGroupCol(lastColToChange.getId());\n const lastSortIndexCol = isCoupled ? groupParent || lastColToChange : lastColToChange;\n const allSortedCols = this.getColumnsWithSortingOrdered();\n colModel.forAllCols((col) => this.setColSortIndex(col, null));\n const allSortedColsWithoutChangesOrGroups = allSortedCols.filter((col) => {\n if (isCoupled && col.getColDef().showRowGroup) {\n return false;\n }\n return col !== lastSortIndexCol;\n });\n const sortedColsWithIndices = lastSortIndexCol.getSortDef() ? [...allSortedColsWithoutChangesOrGroups, lastSortIndexCol] : allSortedColsWithoutChangesOrGroups;\n sortedColsWithIndices.forEach((col, idx) => this.setColSortIndex(col, idx));\n }\n // gets called by API, so if data changes, use can call this, which will end up\n // working out the sort order again of the rows.\n onSortChanged(source, columns) {\n this.dispatchSortChangedEvents(source, columns);\n }\n isSortActive() {\n let isSorting = false;\n this.beans.colModel.forAllCols((col) => {\n if (col.getSortDef()) {\n isSorting = true;\n return true;\n }\n });\n return isSorting;\n }\n dispatchSortChangedEvents(source, columns) {\n const event = {\n type: \"sortChanged\",\n source\n };\n if (columns) {\n event.columns = columns;\n }\n this.eventSvc.dispatchEvent(event);\n }\n clearSortBarTheseColumns(columnsToSkip, source) {\n const clearedColumns = [];\n this.beans.colModel.forAllCols((columnToClear) => {\n if (!columnsToSkip.includes(columnToClear)) {\n if (columnToClear.getSortDef()) {\n clearedColumns.push(columnToClear);\n }\n this.setColSort(columnToClear, void 0, source);\n }\n });\n return clearedColumns;\n }\n getNextSortDirection(column, currentSort) {\n const sortingOrder = column.getSortingOrder();\n const currentSortDef = currentSort === void 0 ? column.getSortDef() : _getSortDefFromInput(currentSort);\n const currentIndex = sortingOrder.findIndex((e) => _areSortDefsEqual(e, currentSortDef));\n let nextIndex = currentIndex + 1;\n if (nextIndex >= sortingOrder.length) {\n nextIndex = 0;\n }\n return _getSortDefFromInput(sortingOrder[nextIndex]);\n }\n /**\n * @returns a map of sort indexes for every sorted column, if groups sort primaries then they will have equivalent indices\n */\n getIndexedSortMap() {\n const { gos, colModel, showRowGroupCols, rowGroupColsSvc } = this.beans;\n let allSortedCols = [];\n colModel.forAllCols((col) => {\n if (col.getSortDef()) {\n allSortedCols.push(col);\n }\n });\n if (colModel.isPivotMode()) {\n const isSortingLinked = _isColumnsSortingCoupledToGroup(gos);\n allSortedCols = allSortedCols.filter((col) => {\n const isAggregated = !!col.getAggFunc();\n const isSecondary = !col.isPrimary();\n const isGroup = isSortingLinked ? showRowGroupCols?.getShowRowGroupCol(col.getId()) : col.getColDef().showRowGroup;\n return isAggregated || isSecondary || isGroup;\n });\n }\n const sortedRowGroupCols = rowGroupColsSvc?.columns.filter((col) => !!col.getSortDef()) ?? [];\n const allColsIndexes = {};\n allSortedCols.forEach((col, index) => allColsIndexes[col.getId()] = index);\n allSortedCols.sort((a, b) => {\n const iA = a.getSortIndex();\n const iB = b.getSortIndex();\n if (iA != null && iB != null) {\n return iA - iB;\n } else if (iA == null && iB == null) {\n const posA = allColsIndexes[a.getId()];\n const posB = allColsIndexes[b.getId()];\n return posA > posB ? 1 : -1;\n } else if (iB == null) {\n return -1;\n } else {\n return 1;\n }\n });\n const isSortLinked = _isColumnsSortingCoupledToGroup(gos) && !!sortedRowGroupCols.length;\n if (isSortLinked) {\n allSortedCols = [\n ...new Set(\n // if linked sorting, replace all columns with the display group column for index purposes, and ensure uniqueness\n allSortedCols.map((col) => showRowGroupCols?.getShowRowGroupCol(col.getId()) ?? col)\n )\n ];\n }\n const indexMap = /* @__PURE__ */ new Map();\n allSortedCols.forEach((col, idx) => indexMap.set(col, idx));\n if (isSortLinked) {\n for (const col of sortedRowGroupCols) {\n const groupDisplayCol = showRowGroupCols.getShowRowGroupCol(col.getId());\n indexMap.set(col, indexMap.get(groupDisplayCol));\n }\n }\n return indexMap;\n }\n getColumnsWithSortingOrdered() {\n return [...this.getIndexedSortMap().entries()].sort(([, idx1], [, idx2]) => idx1 - idx2).map(([col]) => col);\n }\n /**\n * Util method to collect sort items by going through sorted columns once.\n */\n collectSortItems(asSortModel = false) {\n const sortItems = [];\n const columnsWithSortingOrdered = this.getColumnsWithSortingOrdered();\n for (const column of columnsWithSortingOrdered) {\n const sort = column.getSortDef()?.direction;\n if (!sort) {\n continue;\n }\n const type = _normalizeSortType(column.getSortDef()?.type);\n const sortItem = { sort, type };\n if (asSortModel) {\n sortItem.colId = column.getId();\n } else {\n sortItem.column = column;\n }\n sortItems.push(sortItem);\n }\n return sortItems;\n }\n // used by server side row models, to send sort to server\n getSortModel() {\n return this.collectSortItems(true);\n }\n getSortOptions() {\n return this.collectSortItems();\n }\n canColumnDisplayMixedSort(column) {\n const isColumnSortCouplingActive = _isColumnsSortingCoupledToGroup(this.gos);\n const isGroupDisplayColumn = !!column.getColDef().showRowGroup;\n return isColumnSortCouplingActive && isGroupDisplayColumn;\n }\n getDisplaySortForColumn(column) {\n const linkedColumns = this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(column);\n if (!this.canColumnDisplayMixedSort(column) || !linkedColumns?.length) {\n return column.getSortDef();\n }\n const columnHasUniqueData = column.getColDef().field != null || !!column.getColDef().valueGetter;\n const sortableColumns = columnHasUniqueData ? [column, ...linkedColumns] : linkedColumns;\n const firstSort = sortableColumns[0].getSortDef();\n const allMatch = sortableColumns.every((col) => _areSortDefsEqual(col.getSortDef(), firstSort));\n if (!allMatch) {\n return { type: _normalizeSortType(column.getSortDef()?.type), direction: \"mixed\" };\n }\n return firstSort;\n }\n getDisplaySortIndexForColumn(column) {\n return this.getIndexedSortMap().get(column);\n }\n setupHeader(comp, column) {\n const refreshStyles = () => {\n const { type, direction } = _getSortDefFromInput(column.getSortDef());\n comp.toggleCss(\"ag-header-cell-sorted-asc\", direction === \"asc\");\n comp.toggleCss(\"ag-header-cell-sorted-desc\", direction === \"desc\");\n comp.toggleCss(\"ag-header-cell-sorted-abs-asc\", type === \"absolute\" && direction === \"asc\");\n comp.toggleCss(\"ag-header-cell-sorted-abs-desc\", type === \"absolute\" && direction === \"desc\");\n comp.toggleCss(\"ag-header-cell-sorted-none\", !direction);\n if (column.getColDef().showRowGroup) {\n const sourceColumns = this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(column);\n const sortDirectionsMatch = sourceColumns?.every(\n (sourceCol) => direction == sourceCol.getSortDef()?.direction\n );\n const isMultiSorting = !sortDirectionsMatch;\n comp.toggleCss(\"ag-header-cell-sorted-mixed\", isMultiSorting);\n }\n };\n comp.addManagedEventListeners({\n sortChanged: refreshStyles,\n columnPinned: refreshStyles,\n columnRowGroupChanged: refreshStyles,\n displayedColumnsChanged: refreshStyles\n });\n }\n initCol(column) {\n const { sortIndex, initialSortIndex } = column.colDef;\n const sortDef = _getSortDefFromColDef(column.colDef);\n if (sortDef) {\n column.setSortDef(sortDef, true);\n }\n if (sortIndex !== void 0) {\n if (sortIndex !== null) {\n column.sortIndex = sortIndex;\n }\n } else if (initialSortIndex !== null) {\n column.sortIndex = initialSortIndex;\n }\n }\n /**\n * Update a column's sort state from a sort definition.\n * If `sortDefOrDirection` is `undefined`, the call is a no-op (no change).\n */\n updateColSort(column, sortDefOrDirection, source) {\n if (sortDefOrDirection === void 0) {\n return;\n }\n this.setColSort(column, _getSortDefFromInput(sortDefOrDirection), source);\n }\n setColSort(column, sort, source) {\n if (!_areSortDefsEqual(column.getSortDef(), sort)) {\n column.setSortDef(_getSortDefFromInput(sort), sort === void 0);\n column.dispatchColEvent(\"sortChanged\", source);\n }\n column.dispatchStateUpdatedEvent(\"sort\");\n }\n setColSortIndex(column, sortOrder) {\n column.sortIndex = sortOrder;\n column.dispatchStateUpdatedEvent(\"sortIndex\");\n }\n createSortIndicator(skipTemplate) {\n return new SortIndicatorComp(skipTemplate);\n }\n getSortIndicatorSelector() {\n return SortIndicatorSelector;\n }\n};\n\n// packages/ag-grid-community/src/sort/sortModule.ts\nvar SortModule = {\n moduleName: \"Sort\",\n version: VERSION,\n beans: [SortService, RowNodeSorter],\n apiFunctions: {\n onSortChanged\n },\n userComponents: {\n agSortIndicator: SortIndicatorComp\n },\n icons: {\n // show on column header when column is sorted ascending\n sortAscending: \"asc\",\n // show on column header when column is sorted descending\n sortDescending: \"desc\",\n // show on column header when column has no sort, only when enabled with gridOptions.unSortIcon=true\n sortUnSort: \"none\",\n // show on column header when column is sorted absolute ascending\n sortAbsoluteAscending: \"aasc\",\n // show on column header when column is sorted absolute descending\n sortAbsoluteDescending: \"adesc\"\n }\n};\n\n// packages/ag-grid-community/src/syncService.ts\nvar SyncService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"syncSvc\";\n this.waitingForColumns = false;\n }\n postConstruct() {\n this.addManagedPropertyListener(\"columnDefs\", (event) => this.setColumnDefs(event));\n }\n start() {\n this.beans.ctrlsSvc.whenReady(this, () => {\n const columnDefs = this.gos.get(\"columnDefs\");\n if (columnDefs) {\n this.setColumnsAndData(columnDefs);\n } else {\n this.waitingForColumns = true;\n }\n this.gridReady();\n });\n }\n setColumnsAndData(columnDefs) {\n const { colModel, rowModel } = this.beans;\n colModel.setColumnDefs(columnDefs ?? [], \"gridInitializing\");\n rowModel.start();\n }\n gridReady() {\n const { eventSvc, gos } = this;\n eventSvc.dispatchEvent({\n type: \"gridReady\"\n });\n _logIfDebug(gos, `initialised successfully, enterprise = ${gos.isModuleRegistered(\"EnterpriseCore\")}`);\n }\n setColumnDefs(event) {\n const columnDefs = this.gos.get(\"columnDefs\");\n if (!columnDefs) {\n return;\n }\n if (this.waitingForColumns) {\n this.waitingForColumns = false;\n this.setColumnsAndData(columnDefs);\n return;\n }\n this.beans.colModel.setColumnDefs(columnDefs, _convertColumnEventSourceType(event.source));\n }\n};\n\n// packages/ag-grid-community/src/valueService/cellApi.ts\nfunction expireValueCache(beans) {\n beans.valueCache?.expire();\n}\nfunction getCellValue(beans, params) {\n const { colKey, rowNode, useFormatter, from = \"edit\" } = params;\n const column = beans.colModel.getColDefCol(colKey) ?? beans.colModel.getCol(colKey);\n if (!column) {\n return null;\n }\n const result = beans.valueSvc.getValueForDisplay({\n column,\n node: rowNode,\n includeValueFormatted: useFormatter,\n from\n });\n if (useFormatter) {\n return result.valueFormatted ?? _toString(result.value);\n }\n return result.value;\n}\n\n// packages/ag-grid-community/src/valueService/changeDetectionService.ts\nvar SOURCE_PASTE = \"paste\";\nvar ChangeDetectionService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"changeDetectionSvc\";\n /**\n * Nesting depth for `beginDeferred`/`endDeferred` calls.\n * Positive while a batch is active; `cellValueChanged` events are accumulated rather than flushed immediately.\n * Using a counter (not a boolean) so nested callers — e.g. `groupRowValueSetter` called from inside\n * a clipboard or fill-handle deferred block — do not prematurely flush the outer batch.\n */\n this.deferredDepth = 0;\n /** Accumulated `ChangedPath` for the current batch (CSRM only). `null` until the first CSRM change arrives. */\n this.batchedPath = null;\n /** Nodes queued for direct refresh that are not in the path. */\n this.batchedNodes = null;\n }\n destroy() {\n super.destroy();\n this.batchedPath = null;\n this.batchedNodes = null;\n }\n postConstruct() {\n this.csrm = _getClientSideRowModel(this.beans);\n this.addManagedEventListeners({ cellValueChanged: this.onCellValueChanged.bind(this) });\n }\n /**\n * Begin a deferred change-detection pass: subsequent `cellValueChanged` events are accumulated\n * rather than triggering individual aggregation + refresh passes. Flush happens on endDeferred().\n * Calls may be nested — flush only occurs when the outermost endDeferred() is reached.\n */\n beginDeferred() {\n this.deferredDepth++;\n }\n /**\n * End a deferred pass. When the outermost call is reached (depth returns to zero), runs a single\n * aggregation pass over all accumulated changes and refreshes the affected rows in depth-first order.\n */\n endDeferred() {\n if (this.deferredDepth === 0) {\n return;\n }\n if (--this.deferredDepth > 0) {\n return;\n }\n const path = this.batchedPath;\n const nodes = this.batchedNodes;\n this.batchedPath = null;\n this.batchedNodes = null;\n if (path) {\n this.csrm?.doAggregate(path);\n }\n const { rowRenderer } = this.beans;\n if (nodes) {\n for (const node of nodes) {\n refreshRowAndSiblings(rowRenderer, node);\n }\n }\n if (path) {\n const rows = path.getSortedRows();\n for (let i = 0, len = rows.length; i < len; ++i) {\n refreshRowAndSiblings(rowRenderer, rows[i]);\n }\n }\n if (this.batchedPath || this.batchedNodes) {\n this.deferredDepth = 1;\n this.endDeferred();\n }\n }\n onCellValueChanged(event) {\n const { gos, rowModel, changedPathFactory } = this.beans;\n if (event.source === SOURCE_PASTE || gos.get(\"suppressChangeDetection\")) {\n return;\n }\n if (!rowModel.rootNode) {\n return;\n }\n const node = event.node.primaryRow;\n if (this.csrm) {\n let batchedPath = this.batchedPath;\n if (!batchedPath) {\n batchedPath = changedPathFactory?.newPath(gos.get(\"aggregateOnlyChangedColumns\")) ?? null;\n this.batchedPath = batchedPath;\n }\n let pathNode = node;\n if (!node.group) {\n const nodes = this.batchedNodes ?? (this.batchedNodes = /* @__PURE__ */ new Set());\n nodes.add(node);\n pathNode = node.parent;\n }\n batchedPath?.addCell(pathNode, event.column.getColId());\n } else {\n const nodes = this.batchedNodes ?? (this.batchedNodes = /* @__PURE__ */ new Set());\n nodes.add(node);\n }\n if (this.deferredDepth === 0) {\n this.deferredDepth = 1;\n this.endDeferred();\n }\n }\n};\nvar refreshRowAndSiblings = (rowRenderer, node) => {\n const { sibling, pinnedSibling } = node;\n rowRenderer.refreshRowByNode(node);\n rowRenderer.refreshRowByNode(sibling);\n rowRenderer.refreshRowByNode(pinnedSibling);\n rowRenderer.refreshRowByNode(sibling?.pinnedSibling);\n rowRenderer.refreshRowByNode(pinnedSibling?.sibling);\n};\n\n// packages/ag-grid-community/src/valueService/expressionService.ts\nvar ExpressionService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"expressionSvc\";\n this.cache = {};\n }\n evaluate(expression, params) {\n if (typeof expression === \"string\") {\n return this.evaluateExpression(expression, params);\n } else {\n _error(15, { expression });\n }\n }\n evaluateExpression(expression, params) {\n try {\n const javaScriptFunction = this.createExpressionFunction(expression);\n const result = javaScriptFunction(\n params.value,\n params.context,\n params.oldValue,\n params.newValue,\n params.value,\n params.node,\n params.data,\n params.colDef,\n params.rowIndex,\n params.api,\n params.getValue,\n params.column,\n params.columnGroup\n );\n return result;\n } catch (e) {\n _error(16, { expression, params, e });\n return null;\n }\n }\n createExpressionFunction(expression) {\n const expressionToFunctionCache = this.cache;\n if (expressionToFunctionCache[expression]) {\n return expressionToFunctionCache[expression];\n }\n const functionBody = this.createFunctionBody(expression);\n const theFunction = new Function(\n \"x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup\",\n functionBody\n );\n expressionToFunctionCache[expression] = theFunction;\n return theFunction;\n }\n createFunctionBody(expression) {\n if (expression.includes(\"return\")) {\n return expression;\n } else {\n return \"return \" + expression + \";\";\n }\n }\n};\n\n// packages/ag-grid-community/src/valueService/valueCache.ts\nvar ValueCache = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"valueCache\";\n this.cacheVersion = 0;\n }\n postConstruct() {\n const gos = this.gos;\n this.active = gos.get(\"valueCache\");\n this.neverExpires = gos.get(\"valueCacheNeverExpires\");\n }\n onDataChanged() {\n if (this.neverExpires) {\n return;\n }\n this.expire();\n }\n expire() {\n this.cacheVersion++;\n }\n setValue(rowNode, colId, value) {\n if (this.active) {\n const cacheVersion = this.cacheVersion;\n if (rowNode.__cacheVersion !== cacheVersion) {\n rowNode.__cacheVersion = cacheVersion;\n rowNode.__cacheData = {};\n }\n rowNode.__cacheData[colId] = value;\n }\n }\n getValue(rowNode, colId) {\n if (!this.active || rowNode.__cacheVersion !== this.cacheVersion) {\n return void 0;\n }\n return rowNode.__cacheData[colId];\n }\n};\n\n// packages/ag-grid-community/src/valueService/valueModule.ts\nvar ValueCacheModule = {\n moduleName: \"ValueCache\",\n version: VERSION,\n beans: [ValueCache],\n apiFunctions: {\n expireValueCache\n }\n};\nvar ExpressionModule = {\n moduleName: \"Expression\",\n version: VERSION,\n beans: [ExpressionService]\n};\nvar ChangeDetectionModule = {\n moduleName: \"ChangeDetection\",\n version: VERSION,\n beans: [ChangeDetectionService]\n};\nvar CellApiModule = {\n moduleName: \"CellApi\",\n version: VERSION,\n apiFunctions: {\n getCellValue\n }\n};\n\n// packages/ag-grid-community/src/valueService/valueService.ts\nvar ValueService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"valueSvc\";\n this.initialised = false;\n this.isSsrm = false;\n }\n wireBeans(beans) {\n this.expressionSvc = beans.expressionSvc;\n this.colModel = beans.colModel;\n this.valueCache = beans.valueCache;\n this.dataTypeSvc = beans.dataTypeSvc;\n this.editSvc = beans.editSvc;\n this.formulaDataSvc = beans.formulaDataSvc;\n this.rowGroupColsSvc = beans.rowGroupColsSvc;\n }\n postConstruct() {\n if (!this.initialised) {\n this.init();\n }\n }\n init() {\n const { gos, valueCache } = this;\n this.executeValueGetter = valueCache ? this.executeValueGetterWithValueCache.bind(this) : this.executeValueGetterWithoutValueCache.bind(this);\n this.isSsrm = _isServerSideRowModel(gos);\n this.cellExpressions = gos.get(\"enableCellExpressions\");\n this.isTreeData = gos.get(\"treeData\");\n this.initialised = true;\n const listener = (event) => this.callColumnCellValueChangedHandler(event);\n this.eventSvc.addListener(\"cellValueChanged\", listener, true);\n this.addDestroyFunc(() => this.eventSvc.removeListener(\"cellValueChanged\", listener, true));\n this.addManagedPropertyListener(\"treeData\", (propChange) => this.isTreeData = propChange.currentValue);\n }\n /**\n * Use this function to get a displayable cell value.\n * The values from this function are not used for sorting, filtering, or aggregation purposes.\n * Handles: groupHideOpenParents, showOpenedGroup and groupSuppressBlankHeader behaviours\n */\n getValueForDisplay(params) {\n const beans = this.beans;\n const column = params.column;\n const node = params.node;\n const showRowGroupColValueSvc = beans.showRowGroupColValueSvc;\n const isFullWidthGroup = !column && node.group;\n const isGroupCol = column?.colDef.showRowGroup;\n const processTreeDataAsGroup = !this.isTreeData || node.footer;\n if (showRowGroupColValueSvc && processTreeDataAsGroup && (isFullWidthGroup || isGroupCol)) {\n const groupValue = showRowGroupColValueSvc.getGroupValue(node, column, this.displayIgnoresAggData(node));\n if (groupValue == null) {\n return {\n value: null,\n valueFormatted: null\n };\n }\n return {\n value: groupValue.value,\n valueFormatted: params.includeValueFormatted ? showRowGroupColValueSvc.formatAndPrefixGroupColValue(groupValue, column, params.exporting) : null\n };\n }\n if (!column) {\n return {\n value: node.key,\n valueFormatted: null\n };\n }\n let value = this.getValue(column, node, params.from, this.displayIgnoresAggData(node));\n let valueToFormat = value;\n const formula = beans.formula;\n if (column.isAllowFormula() && formula?.isFormula(value)) {\n if (params.useRawFormula) {\n value = formula.normaliseFormula(value, true);\n valueToFormat = formula.resolveValue(column, node);\n } else {\n value = formula.resolveValue(column, node);\n valueToFormat = value;\n }\n }\n const format = params.includeValueFormatted && !(params.exporting && column.colDef.useValueFormatterForExport === false);\n return {\n value,\n valueFormatted: format ? this.formatValue(column, node, valueToFormat) : null\n };\n }\n getValue(column, rowNode, from, ignoreAggData = false) {\n if (!this.initialised) {\n this.init();\n }\n if (!rowNode) {\n return;\n }\n const colDef = column.colDef;\n const isGroup = rowNode.group;\n if (!isGroup) {\n const pivotValueColumn = colDef.pivotValueColumn;\n if (pivotValueColumn) {\n column = pivotValueColumn;\n }\n }\n const pending = this.editSvc?.getPendingEditValue(rowNode, column, from);\n if (pending !== void 0) {\n return pending;\n }\n let result = this.resolveValue(column, rowNode, ignoreAggData, isGroup);\n if (result === void 0) {\n if (isGroup) {\n const rowGroupColId = colDef.showRowGroup;\n if (typeof rowGroupColId === \"string\") {\n const colRowGroupIndex = this.rowGroupColsSvc?.getColumnIndex(rowGroupColId);\n if (colRowGroupIndex != null && colRowGroupIndex > rowNode.level) {\n return null;\n }\n }\n }\n return void 0;\n }\n if (this.cellExpressions && _isExpressionString(result)) {\n const cellValueGetter = result.substring(1);\n result = this.executeValueGetter(cellValueGetter, rowNode.data, column, rowNode);\n }\n return result;\n }\n /** Computes whether to ignore aggregation data for display purposes. */\n displayIgnoresAggData(node) {\n if (!node.group || node.footer || node.level === -1) {\n return false;\n }\n if (!node.sibling || this.gos.get(\"groupSuppressBlankHeader\")) {\n return false;\n }\n if (node.leafGroup && this.colModel.isPivotMode()) {\n return false;\n }\n return !!node.expanded;\n }\n resolveValue(column, rowNode, ignoreAggData, isGroup) {\n const colDef = column.colDef;\n const colId = column.colId;\n const formulaDataSvc = !isGroup && this.formulaDataSvc;\n if (formulaDataSvc && formulaDataSvc.hasDataSource() && colDef.allowFormula === true) {\n const formula = formulaDataSvc.getFormula({ column, rowNode });\n if (_isExpressionString(formula)) {\n return formula;\n }\n }\n const aggData = isGroup && !ignoreAggData ? rowNode.aggData : void 0;\n const isTreeData = this.isTreeData;\n if (isTreeData && aggData?.[colId] !== void 0) {\n return aggData[colId];\n }\n const data = rowNode.data;\n const field = colDef.field;\n const valueGetter = colDef.valueGetter;\n if (isTreeData) {\n if (valueGetter) {\n return this.executeValueGetter(valueGetter, data, column, rowNode);\n }\n if (field && data) {\n return _getValueUsingField(data, field, column.isFieldContainsDots());\n }\n }\n const groupData = rowNode.groupData;\n if (groupData && colId in groupData) {\n return groupData[colId];\n }\n if (aggData?.[colId] !== void 0) {\n return aggData[colId];\n }\n const rowGroupColId = colDef.showRowGroup;\n const allowUserValuesForCell = typeof rowGroupColId !== \"string\" || !isGroup;\n const isSsrm = this.isSsrm;\n const ignoreSsrmAggData = isSsrm && ignoreAggData && !!colDef.aggFunc;\n if (valueGetter && !ignoreSsrmAggData) {\n return allowUserValuesForCell ? this.executeValueGetter(valueGetter, data, column, rowNode) : void 0;\n }\n const ssrmFooterGroupCol = isSsrm && rowNode.footer && rowNode.field && (rowGroupColId === true || rowGroupColId === rowNode.field);\n if (ssrmFooterGroupCol) {\n return _getValueUsingField(data, rowNode.field, column.isFieldContainsDots());\n }\n if (field && data && !ignoreSsrmAggData) {\n return allowUserValuesForCell ? _getValueUsingField(data, field, column.isFieldContainsDots()) : void 0;\n }\n return void 0;\n }\n parseValue(column, rowNode, newValue, oldValue) {\n const colDef = column.getColDef();\n if (colDef.allowFormula && this.beans.formula?.isFormula(newValue)) {\n return newValue;\n }\n const valueParser = colDef.valueParser;\n if (_exists(valueParser)) {\n const params = _addGridCommonParams(this.gos, {\n node: rowNode,\n data: rowNode?.data,\n oldValue,\n newValue,\n colDef,\n column\n });\n if (typeof valueParser === \"function\") {\n return valueParser(params);\n }\n return this.expressionSvc?.evaluate(valueParser, params);\n }\n return newValue;\n }\n getDeleteValue(column, rowNode) {\n if (_exists(column.getColDef().valueParser)) {\n return this.parseValue(\n column,\n rowNode,\n \"\",\n this.getValueForDisplay({ column, node: rowNode, from: \"edit\" }).value\n ) ?? null;\n }\n return null;\n }\n formatValue(column, node, value, suppliedFormatter, useFormatterFromColumn = true) {\n const { expressionSvc } = this.beans;\n let result = null;\n let formatter;\n const colDef = column.getColDef();\n if (suppliedFormatter) {\n formatter = suppliedFormatter;\n } else if (useFormatterFromColumn) {\n formatter = colDef.valueFormatter;\n }\n if (formatter) {\n const data = node ? node.data : null;\n const params = _addGridCommonParams(this.gos, {\n value,\n node,\n data,\n colDef,\n column\n });\n if (typeof formatter === \"function\") {\n result = formatter(params);\n } else {\n result = expressionSvc ? expressionSvc.evaluate(formatter, params) : null;\n }\n } else if (colDef.refData) {\n return colDef.refData[value] || \"\";\n }\n if (result == null && Array.isArray(value)) {\n result = value.join(\", \");\n }\n return result;\n }\n /**\n * Sets the value of a GridCell\n * @param rowNode The `RowNode` to be updated\n * @param column The `Column` to be updated\n * @param newValue The new value to be set\n * @param eventSource The event source\n * @returns `true` if the value has been updated, otherwise `false`.\n */\n setValue(rowNode, column, newValue, eventSource) {\n const colDef = column.getColDef();\n if (!rowNode.data && this.canCreateRowNodeData(rowNode, colDef)) {\n rowNode.data = {};\n }\n if (!this.isSetValueSupported(column, rowNode, newValue, colDef)) {\n return false;\n }\n const oldValue = this.getValue(column, rowNode, \"data\");\n const params = _addGridCommonParams(this.gos, {\n node: rowNode,\n data: rowNode.data,\n oldValue,\n newValue,\n colDef,\n column\n });\n let valueSetterChanged = false;\n if (rowNode.data) {\n const externalFormulaResult = this.handleExternalFormulaChange({\n column,\n eventSource,\n newValue,\n setterParams: params,\n rowNode\n });\n if (externalFormulaResult !== null) {\n return externalFormulaResult;\n }\n const result = this.computeValueChange({\n column,\n rowNode,\n newValue,\n params,\n rowData: rowNode.data,\n valueSetter: colDef.valueSetter,\n field: colDef.field\n });\n valueSetterChanged = result ?? true;\n }\n const changeDetectionSvc = this.beans.changeDetectionSvc;\n changeDetectionSvc?.beginDeferred();\n try {\n if (rowNode.group) {\n const groupResult = this.beans.rowGroupingEditValueSvc?.setGroupDataValue(\n rowNode,\n column,\n newValue,\n oldValue,\n eventSource,\n valueSetterChanged || newValue !== oldValue\n );\n if (groupResult !== void 0) {\n if (!valueSetterChanged && !groupResult) {\n return false;\n }\n return this.finishValueChange(rowNode, column, params, eventSource, newValue);\n }\n }\n if (!valueSetterChanged) {\n return false;\n }\n return this.finishValueChange(rowNode, column, params, eventSource);\n } finally {\n changeDetectionSvc?.endDeferred();\n }\n }\n canCreateRowNodeData(rowNode, colDef) {\n if (!rowNode.group) {\n return true;\n }\n if (colDef.groupRowValueSetter != null || colDef.groupRowEditable != null) {\n return false;\n }\n if (colDef.pivotValueColumn) {\n return false;\n }\n return true;\n }\n finishValueChange(rowNode, column, params, eventSource, savedValueOverride) {\n rowNode.resetQuickFilterAggregateText();\n this.valueCache?.onDataChanged();\n const savedValue = savedValueOverride === void 0 ? this.getValue(column, rowNode, \"data\") : savedValueOverride;\n this.dispatchCellValueChangedEvent(rowNode, params, savedValue, eventSource);\n if (rowNode.pinnedSibling) {\n this.dispatchCellValueChangedEvent(rowNode.pinnedSibling, params, savedValue, eventSource);\n }\n return true;\n }\n isSetValueSupported(column, rowNode, newValue, colDef) {\n const { field, valueSetter } = colDef;\n const formulaSvc = this.beans.formula;\n const isFormulaValue = column.isAllowFormula() && formulaSvc?.isFormula(newValue);\n const hasExternalFormulaData = !!this.formulaDataSvc?.hasDataSource();\n if (_missing(field) && _missing(valueSetter) && !(hasExternalFormulaData && isFormulaValue)) {\n if (rowNode.group && (colDef.groupRowValueSetter || colDef.groupRowEditable)) {\n return true;\n }\n _warn(17);\n return false;\n }\n if (this.dataTypeSvc && !this.dataTypeSvc.checkType(column, newValue)) {\n _warn(135);\n return false;\n }\n return true;\n }\n handleExternalFormulaChange(args) {\n const { column, rowNode, newValue, eventSource, setterParams } = args;\n const formulaSvc = this.beans.formula;\n const formulaDataSvc = this.formulaDataSvc;\n if (!formulaDataSvc?.hasDataSource() || !column.isAllowFormula()) {\n return null;\n }\n const isFormulaValue = formulaSvc?.isFormula(newValue);\n const existingFormula = formulaDataSvc.getFormula({ column, rowNode });\n if (isFormulaValue) {\n const valueWasDifferent = existingFormula !== newValue;\n if (!valueWasDifferent) {\n return false;\n }\n formulaDataSvc.setFormula({ column, rowNode, formula: newValue });\n const computedValue = formulaSvc?.resolveValue(column, rowNode);\n const colDef = column.getColDef();\n if (_exists(colDef.valueSetter) || !_missing(colDef.field)) {\n const computedParams = { ...setterParams, newValue: computedValue };\n this.computeValueChange({\n column,\n rowNode,\n newValue: computedValue,\n params: computedParams,\n rowData: rowNode.data,\n valueSetter: colDef.valueSetter,\n field: colDef.field\n });\n }\n return this.finishValueChange(rowNode, column, setterParams, eventSource);\n }\n if (existingFormula !== void 0) {\n formulaDataSvc.setFormula({ column, rowNode, formula: void 0 });\n }\n return null;\n }\n computeValueChange(params) {\n const { valueSetter, params: setterParams, rowData, field, column, newValue } = params;\n if (_exists(valueSetter)) {\n if (typeof valueSetter === \"function\") {\n return valueSetter(setterParams);\n }\n return this.expressionSvc?.evaluate(valueSetter, setterParams);\n }\n return !!rowData && this.setValueUsingField(rowData, field, newValue, column.isFieldContainsDots());\n }\n dispatchCellValueChangedEvent(rowNode, params, value, source) {\n this.eventSvc.dispatchEvent({\n type: \"cellValueChanged\",\n event: null,\n rowIndex: rowNode.rowIndex,\n rowPinned: rowNode.rowPinned,\n column: params.column,\n colDef: params.colDef,\n data: rowNode.data,\n node: rowNode,\n oldValue: params.oldValue,\n newValue: value,\n newRawValue: params.newValue,\n value,\n source\n });\n }\n callColumnCellValueChangedHandler(event) {\n const onCellValueChanged = event.colDef.onCellValueChanged;\n if (typeof onCellValueChanged === \"function\") {\n this.beans.frameworkOverrides.wrapOutgoing(() => {\n onCellValueChanged(event);\n });\n }\n }\n setValueUsingField(data, field, newValue, isFieldContainsDots) {\n if (!field) {\n return false;\n }\n let valuesAreSame = false;\n if (!isFieldContainsDots) {\n valuesAreSame = data[field] === newValue;\n if (!valuesAreSame) {\n data[field] = newValue;\n }\n } else {\n const fieldPieces = field.split(\".\");\n let currentObject = data;\n while (fieldPieces.length > 0 && currentObject) {\n const fieldPiece = fieldPieces.shift();\n if (fieldPieces.length === 0) {\n valuesAreSame = currentObject[fieldPiece] === newValue;\n if (!valuesAreSame) {\n currentObject[fieldPiece] = newValue;\n }\n } else {\n currentObject = currentObject[fieldPiece];\n }\n }\n }\n return !valuesAreSame;\n }\n executeValueGetterWithValueCache(valueGetter, data, column, rowNode) {\n const colId = column.getColId();\n const valueFromCache = this.valueCache.getValue(rowNode, colId);\n if (valueFromCache !== void 0) {\n return valueFromCache;\n }\n const result = this.executeValueGetterWithoutValueCache(valueGetter, data, column, rowNode);\n this.valueCache.setValue(rowNode, colId, result);\n return result;\n }\n executeValueGetterWithoutValueCache(valueGetter, data, column, rowNode) {\n const params = _addGridCommonParams(this.gos, {\n data,\n node: rowNode,\n column,\n colDef: column.getColDef(),\n getValue: (field) => this.getValueCallback(rowNode, field)\n });\n let result;\n if (typeof valueGetter === \"function\") {\n result = valueGetter(params);\n } else {\n result = this.expressionSvc?.evaluate(valueGetter, params);\n }\n return result;\n }\n getValueCallback(node, field) {\n const otherColumn = this.colModel.getColDefCol(field);\n if (otherColumn) {\n return this.getValue(otherColumn, node, \"data\");\n }\n return null;\n }\n // used by row grouping and pivot, to get key for a row. col can be a pivot col or a row grouping col\n getKeyForNode(col, rowNode) {\n const value = this.getValue(col, rowNode, \"data\");\n const keyCreator = col.getColDef().keyCreator;\n let result = value;\n if (keyCreator) {\n const keyParams = _addGridCommonParams(this.gos, {\n value,\n colDef: col.getColDef(),\n column: col,\n node: rowNode,\n data: rowNode.data\n });\n result = keyCreator(keyParams);\n }\n if (typeof result === \"string\" || result == null) {\n return result;\n }\n result = String(result);\n if (result === \"[object Object]\") {\n _warn(121);\n }\n return result;\n }\n};\n\n// packages/ag-grid-community/src/gridCoreModule.ts\nvar CommunityCoreModule = {\n moduleName: \"CommunityCore\",\n version: VERSION,\n beans: [\n GridDestroyService,\n ApiFunctionService,\n Registry,\n UserComponentFactory,\n RowContainerHeightService,\n VisibleColsService,\n EventService,\n GridOptionsService,\n ColumnModel,\n PageBoundsService,\n PageBoundsListener,\n RowRenderer,\n ValueService,\n FocusService,\n Environment,\n ScrollVisibleService,\n CtrlsService,\n SyncService,\n ColumnNameService,\n ColumnViewportService,\n IconService\n ],\n icons: {\n // icon on select dropdowns (select cell editor, charts tool panels)\n selectOpen: \"small-down\",\n /** @deprecated v33 */\n smallDown: \"small-down\",\n /** @deprecated v33 */\n colorPicker: \"color-picker\",\n /** @deprecated v33 */\n smallUp: \"small-up\",\n /** @deprecated v33 */\n checkboxChecked: \"small-up\",\n /** @deprecated v33 */\n checkboxIndeterminate: \"checkbox-indeterminate\",\n /** @deprecated v33 */\n checkboxUnchecked: \"checkbox-unchecked\",\n /** @deprecated v33 */\n radioButtonOn: \"radio-button-on\",\n /** @deprecated v33 */\n radioButtonOff: \"radio-button-off\",\n /** @deprecated v33 */\n smallLeft: \"small-left\",\n /** @deprecated v33 */\n smallRight: \"small-right\"\n },\n apiFunctions: {\n getGridId,\n destroy,\n isDestroyed,\n getGridOption,\n setGridOption,\n updateGridOptions,\n isModuleRegistered\n },\n dependsOn: [\n DataTypeModule,\n ColumnMoveModule,\n ColumnResizeModule,\n SortModule,\n ColumnHeaderCompModule,\n ColumnGroupModule,\n ColumnGroupHeaderCompModule,\n OverlayModule,\n ChangeDetectionModule,\n AnimationFrameModule,\n KeyboardNavigationModule,\n PinnedColumnModule,\n AriaModule,\n TouchModule,\n CellRendererFunctionModule,\n ColumnFlexModule,\n ExpressionModule,\n SkeletonCellRendererModule,\n ColumnDelayRenderModule\n ]\n};\n\n// packages/ag-grid-community/src/agStack/utils/fuzzyMatch.ts\nfunction _fuzzySuggestions(params) {\n const { inputValue, allSuggestions, hideIrrelevant, filterByPercentageOfBestMatch } = params;\n let thisSuggestions = (allSuggestions ?? []).map(\n (text, idx) => ({\n value: text,\n relevance: _getLevenshteinSimilarityDistance(inputValue, text),\n idx\n })\n );\n thisSuggestions.sort((a, b) => a.relevance - b.relevance);\n if (hideIrrelevant) {\n thisSuggestions = thisSuggestions.filter(\n (suggestion) => suggestion.relevance < Math.max(suggestion.value.length, inputValue.length)\n );\n }\n if (thisSuggestions.length > 0 && filterByPercentageOfBestMatch && filterByPercentageOfBestMatch > 0) {\n const bestMatch = thisSuggestions[0].relevance;\n const limit = bestMatch * filterByPercentageOfBestMatch;\n thisSuggestions = thisSuggestions.filter((suggestion) => limit - suggestion.relevance < 0);\n }\n const values = [];\n const indices = [];\n for (const suggestion of thisSuggestions) {\n values.push(suggestion.value);\n indices.push(suggestion.idx);\n }\n return { values, indices };\n}\nfunction _getLevenshteinSimilarityDistance(source, target) {\n const sourceLength = source.length;\n const targetLength = target.length;\n if (targetLength === 0) {\n return sourceLength ? sourceLength : 0;\n }\n let inputLower = source.toLocaleLowerCase();\n let targetLower = target.toLocaleLowerCase();\n let swapTmp;\n if (source.length < target.length) {\n swapTmp = targetLower;\n targetLower = inputLower;\n inputLower = swapTmp;\n swapTmp = target;\n target = source;\n source = swapTmp;\n }\n let previousRow = new Uint16Array(targetLength + 1);\n let currentRow = new Uint16Array(targetLength + 1);\n for (let j = 0; j <= targetLength; j++) {\n previousRow[j] = j;\n }\n let secondaryScore = 0;\n const earlyMatchLimit = sourceLength / 2 - 10;\n for (let i = 1; i <= sourceLength; i++) {\n const inputChar = source[i - 1];\n const inputCharLower = inputLower[i - 1];\n currentRow[0] = i;\n for (let j = 1; j <= targetLength; j++) {\n const targetChar = target[j - 1];\n const targetCharLower = targetLower[j - 1];\n if (inputCharLower !== targetCharLower) {\n const insertCost = currentRow[j - 1];\n const deleteCost = previousRow[j];\n const replaceCost = previousRow[j - 1];\n let cost = insertCost < deleteCost ? insertCost : deleteCost;\n if (replaceCost < cost) {\n cost = replaceCost;\n }\n currentRow[j] = cost + 1 | 0;\n continue;\n }\n secondaryScore++;\n if (inputChar === targetChar) {\n secondaryScore++;\n }\n if (i > 1 && j > 1) {\n const prevSourceChar = source[i - 2];\n const prevSourceCharLower = inputLower[i - 2];\n const prevTargetChar = target[j - 2];\n const prevTargetCharLower = targetLower[j - 2];\n if (prevSourceCharLower === prevTargetCharLower) {\n secondaryScore++;\n if (prevSourceChar === prevTargetChar) {\n secondaryScore++;\n }\n }\n }\n if (i < earlyMatchLimit) {\n secondaryScore++;\n }\n currentRow[j] = previousRow[j - 1];\n }\n swapTmp = previousRow;\n previousRow = currentRow;\n currentRow = swapTmp;\n }\n return previousRow[targetLength] / (secondaryScore + 1);\n}\n\n// packages/ag-grid-community/src/validation/enterpriseModuleNames.ts\nvar ENTERPRISE_MODULE_NAMES = {\n AdvancedFilter: 1,\n AiToolkit: 1,\n AllEnterprise: 1,\n BatchEdit: 1,\n CellSelection: 1,\n Clipboard: 1,\n ColumnMenu: 1,\n ColumnsToolPanel: 1,\n ContextMenu: 1,\n ExcelExport: 1,\n FiltersToolPanel: 1,\n Find: 1,\n GridCharts: 1,\n IntegratedCharts: 1,\n GroupFilter: 1,\n MasterDetail: 1,\n Menu: 1,\n MultiFilter: 1,\n NewFiltersToolPanel: 1,\n Pivot: 1,\n RangeSelection: 1,\n RichSelect: 1,\n RowNumbers: 1,\n RowGrouping: 1,\n RowGroupingEdit: 1,\n RowGroupingPanel: 1,\n ServerSideRowModelApi: 1,\n ServerSideRowModel: 1,\n SetFilter: 1,\n SideBar: 1,\n Sparklines: 1,\n StatusBar: 1,\n TreeData: 1,\n ViewportRowModel: 1,\n Formula: 1\n};\n\n// packages/ag-grid-community/src/validation/resolvableModuleNames.ts\nvar ALL_COLUMN_FILTERS = [\n \"TextFilter\",\n \"NumberFilter\",\n \"BigIntFilter\",\n \"DateFilter\",\n \"SetFilter\",\n \"MultiFilter\",\n \"GroupFilter\",\n \"CustomFilter\"\n];\nvar RESOLVABLE_MODULE_NAMES = {\n EditCore: [\n \"TextEditor\",\n \"NumberEditor\",\n \"DateEditor\",\n \"CheckboxEditor\",\n \"LargeTextEditor\",\n \"SelectEditor\",\n \"RichSelect\",\n \"CustomEditor\"\n ],\n CheckboxCellRenderer: [\"AllCommunity\"],\n ClientSideRowModelHierarchy: [\"RowGrouping\", \"Pivot\", \"TreeData\"],\n ColumnFilter: ALL_COLUMN_FILTERS,\n ColumnGroupHeaderComp: [\"AllCommunity\"],\n ColumnGroup: [\"AllCommunity\"],\n ColumnHeaderComp: [\"AllCommunity\"],\n ColumnMove: [\"AllCommunity\"],\n ColumnResize: [\"AllCommunity\"],\n CommunityCore: [\"AllCommunity\"],\n CsrmSsrmSharedApi: [\"ClientSideRowModelApi\", \"ServerSideRowModelApi\"],\n RowModelSharedApi: [\"ClientSideRowModelApi\", \"ServerSideRowModelApi\"],\n EnterpriseCore: [\"AllEnterprise\"],\n FilterCore: [...ALL_COLUMN_FILTERS, \"QuickFilter\", \"ExternalFilter\", \"AdvancedFilter\"],\n GroupCellRenderer: [\"RowGrouping\", \"Pivot\", \"TreeData\", \"MasterDetail\", \"ServerSideRowModel\"],\n KeyboardNavigation: [\"AllCommunity\"],\n LoadingCellRenderer: [\"ServerSideRowModel\"],\n MenuCore: [\"ColumnMenu\", \"ContextMenu\"],\n MenuItem: [\"ColumnMenu\", \"ContextMenu\", \"MultiFilter\", \"IntegratedCharts\", \"ColumnsToolPanel\"],\n Overlay: [\"AllCommunity\"],\n PinnedColumn: [\"AllCommunity\"],\n SharedAggregation: [\"RowGrouping\", \"Pivot\", \"TreeData\", \"ServerSideRowModel\"],\n SharedDragAndDrop: [\"AllCommunity\"],\n SharedMasterDetail: [\"MasterDetail\", \"ServerSideRowModel\"],\n SharedMenu: [...ALL_COLUMN_FILTERS, \"ColumnMenu\", \"ContextMenu\"],\n SharedPivot: [\"Pivot\", \"ServerSideRowModel\"],\n SharedRowGrouping: [\"RowGrouping\", \"ServerSideRowModel\"],\n SharedRowSelection: [\"RowSelection\", \"ServerSideRowModel\"],\n SkeletonCellRenderer: [\"ServerSideRowModel\"],\n Sort: [\"AllCommunity\"],\n SsrmInfiniteSharedApi: [\"InfiniteRowModel\", \"ServerSideRowModelApi\"],\n SharedTreeData: [\"TreeData\", \"ServerSideRowModel\"]\n};\nvar MODULES_FOR_ROW_MODELS = {\n InfiniteRowModel: \"infinite\",\n ClientSideRowModelApi: \"clientSide\",\n ClientSideRowModel: \"clientSide\",\n ServerSideRowModelApi: \"serverSide\",\n ServerSideRowModel: \"serverSide\",\n ViewportRowModel: \"viewport\"\n};\nfunction resolveModuleNames(moduleName, rowModelType) {\n const resolvedModuleNames = [];\n for (const modName of Array.isArray(moduleName) ? moduleName : [moduleName]) {\n const resolved = RESOLVABLE_MODULE_NAMES[modName];\n if (resolved) {\n for (const resolvedModName of resolved) {\n const rowModelForModule = MODULES_FOR_ROW_MODELS[resolvedModName];\n if (!rowModelForModule || rowModelForModule === rowModelType) {\n resolvedModuleNames.push(resolvedModName);\n }\n }\n } else {\n resolvedModuleNames.push(modName);\n }\n }\n return resolvedModuleNames;\n}\n\n// packages/ag-grid-community/src/validation/errorMessages/errorText.ts\nvar NoModulesRegisteredError = () => `No AG Grid modules are registered! It is recommended to start with all Community features via the AllCommunityModule:\n \n import { ModuleRegistry, AllCommunityModule } from 'ag-grid-community';\n \n ModuleRegistry.registerModules([ AllCommunityModule ]);\n `;\nvar moduleImportMsg = (moduleNames) => {\n const imports = moduleNames.map(\n (moduleName) => `import { ${convertToUserModuleName(moduleName)} } from '${ENTERPRISE_MODULE_NAMES[moduleName] ? \"ag-grid-enterprise\" : \"ag-grid-community\"}';`\n );\n const includeCharts = moduleNames.some((m) => m === \"IntegratedCharts\" || m === \"Sparklines\");\n if (includeCharts) {\n const chartImport = `import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';`;\n imports.push(chartImport);\n }\n return `import { ModuleRegistry } from 'ag-grid-community'; \n${imports.join(\" \\n\")} \n\nModuleRegistry.registerModules([ ${moduleNames.map((m) => convertToUserModuleName(m, true)).join(\", \")} ]); \n\nFor more info see: ${baseDocLink}/modules/`;\n};\nfunction convertToUserModuleName(moduleName, inModuleRegistration = false) {\n if (inModuleRegistration && (moduleName === \"IntegratedCharts\" || moduleName === \"Sparklines\")) {\n return `${moduleName}Module.with(AgChartsEnterpriseModule)`;\n }\n return `${moduleName}Module`;\n}\nfunction umdMissingModule(reasonOrId, moduleNames) {\n const chartModules = moduleNames.filter((m) => m === \"IntegratedCharts\" || m === \"Sparklines\");\n let message = \"\";\n const agChartsDynamic = globalThis?.agCharts;\n if (!agChartsDynamic && chartModules.length > 0) {\n message = `Unable to use ${reasonOrId} as either the ag-charts-community or ag-charts-enterprise script needs to be included alongside ag-grid-enterprise.\n`;\n } else if (moduleNames.some((m) => ENTERPRISE_MODULE_NAMES[m])) {\n message = message + `Unable to use ${reasonOrId} as that requires the ag-grid-enterprise script to be included.\n`;\n }\n return message;\n}\nfunction missingRowModelTypeError({\n moduleName,\n rowModelType\n}) {\n return `To use the ${moduleName}Module you must set the gridOption \"rowModelType='${rowModelType}'\"`;\n}\nvar missingModule = ({\n reasonOrId,\n moduleName,\n gridScoped,\n gridId,\n rowModelType,\n additionalText,\n isUmd: isUmd2\n}) => {\n const resolvedModuleNames = resolveModuleNames(moduleName, rowModelType);\n const reason = typeof reasonOrId === \"string\" ? reasonOrId : MISSING_MODULE_REASONS[reasonOrId];\n if (isUmd2) {\n return umdMissingModule(reason, resolvedModuleNames);\n }\n const chartModules = resolvedModuleNames.filter((m) => m === \"IntegratedCharts\" || m === \"Sparklines\");\n const chartImportRequired = chartModules.length > 0 ? `${chartModules.map((m) => convertToUserModuleName(m)).join()} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.` : \"\";\n const explanation = `Unable to use ${reason} as ${resolvedModuleNames.length > 1 ? \"one of \" + resolvedModuleNames.map((m) => convertToUserModuleName(m)).join(\", \") : convertToUserModuleName(resolvedModuleNames[0])} is not registered${gridScoped ? \" for gridId: \" + gridId : \"\"}. ${chartImportRequired} Check if you have registered the module:\n`;\n return `${explanation}\n${moduleImportMsg(resolvedModuleNames)}` + (additionalText ? ` \n\n${additionalText}` : \"\");\n};\nvar missingChartsWithModule = (gridModule) => {\n return `${gridModule} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.\n\nimport { AgChartsEnterpriseModule } from 'ag-charts-enterprise';\nimport { ModuleRegistry } from 'ag-grid-community';\nimport { ${gridModule} } from 'ag-grid-enterprise';\n \nModuleRegistry.registerModules([${gridModule}.with(AgChartsEnterpriseModule)]);\n `;\n};\nvar clipboardApiError = (method) => `AG Grid: Unable to use the Clipboard API (navigator.clipboard.${method}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`;\nvar AG_GRID_ERRORS = {\n 1: () => \"`rowData` must be an array\",\n 2: ({ nodeId }) => `Duplicate node id '${nodeId}' detected from getRowId callback, this could cause issues in your grid.`,\n 3: () => \"Calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.\",\n 4: ({ id }) => `Could not find row id=${id}, data item was not found for this id`,\n 5: ({ data }) => [\n `Could not find data item as object was not found.`,\n data,\n \" Consider using getRowId to help the Grid find matching row data\"\n ],\n 6: () => `'groupHideOpenParents' only works when specifying specific columns for 'colDef.showRowGroup'`,\n 7: () => \"Pivoting is not supported with aligned grids as it may produce different columns in each grid.\",\n 8: ({ key }) => `Unknown key for navigation ${key}`,\n 9: ({ variable }) => `No value for ${variable?.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${variable?.defaultValue} will be used and updated when styles load.`,\n 10: ({ eventType }) => `As of v33, the '${eventType}' event is deprecated. Use the global 'modelUpdated' event to determine when row children have changed.`,\n 11: () => \"No gridOptions provided to createGrid\",\n 12: ({ colKey }) => [\"column \", colKey, \" not found\"],\n 13: () => \"Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid.\",\n 14: ({ groupPrefix }) => `Row IDs cannot start with ${groupPrefix}, this is a reserved prefix for AG Grid's row grouping feature.`,\n 15: ({ expression }) => [\"value should be either a string or a function\", expression],\n 16: ({ expression, params, e }) => [\n \"Processing of the expression failed\",\n \"Expression = \",\n expression,\n \"Params = \",\n params,\n \"Exception = \",\n e\n ],\n 17: () => \"you need either field or valueSetter set on colDef for editing to work\",\n 18: () => `alignedGrids contains an undefined option.`,\n 19: () => `alignedGrids - No api found on the linked grid.`,\n 20: () => `You may want to configure via a callback to avoid setup race conditions:\n \"alignedGrids: () => [linkedGrid]\"`,\n 21: () => \"pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.\",\n 22: ({ key }) => `${key} is an initial property and cannot be updated.`,\n 23: () => \"The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.\",\n 24: () => \"row height must be a number if not using standard row model\",\n 25: ({ id }) => [`The getRowId callback must return a string. The ID `, id, ` is being cast to a string.`],\n 26: ({ fnName, preDestroyLink }) => {\n return `Grid API function ${fnName}() cannot be called as the grid has been destroyed.\n Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\n To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${preDestroyLink}`;\n },\n 27: ({ fnName, module }) => `API function '${fnName}' not registered to module '${module}'`,\n 28: () => \"setRowCount cannot be used while using row grouping.\",\n 29: () => \"tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?\",\n 30: ({ toIndex }) => [\n \"tried to insert columns in invalid location, toIndex = \",\n toIndex,\n \"remember that you should not count the moving columns when calculating the new index\"\n ],\n 31: () => \"infinite loop in resizeColumnSets\",\n 32: () => \"applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.\",\n 33: () => \"stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON.\",\n 34: ({ key }) => `the column type '${key}' is a default column type and cannot be overridden.`,\n 35: () => `Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type.`,\n 36: ({ t }) => \"colDef.type '\" + t + \"' does not correspond to defined gridOptions.columnTypes\",\n 37: () => `Changing the column pinning status is not allowed with domLayout='print'`,\n 38: ({ iconName }) => `provided icon '${iconName}' needs to be a string or a function`,\n 39: () => \"Applying column order broke a group where columns should be married together. Applying new order has been discarded.\",\n 40: ({ e, method }) => `${e}\n${clipboardApiError(method)}`,\n 41: () => \"Browser did not allow document.execCommand('copy'). Ensure 'api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons.\",\n 42: () => \"Browser does not support document.execCommand('copy') for clipboard operations\",\n 43: ({ iconName }) => `As of v33, icon '${iconName}' is deprecated. Use the icon CSS name instead.`,\n 44: () => 'Data type definition hierarchies (via the \"extendsDataType\" property) cannot contain circular references.',\n 45: ({ parentCellDataType }) => `The data type definition ${parentCellDataType} does not exist.`,\n 46: () => 'The \"baseDataType\" property of a data type definition must match that of its parent.',\n 47: ({ cellDataType }) => `Missing data type definition - \"${cellDataType}\"`,\n 48: ({ property, inferred, colId }) => {\n const inferredStr = inferred ? \" (inferred)\" : \"\";\n const colIdStr = colId ? ` for column \"${colId}\"` : \"\";\n const parserHint = inferred && property === \"Parser\" ? `\n - \"colDef.cellDataType = 'object'\"` : \"\";\n return `Cell data type is \"object\"${inferredStr} but no Value ${property} has been provided${colIdStr}. Please either provide an object data type definition with a Value ${property}, or set:\n - \"colDef.value${property}\"${parserHint}`;\n },\n 49: ({ methodName }) => `Framework component is missing the method ${methodName}()`,\n 50: ({ compName }) => `Could not find component ${compName}, did you forget to configure this component?`,\n 51: () => `Export cancelled. Export is not allowed as per your configuration.`,\n 52: () => \"There is no `window` associated with the current `document`\",\n 53: () => `unknown value type during csv conversion`,\n 54: () => \"Could not find document body, it is needed for drag and drop and context menu.\",\n 55: () => \"addRowDropZone - A container target needs to be provided\",\n 56: () => \"addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.\",\n 57: () => \"unable to show popup filter, filter instantiation failed\",\n 58: () => \"no values found for select cellEditor\",\n 59: () => \"cannot select pinned rows\",\n 60: () => \"cannot select node until it has finished loading\",\n 61: () => \"since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option.\",\n 62: ({ colId }) => `setFilterModel() - no column found for colId: ${colId}`,\n 63: ({ colId }) => `setFilterModel() - unable to fully apply model, filtering disabled for colId: ${colId}`,\n 64: ({ colId }) => `setFilterModel() - unable to fully apply model, unable to create filter for colId: ${colId}`,\n 65: () => \"filter missing setModel method, which is needed for setFilterModel\",\n 66: () => \"filter API missing getModel method, which is needed for getFilterModel\",\n 67: () => \"Filter is missing isFilterActive() method\",\n 68: () => \"Column Filter API methods have been disabled as Advanced Filters are enabled.\",\n 69: ({ guiFromFilter }) => `getGui method from filter returned ${guiFromFilter}; it should be a DOM element.`,\n 70: ({ newFilter }) => `Grid option quickFilterText only supports string inputs, received: ${typeof newFilter}`,\n 71: () => \"debounceMs is ignored when apply button is present\",\n 72: ({ keys }) => [`ignoring FilterOptionDef as it doesn't contain one of `, keys],\n 73: () => `invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'`,\n 74: () => \"no filter options for filter\",\n 75: () => \"Unknown button type specified\",\n 76: ({ filterModelType }) => [\n 'Unexpected type of filter \"',\n filterModelType,\n '\", it looks like the filter was configured with incorrect Filter Options'\n ],\n 77: () => `Filter model is missing 'conditions'`,\n 78: () => 'Filter Model contains more conditions than \"filterParams.maxNumConditions\". Additional conditions have been ignored.',\n 79: () => '\"filterParams.maxNumConditions\" must be greater than or equal to zero.',\n 80: () => '\"filterParams.numAlwaysVisibleConditions\" must be greater than or equal to zero.',\n 81: () => '\"filterParams.numAlwaysVisibleConditions\" cannot be greater than \"filterParams.maxNumConditions\".',\n 82: ({ param }) => `DateFilter ${param} is not a number`,\n 83: () => `DateFilter minValidYear should be <= maxValidYear`,\n 84: () => `DateFilter minValidDate should be <= maxValidDate`,\n 85: () => \"DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored.\",\n 86: () => \"DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored.\",\n 87: () => \"DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.\",\n 88: ({ index }) => `Invalid row index for ensureIndexVisible: ${index}`,\n 89: () => `A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)`,\n 90: () => `datasource is missing getRows method`,\n 91: () => \"Filter is missing method doesFilterPass\",\n 92: () => `AnimationFrameService called but animation frames are off`,\n 93: () => \"cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`\",\n 94: ({\n paginationPageSizeOption,\n pageSizeSet,\n pageSizesSet,\n pageSizeOptions\n }) => `'paginationPageSize=${paginationPageSizeOption}'${pageSizeSet ? \"\" : \" (default value)\"}, but ${paginationPageSizeOption} is not included in${pageSizesSet ? \"\" : \" the default\"} paginationPageSizeSelector=[${pageSizeOptions?.join(\", \")}].`,\n 95: ({\n paginationPageSizeOption,\n paginationPageSizeSelector: paginationPageSizeSelector2\n }) => `Either set '${paginationPageSizeSelector2}' to an array that includes ${paginationPageSizeOption} or to 'false' to disable the page size selector.`,\n 96: ({ id, data }) => [\n \"Duplicate ID\",\n id,\n \"found for pinned row with data\",\n data,\n \"When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter.\"\n ],\n 97: ({ colId }) => `cellEditor for column ${colId} is missing getGui() method`,\n 98: () => \"popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.\",\n 99: () => \"Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.\",\n // 100: ({ rowModelType }: { rowModelType: RowModelType }) =>\n // `selectAll only available when rowModelType='clientSide', ie not ${rowModelType}` as const,\n 101: ({\n propertyName,\n componentName,\n agGridDefaults,\n jsComps\n }) => {\n const textOutput = [];\n const validComponents = [\n // Don't include the old names / internals in potential suggestions\n ...Object.keys(agGridDefaults ?? []).filter(\n (k) => ![\"agCellEditor\", \"agGroupRowRenderer\", \"agSortIndicator\"].includes(k)\n ),\n ...Object.keys(jsComps ?? []).filter((k) => !!jsComps[k])\n ];\n const suggestions = _fuzzySuggestions({\n inputValue: componentName,\n allSuggestions: validComponents,\n hideIrrelevant: true,\n filterByPercentageOfBestMatch: 0.8\n }).values;\n textOutput.push(\n `Could not find '${componentName}' component. It was configured as \"${propertyName}: '${componentName}'\" but it wasn't found in the list of registered components.\n`\n );\n if (suggestions.length > 0) {\n textOutput.push(` Did you mean: [${suggestions.slice(0, 3)}]?\n`);\n }\n textOutput.push(`If using a custom component check it has been registered correctly.`);\n return textOutput;\n },\n 102: () => \"selectAll: 'filtered' only works when gridOptions.rowModelType='clientSide'\",\n 103: () => \"Invalid selection state. When using client-side row model, the state must conform to `string[]`.\",\n 104: ({ value, param }) => `Numeric value ${value} passed to ${param} param will be interpreted as ${value} seconds. If this is intentional use \"${value}s\" to silence this warning.`,\n 105: ({ e }) => [`chart rendering failed`, e],\n 106: () => `Theming API and Legacy Themes are both used in the same page. A Theming API theme has been provided to the 'theme' grid option, but the file (ag-grid.css) is also included and will cause styling issues. Remove ag-grid.css from the page. See the migration guide: ${baseDocLink}/theming-migration/`,\n 107: ({ key, value }) => `Invalid value for theme param ${key} - ${value}`,\n 108: ({ e }) => [\"chart update failed\", e],\n 109: ({ inputValue, allSuggestions }) => {\n const suggestions = _fuzzySuggestions({\n inputValue,\n allSuggestions,\n hideIrrelevant: true,\n filterByPercentageOfBestMatch: 0.8\n }).values;\n return [\n `Could not find '${inputValue}' aggregate function. It was configured as \"aggFunc: '${inputValue}'\" but it wasn't found in the list of registered aggregations.`,\n suggestions.length > 0 ? ` Did you mean: [${suggestions.slice(0, 3)}]?` : \"\",\n `If using a custom aggregation function check it has been registered correctly.`\n ].join(\"\\n\");\n },\n 110: () => \"groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup\",\n 111: () => \"Invalid selection state. When `groupSelects` is enabled, the state must conform to `IServerSideGroupSelectionState`.\",\n 113: () => \"Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values\",\n 114: ({ component }) => `Could not find component with name of ${component}. Is it in Vue.components?`,\n // 115: () => 'The provided selection state should be an object.' as const,\n 116: () => \"Invalid selection state. The state must conform to `IServerSideSelectionState`.\",\n 117: () => \"selectAll must be of boolean type.\",\n 118: () => \"Infinite scrolling must be enabled in order to set the row count.\",\n 119: () => \"Unable to instantiate filter\",\n 120: () => \"MultiFloatingFilterComp expects MultiFilter as its parent\",\n 121: () => \"a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (see AG Grid docs) or b) to toString() on the object to return a key\",\n 122: () => \"could not find the document, document is empty\",\n 123: () => \"Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model.\",\n 124: () => \"No active charts to update.\",\n 125: ({ chartId }) => `Unable to update chart. No active chart found with ID: ${chartId}.`,\n 126: () => \"unable to restore chart as no chart model is provided\",\n 127: ({ allRange }) => `unable to create chart as ${allRange ? \"there are no columns in the grid\" : \"no range is selected\"}.`,\n 128: ({ feature }) => `${feature} is only available if using 'multiRow' selection mode.`,\n 129: ({ feature, rowModel }) => `${feature} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${rowModel}.`,\n 130: () => 'cannot multi select unless selection mode is \"multiRow\"',\n // 131: () => 'cannot range select while selecting multiple rows' as const,\n 132: () => \"Row selection features are not available unless `rowSelection` is enabled.\",\n 133: ({ iconName }) => `icon '${iconName}' function should return back a string or a dom object`,\n 134: ({ iconName }) => `Did not find icon '${iconName}'`,\n 135: () => `Data type of the new value does not match the cell data type of the column`,\n 136: () => `Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.`,\n 137: ({ type, currentChartType }) => `Unable to update chart as a '${type}' update type is not permitted on a ${currentChartType}.`,\n 138: ({ chartType }) => `invalid chart type supplied: ${chartType}`,\n 139: ({ customThemeName }) => `a custom chart theme with the name ${customThemeName} has been supplied but not added to the 'chartThemes' list`,\n 140: ({ name }) => `no stock theme exists with the name '${name}' and no custom chart theme with that name was supplied to 'customChartThemes'`,\n 141: () => \"cross filtering with row grouping is not supported.\",\n 142: () => \"cross filtering is only supported in the client side row model.\",\n 143: ({ panel }) => `'${panel}' is not a valid Chart Tool Panel name`,\n 144: ({ type }) => `Invalid charts data panel group name supplied: '${type}'`,\n 145: ({ group }) => `As of v32, only one charts customize panel group can be expanded at a time. '${group}' will not be expanded.`,\n 146: ({ comp }) => `Unable to instantiate component '${comp}' as its module hasn't been loaded. Add 'ValidationModule' to see which module is required.`,\n 147: ({ group }) => `Invalid charts customize panel group name supplied: '${group}'`,\n 148: ({ group }) => `invalid chartGroupsDef config '${group}'`,\n 149: ({ group, chartType }) => `invalid chartGroupsDef config '${group}.${chartType}'`,\n 150: () => `'seriesChartTypes' are required when the 'customCombo' chart type is specified.`,\n 151: ({ chartType }) => `invalid chartType '${chartType}' supplied in 'seriesChartTypes', converting to 'line' instead.`,\n 152: ({ colId }) => `no 'seriesChartType' found for colId = '${colId}', defaulting to 'line'.`,\n 153: ({ chartDataType }) => `unexpected chartDataType value '${chartDataType}' supplied, instead use 'category', 'series' or 'excluded'`,\n 154: ({ colId }) => `cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: ${colId}`,\n 155: ({ option }) => `'${option}' is not a valid Chart Toolbar Option`,\n 156: ({ panel }) => `Invalid panel in chartToolPanelsDef.panels: '${panel}'`,\n 157: ({ unrecognisedGroupIds }) => [\"unable to find group(s) for supplied groupIds:\", unrecognisedGroupIds],\n 158: () => \"can not expand a column item that does not represent a column group header\",\n 159: () => \"Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty.\",\n 160: () => `Export cancelled. Export is not allowed as per your configuration.`,\n 161: () => \"The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'\",\n 162: ({ id, dataType }) => `Unrecognized data type for excel export [${id}.dataType=${dataType}]`,\n 163: ({ featureName }) => `Excel table export does not work with ${featureName}. The exported Excel file will not contain any Excel tables.\n Please turn off ${featureName} to enable Excel table exports.`,\n 164: () => \"Unable to add data table to Excel sheet: A table already exists.\",\n 165: () => \"Unable to add data table to Excel sheet: Missing required parameters.\",\n 166: ({ unrecognisedGroupIds }) => [\"unable to find groups for these supplied groupIds:\", unrecognisedGroupIds],\n 167: ({ unrecognisedColIds }) => [\"unable to find columns for these supplied colIds:\", unrecognisedColIds],\n 168: () => \"detailCellRendererParams.template should be function or string\",\n 169: () => 'Reference to eDetailGrid was missing from the details template. Please add data-ref=\"eDetailGrid\" to the template.',\n 170: ({ providedStrategy }) => `invalid cellRendererParams.refreshStrategy = ${providedStrategy} supplied, defaulting to refreshStrategy = 'rows'.`,\n 171: () => \"could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions\",\n 172: () => \"could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData\",\n 173: ({ group }) => `invalid chartGroupsDef config '${group}'`,\n 174: ({ group, chartType }) => `invalid chartGroupsDef config '${group}.${chartType}'`,\n 175: ({ menuTabName, itemsToConsider }) => [\n `Trying to render an invalid menu item '${menuTabName}'. Check that your 'menuTabs' contains one of `,\n itemsToConsider\n ],\n 176: ({ key }) => `unknown menu item type ${key}`,\n 177: () => `valid values for cellSelection.handle.direction are 'x', 'y' and 'xy'. Default to 'xy'.`,\n 178: ({ colId }) => `column ${colId} is not visible`,\n 179: () => \"totalValueGetter should be either a function or a string (expression)\",\n 180: () => \"agRichSelectCellEditor requires cellEditorParams.values to be set\",\n 181: () => \"agRichSelectCellEditor cannot have `multiSelect` and `allowTyping` set to `true`. AllowTyping has been turned off.\",\n 182: () => 'you cannot mix groupDisplayType = \"multipleColumns\" with treeData, only one column can be used to display groups when doing tree data',\n 183: () => \"Group Column Filter only works on group columns. Please use a different filter.\",\n 184: ({ parentGroupData, childNodeData }) => [`duplicate group keys for row data, keys should be unique`, [parentGroupData, childNodeData]],\n 185: ({ data }) => [`getDataPath() should not return an empty path`, [data]],\n 186: ({\n rowId,\n rowData,\n duplicateRowsData\n }) => [\n `duplicate group keys for row data, keys should be unique`,\n rowId,\n rowData,\n ...duplicateRowsData ?? []\n ],\n 187: ({ rowId, firstData, secondData }) => [\n `Duplicate node id ${rowId}. Row IDs are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`,\n \"first instance\",\n firstData,\n \"second instance\",\n secondData\n ],\n 188: (props) => `getRowId callback must be provided for Server Side Row Model ${props?.feature || \"selection\"} to work correctly.`,\n 189: ({ startRow }) => `invalid value ${startRow} for startRow, the value should be >= 0`,\n 190: ({ rowGroupId, data }) => [\n `null and undefined values are not allowed for server side row model keys`,\n rowGroupId ? `column = ${rowGroupId}` : ``,\n `data is `,\n data\n ],\n // 191: () => `cannot multi select unless selection mode is 'multiRow'` as const,\n // 192: () => `cannot use range selection when multi selecting rows` as const,\n // 193: () => \"cannot multi select unless selection mode is 'multiRow'\" as const,\n 194: ({ method }) => `calling gridApi.${method}() is only possible when using rowModelType=\\`clientSide\\`.`,\n 195: ({ justCurrentPage }) => `selecting just ${justCurrentPage ? \"current page\" : \"filtered\"} only works when gridOptions.rowModelType='clientSide'`,\n 196: ({ key }) => `Provided ids must be of string type. Invalid id provided: ${key}`,\n 197: () => \"`toggledNodes` must be an array of string ids.\",\n // 198: () => `cannot multi select unless selection mode is 'multiRow'` as const,\n 199: () => `getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model. Use \\`api.getServerSideSelectionState()\\` instead.`,\n 200: missingModule,\n 201: ({ rowModelType }) => `Could not find row model for rowModelType = ${rowModelType}`,\n 202: () => `\\`getSelectedNodes\\` and \\`getSelectedRows\\` functions cannot be used with \\`groupSelectsChildren\\` and the server-side row model. Use \\`api.getServerSideSelectionState()\\` instead.`,\n 203: () => \"Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.\",\n 204: () => \"Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.\",\n 205: ({ duplicateIdText }) => `Unable to display rows as duplicate row ids (${duplicateIdText}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`,\n 206: () => \"getRowId callback must be implemented for transactions to work. Transaction was ignored.\",\n 207: () => 'The Set Filter Parameter \"defaultToNothingSelected\" value was ignored because it does not work when \"excelMode\" is used.',\n 208: () => `Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects.`,\n 209: () => `Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects. See ${baseDocLink}/filter-set-filter-list/#filter-value-types`,\n 210: () => \"Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects?\",\n 211: () => \"property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date.\",\n 212: () => `please review all your toolPanel components, it seems like at least one of them doesn't have an id`,\n 213: () => \"Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled.\",\n 214: ({ key }) => `unable to lookup Tool Panel as invalid key supplied: ${key}`,\n 215: ({ key, defaultByKey }) => `the key ${key} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(defaultByKey ?? {}).join(\",\")}`,\n 216: ({ name }) => `Missing component for '${name}'`,\n 217: ({ invalidColIds }) => [\"unable to find grid columns for the supplied colDef(s):\", invalidColIds],\n 218: ({ property, defaultOffset }) => `${property} must be a number, the value you provided is not a valid number. Using the default of ${defaultOffset}px.`,\n 219: ({ property }) => `Property ${property} does not exist on the target object.`,\n 220: ({ lineDash }) => `'${lineDash}' is not a valid 'lineDash' option.`,\n 221: () => `agAggregationComponent should only be used with the client and server side row model.`,\n 222: () => `agFilteredRowCountComponent should only be used with the client side row model.`,\n 223: () => `agSelectedRowCountComponent should only be used with the client and server side row model.`,\n 224: () => `agTotalAndFilteredRowCountComponent should only be used with the client side row model.`,\n 225: () => \"agTotalRowCountComponent should only be used with the client side row model.\",\n 226: () => \"viewport is missing init method.\",\n 227: () => \"menu item icon must be DOM node or string\",\n 228: ({ menuItemOrString }) => `unrecognised menu item ${menuItemOrString}`,\n // 229: ({ index }: { index: number }) => ['invalid row index for ensureIndexVisible: ', index] as const,\n 230: () => \"detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://www.ag-grid.com/react-data-grid/master-detail-custom-detail/\",\n // @deprecated v32 mark for removal as part of v32 deprecated features\n 231: () => \"As of v32, using custom components with `reactiveCustomComponents = false` is deprecated.\",\n 232: () => \"Using both rowData and v-model. rowData will be ignored.\",\n 233: ({ methodName }) => `Framework component is missing the method ${methodName}()`,\n 234: () => 'Group Column Filter does not work with the colDef property \"field\". This property will be ignored.',\n 235: () => 'Group Column Filter does not work with the colDef property \"filterValueGetter\". This property will be ignored.',\n 236: () => 'Group Column Filter does not work with the colDef property \"filterParams\". This property will be ignored.',\n 237: () => \"Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter.\",\n 238: () => \"setRowCount can only accept a positive row count.\",\n 239: () => 'Theming API and CSS File Themes are both used in the same page. In v33 we released the Theming API as the new default method of styling the grid. See the migration docs https://www.ag-grid.com/react-data-grid/theming-migration/. Because no value was provided to the `theme` grid option it defaulted to themeQuartz. But the file (ag-grid.css) is also included and will cause styling issues. Either pass the string \"legacy\" to the theme grid option to use v32 style themes, or remove ag-grid.css from the page to use Theming API.',\n 240: ({ theme }) => `theme grid option must be a Theming API theme object or the string \"legacy\", received: ${theme}`,\n // 241: () => `cannot select multiple rows when rowSelection.mode is set to 'singleRow'` as const,\n // 242: () => 'cannot select multiple rows when using rangeSelect' as const,\n 243: () => \"Failed to deserialize state - each provided state object must be an object.\",\n 244: () => \"Failed to deserialize state - `selectAllChildren` must be a boolean value or undefined.\",\n 245: () => \"Failed to deserialize state - `toggledNodes` must be an array.\",\n 246: () => \"Failed to deserialize state - Every `toggledNode` requires an associated string id.\",\n 247: () => `Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule. \nPlease rebuild the selection state and reapply it.`,\n 248: () => \"SetFloatingFilter expects SetFilter as its parent\",\n 249: () => \"Must supply a Value Formatter in Set Filter params when using a Key Creator\",\n 250: () => \"Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.\",\n 251: ({ chartType }) => `AG Grid: Unable to create chart as an invalid chartType = '${chartType}' was supplied.`,\n 252: () => \"cannot get grid to draw rows when it is in the middle of drawing rows. \\nYour code probably called a grid API method while the grid was in the render stage. \\nTo overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). \\nTo see what part of your code that caused the refresh check this stacktrace.\",\n 253: ({ version }) => [\"Illegal version string: \", version],\n 254: () => \"Cannot create chart: no chart themes available.\",\n 255: ({ point }) => `Lone surrogate U+${point?.toString(16).toUpperCase()} is not a scalar value`,\n 256: () => \"Unable to initialise. See validation error, or load ValidationModule if missing.\",\n 257: () => missingChartsWithModule(\"IntegratedChartsModule\"),\n 258: () => missingChartsWithModule(\"SparklinesModule\"),\n 259: ({ part }) => `the argument to theme.withPart must be a Theming API part object, received: ${part}`,\n 260: ({\n propName,\n compName,\n gridScoped,\n gridId,\n rowModelType\n }) => missingModule({\n reasonOrId: `AG Grid '${propName}' component: ${compName}`,\n moduleName: USER_COMP_MODULES[compName],\n gridId,\n gridScoped,\n rowModelType\n }),\n 261: () => \"As of v33, `column.isHovered()` is deprecated. Use `api.isColumnHovered(column)` instead.\",\n 262: () => 'As of v33, icon key \"smallDown\" is deprecated. Use \"advancedFilterBuilderSelect\" for Advanced Filter Builder dropdown, \"selectOpen\" for Select cell editor and dropdowns (e.g. Integrated Charts menu), \"richSelectOpen\" for Rich Select cell editor.',\n 263: () => 'As of v33, icon key \"smallLeft\" is deprecated. Use \"panelDelimiterRtl\" for Row Group Panel / Pivot Panel, \"subMenuOpenRtl\" for sub-menus.',\n 264: () => 'As of v33, icon key \"smallRight\" is deprecated. Use \"panelDelimiter\" for Row Group Panel / Pivot Panel, \"subMenuOpen\" for sub-menus.',\n 265: ({ colId }) => `Unable to infer chart data type for column '${colId}' if first data entry is null. Please specify \"chartDataType\", or a \"cellDataType\" in the column definition. For more information, see ${baseDocLink}/integrated-charts-range-chart#coldefchartdatatype .`,\n 266: () => 'As of v33.1, using \"keyCreator\" with the Rich Select Editor has been deprecated. It now requires the \"formatValue\" callback to convert complex data to strings.',\n 267: () => \"Detail grids can not use a different theme to the master grid, the `theme` detail grid option will be ignored.\",\n 268: () => \"Transactions aren't supported with tree data when using treeDataChildrenField\",\n 269: () => \"When `masterSelects: 'detail'`, detail grids must be configured with multi-row selection\",\n 270: ({ id, parentId }) => `Cycle detected for row with id='${id}' and parent id='${parentId}'. Resetting the parent for row with id='${id}' and showing it as a root-level node.`,\n 271: ({ id, parentId }) => `Parent row not found for row with id='${id}' and parent id='${parentId}'. Showing row with id='${id}' as a root-level node.`,\n 272: () => NoModulesRegisteredError(),\n 273: ({ providedId, usedId }) => `Provided column id '${providedId}' was already in use, ensure all column and group ids are unique. Using '${usedId}' instead.`,\n 274: ({ prop }) => {\n let msg = `Since v33, ${prop} has been deprecated.`;\n switch (prop) {\n case \"maxComponentCreationTimeMs\":\n msg += \" This property is no longer required and so will be removed in a future version.\";\n break;\n case \"setGridApi\":\n msg += ` This method is not called by AG Grid. To access the GridApi see: https://ag-grid.com/react-data-grid/grid-interface/#grid-api `;\n break;\n case \"children\":\n msg += ` For multiple versions AgGridReact does not support children.`;\n break;\n }\n return msg;\n },\n 275: missingRowModelTypeError,\n 276: () => \"Row Numbers Row Resizer cannot be used when Grid Columns have `autoHeight` enabled.\",\n 277: ({ colId }) => `'enableFilterHandlers' is set to true, but column '${colId}' does not have 'filter.doesFilterPass' or 'filter.handler' set.`,\n 278: ({ colId }) => `Unable to create filter handler for column '${colId}'`,\n 279: (_) => {\n },\n // `Unable to create dynamic bean '${name}' during module init lifecycle, dynamic beans must be initialised on first use.` as const,\n 280: ({ colId }) => `'name' must be provided for custom filter components for column '${colId}`,\n 281: ({ colId }) => `Filter for column '${colId}' does not have 'filterParams.buttons', but the new Filters Tool Panel has buttons configured. Either configure buttons for the filter, or disable buttons on the Filters Tool Panel.`,\n 282: () => \"New filter tool panel requires `enableFilterHandlers: true`.\",\n 283: () => \"As of v34, use the same method on the filter handler (`api.getColumnFilterHandler(colKey)`) instead.\",\n 284: () => \"As of v34, filters are active when they have a model. Use `api.getColumnFilterModel()` instead.\",\n 285: () => \"As of v34, use (`api.getColumnFilterModel()`) instead.\",\n 286: () => \"As of v34, use (`api.setColumnFilterModel()`) instead.\",\n 287: () => \"`api.doFilterAction()` requires `enableFilterHandlers = true\",\n 288: () => \"`api.getColumnFilterModel(key, true)` requires `enableFilterHandlers = true\",\n 289: ({ rowModelType }) => `Row Model '${rowModelType}' is not supported with Batch Editing`,\n 290: ({ rowIndex, rowPinned }) => `Row with index '${rowIndex}' and pinned state '${rowPinned}' not found`,\n 291: () => \"License Key being set multiple times with different values. This can result in an incorrect license key being used,\",\n 292: ({ colId }) => `The Multi Filter for column '${colId}' has buttons configured against the child filters. When 'enableFilterHandlers=true', buttons must instead be provided against the parent Multi Filter params. The child filter buttons will be ignored.`,\n 293: () => `The grid was initialised detached from the DOM and was then inserted into a Shadow Root. Theme styles are probably broken. Pass the themeStyleContainer grid option to let the grid know where in the document to insert theme CSS.`,\n 294: () => `When using the \\`agRichSelectCellEditor\\` setting \\`filterListAsync = true\\` requires \\`allowTyping = true\\` and the \\`values()\\` callback must return a Promise of filtered values.`,\n 295: ({ blockedService }) => `colDef.allowFormula is not supported with ${blockedService}. Formulas has been turned off.`,\n 296: () => \"Since v35, `api.hideOverlay()` does not hide the overlay when `activeOverlay` is set. Set `activeOverlay=null` instead.\",\n 297: () => '`api.hideOverlay()` does not hide the no matching rows overlay as it is only controlled by grid state. Set `suppressOverlays=[\"noMatchingRows\"] to not show it.',\n 298: () => `Columns Tool Panel 'buttons' requires 'apply' to enable Deferred Updates.`\n};\nfunction getError(errorId, args) {\n const msgOrFunc = AG_GRID_ERRORS[errorId];\n if (!msgOrFunc) {\n return [`Missing error text for error id ${errorId}!`];\n }\n const errorBody = msgOrFunc(args);\n const errorLink = getErrorLink(errorId, args);\n const errorSuffix = `\nSee ${errorLink}`;\n return Array.isArray(errorBody) ? errorBody.concat(errorSuffix) : [errorBody, errorSuffix];\n}\nvar MISSING_MODULE_REASONS = {\n 1: \"Charting Aggregation\",\n 2: \"pivotResultFields\",\n 3: \"setTooltip\"\n};\n\n// packages/ag-grid-community/src/vanillaFrameworkOverrides.ts\nvar VanillaFrameworkOverrides = class {\n constructor(frameworkName = \"javascript\") {\n this.frameworkName = frameworkName;\n this.renderingEngine = \"vanilla\";\n this.batchFrameworkComps = false;\n this.wrapIncoming = (callback) => callback();\n this.wrapOutgoing = (callback) => callback();\n this.baseDocLink = `${BASE_URL}/${this.frameworkName}-data-grid`;\n setValidationDocLink(this.baseDocLink);\n }\n frameworkComponent(_) {\n return null;\n }\n isFrameworkComponent(_) {\n return false;\n }\n getDocLink(path) {\n return this.baseDocLink + (path ? \"/\" + path : \"\");\n }\n};\n\n// packages/ag-grid-community/src/grid.ts\nvar _gridApiCache = /* @__PURE__ */ new WeakMap();\nvar _gridElementCache = /* @__PURE__ */ new WeakMap();\nfunction createGrid(eGridDiv, gridOptions, params) {\n if (!gridOptions) {\n _error(11);\n return {};\n }\n const gridParams = params;\n let destroyCallback;\n if (!gridParams?.setThemeOnGridDiv) {\n const newGridDiv = _createElement({ tag: \"div\" });\n newGridDiv.style.height = \"100%\";\n eGridDiv.appendChild(newGridDiv);\n eGridDiv = newGridDiv;\n destroyCallback = () => eGridDiv.remove();\n }\n const api = new GridCoreCreator().create(\n eGridDiv,\n gridOptions,\n (context) => {\n const gridComp = new GridComp(eGridDiv);\n context.createBean(gridComp);\n },\n void 0,\n params,\n destroyCallback\n );\n return api;\n}\nvar nextGridId = 1;\nvar GridCoreCreator = class {\n create(eGridDiv, providedOptions, createUi, acceptChanges, params, _destroyCallback) {\n const gridOptions = GlobalGridOptions.applyGlobalGridOptions(providedOptions);\n const gridId = gridOptions.gridId ?? String(nextGridId++);\n const registeredModules = this.getRegisteredModules(params, gridId, gridOptions.rowModelType);\n const beanClasses = this.createBeansList(gridOptions.rowModelType, registeredModules, gridId);\n const providedBeanInstances = this.createProvidedBeans(eGridDiv, gridOptions, params);\n if (!beanClasses) {\n return void 0;\n }\n const destroyCallback = () => {\n _gridElementCache.delete(api);\n _gridApiCache.delete(eGridDiv);\n _unRegisterGridModules(gridId);\n _destroyCallback?.();\n };\n const contextParams = {\n providedBeanInstances,\n beanClasses,\n id: gridId,\n beanInitComparator: gridBeanInitComparator,\n beanDestroyComparator: gridBeanDestroyComparator,\n derivedBeans: [createGridApi],\n destroyCallback\n };\n const context = new AgContext(contextParams);\n this.registerModuleFeatures(context, registeredModules);\n createUi(context);\n context.getBean(\"syncSvc\").start();\n acceptChanges?.(context);\n const api = context.getBean(\"gridApi\");\n _gridApiCache.set(eGridDiv, api);\n _gridElementCache.set(api, eGridDiv);\n return api;\n }\n getRegisteredModules(params, gridId, rowModelType) {\n _registerModule(CommunityCoreModule, void 0, true);\n params?.modules?.forEach((m) => _registerModule(m, gridId));\n return _getRegisteredModules(gridId, getDefaultRowModelType(rowModelType));\n }\n registerModuleFeatures(context, registeredModules) {\n const registry = context.getBean(\"registry\");\n const apiFunctionSvc = context.getBean(\"apiFunctionSvc\");\n for (const module of registeredModules) {\n registry.registerModule(module);\n const apiFunctions = module.apiFunctions;\n if (apiFunctions) {\n const names = Object.keys(apiFunctions);\n for (const name of names) {\n apiFunctionSvc?.addFunction(name, apiFunctions[name]);\n }\n }\n }\n }\n createProvidedBeans(eGridDiv, gridOptions, params) {\n let frameworkOverrides = params ? params.frameworkOverrides : null;\n if (_missing(frameworkOverrides)) {\n frameworkOverrides = new VanillaFrameworkOverrides();\n }\n const seed = {\n gridOptions,\n eGridDiv,\n eRootDiv: eGridDiv,\n globalListener: params ? params.globalListener : null,\n globalSyncListener: params ? params.globalSyncListener : null,\n frameworkOverrides,\n withinStudio: params?.withinStudio\n };\n if (params?.providedBeanInstances) {\n Object.assign(seed, params.providedBeanInstances);\n }\n return seed;\n }\n createBeansList(userProvidedRowModelType, registeredModules, gridId) {\n const rowModelModuleNames = {\n clientSide: \"ClientSideRowModel\",\n infinite: \"InfiniteRowModel\",\n serverSide: \"ServerSideRowModel\",\n viewport: \"ViewportRowModel\"\n };\n const rowModelType = getDefaultRowModelType(userProvidedRowModelType);\n const rowModuleModelName = rowModelModuleNames[rowModelType];\n if (!rowModuleModelName) {\n _logPreInitErr(201, { rowModelType }, `Unknown rowModelType ${rowModelType}.`);\n return;\n }\n if (!_hasUserRegistered()) {\n _logPreInitErr(272, void 0, NoModulesRegisteredError());\n return;\n }\n if (!userProvidedRowModelType) {\n const registeredRowModelModules = Object.entries(rowModelModuleNames).filter(\n ([rowModelType2, module]) => _isModuleRegistered(module, gridId, rowModelType2)\n );\n if (registeredRowModelModules.length == 1) {\n const [userRowModelType, moduleName] = registeredRowModelModules[0];\n if (userRowModelType !== rowModelType) {\n const params = {\n moduleName,\n rowModelType: userRowModelType\n };\n _logPreInitErr(275, params, missingRowModelTypeError(params));\n return;\n }\n }\n }\n if (!_isModuleRegistered(rowModuleModelName, gridId, rowModelType)) {\n const isUmd2 = _isUmd();\n const reasonOrId = `rowModelType = '${rowModelType}'`;\n const message = isUmd2 ? `Unable to use ${reasonOrId} as that requires the ag-grid-enterprise script to be included.\n` : `Missing module ${rowModuleModelName}Module for rowModelType ${rowModelType}.`;\n _logPreInitErr(\n 200,\n {\n reasonOrId,\n moduleName: rowModuleModelName,\n gridScoped: _areModulesGridScoped(),\n gridId,\n rowModelType,\n isUmd: isUmd2\n },\n message\n );\n return;\n }\n const beans = /* @__PURE__ */ new Set();\n for (const module of registeredModules) {\n for (const bean of module.beans ?? []) {\n beans.add(bean);\n }\n }\n return Array.from(beans);\n }\n};\nfunction getDefaultRowModelType(passedRowModelType) {\n return passedRowModelType ?? \"clientSide\";\n}\nfunction getGridApi(gridElement) {\n if (typeof gridElement === \"string\") {\n try {\n gridElement = document.querySelector(`[grid-id=\"${gridElement}\"]`)?.parentElement ?? document.querySelector(gridElement)?.firstElementChild ?? document.getElementById(gridElement)?.firstElementChild;\n } catch {\n gridElement = null;\n }\n }\n return gridElement ? _gridApiCache.get(gridElement) : void 0;\n}\nfunction getGridElement(api) {\n return _gridElementCache.get(api);\n}\n\n// packages/ag-grid-community/src/misc/state/stateUtils.ts\nfunction convertColumnState(columnState, enablePivotMode = false) {\n const sortColumns = [];\n const groupColIds = [];\n const aggregationColumns = [];\n const pivotColIds = [];\n const leftColIds = [];\n const rightColIds = [];\n const hiddenColIds = [];\n const columnSizes = [];\n const columns = [];\n let defaultSortIndex = 0;\n for (let i = 0; i < columnState.length; i++) {\n const {\n colId,\n sort,\n sortType,\n sortIndex,\n rowGroup,\n rowGroupIndex,\n aggFunc,\n pivot,\n pivotIndex,\n pinned,\n hide,\n width,\n flex\n } = columnState[i];\n columns.push(colId);\n if (sort) {\n sortColumns[sortIndex ?? defaultSortIndex++] = { colId, sort, type: sortType };\n }\n if (rowGroup) {\n groupColIds[rowGroupIndex ?? 0] = colId;\n }\n if (typeof aggFunc === \"string\") {\n aggregationColumns.push({ colId, aggFunc });\n }\n if (pivot) {\n pivotColIds[pivotIndex ?? 0] = colId;\n }\n if (pinned) {\n (pinned === \"right\" ? rightColIds : leftColIds).push(colId);\n }\n if (hide) {\n hiddenColIds.push(colId);\n }\n if (flex != null || width) {\n columnSizes.push({ colId, flex: flex ?? void 0, width: width === null ? void 0 : width });\n }\n }\n return {\n sort: sortColumns.length ? { sortModel: _removeEmptyValues(sortColumns) } : void 0,\n rowGroup: groupColIds.length ? { groupColIds: _removeEmptyValues(groupColIds) } : void 0,\n aggregation: aggregationColumns.length ? { aggregationModel: aggregationColumns } : void 0,\n pivot: pivotColIds.length || enablePivotMode ? { pivotMode: enablePivotMode, pivotColIds: _removeEmptyValues(pivotColIds) } : void 0,\n columnPinning: leftColIds.length || rightColIds.length ? { leftColIds, rightColIds } : void 0,\n columnVisibility: hiddenColIds.length ? { hiddenColIds } : void 0,\n columnSizing: columnSizes.length ? { columnSizingModel: columnSizes } : void 0,\n columnOrder: columns.length ? { orderedColIds: columns } : void 0\n };\n}\nfunction _removeEmptyValues(array) {\n return array.filter((a) => a != void 0);\n}\nfunction _convertColumnGroupState(columnGroupState) {\n const openColumnGroups = [];\n for (const { groupId, open } of columnGroupState) {\n if (open) {\n openColumnGroups.push(groupId);\n }\n }\n return openColumnGroups.length ? { openColumnGroupIds: openColumnGroups } : void 0;\n}\nfunction convertColumnGroupState(columnGroupState) {\n return { columnGroup: _convertColumnGroupState(columnGroupState) };\n}\n\n// packages/ag-grid-community/src/alignedGrids/alignedGridsService.ts\nvar AlignedGridsService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"alignedGridsSvc\";\n // flag to mark if we are consuming. to avoid cyclic events (ie other grid firing back to master\n // while processing a master event) we mark this if consuming an event, and if we are, then\n // we don't fire back any events.\n this.consuming = false;\n }\n getAlignedGridApis() {\n let alignedGrids = this.gos.get(\"alignedGrids\") ?? [];\n const isCallbackConfig = typeof alignedGrids === \"function\";\n if (typeof alignedGrids === \"function\") {\n alignedGrids = alignedGrids();\n }\n const apis = alignedGrids.map((alignedGrid) => {\n if (!alignedGrid) {\n _error(18);\n if (!isCallbackConfig) {\n _error(20);\n }\n return;\n }\n if (this.isGridApi(alignedGrid)) {\n return alignedGrid;\n }\n const refOrComp = alignedGrid;\n if (\"current\" in refOrComp) {\n return refOrComp.current?.api;\n }\n if (!refOrComp.api) {\n _error(19);\n }\n return refOrComp.api;\n }).filter((api) => !!api && !api.isDestroyed());\n return apis;\n }\n isGridApi(ref) {\n return !!ref && !!ref.dispatchEvent;\n }\n postConstruct() {\n const fireColumnEvent = this.fireColumnEvent.bind(this);\n this.addManagedEventListeners({\n columnMoved: fireColumnEvent,\n columnVisible: fireColumnEvent,\n columnPinned: fireColumnEvent,\n columnGroupOpened: fireColumnEvent,\n columnResized: fireColumnEvent,\n bodyScroll: this.fireScrollEvent.bind(this),\n alignedGridColumn: ({ event }) => this.onColumnEvent(event),\n alignedGridScroll: ({ event }) => this.onScrollEvent(event)\n });\n }\n // common logic across all the fire methods\n fireEvent(event) {\n if (this.consuming) {\n return;\n }\n for (const api of this.getAlignedGridApis()) {\n if (api.isDestroyed()) {\n continue;\n }\n api.dispatchEvent(event);\n }\n }\n // common logic across all consume methods. very little common logic, however extracting\n // guarantees consistency across the methods.\n onEvent(callback) {\n this.consuming = true;\n callback();\n this.consuming = false;\n }\n fireColumnEvent(columnEvent) {\n this.fireEvent({\n type: \"alignedGridColumn\",\n event: columnEvent\n });\n }\n fireScrollEvent(scrollEvent) {\n if (scrollEvent.direction !== \"horizontal\") {\n return;\n }\n this.fireEvent({\n type: \"alignedGridScroll\",\n event: scrollEvent\n });\n }\n onScrollEvent(event) {\n this.onEvent(() => {\n this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(event.left, true);\n });\n }\n extractDataFromEvent(event, func) {\n const result = [];\n if (event.columns) {\n event.columns.forEach((column) => {\n result.push(func(column));\n });\n } else if (event.column) {\n result.push(func(event.column));\n }\n return result;\n }\n getMasterColumns(event) {\n return this.extractDataFromEvent(event, (col) => col);\n }\n getColumnIds(event) {\n return this.extractDataFromEvent(event, (col) => col.getColId());\n }\n onColumnEvent(event) {\n this.onEvent(() => {\n switch (event.type) {\n case \"columnMoved\":\n case \"columnVisible\":\n case \"columnPinned\":\n case \"columnResized\": {\n this.processColumnEvent(event);\n break;\n }\n case \"columnGroupOpened\": {\n this.processGroupOpenedEvent(event);\n break;\n }\n case \"columnPivotChanged\":\n _warn(21);\n break;\n }\n });\n }\n processGroupOpenedEvent(groupOpenedEvent) {\n const { colGroupSvc } = this.beans;\n if (!colGroupSvc) {\n return;\n }\n for (const masterGroup of groupOpenedEvent.columnGroups) {\n let otherColumnGroup = null;\n if (masterGroup) {\n otherColumnGroup = colGroupSvc.getProvidedColGroup(masterGroup.getGroupId());\n }\n if (masterGroup && !otherColumnGroup) {\n continue;\n }\n colGroupSvc.setColumnGroupOpened(otherColumnGroup, masterGroup.isExpanded(), \"alignedGridChanged\");\n }\n }\n processColumnEvent(colEvent) {\n const masterColumn = colEvent.column;\n let otherColumn = null;\n const beans = this.beans;\n const { colResize, ctrlsSvc, colModel } = beans;\n if (masterColumn) {\n otherColumn = colModel.getColDefCol(masterColumn.getColId());\n }\n if (masterColumn && !otherColumn) {\n return;\n }\n const masterColumns = this.getMasterColumns(colEvent);\n switch (colEvent.type) {\n case \"columnMoved\":\n {\n const srcColState = colEvent.api.getColumnState();\n const destColState = srcColState.map((s) => ({ colId: s.colId }));\n _applyColumnState(beans, { state: destColState, applyOrder: true }, \"alignedGridChanged\");\n }\n break;\n case \"columnVisible\":\n {\n const srcColState = colEvent.api.getColumnState();\n const destColState = srcColState.map((s) => ({ colId: s.colId, hide: s.hide }));\n _applyColumnState(beans, { state: destColState }, \"alignedGridChanged\");\n }\n break;\n case \"columnPinned\":\n {\n const srcColState = colEvent.api.getColumnState();\n const destColState = srcColState.map((s) => ({ colId: s.colId, pinned: s.pinned }));\n _applyColumnState(beans, { state: destColState }, \"alignedGridChanged\");\n }\n break;\n case \"columnResized\": {\n const resizedEvent = colEvent;\n const columnWidths = {};\n for (const column of masterColumns) {\n columnWidths[column.getId()] = { key: column.getColId(), newWidth: column.getActualWidth() };\n }\n for (const col of resizedEvent.flexColumns ?? []) {\n if (columnWidths[col.getId()]) {\n delete columnWidths[col.getId()];\n }\n }\n colResize?.setColumnWidths(\n Object.values(columnWidths),\n false,\n resizedEvent.finished,\n \"alignedGridChanged\"\n );\n break;\n }\n }\n const gridBodyCon = ctrlsSvc.getGridBodyCtrl();\n const isVerticalScrollShowing = gridBodyCon.isVerticalScrollShowing();\n for (const api of this.getAlignedGridApis()) {\n api.setGridOption(\"alwaysShowVerticalScroll\", isVerticalScrollShowing);\n }\n }\n};\n\n// packages/ag-grid-community/src/alignedGrids/alignedGridsModule.ts\nvar AlignedGridsModule = {\n moduleName: \"AlignedGrids\",\n version: VERSION,\n beans: [AlignedGridsService],\n dependsOn: [ColumnApiModule]\n};\n\n// packages/ag-grid-community/src/api/rowApi.ts\nfunction redrawRows(beans, params = {}) {\n const rowNodes = params ? params.rowNodes : void 0;\n beans.frameworkOverrides.wrapIncoming(() => beans.rowRenderer.redrawRows(rowNodes));\n}\nfunction setRowNodeExpanded(beans, rowNode, expanded, expandParents, forceSync) {\n if (rowNode) {\n if (expandParents && rowNode.parent && rowNode.parent.level !== -1) {\n setRowNodeExpanded(beans, rowNode.parent, expanded, expandParents, forceSync);\n }\n rowNode.setExpanded(expanded, void 0, forceSync);\n }\n}\nfunction getRowNode(beans, id) {\n return beans.rowModel.getRowNode(id);\n}\nfunction addRenderedRowListener(beans, eventName, rowIndex, callback) {\n beans.rowRenderer.addRenderedRowListener(eventName, rowIndex, callback);\n}\nfunction getRenderedNodes(beans) {\n return beans.rowRenderer.getRenderedNodes();\n}\nfunction forEachNode(beans, callback, includeFooterNodes) {\n beans.rowModel.forEachNode(callback, includeFooterNodes);\n}\nfunction getFirstDisplayedRowIndex(beans) {\n return beans.rowRenderer.firstRenderedRow;\n}\nfunction getLastDisplayedRowIndex(beans) {\n return beans.rowRenderer.lastRenderedRow;\n}\nfunction getDisplayedRowAtIndex(beans, index) {\n return beans.rowModel.getRow(index);\n}\nfunction getDisplayedRowCount(beans) {\n return beans.rowModel.getRowCount();\n}\n\n// packages/ag-grid-community/src/api/scrollApi.ts\nfunction getVerticalPixelRange(beans) {\n return beans.ctrlsSvc.getScrollFeature().getVScrollPosition();\n}\nfunction getHorizontalPixelRange(beans) {\n return beans.ctrlsSvc.getScrollFeature().getHScrollPosition();\n}\nfunction ensureColumnVisible(beans, key, position = \"auto\") {\n beans.frameworkOverrides.wrapIncoming(\n () => beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(key, position),\n \"ensureVisible\"\n );\n}\nfunction ensureIndexVisible(beans, index, position) {\n beans.frameworkOverrides.wrapIncoming(\n () => beans.ctrlsSvc.getScrollFeature().ensureIndexVisible(index, position),\n \"ensureVisible\"\n );\n}\nfunction ensureNodeVisible(beans, nodeSelector, position = null) {\n beans.frameworkOverrides.wrapIncoming(\n () => beans.ctrlsSvc.getScrollFeature().ensureNodeVisible(nodeSelector, position),\n \"ensureVisible\"\n );\n}\n\n// packages/ag-grid-community/src/api/apiModule.ts\nvar RowApiModule = {\n moduleName: \"RowApi\",\n version: VERSION,\n apiFunctions: {\n redrawRows,\n setRowNodeExpanded,\n getRowNode,\n addRenderedRowListener,\n getRenderedNodes,\n forEachNode,\n getFirstDisplayedRowIndex,\n getLastDisplayedRowIndex,\n getDisplayedRowAtIndex,\n getDisplayedRowCount\n }\n};\nvar ScrollApiModule = {\n moduleName: \"ScrollApi\",\n version: VERSION,\n apiFunctions: {\n getVerticalPixelRange,\n getHorizontalPixelRange,\n ensureColumnVisible,\n ensureIndexVisible,\n ensureNodeVisible\n }\n};\n\n// packages/ag-grid-community/src/api/rowModelSharedApi.ts\nfunction expandAll(beans) {\n beans.expansionSvc?.expandAll(true);\n}\nfunction collapseAll(beans) {\n beans.expansionSvc?.expandAll(false);\n}\nfunction onRowHeightChanged(beans) {\n beans.rowModel?.onRowHeightChanged();\n}\nfunction resetRowHeights(beans) {\n if (beans.rowAutoHeight?.active) {\n _warn(3);\n return;\n }\n beans.rowModel?.resetRowHeights();\n}\nfunction resetRowGroupExpansion(beans) {\n beans.expansionSvc?.resetExpansion();\n}\n\n// packages/ag-grid-community/src/api/ssrmInfiniteSharedApi.ts\nfunction setRowCount(beans, rowCount, maxRowFound) {\n const serverSideRowModel = _getServerSideRowModel(beans);\n if (serverSideRowModel) {\n if (beans.rowGroupColsSvc?.columns.length === 0) {\n if (rowCount < 0) {\n _error(238);\n return;\n }\n serverSideRowModel.setRowCount(rowCount, maxRowFound);\n return;\n }\n _error(28);\n return;\n }\n _getInfiniteRowModel(beans)?.setRowCount(rowCount, maxRowFound);\n}\nfunction getCacheBlockState(beans) {\n if (_isServerSideRowModel(beans.gos)) {\n const ssrm = beans.rowModel;\n return ssrm.getBlockStates();\n }\n return beans.rowNodeBlockLoader?.getBlockState() ?? {};\n}\nfunction isLastRowIndexKnown(beans) {\n return beans.rowModel.isLastRowIndexKnown();\n}\n\n// packages/ag-grid-community/src/api/sharedApiModule.ts\nvar CsrmSsrmSharedApiModule = {\n moduleName: \"CsrmSsrmSharedApi\",\n version: VERSION,\n apiFunctions: { expandAll, collapseAll, resetRowGroupExpansion }\n};\nvar RowModelSharedApiModule = {\n moduleName: \"RowModelSharedApi\",\n version: VERSION,\n apiFunctions: { onRowHeightChanged, resetRowHeights }\n};\nvar SsrmInfiniteSharedApiModule = {\n moduleName: \"SsrmInfiniteSharedApi\",\n version: VERSION,\n apiFunctions: {\n setRowCount,\n getCacheBlockState,\n isLastRowIndexKnown\n }\n};\n\n// packages/ag-grid-community/src/utils/changedPath.ts\nvar forEachGroupDepthFirst = (children, callback) => {\n for (let i = 0, len = children.length; i < len; ++i) {\n const child = children[i];\n const grandChildren = child.childrenAfterGroup;\n if (grandChildren !== null) {\n forEachGroupDepthFirst(grandChildren, callback);\n callback(child);\n }\n }\n};\nvar _forEachChangedGroupDepthFirst = (rootNode, hierarchical, changedPath, callback) => {\n if (changedPath != null) {\n const rows = changedPath.getSortedRows();\n for (let i = 0, len = rows.length; i < len; ++i) {\n const row = rows[i];\n if (row.childrenAfterGroup !== null && !row.destroyed) {\n callback(row);\n }\n }\n return;\n }\n if (rootNode == null) {\n return;\n }\n const children = rootNode.childrenAfterGroup;\n if (children === null) {\n return;\n }\n if (hierarchical) {\n forEachGroupDepthFirst(children, callback);\n }\n callback(rootNode);\n};\n\n// packages/ag-grid-community/src/clientSideRowModel/clientSideNodeManager.ts\nvar ClientSideNodeManager = class extends BeanStub {\n constructor(rootNode) {\n super();\n this.rootNode = rootNode;\n this.nextId = 0;\n this.allNodesMap = {};\n initRootNode(rootNode);\n }\n getRowNode(id) {\n return this.allNodesMap[id];\n }\n setNewRowData(rowData) {\n this.dispatchRowDataUpdateStarted(rowData);\n this.destroyAllNodes();\n const rootNode = initRootNode(this.rootNode);\n const allLeafs = new Array(rowData.length);\n rootNode._leafs = allLeafs;\n let writeIdx = 0;\n const nestedDataGetter = this.beans.groupStage?.getNestedDataGetter();\n const processedNested = nestedDataGetter ? /* @__PURE__ */ new Set() : null;\n const processChildren = (parent, childrenData) => {\n const level = parent.level + 1;\n for (let i = 0, len = childrenData.length; i < len; ++i) {\n const data = childrenData[i];\n if (!data) {\n continue;\n }\n const node = this.createRowNode(data, level, writeIdx);\n allLeafs[writeIdx++] = node;\n if (processedNested && !processedNested.has(data)) {\n processedNested.add(data);\n node.treeParent = parent;\n const children = nestedDataGetter(data);\n if (children) {\n processChildren(node, children);\n }\n }\n }\n };\n processChildren(rootNode, rowData);\n allLeafs.length = writeIdx;\n }\n destroyAllNodes() {\n const { selectionSvc, pinnedRowModel, groupStage } = this.beans;\n selectionSvc?.reset(\"rowDataChanged\");\n if (pinnedRowModel?.isManual()) {\n pinnedRowModel.reset();\n }\n groupStage?.clearNonLeafs();\n const existingLeafs = this.rootNode._leafs;\n if (existingLeafs) {\n for (let i = 0, len = existingLeafs.length; i < len; ++i) {\n existingLeafs[i]._destroy(false);\n }\n }\n this.allNodesMap = /* @__PURE__ */ Object.create(null);\n this.nextId = 0;\n }\n setImmutableRowData(params, rowData) {\n const { rootNode, gos } = this;\n this.dispatchRowDataUpdateStarted(rowData);\n const getRowIdFunc = _getRowIdCallback(gos);\n const changedRowNodes = params.changedRowNodes;\n const { adds, updates } = changedRowNodes;\n const processedNodes = /* @__PURE__ */ new Set();\n const nodesToUnselect = [];\n const nestedDataGetter = this.beans.groupStage?.getNestedDataGetter();\n let reorder = gos.get(\"suppressMaintainUnsortedOrder\") ? void 0 : false;\n let prevIndex = -1;\n let treeUpdated = false;\n const updateNode = (node, data) => {\n if (!reorder && reorder !== void 0) {\n const oldIndex = node.sourceRowIndex;\n reorder = oldIndex <= prevIndex;\n prevIndex = oldIndex;\n }\n if (node.data !== data) {\n node.updateData(data);\n if (!adds.has(node)) {\n updates.add(node);\n }\n if (!node.selectable && node.isSelected()) {\n nodesToUnselect.push(node);\n }\n }\n };\n const processChildren = (parent, childrenData, level) => {\n for (let i = 0, len = childrenData.length; i < len; ++i) {\n const data = childrenData[i];\n if (!data) {\n continue;\n }\n let node = this.getRowNode(getRowIdFunc({ data, level }));\n if (node) {\n updateNode(node, data);\n treeUpdated || (treeUpdated = !!nestedDataGetter && node.treeParent !== parent);\n } else {\n node = this.createRowNode(data, level);\n adds.add(node);\n }\n if (!nestedDataGetter || processedNodes.has(node)) {\n processedNodes.add(node);\n continue;\n }\n processedNodes.add(node);\n node.treeParent = parent;\n const children = nestedDataGetter(data);\n if (children) {\n processChildren(node, children, level + 1);\n }\n }\n };\n processChildren(rootNode, rowData, 0);\n const changed = this.deleteUnusedNodes(processedNodes, changedRowNodes, nodesToUnselect, !!params.animate) || reorder || adds.size > 0;\n if (changed) {\n const allLeafs = rootNode._leafs ?? (rootNode._leafs = []);\n if (reorder === void 0) {\n updateRootLeafsKeepOrder(allLeafs, processedNodes, changedRowNodes);\n } else if (updateRootLeafsOrdered(allLeafs, processedNodes)) {\n changedRowNodes.reordered = true;\n }\n }\n if (changed || treeUpdated || updates.size) {\n params.rowDataUpdated = true;\n this.deselect(nodesToUnselect);\n }\n }\n deleteUnusedNodes(processedNodes, { removals }, nodesToUnselect, animate) {\n const allLeafs = this.rootNode._leafs;\n for (let i = 0, len = allLeafs.length; i < len; i++) {\n const node = allLeafs[i];\n if (!processedNodes.has(node)) {\n if (this.destroyNode(node, animate)) {\n removals.push(node);\n if (node.isSelected()) {\n nodesToUnselect.push(node);\n }\n }\n }\n }\n return removals.length > 0;\n }\n updateRowData(rowDataTran, changedRowNodes, animate) {\n this.dispatchRowDataUpdateStarted(rowDataTran.add);\n if (this.beans.groupStage?.getNestedDataGetter()) {\n _warn(268);\n return { remove: [], update: [], add: [] };\n }\n const nodesToUnselect = [];\n const getRowIdFunc = _getRowIdCallback(this.gos);\n const remove = this.executeRemove(getRowIdFunc, rowDataTran, changedRowNodes, nodesToUnselect, animate);\n const update = this.executeUpdate(getRowIdFunc, rowDataTran, changedRowNodes, nodesToUnselect);\n const add = this.executeAdd(rowDataTran, changedRowNodes);\n this.deselect(nodesToUnselect);\n return { remove, update, add };\n }\n executeRemove(getRowIdFunc, { remove }, { adds, updates, removals }, nodesToUnselect, animate) {\n const allLeafs = this.rootNode._leafs;\n const allLeafsLen = allLeafs?.length;\n const removeLen = remove?.length;\n if (!removeLen || !allLeafsLen) {\n return [];\n }\n let removeCount = 0;\n let filterIdx = allLeafsLen;\n let filterEndIdx = 0;\n const removedResult = new Array(removeLen);\n for (let i = 0; i < removeLen; ++i) {\n const rowNode = this.lookupNode(getRowIdFunc, remove[i]);\n if (!rowNode) {\n continue;\n }\n const sourceRowIndex = rowNode.sourceRowIndex;\n if (sourceRowIndex < filterIdx) {\n filterIdx = sourceRowIndex;\n }\n if (sourceRowIndex > filterEndIdx) {\n filterEndIdx = sourceRowIndex;\n }\n removedResult[removeCount++] = rowNode;\n if (!this.destroyNode(rowNode, animate)) {\n continue;\n }\n if (rowNode.isSelected()) {\n nodesToUnselect.push(rowNode);\n }\n if (!adds.delete(rowNode)) {\n updates.delete(rowNode);\n removals.push(rowNode);\n }\n }\n removedResult.length = removeCount;\n if (removeCount) {\n filterRemovedRowNodes(allLeafs, filterIdx, filterEndIdx);\n }\n return removedResult;\n }\n executeUpdate(getRowIdFunc, { update }, { adds, updates }, nodesToUnselect) {\n const updateLen = update?.length;\n if (!updateLen) {\n return [];\n }\n const updateResult = new Array(updateLen);\n let writeIdx = 0;\n for (let i = 0; i < updateLen; i++) {\n const item = update[i];\n const rowNode = this.lookupNode(getRowIdFunc, item);\n if (rowNode) {\n rowNode.updateData(item);\n if (!rowNode.selectable && rowNode.isSelected()) {\n nodesToUnselect.push(rowNode);\n }\n updateResult[writeIdx++] = rowNode;\n if (!adds.has(rowNode)) {\n updates.add(rowNode);\n }\n }\n }\n updateResult.length = writeIdx;\n return updateResult;\n }\n executeAdd(rowDataTran, changedRowNodes) {\n var _a;\n const allLeafs = (_a = this.rootNode)._leafs ?? (_a._leafs = []);\n const allLeafsLen = allLeafs.length;\n const add = rowDataTran.add;\n const addLength = add?.length;\n if (!addLength) {\n return [];\n }\n const newLen = allLeafsLen + addLength;\n let addIndex = this.sanitizeAddIndex(allLeafs, rowDataTran.addIndex);\n if (addIndex < allLeafsLen) {\n for (let readIdx = allLeafsLen - 1, writeIdx = newLen - 1; readIdx >= addIndex; --readIdx) {\n const node = allLeafs[readIdx];\n node.sourceRowIndex = writeIdx;\n allLeafs[writeIdx--] = node;\n }\n changedRowNodes.reordered = true;\n }\n allLeafs.length = newLen;\n const addedNodes = new Array(addLength);\n const adds = changedRowNodes.adds;\n for (let i = 0; i < addLength; i++) {\n const node = this.createRowNode(add[i], 0, addIndex);\n adds.add(node);\n allLeafs[addIndex] = node;\n addedNodes[i] = node;\n addIndex++;\n }\n return addedNodes;\n }\n dispatchRowDataUpdateStarted(data) {\n this.eventSvc.dispatchEvent({ type: \"rowDataUpdateStarted\", firstRowData: data?.length ? data[0] : null });\n }\n deselect(nodes) {\n const source = \"rowDataChanged\";\n const selectionSvc = this.beans.selectionSvc;\n if (nodes.length) {\n selectionSvc?.setNodesSelected({ newValue: false, nodes, suppressFinishActions: true, source });\n }\n selectionSvc?.updateGroupsFromChildrenSelections?.(source);\n if (nodes.length) {\n this.eventSvc.dispatchEvent({\n type: \"selectionChanged\",\n source,\n selectedNodes: selectionSvc?.getSelectedNodes() ?? null,\n serverSideState: null\n });\n }\n }\n createRowNode(data, level, sourceRowIndex) {\n const node = new RowNode(this.beans);\n node.parent = this.rootNode;\n node.level = level;\n node.group = false;\n if (sourceRowIndex != null) {\n node.sourceRowIndex = sourceRowIndex;\n }\n node.setDataAndId(data, String(this.nextId++));\n const id = node.id;\n const allNodesMap = this.allNodesMap;\n if (allNodesMap[id]) {\n _warn(2, { nodeId: id });\n }\n allNodesMap[id] = node;\n return node;\n }\n /** Called when a node needs to be deleted */\n destroyNode(node, animate) {\n if (!node._destroy(animate)) {\n return false;\n }\n const id = node.id;\n const allNodesMap = this.allNodesMap;\n if (allNodesMap[id] === node) {\n delete allNodesMap[id];\n }\n return true;\n }\n lookupNode(getRowIdFunc, data) {\n if (!getRowIdFunc) {\n return lookupNodeByData(this.rootNode._leafs, data);\n }\n const id = getRowIdFunc({ data, level: 0 });\n const rowNode = this.allNodesMap[id];\n if (!rowNode) {\n _error(4, { id });\n return null;\n }\n return rowNode;\n }\n sanitizeAddIndex(allLeafs, addIndex) {\n const allLeafsLen = allLeafs.length;\n if (typeof addIndex !== \"number\") {\n return allLeafsLen;\n }\n if (addIndex < 0 || addIndex >= allLeafsLen || Number.isNaN(addIndex)) {\n return allLeafsLen;\n }\n addIndex = Math.ceil(addIndex);\n const gos = this.gos;\n if (addIndex > 0 && gos.get(\"treeData\") && gos.get(\"getDataPath\")) {\n addIndex = adjustAddIndexForDataPath(allLeafs, addIndex);\n }\n return addIndex;\n }\n};\nvar adjustAddIndexForDataPath = (allLeafs, addIndex) => {\n for (let i = 0, len = allLeafs.length; i < len; i++) {\n const node = allLeafs[i];\n if (node?.rowIndex == addIndex - 1) {\n return i + 1;\n }\n }\n return addIndex;\n};\nvar initRootNode = (rootNode) => {\n rootNode.group = true;\n rootNode.level = -1;\n rootNode._expanded = true;\n rootNode.id = \"ROOT_NODE_ID\";\n if (rootNode._leafs?.length !== 0) {\n rootNode._leafs = [];\n }\n const childrenAfterGroup = [];\n const childrenAfterSort = [];\n const childrenAfterAggFilter = [];\n const childrenAfterFilter = [];\n rootNode.childrenAfterGroup = childrenAfterGroup;\n rootNode.childrenAfterSort = childrenAfterSort;\n rootNode.childrenAfterAggFilter = childrenAfterAggFilter;\n rootNode.childrenAfterFilter = childrenAfterFilter;\n const sibling = rootNode.sibling;\n if (sibling) {\n sibling.childrenAfterGroup = childrenAfterGroup;\n sibling.childrenAfterSort = childrenAfterSort;\n sibling.childrenAfterAggFilter = childrenAfterAggFilter;\n sibling.childrenAfterFilter = childrenAfterFilter;\n sibling.childrenMapped = rootNode.childrenMapped;\n }\n rootNode.updateHasChildren();\n return rootNode;\n};\nvar lookupNodeByData = (nodes, data) => {\n if (nodes) {\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n if (node.data === data) {\n return node;\n }\n }\n }\n _error(5, { data });\n return null;\n};\nvar filterRemovedRowNodes = (allLeafs, filterIdx, filterEndIdx) => {\n filterIdx = Math.max(0, filterIdx);\n for (let readIdx = filterIdx, len = allLeafs.length; readIdx < len; ++readIdx) {\n const node = allLeafs[readIdx];\n if (readIdx <= filterEndIdx && node.destroyed) {\n continue;\n }\n node.sourceRowIndex = filterIdx;\n allLeafs[filterIdx++] = node;\n }\n allLeafs.length = filterIdx;\n};\nvar updateRootLeafsOrdered = (allLeafs, processedNodes) => {\n const newSize = processedNodes.size;\n allLeafs.length = newSize;\n let writeIdx = 0;\n let added = false;\n let reordered = false;\n for (const node of processedNodes) {\n const sourceRowIndex = node.sourceRowIndex;\n if (sourceRowIndex === writeIdx) {\n reordered || (reordered = added);\n } else {\n if (sourceRowIndex >= 0) {\n reordered = true;\n } else {\n added = true;\n }\n node.sourceRowIndex = writeIdx;\n allLeafs[writeIdx] = node;\n }\n ++writeIdx;\n }\n return reordered;\n};\nvar updateRootLeafsKeepOrder = (allLeafs, processedNodes, { adds }) => {\n const allLeafsLen = allLeafs.length;\n const newAllLeafsLen = processedNodes.size;\n if (newAllLeafsLen > allLeafsLen) {\n allLeafs.length = newAllLeafsLen;\n }\n let writeIdx = 0;\n for (let readIdx = 0; readIdx < allLeafsLen; ++readIdx) {\n const node = allLeafs[readIdx];\n if (!node.destroyed) {\n if (writeIdx !== readIdx) {\n node.sourceRowIndex = writeIdx;\n allLeafs[writeIdx] = node;\n }\n ++writeIdx;\n }\n }\n for (const node of adds) {\n if (node.sourceRowIndex < 0) {\n node.sourceRowIndex = writeIdx;\n allLeafs[writeIdx++] = node;\n }\n }\n allLeafs.length = writeIdx;\n};\n\n// packages/ag-grid-community/src/clientSideRowModel/filterStage.ts\nfunction updateRowNodeAfterFilter(rowNode) {\n const sibling = rowNode.sibling;\n if (sibling) {\n sibling.childrenAfterFilter = rowNode.childrenAfterFilter;\n }\n}\nvar FilterStage = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"filterStage\";\n this.step = \"filter\";\n this.refreshProps = [\"excludeChildrenWhenTreeDataFiltering\"];\n }\n wireBeans(beans) {\n this.filterManager = beans.filterManager;\n }\n execute(changedPath) {\n const filterActive = !!this.filterManager?.isChildFilterPresent();\n if (this.beans.formula?.active) {\n this.softFilter(filterActive, changedPath);\n } else {\n this.filterNodes(filterActive, changedPath);\n }\n }\n filterNodes(filterActive, changedPath) {\n const filterCallback = (rowNode, includeChildNodes) => {\n if (rowNode.hasChildren()) {\n if (filterActive && !includeChildNodes) {\n rowNode.childrenAfterFilter = rowNode.childrenAfterGroup.filter((childNode) => {\n const passBecauseChildren = childNode.childrenAfterFilter && childNode.childrenAfterFilter.length > 0;\n const passBecauseDataPasses = childNode.data && this.filterManager.doesRowPassFilter({ rowNode: childNode });\n return passBecauseChildren || passBecauseDataPasses;\n });\n } else {\n rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;\n }\n } else {\n rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;\n }\n updateRowNodeAfterFilter(rowNode);\n };\n if (this.doingTreeDataFiltering()) {\n const treeDataDepthFirstFilter = (rowNode, alreadyFoundInParent) => {\n if (rowNode.childrenAfterGroup) {\n for (let i = 0; i < rowNode.childrenAfterGroup.length; i++) {\n const childNode = rowNode.childrenAfterGroup[i];\n const foundInParent = alreadyFoundInParent || this.filterManager.doesRowPassFilter({ rowNode: childNode });\n if (childNode.childrenAfterGroup) {\n treeDataDepthFirstFilter(rowNode.childrenAfterGroup[i], foundInParent);\n } else {\n filterCallback(childNode, foundInParent);\n }\n }\n }\n filterCallback(rowNode, alreadyFoundInParent);\n };\n treeDataDepthFirstFilter(this.beans.rowModel.rootNode, false);\n } else {\n const defaultFilterCallback = (rowNode) => filterCallback(rowNode, false);\n _forEachChangedGroupDepthFirst(\n this.beans.rowModel.rootNode,\n this.beans.rowModel.hierarchical,\n changedPath,\n defaultFilterCallback\n );\n }\n }\n softFilter(filterActive, changedPath) {\n const filterCallback = (rowNode) => {\n rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;\n if (rowNode.hasChildren()) {\n for (const childNode of rowNode.childrenAfterGroup) {\n childNode.softFiltered = filterActive && !(childNode.data && this.filterManager.doesRowPassFilter({ rowNode: childNode }));\n }\n }\n updateRowNodeAfterFilter(rowNode);\n };\n const rowModel = this.beans.rowModel;\n _forEachChangedGroupDepthFirst(rowModel.rootNode, rowModel.hierarchical, changedPath, filterCallback);\n }\n doingTreeDataFiltering() {\n const { gos } = this;\n return !!this.beans.groupStage?.treeData && !gos.get(\"excludeChildrenWhenTreeDataFiltering\");\n }\n};\n\n// packages/ag-grid-community/src/clientSideRowModel/deltaSort.ts\nvar MIN_DELTA_SORT_ROWS = 4;\nvar doDeltaSort = (rowNodeSorter, rowNode, changedRowNodes, changedPath, sortOptions) => {\n const oldSortedRows = rowNode.childrenAfterSort;\n const unsortedRows = rowNode.childrenAfterAggFilter;\n if (!unsortedRows) {\n return oldSortedRows && oldSortedRows.length > 0 ? oldSortedRows : [];\n }\n const unsortedRowsLen = unsortedRows.length;\n if (unsortedRowsLen <= 1) {\n if (oldSortedRows?.length === unsortedRowsLen && (unsortedRowsLen === 0 || oldSortedRows[0] === unsortedRows[0])) {\n return oldSortedRows;\n }\n return unsortedRows.slice();\n }\n if (!oldSortedRows || unsortedRowsLen <= MIN_DELTA_SORT_ROWS) {\n return rowNodeSorter.doFullSortInPlace(unsortedRows.slice(), sortOptions);\n }\n const indexByNode = /* @__PURE__ */ new Map();\n const { updates, adds } = changedRowNodes;\n const touchedRows = [];\n for (let i = 0; i < unsortedRowsLen; ++i) {\n const node = unsortedRows[i];\n if (updates.has(node) || adds.has(node) || changedPath?.hasRow(node)) {\n indexByNode.set(node, ~i);\n touchedRows.push(node);\n } else {\n indexByNode.set(node, i);\n }\n }\n const touchedRowsLen = touchedRows.length;\n if (touchedRowsLen === 0) {\n return unsortedRowsLen === oldSortedRows.length ? oldSortedRows : filterRemovedNodes(oldSortedRows, indexByNode, touchedRows);\n }\n touchedRows.sort(\n (a, b) => rowNodeSorter.compareRowNodes(sortOptions, a, b) || ~indexByNode.get(a) - ~indexByNode.get(b)\n );\n if (touchedRowsLen === unsortedRowsLen) {\n return touchedRows;\n }\n return mergeDeltaSortedArrays(rowNodeSorter, sortOptions, touchedRows, oldSortedRows, indexByNode, unsortedRowsLen);\n};\nvar mergeDeltaSortedArrays = (rowNodeSorter, sortOptions, touchedRows, oldSortedRows, indexByNode, resultSize) => {\n const result = new Array(resultSize);\n let touchedIdx = 0;\n let touchedNode = touchedRows[touchedIdx];\n let untouchedNode;\n let untouchedIdx = -1;\n let oldIdx = 0;\n let resultIdx = 0;\n const touchedLength = touchedRows.length;\n const oldSortedLength = oldSortedRows.length;\n while (true) {\n if (untouchedIdx < 0) {\n if (oldIdx >= oldSortedLength) {\n break;\n }\n untouchedNode = oldSortedRows[oldIdx++];\n untouchedIdx = indexByNode.get(untouchedNode) ?? -1;\n if (untouchedIdx < 0) {\n continue;\n }\n }\n const orderDelta = rowNodeSorter.compareRowNodes(sortOptions, touchedNode, untouchedNode) || ~indexByNode.get(touchedNode) - untouchedIdx;\n if (orderDelta < 0) {\n result[resultIdx++] = touchedNode;\n if (++touchedIdx >= touchedLength) {\n break;\n }\n touchedNode = touchedRows[touchedIdx];\n } else {\n result[resultIdx++] = untouchedNode;\n untouchedIdx = -1;\n }\n }\n while (touchedIdx < touchedLength) {\n result[resultIdx++] = touchedRows[touchedIdx++];\n }\n if (untouchedIdx < 0) {\n return result;\n }\n result[resultIdx++] = untouchedNode;\n while (oldIdx < oldSortedLength) {\n const node = oldSortedRows[oldIdx++];\n if (indexByNode.get(node) >= 0) {\n result[resultIdx++] = node;\n }\n }\n return result;\n};\nvar filterRemovedNodes = (rows, map, result) => {\n let count = 0;\n result.length = map.size;\n for (let i = 0, len = rows.length; i < len; ++i) {\n const node = rows[i];\n if (map.has(node)) {\n result[count++] = node;\n }\n }\n result.length = count;\n return result;\n};\n\n// packages/ag-grid-community/src/clientSideRowModel/sortStage.ts\nvar updateRowNodeAfterSort = (rowNode) => {\n const childrenAfterSort = rowNode.childrenAfterSort;\n const sibling = rowNode.sibling;\n if (sibling) {\n sibling.childrenAfterSort = childrenAfterSort;\n }\n if (!childrenAfterSort) {\n return;\n }\n for (let i = 0, lastIdx = childrenAfterSort.length - 1; i <= lastIdx; i++) {\n const child = childrenAfterSort[i];\n const first = i === 0;\n const last = i === lastIdx;\n if (child.firstChild !== first) {\n child.firstChild = first;\n child.dispatchRowEvent(\"firstChildChanged\");\n }\n if (child.lastChild !== last) {\n child.lastChild = last;\n child.dispatchRowEvent(\"lastChildChanged\");\n }\n if (child.childIndex !== i) {\n child.childIndex = i;\n child.dispatchRowEvent(\"childIndexChanged\");\n }\n }\n};\nvar SortStage = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"sortStage\";\n this.step = \"sort\";\n this.refreshProps = [\"postSortRows\", \"groupDisplayType\", \"accentedSort\"];\n }\n execute(changedPath, changedRowNodes) {\n const sortOptions = this.beans.sortSvc.getSortOptions();\n const useDeltaSort = sortOptions.length > 0 && !!changedRowNodes && // in time we can remove this check, so that delta sort is always\n // on if transactions are present. it's off for now so that we can\n // selectively turn it on and test it with some select users before\n // rolling out to everyone.\n this.gos.get(\"deltaSort\");\n const { gos, colModel, rowGroupColsSvc, rowNodeSorter, rowRenderer, showRowGroupCols } = this.beans;\n const groupMaintainOrder = gos.get(\"groupMaintainOrder\");\n const groupColumnsPresent = colModel.getCols().some((c) => c.isRowGroupActive());\n const groupCols = rowGroupColsSvc?.columns;\n const isPivotMode = colModel.isPivotMode();\n const postSortFunc = gos.getCallback(\"postSortRows\");\n let hasAnyFirstChildChanged = false;\n let sortContainsGroupColumns;\n const callback = (rowNode) => {\n const skipSortingPivotLeafs = isPivotMode && rowNode.leafGroup;\n let skipSortingGroups = groupMaintainOrder && groupColumnsPresent && !rowNode.leafGroup;\n if (skipSortingGroups) {\n sortContainsGroupColumns ?? (sortContainsGroupColumns = this.shouldSortContainsGroupCols(sortOptions));\n skipSortingGroups && (skipSortingGroups = !sortContainsGroupColumns);\n }\n let newChildrenAfterSort = null;\n if (skipSortingGroups) {\n let wasSortExplicitlyRemoved = false;\n if (groupCols) {\n const nextGroupIndex = rowNode.level + 1;\n if (nextGroupIndex < groupCols.length) {\n wasSortExplicitlyRemoved = groupCols[nextGroupIndex].wasSortExplicitlyRemoved;\n }\n }\n if (!wasSortExplicitlyRemoved) {\n newChildrenAfterSort = preserveGroupOrder(rowNode);\n }\n } else if (!sortOptions.length || skipSortingPivotLeafs) {\n } else if (useDeltaSort && changedRowNodes) {\n newChildrenAfterSort = doDeltaSort(rowNodeSorter, rowNode, changedRowNodes, changedPath, sortOptions);\n } else {\n newChildrenAfterSort = rowNodeSorter.doFullSortInPlace(\n rowNode.childrenAfterAggFilter.slice(),\n sortOptions\n );\n }\n newChildrenAfterSort || (newChildrenAfterSort = rowNode.childrenAfterAggFilter?.slice() ?? []);\n hasAnyFirstChildChanged || (hasAnyFirstChildChanged = rowNode.childrenAfterSort?.[0] !== newChildrenAfterSort[0]);\n rowNode.childrenAfterSort = newChildrenAfterSort;\n updateRowNodeAfterSort(rowNode);\n if (postSortFunc) {\n const params = { nodes: rowNode.childrenAfterSort };\n postSortFunc(params);\n }\n };\n _forEachChangedGroupDepthFirst(\n this.beans.rowModel.rootNode,\n this.beans.rowModel.hierarchical,\n changedPath,\n callback\n );\n if (hasAnyFirstChildChanged && gos.get(\"groupHideOpenParents\")) {\n const columns = showRowGroupCols?.columns;\n if (columns?.length) {\n rowRenderer.refreshCells({ columns, force: true });\n }\n }\n }\n shouldSortContainsGroupCols(sortOptions) {\n const sortOptionsLen = sortOptions.length;\n if (!sortOptionsLen) {\n return false;\n }\n if (_isColumnsSortingCoupledToGroup(this.gos)) {\n for (let i = 0; i < sortOptionsLen; ++i) {\n const column = sortOptions[i].column;\n if (column.isPrimary() && column.isRowGroupActive()) {\n return true;\n }\n }\n return false;\n }\n for (let i = 0; i < sortOptionsLen; ++i) {\n if (sortOptions[i].column.getColDef().showRowGroup) {\n return true;\n }\n }\n return false;\n }\n};\nvar preserveGroupOrder = (node) => {\n const childrenAfterSort = node.childrenAfterSort;\n const childrenAfterAggFilter = node.childrenAfterAggFilter;\n const childrenAfterSortLen = childrenAfterSort?.length;\n const childrenAfterAggFilterLen = childrenAfterAggFilter?.length;\n if (!childrenAfterSortLen || !childrenAfterAggFilterLen) {\n return null;\n }\n const result = new Array(childrenAfterAggFilterLen);\n const processed = /* @__PURE__ */ new Set();\n for (let i = 0; i < childrenAfterAggFilterLen; ++i) {\n processed.add(childrenAfterAggFilter[i]);\n }\n let writeIdx = 0;\n for (let i = 0; i < childrenAfterSortLen; ++i) {\n const node2 = childrenAfterSort[i];\n if (processed.delete(node2)) {\n result[writeIdx++] = node2;\n }\n }\n if (processed.size === 0 && writeIdx === childrenAfterSortLen) {\n return childrenAfterSort;\n }\n for (const newNode of processed) {\n result[writeIdx++] = newNode;\n }\n result.length = writeIdx;\n return result;\n};\n\n// packages/ag-grid-community/src/clientSideRowModel/clientSideRowModel.ts\nvar ClientSideRowModel = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"rowModel\";\n // top most node of the tree. the children are the user provided data.\n this.rootNode = null;\n /** Public-readonly flag indicating row count is ready for external consumers. */\n this.rowCountReady = false;\n /** True when grouping or tree data is active. Updated after grouping stage runs. */\n this.hierarchical = false;\n /** Manages the row nodes, including creation, update, and removal. */\n this.nodeManager = void 0;\n /** The rows mapped to rows to display, during the 'map' stage. */\n this.rowsToDisplay = [];\n /** Row nodes used for formula calculations when formula feature is active. */\n this.formulaRows = [];\n /** The ordered list of row processing stages: group → filter → pivot → aggregate → filterAggregates → sort → flatten. */\n this.stages = null;\n /** Queued async transactions waiting to be processed. */\n this.asyncTransactions = null;\n /** Timer handle for batching async transactions. */\n this.asyncTransactionsTimer = 0;\n /** Has the start() method been called. */\n this.started = false;\n /** Set to true when row data is being updated. Reset when model is fully refreshed. */\n this.refreshingData = false;\n /** Keep track if row data was updated. Important with suppressModelUpdateAfterUpdateTransaction and refreshModel api is called. */\n this.rowDataUpdatedPending = false;\n /**\n * This is to prevent refresh model being called when it's already being called.\n * E.g. the group stage can trigger initial state filter model to be applied. This fires onFilterChanged,\n * which then triggers the listener here that calls refresh model again but at the filter stage\n * (which is about to be run by the original call).\n */\n this.refreshingModel = false;\n /** Set by nested refresh calls to force newData=true in the final modelUpdated event. */\n this.pendingNewData = false;\n /** Set by nested reMapRows() or refreshModel() calls to force keepRenderedRows=false in the final modelUpdated event. */\n this.noKeepRenderedRows = false;\n /** Set by nested reMapRows() or refreshModel() calls to force keepUndoRedoStack=false in the final modelUpdated event. */\n this.noKeepUndoRedoStack = false;\n /** Set by nested refresh calls to prevent animate=true in the final modelUpdated event when any call didn't allow animation. */\n this.noAnimate = false;\n /** True after the first time row nodes have been created or data has been set. Used to determine when to fire rowCountReady. */\n this.rowNodesCountReady = false;\n /** Maps a property name to the index in this.stages array */\n this.stagesRefreshProps = /* @__PURE__ */ new Map();\n this.onRowHeightChanged_debounced = _debounce(this, this.onRowHeightChanged.bind(this), 100);\n }\n postConstruct() {\n const beans = this.beans;\n const rootNode = new RowNode(beans);\n this.rootNode = rootNode;\n this.nodeManager = this.createBean(new ClientSideNodeManager(rootNode));\n const onColumnsChanged = () => {\n this.beans.groupStage?.invalidateGroupCols();\n this.refreshModel({\n step: \"group\",\n afterColumnsChanged: true,\n keepRenderedRows: true,\n animate: !this.gos.get(\"suppressAnimationFrame\")\n });\n };\n this.addManagedEventListeners({\n newColumnsLoaded: onColumnsChanged,\n columnRowGroupChanged: onColumnsChanged,\n columnValueChanged: this.onValueChanged.bind(this),\n columnPivotChanged: () => this.refreshModel({ step: \"pivot\" }),\n columnPivotModeChanged: () => this.refreshModel({ step: \"group\" }),\n filterChanged: this.onFilterChanged.bind(this),\n sortChanged: this.onSortChanged.bind(this),\n stylesChanged: this.onGridStylesChanges.bind(this),\n gridReady: this.onGridReady.bind(this),\n rowExpansionStateChanged: this.onRowGroupOpened.bind(this)\n });\n this.addPropertyListeners();\n }\n addPropertyListeners() {\n const { beans, stagesRefreshProps } = this;\n const orderedStages = [\n beans.groupStage,\n beans.filterStage,\n beans.pivotStage,\n beans.aggStage,\n beans.sortStage,\n beans.filterAggStage,\n beans.flattenStage\n ].filter((stage) => !!stage);\n this.stages = orderedStages;\n for (let i = orderedStages.length - 1; i >= 0; --i) {\n const stage = orderedStages[i];\n for (const prop of stage.refreshProps) {\n stagesRefreshProps.set(prop, i);\n }\n }\n this.addManagedPropertyListeners([...stagesRefreshProps.keys(), \"rowData\"], (params) => {\n const properties = params.changeSet?.properties;\n if (properties) {\n this.onPropChange(properties);\n }\n });\n this.addManagedPropertyListener(\"rowHeight\", () => this.resetRowHeights());\n }\n start() {\n this.started = true;\n if (this.rowNodesCountReady) {\n this.refreshModel({ step: \"group\", rowDataUpdated: true, newData: true });\n } else {\n this.setInitialData();\n }\n }\n setInitialData() {\n const rowData = this.gos.get(\"rowData\");\n if (rowData) {\n this.onPropChange([\"rowData\"]);\n }\n }\n ensureRowHeightsValid(startPixel, endPixel, startLimitIndex, endLimitIndex) {\n let atLeastOneChange;\n let res = false;\n do {\n atLeastOneChange = false;\n const rowAtStartPixel = this.getRowIndexAtPixel(startPixel);\n const rowAtEndPixel = this.getRowIndexAtPixel(endPixel);\n const firstRow = Math.max(rowAtStartPixel, startLimitIndex);\n const lastRow = Math.min(rowAtEndPixel, endLimitIndex);\n for (let rowIndex = firstRow; rowIndex <= lastRow; rowIndex++) {\n const rowNode = this.getRow(rowIndex);\n if (rowNode.rowHeightEstimated) {\n const rowHeight = _getRowHeightForNode(this.beans, rowNode);\n rowNode.setRowHeight(rowHeight.height);\n atLeastOneChange = true;\n res = true;\n }\n }\n if (atLeastOneChange) {\n this.setRowTopAndRowIndex();\n }\n } while (atLeastOneChange);\n return res;\n }\n onPropChange(properties) {\n const { nodeManager, gos, beans } = this;\n const groupStage = beans.groupStage;\n if (!nodeManager) {\n return;\n }\n const changedProps = new Set(properties);\n const extractData = groupStage?.onPropChange(changedProps);\n let newRowData;\n if (changedProps.has(\"rowData\")) {\n newRowData = gos.get(\"rowData\");\n } else if (extractData) {\n newRowData = groupStage?.extractData();\n }\n if (newRowData && !Array.isArray(newRowData)) {\n newRowData = null;\n _warn(1);\n }\n const params = { step: \"nothing\", changedProps };\n if (newRowData) {\n const immutable = !extractData && !this.isEmpty() && newRowData.length > 0 && gos.exists(\"getRowId\") && // backward compatibility - for who want old behaviour of Row IDs but NOT Immutable Data.\n !gos.get(\"resetRowDataOnUpdate\");\n this.refreshingData = true;\n if (immutable) {\n params.keepRenderedRows = true;\n params.animate = !gos.get(\"suppressAnimationFrame\");\n params.changedRowNodes = new ChangedRowNodes();\n nodeManager.setImmutableRowData(params, newRowData);\n } else {\n params.rowDataUpdated = true;\n params.newData = true;\n nodeManager.setNewRowData(newRowData);\n this.rowNodesCountReady = true;\n }\n }\n const step = params.rowDataUpdated ? \"group\" : this.getRefreshedStage(properties);\n if (step) {\n params.step = step;\n this.refreshModel(params);\n }\n }\n getRefreshedStage(properties) {\n const { stages, stagesRefreshProps } = this;\n if (!stages) {\n return null;\n }\n const stagesLen = stages.length;\n let minIndex = stagesLen;\n for (let i = 0, len = properties.length; i < len && minIndex; ++i) {\n minIndex = Math.min(minIndex, stagesRefreshProps.get(properties[i]) ?? minIndex);\n }\n return minIndex < stagesLen ? stages[minIndex].step : null;\n }\n setRowTopAndRowIndex(outputDisplayedRowsMapped) {\n const { beans, rowsToDisplay } = this;\n const defaultRowHeight = beans.environment.getDefaultRowHeight();\n let nextRowTop = 0;\n const allowEstimate = _isDomLayout(this.gos, \"normal\");\n for (let i = 0, len = rowsToDisplay.length; i < len; ++i) {\n const rowNode = rowsToDisplay[i];\n const id = rowNode.id;\n if (id != null) {\n outputDisplayedRowsMapped?.add(id);\n }\n if (rowNode.rowHeight == null) {\n const rowHeight = _getRowHeightForNode(beans, rowNode, allowEstimate, defaultRowHeight);\n rowNode.setRowHeight(rowHeight.height, rowHeight.estimated);\n }\n rowNode.setRowTop(nextRowTop);\n rowNode.setRowIndex(i);\n nextRowTop += rowNode.rowHeight;\n }\n if (this.beans.formula?.active) {\n const formulaRows = this.formulaRows;\n for (let i = 0, len = formulaRows.length; i < len; ++i) {\n const rowNode = formulaRows[i];\n rowNode.formulaRowIndex = i;\n }\n }\n }\n clearRowTopAndRowIndex(changedPath, displayedRowsMapped) {\n const clearIfNotDisplayed = (rowNode) => {\n if (rowNode?.id != null && !displayedRowsMapped.has(rowNode.id)) {\n rowNode.clearRowTopAndRowIndex();\n }\n };\n const recurse = (rowNode) => {\n clearIfNotDisplayed(rowNode);\n clearIfNotDisplayed(rowNode.detailNode);\n clearIfNotDisplayed(rowNode.sibling);\n const childrenAfterGroup = rowNode.childrenAfterGroup;\n if (!rowNode.hasChildren() || !childrenAfterGroup) {\n return;\n }\n if (changedPath && rowNode.level !== -1 && !rowNode.expanded) {\n return;\n }\n for (let i = 0, len = childrenAfterGroup.length; i < len; ++i) {\n recurse(childrenAfterGroup[i]);\n }\n };\n const rootNode = this.rootNode;\n if (rootNode) {\n recurse(rootNode);\n }\n }\n isLastRowIndexKnown() {\n return true;\n }\n getRowCount() {\n return this.rowsToDisplay.length;\n }\n /**\n * Returns the number of rows with level === 1\n */\n getTopLevelRowCount() {\n const { rootNode, rowsToDisplay } = this;\n if (!rootNode || !rowsToDisplay.length) {\n return 0;\n }\n const showingRootNode = rowsToDisplay[0] === rootNode;\n if (showingRootNode) {\n return 1;\n }\n const totalFooterInc = rootNode.sibling?.displayed ? 1 : 0;\n return (rootNode.childrenAfterSort?.length ?? 0) + totalFooterInc;\n }\n /**\n * Get the row display index by the top level index\n * top level index is the index of rows with level === 1\n */\n getTopLevelRowDisplayedIndex(topLevelIndex) {\n const { beans, rootNode, rowsToDisplay } = this;\n const showingRootNode = !rootNode || !rowsToDisplay.length || rowsToDisplay[0] === rootNode;\n if (showingRootNode) {\n return topLevelIndex;\n }\n const childrenAfterSort = rootNode.childrenAfterSort;\n const getDefaultIndex = (adjustedIndex) => {\n let rowNode = childrenAfterSort[adjustedIndex];\n if (this.gos.get(\"groupHideOpenParents\")) {\n while (rowNode.expanded && rowNode.childrenAfterSort && rowNode.childrenAfterSort.length > 0) {\n rowNode = rowNode.childrenAfterSort[0];\n }\n }\n return rowNode.rowIndex;\n };\n const footerSvc = beans.footerSvc;\n if (footerSvc) {\n return footerSvc?.getTopDisplayIndex(rowsToDisplay, topLevelIndex, childrenAfterSort, getDefaultIndex);\n }\n return getDefaultIndex(topLevelIndex);\n }\n /**\n * The opposite of `getTopLevelRowDisplayedIndex`\n */\n getTopLevelIndexFromDisplayedIndex(displayedIndex) {\n const { rootNode, rowsToDisplay } = this;\n const showingRootNode = !rootNode || !rowsToDisplay.length || rowsToDisplay[0] === rootNode;\n if (showingRootNode) {\n return displayedIndex;\n }\n let node = this.getRow(displayedIndex);\n if (node.footer) {\n node = node.sibling;\n }\n let parent = node.parent;\n while (parent && parent !== rootNode) {\n node = parent;\n parent = node.parent;\n }\n const topLevelIndex = rootNode.childrenAfterSort?.indexOf(node) ?? -1;\n return topLevelIndex >= 0 ? topLevelIndex : displayedIndex;\n }\n getRowBounds(index) {\n const rowNode = this.rowsToDisplay[index];\n return rowNode ? { rowTop: rowNode.rowTop, rowHeight: rowNode.rowHeight } : null;\n }\n onRowGroupOpened() {\n this.refreshModel({ step: \"map\", keepRenderedRows: true, animate: _isAnimateRows(this.gos) });\n }\n onFilterChanged({ afterDataChange, columns }) {\n if (!afterDataChange) {\n const primaryOrQuickFilterChanged = columns.length === 0 || columns.some((col) => col.isPrimary());\n const step = primaryOrQuickFilterChanged ? \"filter\" : \"filter_aggregates\";\n this.refreshModel({ step, keepRenderedRows: true, animate: _isAnimateRows(this.gos) });\n }\n }\n onSortChanged() {\n this.refreshModel({\n step: \"sort\",\n keepRenderedRows: true,\n animate: _isAnimateRows(this.gos)\n });\n }\n getType() {\n return \"clientSide\";\n }\n onValueChanged() {\n this.refreshModel({ step: this.beans.colModel.isPivotActive() ? \"pivot\" : \"aggregate\" });\n }\n isSuppressModelUpdateAfterUpdateTransaction(params) {\n if (!this.gos.get(\"suppressModelUpdateAfterUpdateTransaction\")) {\n return false;\n }\n const { changedRowNodes, newData, rowDataUpdated } = params;\n if (!changedRowNodes || newData || !rowDataUpdated) {\n return false;\n }\n if (changedRowNodes.removals.length || changedRowNodes.adds.size) {\n return false;\n }\n return true;\n }\n /**\n * Performs a map-only refresh. Safe to call during an active refresh.\n * If a refresh is in progress, flags are captured and applied to the outer refresh.\n * Flag accumulation is intentional - they persist until the next successful refreshModel().\n */\n reMapRows() {\n if (this.refreshingModel || this.refreshingData) {\n this.noKeepRenderedRows = true;\n this.noKeepUndoRedoStack = true;\n this.noAnimate = true;\n return;\n }\n this.refreshModel({ step: \"map\", keepRenderedRows: false, keepUndoRedoStack: false, animate: false });\n }\n refreshModel(params) {\n const { nodeManager, eventSvc, started } = this;\n if (!nodeManager) {\n return;\n }\n const rowDataUpdated = !!params.rowDataUpdated;\n if (started && rowDataUpdated) {\n eventSvc.dispatchEvent({ type: \"rowDataUpdated\" });\n }\n if (this.deferRefresh(params)) {\n this.setPendingRefreshFlags(params);\n this.rowDataUpdatedPending || (this.rowDataUpdatedPending = rowDataUpdated);\n return;\n }\n if (this.rowDataUpdatedPending) {\n this.rowDataUpdatedPending = false;\n params.step = \"group\";\n }\n this.updateRefreshParams(params);\n let succeeded = false;\n this.refreshingModel = true;\n try {\n this.executeRefresh(params, rowDataUpdated);\n succeeded = true;\n } finally {\n this.refreshingData = false;\n this.refreshingModel = false;\n if (!succeeded) {\n this.setPendingRefreshFlags(params);\n }\n }\n this.clearPendingRefreshFlags();\n eventSvc.dispatchEvent({\n type: \"modelUpdated\",\n animate: params.animate,\n keepRenderedRows: params.keepRenderedRows,\n newData: params.newData,\n newPage: false,\n keepUndoRedoStack: params.keepUndoRedoStack\n });\n }\n /** Executes the refresh pipeline stages and updates row positions. */\n executeRefresh(params, rowDataUpdated) {\n const { beans, rootNode } = this;\n beans.masterDetailSvc?.refreshModel(params);\n if (rowDataUpdated && params.step !== \"group\") {\n beans.colFilter?.refreshModel();\n }\n let changedPath = params.changedPath;\n changedPath?.addRow(rootNode);\n if (params.step === \"group\") {\n this.doGrouping(rootNode, params);\n changedPath ?? (changedPath = params.changedPath);\n }\n changedPath ?? (changedPath = beans.changedPathFactory?.ensureRowsPath(params, rootNode));\n switch (params.step) {\n case \"group\":\n case \"filter\":\n this.doFilter(changedPath);\n case \"pivot\":\n if (this.doPivot(changedPath)) {\n changedPath = void 0;\n params.changedPath = void 0;\n }\n case \"aggregate\":\n this.doAggregate(changedPath);\n case \"filter_aggregates\":\n this.doFilterAggregates(changedPath);\n case \"sort\":\n this.doSort(changedPath, params.changedRowNodes);\n case \"map\":\n this.doRowsToDisplay();\n }\n const displayedNodesMapped = /* @__PURE__ */ new Set();\n this.setRowTopAndRowIndex(displayedNodesMapped);\n this.clearRowTopAndRowIndex(changedPath, displayedNodesMapped);\n this.updateRefreshParams(params);\n }\n /** Checks if the refresh should be deferred. Caller must call setPendingRefreshFlags when this returns true. */\n deferRefresh(params) {\n if (this.refreshingModel) {\n return true;\n }\n if (this.beans.colModel.changeEventsDispatching) {\n return true;\n }\n if (this.isSuppressModelUpdateAfterUpdateTransaction(params)) {\n if (this.started) {\n this.refreshingData = false;\n }\n return true;\n }\n if (!this.started) {\n return true;\n }\n return false;\n }\n /** Captures flags from deferred refresh calls to apply to the eventual modelUpdated event. */\n setPendingRefreshFlags(params) {\n this.pendingNewData || (this.pendingNewData = !!params.newData);\n this.noKeepRenderedRows || (this.noKeepRenderedRows = !params.keepRenderedRows);\n this.noKeepUndoRedoStack || (this.noKeepUndoRedoStack = !params.keepUndoRedoStack);\n this.noAnimate || (this.noAnimate = !params.animate);\n }\n /** Clears pending refresh flags. Called at the end of a successful refreshModel. */\n clearPendingRefreshFlags() {\n this.pendingNewData = false;\n this.noKeepRenderedRows = false;\n this.noKeepUndoRedoStack = false;\n this.noAnimate = false;\n }\n /** Updates the params to reflect any forced flags from nested refresh calls. */\n updateRefreshParams(params) {\n params.newData = this.pendingNewData || !!params.newData;\n params.keepRenderedRows = !this.noKeepRenderedRows && !!params.keepRenderedRows;\n params.keepUndoRedoStack = !this.noKeepUndoRedoStack && !!params.keepUndoRedoStack;\n params.animate = !this.noAnimate && !!params.animate;\n }\n isEmpty() {\n return !this.rootNode?._leafs?.length || !this.beans.colModel?.ready;\n }\n isRowsToRender() {\n return this.rowsToDisplay.length > 0;\n }\n getOverlayType() {\n const { beans, gos } = this;\n if (this.rootNode?._leafs?.length) {\n if (beans.filterManager?.isAnyFilterPresent() && this.getRowCount() === 0) {\n return \"noMatchingRows\";\n }\n } else if (this.rowCountReady || (gos.get(\"rowData\")?.length ?? 0) == 0) {\n return \"noRows\";\n }\n return null;\n }\n getNodesInRangeForSelection(firstInRange, lastInRange) {\n let started = false;\n let finished = false;\n const result = [];\n const groupsSelectChildren = _getGroupSelectsDescendants(this.gos);\n this.forEachNodeAfterFilterAndSort((rowNode) => {\n if (finished) {\n return;\n }\n if (started) {\n if (rowNode === lastInRange || rowNode === firstInRange) {\n finished = true;\n if (groupsSelectChildren && rowNode.group) {\n addAllLeafs(result, rowNode);\n return;\n }\n }\n }\n if (!started) {\n if (rowNode !== lastInRange && rowNode !== firstInRange) {\n return;\n }\n started = true;\n if (lastInRange === firstInRange) {\n finished = true;\n }\n }\n const includeThisNode = !rowNode.group || !groupsSelectChildren;\n if (includeThisNode) {\n result.push(rowNode);\n }\n });\n return result;\n }\n getTopLevelNodes() {\n return this.rootNode?.childrenAfterGroup ?? null;\n }\n getRow(index) {\n return this.rowsToDisplay[index];\n }\n getFormulaRow(index) {\n return this.formulaRows[index];\n }\n isRowPresent(rowNode) {\n return this.rowsToDisplay.indexOf(rowNode) >= 0;\n }\n getRowIndexAtPixel(pixelToMatch) {\n const rowsToDisplay = this.rowsToDisplay;\n const rowsToDisplayLen = rowsToDisplay.length;\n if (this.isEmpty() || rowsToDisplayLen === 0) {\n return -1;\n }\n let bottomPointer = 0;\n let topPointer = rowsToDisplayLen - 1;\n if (pixelToMatch <= 0) {\n return 0;\n }\n const lastNode = rowsToDisplay[topPointer];\n if (lastNode.rowTop <= pixelToMatch) {\n return topPointer;\n }\n let oldBottomPointer = -1;\n let oldTopPointer = -1;\n while (true) {\n const midPointer = Math.floor((bottomPointer + topPointer) / 2);\n const currentRowNode = rowsToDisplay[midPointer];\n if (this.isRowInPixel(currentRowNode, pixelToMatch)) {\n return midPointer;\n }\n if (currentRowNode.rowTop < pixelToMatch) {\n bottomPointer = midPointer + 1;\n } else if (currentRowNode.rowTop > pixelToMatch) {\n topPointer = midPointer - 1;\n }\n const caughtInInfiniteLoop = oldBottomPointer === bottomPointer && oldTopPointer === topPointer;\n if (caughtInInfiniteLoop) {\n return midPointer;\n }\n oldBottomPointer = bottomPointer;\n oldTopPointer = topPointer;\n }\n }\n isRowInPixel(rowNode, pixelToMatch) {\n const topPixel = rowNode.rowTop;\n const bottomPixel = topPixel + rowNode.rowHeight;\n return topPixel <= pixelToMatch && bottomPixel > pixelToMatch;\n }\n forEachLeafNode(callback) {\n const allLeafs = this.rootNode?._leafs;\n if (allLeafs) {\n for (let i = 0, len = allLeafs.length; i < len; ++i) {\n callback(allLeafs[i], i);\n }\n }\n }\n forEachNode(callback, includeFooterNodes = false) {\n this.depthFirstSearchRowNodes(callback, includeFooterNodes);\n }\n forEachDisplayedNode(callback) {\n const rowsToDisplay = this.rowsToDisplay;\n for (let i = 0, len = rowsToDisplay.length; i < len; ++i) {\n callback(rowsToDisplay[i], i);\n }\n }\n forEachNodeAfterFilter(callback, includeFooterNodes = false) {\n this.depthFirstSearchRowNodes(callback, includeFooterNodes, (node) => node.childrenAfterAggFilter);\n }\n forEachNodeAfterFilterAndSort(callback, includeFooterNodes = false) {\n this.depthFirstSearchRowNodes(callback, includeFooterNodes, (node) => node.childrenAfterSort);\n }\n forEachPivotNode(callback, includeFooterNodes, afterSort) {\n const { colModel, rowGroupColsSvc } = this.beans;\n if (!colModel.isPivotMode()) {\n return;\n }\n if (!rowGroupColsSvc?.columns.length) {\n callback(this.rootNode, 0);\n return;\n }\n const childrenField = afterSort ? \"childrenAfterSort\" : \"childrenAfterGroup\";\n this.depthFirstSearchRowNodes(\n callback,\n includeFooterNodes,\n (node) => !node.leafGroup ? node[childrenField] : null\n );\n }\n /**\n * Iterate through each node and all of its children\n * @param callback the function to execute for each node\n * @param includeFooterNodes whether to also iterate over footer nodes\n * @param nodes the nodes to start iterating over\n * @param getChildren a function to determine the recursion strategy\n * @param startIndex the index to start from\n * @returns the index ended at\n */\n depthFirstSearchRowNodes(callback, includeFooterNodes = false, getChildren = (node2) => node2.childrenAfterGroup, node = this.rootNode, startIndex = 0) {\n let index = startIndex;\n if (!node) {\n return index;\n }\n const isRootNode = node === this.rootNode;\n if (!isRootNode) {\n callback(node, index++);\n }\n if (node.hasChildren() && !node.footer) {\n const children = isRootNode || this.hierarchical ? getChildren(node) : null;\n if (children) {\n const footerSvc = this.beans.footerSvc;\n index = footerSvc?.addTotalRows(index, node, callback, includeFooterNodes, isRootNode, \"top\") ?? index;\n for (const node2 of children) {\n index = this.depthFirstSearchRowNodes(callback, includeFooterNodes, getChildren, node2, index);\n }\n return footerSvc?.addTotalRows(index, node, callback, includeFooterNodes, isRootNode, \"bottom\") ?? index;\n }\n }\n return index;\n }\n // it's possible to recompute the aggregate without doing the other parts + api.refreshClientSideRowModel('aggregate')\n doAggregate(changedPath) {\n const rootNode = this.rootNode;\n if (rootNode) {\n this.beans.aggStage?.execute(changedPath);\n }\n }\n doFilterAggregates(changedPath) {\n const rootNode = this.rootNode;\n const filterAggStage = this.beans.filterAggStage;\n if (filterAggStage && this.hierarchical) {\n filterAggStage.execute(changedPath);\n return;\n }\n rootNode.childrenAfterAggFilter = rootNode.childrenAfterFilter;\n const sibling = rootNode.sibling;\n if (sibling) {\n sibling.childrenAfterAggFilter = rootNode.childrenAfterFilter;\n }\n }\n doSort(changedPath, changedRowNodes) {\n const sortStage = this.beans.sortStage;\n if (sortStage) {\n sortStage.execute(changedPath, changedRowNodes);\n return;\n }\n _forEachChangedGroupDepthFirst(this.rootNode, this.hierarchical, changedPath, (rowNode) => {\n rowNode.childrenAfterSort = rowNode.childrenAfterAggFilter.slice(0);\n updateRowNodeAfterSort(rowNode);\n });\n }\n doGrouping(rootNode, params) {\n const groupStage = this.beans.groupStage;\n const groupingChanged = groupStage?.execute(params);\n if (groupingChanged === void 0) {\n const allLeafs = rootNode._leafs;\n rootNode.childrenAfterGroup = allLeafs;\n rootNode.updateHasChildren();\n const sibling = rootNode.sibling;\n if (sibling) {\n sibling.childrenAfterGroup = allLeafs;\n }\n }\n if (groupingChanged || params.rowDataUpdated) {\n this.beans.colFilter?.refreshModel();\n }\n if (!this.rowCountReady && this.rowNodesCountReady) {\n this.rowCountReady = true;\n this.eventSvc.dispatchEventOnce({ type: \"rowCountReady\" });\n }\n }\n doFilter(changedPath) {\n const filterStage = this.beans.filterStage;\n if (filterStage) {\n filterStage.execute(changedPath);\n return;\n }\n _forEachChangedGroupDepthFirst(this.rootNode, this.hierarchical, changedPath, (rowNode) => {\n rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;\n updateRowNodeAfterFilter(rowNode);\n });\n }\n /** Returns `true` if pivot columns changed and changedPath should be deactivated. */\n doPivot(changedPath) {\n return this.beans.pivotStage?.execute(changedPath) ?? false;\n }\n getRowNode(id) {\n const found = this.nodeManager?.getRowNode(id);\n if (typeof found === \"object\") {\n return found;\n }\n return this.beans.groupStage?.getNonLeaf(id);\n }\n batchUpdateRowData(rowDataTransaction, callback) {\n if (!this.asyncTransactionsTimer) {\n this.asyncTransactions = [];\n const waitMilliseconds = this.gos.get(\"asyncTransactionWaitMillis\");\n this.asyncTransactionsTimer = setTimeout(() => this.executeBatchUpdateRowData(), waitMilliseconds);\n }\n this.asyncTransactions.push({ rowDataTransaction, callback });\n }\n flushAsyncTransactions() {\n const asyncTransactionsTimer = this.asyncTransactionsTimer;\n if (asyncTransactionsTimer) {\n clearTimeout(asyncTransactionsTimer);\n this.executeBatchUpdateRowData();\n }\n }\n executeBatchUpdateRowData() {\n const { nodeManager, beans, eventSvc, asyncTransactions } = this;\n if (!nodeManager) {\n return;\n }\n beans.valueCache?.onDataChanged();\n const rowNodeTrans = [];\n const callbackFuncsBound = [];\n const changedRowNodes = new ChangedRowNodes();\n const animate = !this.gos.get(\"suppressAnimationFrame\");\n for (const { rowDataTransaction, callback } of asyncTransactions ?? []) {\n this.rowNodesCountReady = true;\n this.refreshingData = true;\n const rowNodeTransaction = nodeManager.updateRowData(rowDataTransaction, changedRowNodes, animate);\n rowNodeTrans.push(rowNodeTransaction);\n if (callback) {\n callbackFuncsBound.push(callback.bind(null, rowNodeTransaction));\n }\n }\n this.commitTransactions(changedRowNodes, animate);\n if (callbackFuncsBound.length > 0) {\n setTimeout(() => {\n for (let i = 0, len = callbackFuncsBound.length; i < len; i++) {\n callbackFuncsBound[i]();\n }\n }, 0);\n }\n if (rowNodeTrans.length > 0) {\n eventSvc.dispatchEvent({ type: \"asyncTransactionsFlushed\", results: rowNodeTrans });\n }\n this.asyncTransactionsTimer = 0;\n this.asyncTransactions = null;\n }\n /**\n * Used to apply transaction changes.\n * Called by gridApi & rowDragFeature\n */\n updateRowData(rowDataTran) {\n const nodeManager = this.nodeManager;\n if (!nodeManager) {\n return null;\n }\n this.beans.valueCache?.onDataChanged();\n this.rowNodesCountReady = true;\n const changedRowNodes = new ChangedRowNodes();\n const animate = !this.gos.get(\"suppressAnimationFrame\");\n this.refreshingData = true;\n const rowNodeTransaction = nodeManager.updateRowData(rowDataTran, changedRowNodes, animate);\n this.commitTransactions(changedRowNodes, animate);\n return rowNodeTransaction;\n }\n /**\n * Common to:\n * - executeBatchUpdateRowData (batch transactions)\n * - updateRowData (single transaction)\n * - setImmutableRowData (generated transaction)\n *\n * @param rowNodeTrans - the transactions to apply\n * @param orderChanged - whether the order of the rows has changed, either via generated transaction or user provided addIndex\n */\n commitTransactions(changedRowNodes, animate) {\n this.refreshModel({\n step: \"group\",\n rowDataUpdated: true,\n keepRenderedRows: true,\n animate,\n changedRowNodes\n });\n }\n /** 'map' stage */\n doRowsToDisplay() {\n const { rootNode, beans } = this;\n if (beans.formula?.active) {\n const unfilteredRows = rootNode?.childrenAfterSort ?? [];\n this.formulaRows = unfilteredRows;\n this.rowsToDisplay = unfilteredRows.filter((row) => !row.softFiltered);\n for (const row of this.rowsToDisplay) {\n row.setUiLevel(0);\n }\n return;\n }\n const flattenStage = beans.flattenStage;\n if (flattenStage) {\n this.rowsToDisplay = flattenStage.execute();\n return;\n }\n const rowsToDisplay = this.rootNode.childrenAfterSort ?? [];\n for (const row of rowsToDisplay) {\n row.setUiLevel(0);\n }\n this.rowsToDisplay = rowsToDisplay;\n }\n onRowHeightChanged() {\n this.refreshModel({ step: \"map\", keepRenderedRows: true, keepUndoRedoStack: true });\n }\n resetRowHeights() {\n const rootNode = this.rootNode;\n if (!rootNode) {\n return;\n }\n const atLeastOne = this.resetRowHeightsForAllRowNodes();\n rootNode.setRowHeight(rootNode.rowHeight, true);\n const sibling = rootNode.sibling;\n sibling?.setRowHeight(sibling.rowHeight, true);\n if (atLeastOne) {\n this.onRowHeightChanged();\n }\n }\n resetRowHeightsForAllRowNodes() {\n let atLeastOne = false;\n this.forEachNode((rowNode) => {\n rowNode.setRowHeight(rowNode.rowHeight, true);\n const detailNode = rowNode.detailNode;\n detailNode?.setRowHeight(detailNode.rowHeight, true);\n const sibling = rowNode.sibling;\n sibling?.setRowHeight(sibling.rowHeight, true);\n atLeastOne = true;\n });\n return atLeastOne;\n }\n onGridStylesChanges(e) {\n if (e.rowHeightChanged && !this.beans.rowAutoHeight?.active) {\n this.resetRowHeights();\n }\n }\n onGridReady() {\n if (!this.started) {\n this.setInitialData();\n }\n }\n destroy() {\n super.destroy();\n this.nodeManager = this.destroyBean(this.nodeManager);\n this.started = false;\n this.rootNode = null;\n this.rowsToDisplay = [];\n this.asyncTransactions = null;\n this.stages = null;\n this.stagesRefreshProps.clear();\n clearTimeout(this.asyncTransactionsTimer);\n }\n /**\n * @deprecated v33.1\n */\n onRowHeightChangedDebounced() {\n this.onRowHeightChanged_debounced();\n }\n};\nvar addAllLeafs = (result, node) => {\n const childrenAfterGroup = node.childrenAfterGroup;\n if (childrenAfterGroup) {\n for (let i = 0, len = childrenAfterGroup.length; i < len; ++i) {\n const child = childrenAfterGroup[i];\n if (child.data) {\n result.push(child);\n }\n if (child.group) {\n addAllLeafs(result, child);\n }\n }\n }\n};\n\n// packages/ag-grid-community/src/clientSideRowModel/clientSideRowModelApi.ts\nfunction onGroupExpandedOrCollapsed(beans) {\n beans.expansionSvc?.onGroupExpandedOrCollapsed();\n}\nfunction refreshClientSideRowModel(beans, step) {\n const clientSideRowModel = _getClientSideRowModel(beans);\n if (clientSideRowModel) {\n if (!step || step === \"everything\") {\n step = \"group\";\n }\n clientSideRowModel.refreshModel({\n step,\n keepRenderedRows: true,\n animate: !beans.gos.get(\"suppressAnimationFrame\")\n });\n }\n}\nfunction isRowDataEmpty(beans) {\n return _getClientSideRowModel(beans)?.isEmpty() ?? true;\n}\nfunction forEachLeafNode(beans, callback) {\n _getClientSideRowModel(beans)?.forEachLeafNode(callback);\n}\nfunction forEachNodeAfterFilter(beans, callback) {\n _getClientSideRowModel(beans)?.forEachNodeAfterFilter(callback);\n}\nfunction forEachNodeAfterFilterAndSort(beans, callback) {\n _getClientSideRowModel(beans)?.forEachNodeAfterFilterAndSort(callback);\n}\nfunction applyTransaction(beans, rowDataTransaction) {\n return beans.frameworkOverrides.wrapIncoming(\n () => _getClientSideRowModel(beans)?.updateRowData(rowDataTransaction)\n );\n}\nfunction applyTransactionAsync(beans, rowDataTransaction, callback) {\n beans.frameworkOverrides.wrapIncoming(\n () => _getClientSideRowModel(beans)?.batchUpdateRowData(rowDataTransaction, callback)\n );\n}\nfunction flushAsyncTransactions(beans) {\n beans.frameworkOverrides.wrapIncoming(() => _getClientSideRowModel(beans)?.flushAsyncTransactions());\n}\nfunction getBestCostNodeSelection(beans) {\n return beans.selectionSvc?.getBestCostNodeSelection();\n}\n\n// packages/ag-grid-community/src/clientSideRowModel/clientSideRowModelModule.ts\nvar ClientSideRowModelModule = {\n moduleName: \"ClientSideRowModel\",\n version: VERSION,\n rowModels: [\"clientSide\"],\n beans: [ClientSideRowModel, SortStage],\n dependsOn: [SortModule]\n};\nvar ClientSideRowModelApiModule = {\n moduleName: \"ClientSideRowModelApi\",\n version: VERSION,\n apiFunctions: {\n onGroupExpandedOrCollapsed,\n refreshClientSideRowModel,\n isRowDataEmpty,\n forEachLeafNode,\n forEachNodeAfterFilter,\n forEachNodeAfterFilterAndSort,\n applyTransaction,\n applyTransactionAsync,\n flushAsyncTransactions,\n getBestCostNodeSelection,\n resetRowHeights,\n onRowHeightChanged\n },\n dependsOn: [CsrmSsrmSharedApiModule, RowModelSharedApiModule]\n};\n\n// packages/ag-grid-community/src/columnAutosize/columnAutoSize.css\nvar columnAutoSize_default = \":where(.ag-ltr) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,left .2s ease-in-out}}:where(.ag-rtl) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,right .2s ease-in-out}}\";\n\n// packages/ag-grid-community/src/columnAutosize/columnAutosizeApi.ts\nfunction sizeColumnsToFit(beans, paramsOrGridWidth) {\n if (typeof paramsOrGridWidth === \"number\") {\n beans.colAutosize?.sizeColumnsToFit(paramsOrGridWidth, \"api\");\n } else {\n beans.colAutosize?.sizeColumnsToFitGridBody(paramsOrGridWidth);\n }\n}\nfunction autoSizeColumns({ colAutosize, visibleCols }, keysOrParams, skipHeader) {\n if (Array.isArray(keysOrParams)) {\n colAutosize?.autoSizeCols({ colKeys: keysOrParams, skipHeader, source: \"api\" });\n } else {\n colAutosize?.autoSizeCols({\n ...keysOrParams,\n colKeys: keysOrParams.colIds ?? visibleCols.allCols,\n source: \"api\"\n });\n }\n}\nfunction autoSizeAllColumns(beans, paramsOrSkipHeader) {\n if (paramsOrSkipHeader && typeof paramsOrSkipHeader === \"object\") {\n autoSizeColumns(beans, paramsOrSkipHeader);\n } else {\n beans.colAutosize?.autoSizeAllColumns({ source: \"api\", skipHeader: paramsOrSkipHeader });\n }\n}\n\n// packages/ag-grid-community/src/columnAutosize/columnAutosizeService.ts\nvar ColumnAutosizeService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colAutosize\";\n this.timesDelayed = 0;\n /** when we're waiting for cell data types to be inferred, we need to defer column resizing */\n this.shouldQueueResizeOperations = false;\n this.resizeOperationQueue = [];\n }\n postConstruct() {\n const { gos } = this;\n const autoSizeStrategy = gos.get(\"autoSizeStrategy\");\n if (autoSizeStrategy) {\n let shouldHideColumns = false;\n const type = autoSizeStrategy.type;\n if (type === \"fitGridWidth\" || type === \"fitProvidedWidth\") {\n shouldHideColumns = true;\n } else if (type === \"fitCellContents\") {\n this.addManagedEventListeners({ firstDataRendered: () => this.onFirstDataRendered(autoSizeStrategy) });\n const rowData = gos.get(\"rowData\");\n shouldHideColumns = rowData != null && rowData.length > 0 && _isClientSideRowModel(gos);\n }\n if (shouldHideColumns) {\n this.beans.colDelayRenderSvc?.hideColumns(type);\n }\n }\n }\n autoSizeCols(params) {\n const { eventSvc, visibleCols, colModel } = this.beans;\n setWidthAnimation(this.beans, true);\n this.innerAutoSizeCols(params).then((columnsAutoSized) => {\n const dispatch = (cols) => dispatchColumnResizedEvent(eventSvc, Array.from(cols), true, \"autosizeColumns\");\n if (!params.scaleUpToFitGridWidth) {\n setWidthAnimation(this.beans, false);\n return dispatch(columnsAutoSized);\n }\n const availableGridWidth = getAvailableWidth(this.beans);\n const isLeftCol = (col) => visibleCols.leftCols.some((leftCol) => _columnsMatch(leftCol, col));\n const isRightCol = (col) => visibleCols.rightCols.some((rightCol) => _columnsMatch(rightCol, col));\n const colKeys = params.colKeys.filter((col) => {\n const allowAutoSize = !colModel.getCol(col)?.getColDef().suppressAutoSize;\n return allowAutoSize && !isRowNumberCol(col) && !isLeftCol(col) && !isRightCol(col);\n });\n this.sizeColumnsToFit(availableGridWidth, params.source, true, {\n defaultMaxWidth: params.defaultMaxWidth,\n defaultMinWidth: params.defaultMinWidth,\n columnLimits: params.columnLimits?.map((limit) => ({ ...limit, key: limit.colId })),\n colKeys,\n onlyScaleUp: true,\n animate: false\n });\n setWidthAnimation(this.beans, false);\n dispatch(columnsAutoSized);\n });\n }\n innerAutoSizeCols(params) {\n return new Promise((resolve, reject) => {\n if (this.shouldQueueResizeOperations) {\n return this.pushResizeOperation(() => this.innerAutoSizeCols(params).then(resolve, reject));\n }\n const {\n colKeys,\n skipHeader,\n skipHeaderGroups,\n stopAtGroup,\n defaultMaxWidth,\n defaultMinWidth,\n columnLimits = [],\n source = \"api\"\n } = params;\n const { animationFrameSvc, renderStatus, colModel, autoWidthCalc, visibleCols } = this.beans;\n animationFrameSvc?.flushAllFrames();\n if (this.timesDelayed < 5 && renderStatus && (!renderStatus.areHeaderCellsRendered() || !renderStatus.areCellsRendered())) {\n this.timesDelayed++;\n setTimeout(() => {\n if (this.isAlive()) {\n this.innerAutoSizeCols(params).then(resolve, reject);\n }\n });\n return;\n }\n this.timesDelayed = 0;\n const columnsAutoSized = /* @__PURE__ */ new Set();\n let changesThisTimeAround = -1;\n const columnLimitsIndex = Object.fromEntries(\n columnLimits.map(({ colId, ...dimensions }) => [colId, dimensions])\n );\n const shouldSkipHeader = skipHeader ?? this.gos.get(\"skipHeaderOnAutoSize\");\n const shouldSkipHeaderGroups = skipHeaderGroups ?? shouldSkipHeader;\n while (changesThisTimeAround !== 0) {\n changesThisTimeAround = 0;\n const updatedColumns = [];\n for (const key of colKeys) {\n if (!key || isSpecialCol(key)) {\n continue;\n }\n const column = colModel.getCol(key);\n if (!column || columnsAutoSized.has(column) || column.getColDef().suppressAutoSize) {\n continue;\n }\n const preferredWidth = autoWidthCalc.getPreferredWidthForColumn(column, shouldSkipHeader);\n if (preferredWidth > 0) {\n const columnLimit = columnLimitsIndex[column.colId] ?? {};\n columnLimit.minWidth ?? (columnLimit.minWidth = defaultMinWidth);\n columnLimit.maxWidth ?? (columnLimit.maxWidth = defaultMaxWidth);\n const newWidth = normaliseColumnWidth(column, preferredWidth, columnLimit);\n column.setActualWidth(newWidth, source);\n columnsAutoSized.add(column);\n changesThisTimeAround++;\n }\n updatedColumns.push(column);\n }\n if (updatedColumns.length) {\n visibleCols.refresh(source);\n }\n }\n if (!shouldSkipHeaderGroups) {\n this.autoSizeColumnGroupsByColumns(colKeys, source, stopAtGroup);\n }\n resolve(columnsAutoSized);\n });\n }\n autoSizeColumn(key, source, skipHeader) {\n this.autoSizeCols({ colKeys: [key], skipHeader, skipHeaderGroups: true, source });\n }\n autoSizeColumnGroupsByColumns(keys, source, stopAtGroup) {\n const { colModel, ctrlsSvc } = this.beans;\n const columnGroups = /* @__PURE__ */ new Set();\n const columns = colModel.getColsForKeys(keys);\n for (const col of columns) {\n let parent = col.getParent();\n while (parent && parent != stopAtGroup) {\n if (!parent.isPadding()) {\n columnGroups.add(parent);\n }\n parent = parent.getParent();\n }\n }\n let headerGroupCtrl;\n for (const columnGroup of columnGroups) {\n for (const headerContainerCtrl of ctrlsSvc.getHeaderRowContainerCtrls()) {\n headerGroupCtrl = headerContainerCtrl.getHeaderCtrlForColumn(columnGroup);\n if (headerGroupCtrl) {\n break;\n }\n }\n headerGroupCtrl?.resizeLeafColumnsToFit(source);\n }\n }\n autoSizeAllColumns(params) {\n if (this.shouldQueueResizeOperations) {\n this.pushResizeOperation(() => this.autoSizeAllColumns(params));\n return;\n }\n this.autoSizeCols({ colKeys: this.beans.visibleCols.allCols, ...params });\n }\n addColumnAutosizeListeners(element, column) {\n const skipHeaderOnAutoSize = this.gos.get(\"skipHeaderOnAutoSize\");\n const autoSizeColListener = () => {\n this.autoSizeColumn(column, \"uiColumnResized\", skipHeaderOnAutoSize);\n };\n element.addEventListener(\"dblclick\", autoSizeColListener);\n const touchListener = new TouchListener(element);\n touchListener.addEventListener(\"doubleTap\", autoSizeColListener);\n return () => {\n element.removeEventListener(\"dblclick\", autoSizeColListener);\n touchListener.destroy();\n };\n }\n addColumnGroupResize(element, columnGroup, callback) {\n const skipHeaderOnAutoSize = this.gos.get(\"skipHeaderOnAutoSize\");\n const listener = () => {\n const keys = [];\n const leafCols = columnGroup.getDisplayedLeafColumns();\n for (const column of leafCols) {\n if (!column.getColDef().suppressAutoSize) {\n keys.push(column.getColId());\n }\n }\n if (keys.length > 0) {\n this.autoSizeCols({\n colKeys: keys,\n skipHeader: skipHeaderOnAutoSize,\n stopAtGroup: columnGroup,\n source: \"uiColumnResized\"\n });\n }\n callback();\n };\n element.addEventListener(\"dblclick\", listener);\n return () => element.removeEventListener(\"dblclick\", listener);\n }\n // method will call itself if no available width. this covers if the grid\n // isn't visible, but is just about to be visible.\n sizeColumnsToFitGridBody(params, nextTimeout) {\n if (!this.isAlive()) {\n return;\n }\n const availableWidth = getAvailableWidth(this.beans);\n if (availableWidth > 0) {\n this.sizeColumnsToFit(availableWidth, \"sizeColumnsToFit\", false, params);\n return;\n }\n if (nextTimeout === void 0) {\n window.setTimeout(() => {\n this.sizeColumnsToFitGridBody(params, 100);\n }, 0);\n } else if (nextTimeout === 100) {\n window.setTimeout(() => {\n this.sizeColumnsToFitGridBody(params, 500);\n }, 100);\n } else if (nextTimeout === 500) {\n window.setTimeout(() => {\n this.sizeColumnsToFitGridBody(params, -1);\n }, 500);\n } else {\n _warn(29);\n }\n }\n // called from api\n sizeColumnsToFit(gridWidth, source = \"sizeColumnsToFit\", silent, params) {\n if (this.shouldQueueResizeOperations) {\n this.pushResizeOperation(() => this.sizeColumnsToFit(gridWidth, source, silent, params));\n return;\n }\n const { beans } = this;\n const animate = params?.animate ?? true;\n if (animate) {\n setWidthAnimation(beans, true);\n }\n const limitsMap = {};\n for (const { key, ...dimensions } of params?.columnLimits ?? []) {\n limitsMap[typeof key === \"string\" ? key : key.getColId()] = dimensions;\n }\n const allDisplayedColumns = beans.visibleCols.allCols;\n if (gridWidth <= 0 || !allDisplayedColumns.length) {\n return;\n }\n const currentTotalColumnWidth = getWidthOfColsInList(allDisplayedColumns);\n if (params?.onlyScaleUp && currentTotalColumnWidth > gridWidth) {\n return;\n }\n const doColumnsAlreadyFit = gridWidth === currentTotalColumnWidth;\n if (doColumnsAlreadyFit) {\n const doAllColumnsSatisfyConstraints = allDisplayedColumns.every((column) => {\n if (column.colDef.suppressSizeToFit) {\n return true;\n }\n const widthOverride = limitsMap?.[column.getId()];\n const minWidth = widthOverride?.minWidth ?? params?.defaultMinWidth;\n const maxWidth = widthOverride?.maxWidth ?? params?.defaultMaxWidth;\n const colWidth = column.getActualWidth();\n return (minWidth == null || colWidth >= minWidth) && (maxWidth == null || colWidth <= maxWidth);\n });\n if (doAllColumnsSatisfyConstraints) {\n return;\n }\n }\n const colsToSpread = [];\n const colsToNotSpread = [];\n for (const column of allDisplayedColumns) {\n const isIncluded = params?.colKeys?.some((key) => _columnsMatch(column, key)) ?? true;\n if (column.getColDef().suppressSizeToFit || !isIncluded) {\n colsToNotSpread.push(column);\n } else {\n colsToSpread.push(column);\n }\n }\n const colsToDispatchEventFor = colsToSpread.slice(0);\n let finishedResizing = false;\n const moveToNotSpread = (column) => {\n _removeFromArray(colsToSpread, column);\n colsToNotSpread.push(column);\n };\n const currentWidths = {};\n for (const column of colsToSpread) {\n if (params?.onlyScaleUp) {\n currentWidths[column.getColId()] = column.getActualWidth();\n }\n column.resetActualWidth(source);\n const widthOverride = limitsMap?.[column.getId()];\n const minOverride = widthOverride?.minWidth ?? params?.defaultMinWidth ?? -Infinity;\n const maxOverride = widthOverride?.maxWidth ?? params?.defaultMaxWidth ?? Infinity;\n const colWidth = column.getActualWidth();\n const targetWidth = Math.max(Math.min(colWidth, maxOverride), minOverride);\n if (targetWidth != colWidth) {\n column.setActualWidth(targetWidth, source, true);\n }\n }\n while (!finishedResizing) {\n finishedResizing = true;\n const availablePixels = gridWidth - getWidthOfColsInList(colsToNotSpread);\n if (availablePixels <= 0) {\n for (const column of colsToSpread) {\n const newWidth = limitsMap?.[column.getId()]?.minWidth ?? params?.defaultMinWidth ?? column.minWidth;\n column.setActualWidth(newWidth, source, true);\n }\n } else {\n const scale = availablePixels / getWidthOfColsInList(colsToSpread);\n let pixelsForLastCol = availablePixels;\n for (let i = colsToSpread.length - 1; i >= 0; i--) {\n const column = colsToSpread[i];\n const id = column.getColId();\n const prevWidth = currentWidths[id];\n const widthOverride = limitsMap?.[id];\n const minOverride = widthOverride?.minWidth ?? params?.defaultMinWidth ?? prevWidth;\n const maxOverride = widthOverride?.maxWidth ?? params?.defaultMaxWidth;\n const minWidth = Math.max(minOverride ?? -Infinity, column.getMinWidth());\n const maxWidth = Math.min(maxOverride ?? Infinity, column.getMaxWidth());\n let newWidth = Math.round(column.getActualWidth() * scale);\n if (newWidth < minWidth) {\n newWidth = minWidth;\n moveToNotSpread(column);\n finishedResizing = false;\n } else if (newWidth > maxWidth) {\n newWidth = maxWidth;\n moveToNotSpread(column);\n finishedResizing = false;\n } else if (i === 0) {\n newWidth = pixelsForLastCol;\n }\n column.setActualWidth(newWidth, source, true);\n pixelsForLastCol -= newWidth;\n }\n }\n }\n for (const col of colsToDispatchEventFor) {\n col.fireColumnWidthChangedEvent(source);\n }\n const visibleCols = beans.visibleCols;\n visibleCols.setLeftValues(source);\n visibleCols.updateBodyWidths();\n if (silent) {\n return;\n }\n dispatchColumnResizedEvent(this.eventSvc, colsToDispatchEventFor, true, source);\n if (animate) {\n setWidthAnimation(beans, false);\n }\n }\n applyAutosizeStrategy() {\n const { gos, colDelayRenderSvc } = this.beans;\n const autoSizeStrategy = gos.get(\"autoSizeStrategy\");\n if (autoSizeStrategy?.type !== \"fitGridWidth\" && autoSizeStrategy?.type !== \"fitProvidedWidth\") {\n return;\n }\n setTimeout(() => {\n if (!this.isAlive()) {\n return;\n }\n const type = autoSizeStrategy.type;\n if (type === \"fitGridWidth\") {\n const { columnLimits: propColumnLimits, defaultMinWidth, defaultMaxWidth } = autoSizeStrategy;\n const columnLimits = propColumnLimits?.map(({ colId: key, minWidth, maxWidth }) => ({\n key,\n minWidth,\n maxWidth\n }));\n this.sizeColumnsToFitGridBody({\n defaultMinWidth,\n defaultMaxWidth,\n columnLimits\n });\n } else if (type === \"fitProvidedWidth\") {\n this.sizeColumnsToFit(autoSizeStrategy.width, \"sizeColumnsToFit\");\n }\n colDelayRenderSvc?.revealColumns(type);\n });\n }\n onFirstDataRendered({ colIds: colKeys, ...params }) {\n setTimeout(() => {\n if (!this.isAlive()) {\n return;\n }\n const source = \"autosizeColumns\";\n if (colKeys) {\n this.autoSizeCols({ ...params, source, colKeys });\n } else {\n this.autoSizeAllColumns({ ...params, source });\n }\n this.beans.colDelayRenderSvc?.revealColumns(params.type);\n });\n }\n processResizeOperations() {\n this.shouldQueueResizeOperations = false;\n for (const resizeOperation of this.resizeOperationQueue) {\n resizeOperation();\n }\n this.resizeOperationQueue = [];\n }\n pushResizeOperation(func) {\n this.resizeOperationQueue.push(func);\n }\n destroy() {\n this.resizeOperationQueue.length = 0;\n super.destroy();\n }\n};\nfunction normaliseColumnWidth(column, newWidth, limits = {}) {\n const minWidth = limits.minWidth ?? column.getMinWidth();\n if (newWidth < minWidth) {\n newWidth = minWidth;\n }\n const maxWidth = limits.maxWidth ?? column.getMaxWidth();\n if (newWidth > maxWidth) {\n newWidth = maxWidth;\n }\n return newWidth;\n}\nfunction getAvailableWidth({ ctrlsSvc, scrollVisibleSvc }) {\n const gridBodyCtrl = ctrlsSvc.getGridBodyCtrl();\n const removeScrollWidth = gridBodyCtrl.isVerticalScrollShowing();\n const scrollWidthToRemove = removeScrollWidth ? scrollVisibleSvc.getScrollbarWidth() : 0;\n const bodyViewportWidth = _getInnerWidth(gridBodyCtrl.eGridBody);\n return bodyViewportWidth - scrollWidthToRemove;\n}\nvar WIDTH_ANIMATION_CLASS = \"ag-animate-autosize\";\nfunction setWidthAnimation({ ctrlsSvc, gos }, enable) {\n if (!gos.get(\"animateColumnResizing\") || gos.get(\"enableRtl\") || !ctrlsSvc.isAlive()) {\n return;\n }\n const classList = ctrlsSvc.getGridBodyCtrl().eGridBody.classList;\n if (enable) {\n classList.add(WIDTH_ANIMATION_CLASS);\n } else {\n classList.remove(WIDTH_ANIMATION_CLASS);\n }\n}\n\n// packages/ag-grid-community/src/columnAutosize/columnAutosizeModule.ts\nvar ColumnAutoSizeModule = {\n moduleName: \"ColumnAutoSize\",\n version: VERSION,\n beans: [ColumnAutosizeService],\n apiFunctions: {\n sizeColumnsToFit,\n autoSizeColumns,\n autoSizeAllColumns\n },\n dependsOn: [AutoWidthModule],\n css: [columnAutoSize_default]\n};\n\n// packages/ag-grid-community/src/columns/columnHover/columnHoverApi.ts\nfunction isColumnHovered(beans, column) {\n return !!beans.colHover?.isHovered(column);\n}\n\n// packages/ag-grid-community/src/columns/columnHover/hoverFeature.ts\nvar HoverFeature = class extends BeanStub {\n constructor(columns, element) {\n super();\n this.columns = columns;\n this.element = element;\n this.destroyManagedListeners = [];\n this.enableFeature = (enabled) => {\n const { beans, gos, element, columns } = this;\n const colHover = beans.colHover;\n const active = enabled ?? !!gos.get(\"columnHoverHighlight\");\n if (active) {\n this.destroyManagedListeners = this.addManagedElementListeners(element, {\n mouseover: colHover.setMouseOver.bind(colHover, columns),\n mouseout: colHover.clearMouseOver.bind(colHover)\n });\n } else {\n for (const fn of this.destroyManagedListeners) {\n fn();\n }\n this.destroyManagedListeners = [];\n }\n };\n }\n postConstruct() {\n this.addManagedPropertyListener(\"columnHoverHighlight\", ({ currentValue }) => {\n this.enableFeature(currentValue);\n });\n this.enableFeature();\n }\n destroy() {\n super.destroy();\n this.destroyManagedListeners = null;\n }\n};\n\n// packages/ag-grid-community/src/columns/columnHover/columnHoverService.ts\nvar CSS_COLUMN_HOVER = \"ag-column-hover\";\nvar ColumnHoverService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colHover\";\n }\n postConstruct() {\n this.addManagedPropertyListener(\"columnHoverHighlight\", ({ currentValue }) => {\n if (!currentValue) {\n this.clearMouseOver();\n }\n });\n }\n setMouseOver(columns) {\n this.updateState(columns);\n }\n clearMouseOver() {\n this.updateState(null);\n }\n isHovered(column) {\n if (!this.gos.get(\"columnHoverHighlight\")) {\n return false;\n }\n const selectedColumns = this.selectedColumns;\n return !!selectedColumns && selectedColumns.indexOf(column) >= 0;\n }\n addHeaderColumnHoverListener(compBean, comp, column) {\n const listener = () => {\n const isHovered = this.isHovered(column);\n comp.toggleCss(\"ag-column-hover\", isHovered);\n };\n compBean.addManagedEventListeners({ columnHoverChanged: listener });\n listener();\n }\n onCellColumnHover(column, cellComp) {\n if (!cellComp) {\n return;\n }\n const isHovered = this.isHovered(column);\n cellComp.toggleCss(CSS_COLUMN_HOVER, isHovered);\n }\n addHeaderFilterColumnHoverListener(compBean, comp, column, eGui) {\n this.createHoverFeature(compBean, [column], eGui);\n const listener = () => {\n const hovered = this.isHovered(column);\n comp.toggleCss(\"ag-column-hover\", hovered);\n };\n compBean.addManagedEventListeners({ columnHoverChanged: listener });\n listener();\n }\n createHoverFeature(compBean, columns, eGui) {\n compBean.createManagedBean(new HoverFeature(columns, eGui));\n }\n updateState(columns) {\n this.selectedColumns = columns;\n this.eventSvc.dispatchEvent({\n type: \"columnHoverChanged\"\n });\n }\n};\n\n// packages/ag-grid-community/src/columns/columnHover/columnHoverModule.ts\nvar ColumnHoverModule = {\n moduleName: \"ColumnHover\",\n version: VERSION,\n beans: [ColumnHoverService],\n apiFunctions: {\n isColumnHovered\n }\n};\n\n// packages/ag-grid-community/src/export/gridSerializer.ts\nvar GridSerializer = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"gridSerializer\";\n }\n wireBeans(beans) {\n this.visibleCols = beans.visibleCols;\n this.colModel = beans.colModel;\n this.rowModel = beans.rowModel;\n this.pinnedRowModel = beans.pinnedRowModel;\n }\n serialize(gridSerializingSession, params = {}) {\n const { allColumns, columnKeys, skipRowGroups, exportRowNumbers } = params;\n const columnsToExport = this.getColumnsToExport({\n allColumns,\n skipRowGroups,\n columnKeys,\n exportRowNumbers\n });\n return [\n // first pass, put in the header names of the cols\n this.prepareSession(columnsToExport),\n this.prependContent(params),\n this.exportColumnGroups(params, columnsToExport),\n this.exportHeaders(params, columnsToExport),\n this.processPinnedTopRows(params, columnsToExport),\n this.processRows(params, columnsToExport),\n this.processPinnedBottomRows(params, columnsToExport),\n this.appendContent(params)\n ].reduce((composed, f) => f(composed), gridSerializingSession).parse();\n }\n processRow(gridSerializingSession, params, columnsToExport, node) {\n const rowSkipper = params.shouldRowBeSkipped || (() => false);\n const isClipboardExport = params.rowPositions != null;\n const isExplicitExportSelection = isClipboardExport || !!params.onlySelected;\n const hideOpenParents = this.gos.get(\"groupHideOpenParents\") && !isExplicitExportSelection;\n const isLeafNode = this.colModel.isPivotMode() ? node.leafGroup : !node.group;\n const isFooter = !!node.footer;\n const shouldSkipCurrentGroup = node.allChildrenCount === 1 && node.childrenAfterGroup?.length === 1 && _canSkipShowingRowGroup(this.gos, node);\n if (!isLeafNode && !isFooter && (params.skipRowGroups || shouldSkipCurrentGroup || hideOpenParents) || params.onlySelected && !node.isSelected() || params.skipPinnedTop && node.rowPinned === \"top\" || params.skipPinnedBottom && node.rowPinned === \"bottom\" || node.stub) {\n return;\n }\n const nodeIsRootNode = node.level === -1;\n if (nodeIsRootNode && !isLeafNode && !isFooter) {\n return;\n }\n const shouldRowBeSkipped = rowSkipper(_addGridCommonParams(this.gos, { node }));\n if (shouldRowBeSkipped) {\n return;\n }\n const rowAccumulator = gridSerializingSession.onNewBodyRow(node);\n columnsToExport.forEach((column, index) => {\n rowAccumulator.onColumn(column, index, node);\n });\n if (params.getCustomContentBelowRow) {\n const content = params.getCustomContentBelowRow(_addGridCommonParams(this.gos, { node }));\n if (content) {\n gridSerializingSession.addCustomContent(content);\n }\n }\n }\n appendContent(params) {\n return (gridSerializingSession) => {\n const appendContent = params.appendContent;\n if (appendContent) {\n gridSerializingSession.addCustomContent(appendContent);\n }\n return gridSerializingSession;\n };\n }\n prependContent(params) {\n return (gridSerializingSession) => {\n const prependContent = params.prependContent;\n if (prependContent) {\n gridSerializingSession.addCustomContent(prependContent);\n }\n return gridSerializingSession;\n };\n }\n prepareSession(columnsToExport) {\n return (gridSerializingSession) => {\n gridSerializingSession.prepare(columnsToExport);\n return gridSerializingSession;\n };\n }\n exportColumnGroups(params, columnsToExport) {\n return (gridSerializingSession) => {\n if (!params.skipColumnGroupHeaders) {\n const idCreator = new GroupInstanceIdCreator();\n const { colGroupSvc } = this.beans;\n const displayedGroups = colGroupSvc ? colGroupSvc.createColumnGroups({\n columns: columnsToExport,\n idCreator,\n pinned: null,\n isStandaloneStructure: true\n }) : columnsToExport;\n this.recursivelyAddHeaderGroups(\n displayedGroups,\n gridSerializingSession,\n params.processGroupHeaderCallback\n );\n }\n return gridSerializingSession;\n };\n }\n exportHeaders(params, columnsToExport) {\n return (gridSerializingSession) => {\n if (!params.skipColumnHeaders) {\n const gridRowIterator = gridSerializingSession.onNewHeaderRow();\n columnsToExport.forEach((column, index) => {\n gridRowIterator.onColumn(column, index, void 0);\n });\n }\n return gridSerializingSession;\n };\n }\n processPinnedTopRows(params, columnsToExport) {\n return (gridSerializingSession) => {\n const processRow = this.processRow.bind(this, gridSerializingSession, params, columnsToExport);\n if (params.rowPositions) {\n params.rowPositions.filter((position) => position.rowPinned === \"top\").sort((a, b) => a.rowIndex - b.rowIndex).map((position) => this.pinnedRowModel?.getPinnedTopRow(position.rowIndex)).forEach(processRow);\n } else if (!this.pinnedRowModel?.isManual()) {\n this.pinnedRowModel?.forEachPinnedRow(\"top\", processRow);\n }\n return gridSerializingSession;\n };\n }\n processRows(params, columnsToExport) {\n return (gridSerializingSession) => {\n const rowModel = this.rowModel;\n const usingCsrm = _isClientSideRowModel(this.gos, rowModel);\n const usingSsrm = _isServerSideRowModel(this.gos, rowModel);\n const onlySelectedNonStandardModel = !usingCsrm && params.onlySelected;\n const processRow = this.processRow.bind(this, gridSerializingSession, params, columnsToExport);\n const { exportedRows = \"filteredAndSorted\" } = params;\n if (params.rowPositions) {\n params.rowPositions.filter((position) => position.rowPinned == null).sort((a, b) => a.rowIndex - b.rowIndex).map((position) => rowModel.getRow(position.rowIndex)).forEach(processRow);\n } else if (this.colModel.isPivotMode()) {\n if (usingCsrm) {\n rowModel.forEachPivotNode(processRow, true, exportedRows === \"filteredAndSorted\");\n } else if (usingSsrm) {\n rowModel.forEachNodeAfterFilterAndSort(processRow, true);\n } else {\n rowModel.forEachNode(processRow);\n }\n } else if (params.onlySelectedAllPages || onlySelectedNonStandardModel) {\n const selectedNodes = this.beans.selectionSvc?.getSelectedNodes() ?? [];\n this.replicateSortedOrder(selectedNodes);\n selectedNodes.forEach(processRow);\n } else if (exportedRows === \"all\") {\n rowModel.forEachNode(processRow);\n } else if (usingCsrm || usingSsrm) {\n rowModel.forEachNodeAfterFilterAndSort(processRow, true);\n } else {\n rowModel.forEachNode(processRow);\n }\n return gridSerializingSession;\n };\n }\n replicateSortedOrder(rows) {\n const { sortSvc, rowNodeSorter } = this.beans;\n if (!sortSvc || !rowNodeSorter) {\n return;\n }\n const sortOptions = sortSvc.getSortOptions();\n const compareNodes = (rowA, rowB) => {\n if (rowA.rowIndex != null && rowB.rowIndex != null) {\n return rowA.rowIndex - rowB.rowIndex;\n }\n if (rowA.level === rowB.level) {\n if (rowA.parent?.id === rowB.parent?.id) {\n return rowNodeSorter.compareRowNodes(sortOptions, rowA, rowB) || (rowA.rowIndex ?? -1) - (rowB.rowIndex ?? -1);\n }\n return compareNodes(rowA.parent, rowB.parent);\n }\n if (rowA.level > rowB.level) {\n return compareNodes(rowA.parent, rowB);\n }\n return compareNodes(rowA, rowB.parent);\n };\n rows.sort(compareNodes);\n }\n processPinnedBottomRows(params, columnsToExport) {\n return (gridSerializingSession) => {\n const processRow = this.processRow.bind(this, gridSerializingSession, params, columnsToExport);\n if (params.rowPositions) {\n params.rowPositions.filter((position) => position.rowPinned === \"bottom\").sort((a, b) => a.rowIndex - b.rowIndex).map((position) => this.pinnedRowModel?.getPinnedBottomRow(position.rowIndex)).forEach(processRow);\n } else if (!this.pinnedRowModel?.isManual()) {\n this.pinnedRowModel?.forEachPinnedRow(\"bottom\", processRow);\n }\n return gridSerializingSession;\n };\n }\n getColumnsToExport(params) {\n const { allColumns = false, skipRowGroups = false, exportRowNumbers = false, columnKeys } = params;\n const { colModel, gos, visibleCols } = this;\n const isPivotMode = colModel.isPivotMode();\n const filterSpecialColumns = (col) => {\n if (isColumnSelectionCol(col)) {\n return false;\n }\n return !isRowNumberCol(col) || exportRowNumbers;\n };\n if (columnKeys?.length) {\n return colModel.getColsForKeys(columnKeys).filter(filterSpecialColumns);\n }\n const isTreeData = gos.get(\"treeData\");\n let columnsToExport = [];\n if (allColumns && !isPivotMode) {\n columnsToExport = colModel.getCols();\n } else {\n columnsToExport = visibleCols.allCols;\n }\n columnsToExport = columnsToExport.filter(\n (column) => filterSpecialColumns(column) && (skipRowGroups && !isTreeData ? !isColumnGroupAutoCol(column) : true)\n );\n return columnsToExport;\n }\n recursivelyAddHeaderGroups(displayedGroups, gridSerializingSession, processGroupHeaderCallback) {\n const directChildrenHeaderGroups = [];\n for (const columnGroupChild of displayedGroups) {\n const columnGroup = columnGroupChild;\n if (!columnGroup.getChildren) {\n continue;\n }\n for (const it of columnGroup.getChildren() ?? []) {\n directChildrenHeaderGroups.push(it);\n }\n }\n if (displayedGroups.length > 0 && isColumnGroup(displayedGroups[0])) {\n this.doAddHeaderHeader(gridSerializingSession, displayedGroups, processGroupHeaderCallback);\n }\n if (directChildrenHeaderGroups && directChildrenHeaderGroups.length > 0) {\n this.recursivelyAddHeaderGroups(\n directChildrenHeaderGroups,\n gridSerializingSession,\n processGroupHeaderCallback\n );\n }\n }\n doAddHeaderHeader(gridSerializingSession, displayedGroups, processGroupHeaderCallback) {\n const gridRowIterator = gridSerializingSession.onNewHeaderGroupingRow();\n let columnIndex = 0;\n for (const columnGroupChild of displayedGroups) {\n const columnGroup = columnGroupChild;\n let name;\n if (processGroupHeaderCallback) {\n name = processGroupHeaderCallback(\n _addGridCommonParams(this.gos, {\n columnGroup\n })\n );\n } else {\n name = this.beans.colNames.getDisplayNameForColumnGroup(columnGroup, \"header\");\n }\n const columnsToCalculateRange = columnGroup.isExpandable() ? columnGroup.getLeafColumns() : [];\n const collapsibleGroupRanges = columnsToCalculateRange.reduce(\n (collapsibleGroups, currentColumn, currentIdx, arr) => {\n let lastGroup = _last(collapsibleGroups);\n const groupShow = currentColumn.getColumnGroupShow() === \"open\";\n if (!groupShow) {\n if (lastGroup && lastGroup[1] == null) {\n lastGroup[1] = currentIdx - 1;\n }\n } else if (!lastGroup || lastGroup[1] != null) {\n lastGroup = [currentIdx];\n collapsibleGroups.push(lastGroup);\n }\n if (currentIdx === arr.length - 1 && lastGroup && lastGroup[1] == null) {\n lastGroup[1] = currentIdx;\n }\n return collapsibleGroups;\n },\n []\n );\n gridRowIterator.onColumn(\n columnGroup,\n name || \"\",\n columnIndex++,\n columnGroup.getLeafColumns().length - 1,\n collapsibleGroupRanges\n );\n }\n }\n};\n\n// packages/ag-grid-community/src/export/exportModule.ts\nvar SharedExportModule = {\n moduleName: \"SharedExport\",\n version: VERSION,\n beans: [GridSerializer]\n};\n\n// packages/ag-grid-community/src/export/baseCreator.ts\nvar BaseCreator = class extends BeanStub {\n getFileName(fileName) {\n const extension = this.getDefaultFileExtension();\n if (!fileName?.length) {\n fileName = this.getDefaultFileName();\n }\n return fileName.includes(\".\") ? fileName : `${fileName}.${extension}`;\n }\n getData(params) {\n return this.beans.gridSerializer.serialize(this.createSerializingSession(params), params);\n }\n getDefaultFileName() {\n return `export.${this.getDefaultFileExtension()}`;\n }\n};\n\n// packages/ag-grid-community/src/export/downloader.ts\nfunction _downloadFile(fileName, content) {\n const win = document.defaultView || window;\n if (!win) {\n _warn(52);\n return;\n }\n const element = document.createElement(\"a\");\n const url = win.URL.createObjectURL(content);\n element.setAttribute(\"href\", url);\n element.setAttribute(\"download\", fileName);\n element.style.display = \"none\";\n document.body.appendChild(element);\n element.dispatchEvent(\n new MouseEvent(\"click\", {\n bubbles: false,\n cancelable: true,\n view: win\n })\n );\n element.remove();\n win.setTimeout(() => {\n win.URL.revokeObjectURL(url);\n }, 0);\n}\n\n// packages/ag-grid-community/src/export/baseGridSerializingSession.ts\nvar BaseGridSerializingSession = class {\n constructor(config) {\n this.valueFrom = \"data\";\n const {\n colModel,\n rowGroupColsSvc,\n colNames,\n valueSvc,\n gos,\n processCellCallback,\n processHeaderCallback,\n processGroupHeaderCallback,\n processRowGroupCallback,\n valueFrom\n } = config;\n this.colModel = colModel;\n this.rowGroupColsSvc = rowGroupColsSvc;\n this.colNames = colNames;\n this.valueSvc = valueSvc;\n this.gos = gos;\n this.processCellCallback = processCellCallback;\n this.processHeaderCallback = processHeaderCallback;\n this.processGroupHeaderCallback = processGroupHeaderCallback;\n this.processRowGroupCallback = processRowGroupCallback;\n if (valueFrom) {\n this.valueFrom = valueFrom;\n }\n }\n prepare(_columnsToExport) {\n }\n extractHeaderValue(column) {\n const value = this.getHeaderName(this.processHeaderCallback, column);\n return value ?? \"\";\n }\n extractRowCellValue(params) {\n const { column, node, currentColumnIndex, accumulatedRowIndex, type, useRawFormula } = params;\n const isFullWidthGroup = currentColumnIndex === 0 && _isFullWidthGroupRow(this.gos, node, this.colModel.isPivotMode());\n if (this.processRowGroupCallback && (this.gos.get(\"treeData\") || node.group) && (column.isRowGroupDisplayed(node.rowGroupColumn?.getColId() ?? \"\") || isFullWidthGroup)) {\n return { value: this.processRowGroupCallback(_addGridCommonParams(this.gos, { column, node })) ?? \"\" };\n }\n if (this.processCellCallback) {\n return {\n value: this.processCellCallback(\n _addGridCommonParams(this.gos, {\n accumulatedRowIndex,\n column,\n node,\n value: this.valueSvc.getValueForDisplay({ column, node, from: this.valueFrom }).value,\n type,\n parseValue: (valueToParse) => this.valueSvc.parseValue(\n column,\n node,\n valueToParse,\n this.valueSvc.getValue(column, node, this.valueFrom)\n ),\n formatValue: (valueToFormat) => this.valueSvc.formatValue(column, node, valueToFormat) ?? valueToFormat\n })\n ) ?? \"\"\n };\n }\n const isTreeData = this.gos.get(\"treeData\");\n const valueService = this.valueSvc;\n const isGrandTotalRow = node.level === -1 && node.footer;\n const isMultiAutoCol = column.colDef.showRowGroup === true && (node.group || isTreeData);\n if (!isGrandTotalRow && (isFullWidthGroup || isMultiAutoCol)) {\n let concatenatedGroupValue = \"\";\n let pointer = node;\n while (pointer && pointer.level !== -1) {\n const { value: value2, valueFormatted: valueFormatted2 } = valueService.getValueForDisplay({\n column: isFullWidthGroup ? void 0 : column,\n // full width group doesn't have a column\n node: pointer,\n includeValueFormatted: true,\n exporting: true,\n from: this.valueFrom\n });\n concatenatedGroupValue = ` -> ${valueFormatted2 ?? value2 ?? \"\"}${concatenatedGroupValue}`;\n pointer = pointer.parent;\n }\n return {\n value: concatenatedGroupValue,\n // don't return the unformatted value; as if the grid detects number it'll not use the concatenated string\n valueFormatted: concatenatedGroupValue\n };\n }\n const { value, valueFormatted } = valueService.getValueForDisplay({\n column,\n node,\n includeValueFormatted: true,\n exporting: true,\n useRawFormula,\n from: this.valueFrom\n });\n return {\n value: value ?? \"\",\n valueFormatted\n };\n }\n getHeaderName(callback, column) {\n if (callback) {\n return callback(_addGridCommonParams(this.gos, { column }));\n }\n return this.colNames.getDisplayNameForColumn(column, \"csv\", true);\n }\n};\n\n// packages/ag-grid-community/src/csvExport/csvSerializingSession.ts\nvar LINE_SEPARATOR = \"\\r\\n\";\nvar CsvSerializingSession = class extends BaseGridSerializingSession {\n constructor(config) {\n super(config);\n this.config = config;\n this.isFirstLine = true;\n this.result = \"\";\n const { suppressQuotes, columnSeparator } = config;\n this.suppressQuotes = suppressQuotes;\n this.columnSeparator = columnSeparator;\n }\n addCustomContent(content) {\n if (!content) {\n return;\n }\n if (typeof content === \"string\") {\n if (!/^\\s*\\n/.test(content)) {\n this.beginNewLine();\n }\n content = content.replace(/\\r?\\n/g, LINE_SEPARATOR);\n this.result += content;\n } else {\n content.forEach((row) => {\n this.beginNewLine();\n row.forEach((cell, index) => {\n if (index !== 0) {\n this.result += this.columnSeparator;\n }\n this.result += this.putInQuotes(cell.data.value || \"\");\n if (cell.mergeAcross) {\n this.appendEmptyCells(cell.mergeAcross);\n }\n });\n });\n }\n }\n onNewHeaderGroupingRow() {\n this.beginNewLine();\n return {\n onColumn: this.onNewHeaderGroupingRowColumn.bind(this)\n };\n }\n onNewHeaderGroupingRowColumn(columnGroup, header, index, span) {\n if (index != 0) {\n this.result += this.columnSeparator;\n }\n this.result += this.putInQuotes(header);\n this.appendEmptyCells(span);\n }\n appendEmptyCells(count) {\n for (let i = 1; i <= count; i++) {\n this.result += this.columnSeparator + this.putInQuotes(\"\");\n }\n }\n onNewHeaderRow() {\n this.beginNewLine();\n return {\n onColumn: this.onNewHeaderRowColumn.bind(this)\n };\n }\n onNewHeaderRowColumn(column, index) {\n if (index != 0) {\n this.result += this.columnSeparator;\n }\n this.result += this.putInQuotes(this.extractHeaderValue(column));\n }\n onNewBodyRow() {\n this.beginNewLine();\n return {\n onColumn: this.onNewBodyRowColumn.bind(this)\n };\n }\n onNewBodyRowColumn(column, index, node) {\n if (index != 0) {\n this.result += this.columnSeparator;\n }\n const rowCellValue = this.extractRowCellValue({\n column,\n node,\n currentColumnIndex: index,\n accumulatedRowIndex: index,\n type: \"csv\",\n useRawFormula: false\n });\n this.result += this.putInQuotes(rowCellValue.valueFormatted ?? rowCellValue.value);\n }\n putInQuotes(value) {\n if (this.suppressQuotes) {\n return value;\n }\n if (value === null || value === void 0) {\n return '\"\"';\n }\n let stringValue;\n if (typeof value === \"string\") {\n stringValue = value;\n } else if (typeof value.toString === \"function\") {\n stringValue = value.toString();\n } else {\n _warn(53);\n stringValue = \"\";\n }\n const valueEscaped = stringValue.replace(/\"/g, '\"\"');\n return '\"' + valueEscaped + '\"';\n }\n parse() {\n return this.result;\n }\n beginNewLine() {\n if (!this.isFirstLine) {\n this.result += LINE_SEPARATOR;\n }\n this.isFirstLine = false;\n }\n};\n\n// packages/ag-grid-community/src/csvExport/csvCreator.ts\nvar CsvCreator = class extends BaseCreator {\n constructor() {\n super(...arguments);\n this.beanName = \"csvCreator\";\n }\n getMergedParams(params) {\n const baseParams6 = this.gos.get(\"defaultCsvExportParams\");\n return Object.assign({}, baseParams6, params);\n }\n export(userParams) {\n if (this.isExportSuppressed()) {\n _warn(51);\n return;\n }\n const exportFunc = () => {\n const mergedParams = this.getMergedParams(userParams);\n const data = this.getData(mergedParams);\n const packagedFile = new Blob([\"\\uFEFF\", data], { type: \"text/plain\" });\n const fileNameParams = mergedParams.fileName;\n const fileName = typeof fileNameParams === \"function\" ? fileNameParams(_addGridCommonParams(this.gos, {})) : fileNameParams;\n _downloadFile(this.getFileName(fileName), packagedFile);\n };\n const { overlays } = this.beans;\n if (overlays) {\n overlays.showExportOverlay(exportFunc);\n } else {\n exportFunc();\n }\n }\n exportDataAsCsv(params) {\n this.export(params);\n }\n getDataAsCsv(params, skipDefaultParams = false) {\n const mergedParams = skipDefaultParams ? Object.assign({}, params) : this.getMergedParams(params);\n return this.getData(mergedParams);\n }\n getDefaultFileExtension() {\n return \"csv\";\n }\n createSerializingSession(params) {\n const { colModel, colNames, rowGroupColsSvc, valueSvc, gos } = this.beans;\n const {\n processCellCallback,\n processHeaderCallback,\n processGroupHeaderCallback,\n processRowGroupCallback,\n suppressQuotes,\n columnSeparator,\n valueFrom\n } = params;\n return new CsvSerializingSession({\n colModel,\n colNames,\n valueSvc,\n gos,\n processCellCallback: processCellCallback || void 0,\n processHeaderCallback: processHeaderCallback || void 0,\n processGroupHeaderCallback: processGroupHeaderCallback || void 0,\n processRowGroupCallback: processRowGroupCallback || void 0,\n suppressQuotes: suppressQuotes || false,\n columnSeparator: columnSeparator || \",\",\n rowGroupColsSvc,\n valueFrom\n });\n }\n isExportSuppressed() {\n return this.gos.get(\"suppressCsvExport\");\n }\n};\n\n// packages/ag-grid-community/src/csvExport/csvExportApi.ts\nfunction getDataAsCsv(beans, params) {\n return beans.csvCreator?.getDataAsCsv(params);\n}\nfunction exportDataAsCsv(beans, params) {\n beans.csvCreator?.exportDataAsCsv(params);\n}\n\n// packages/ag-grid-community/src/csvExport/csvExportModule.ts\nvar CsvExportModule = {\n moduleName: \"CsvExport\",\n version: VERSION,\n beans: [CsvCreator],\n apiFunctions: {\n getDataAsCsv,\n exportDataAsCsv\n },\n dependsOn: [SharedExportModule]\n};\n\n// packages/ag-grid-community/src/agStack/tooltip/agTooltipFeature.ts\nvar AgTooltipFeature = class extends AgBeanStub {\n constructor(ctrl, beans) {\n super();\n this.ctrl = ctrl;\n if (beans) {\n this.beans = beans;\n }\n }\n postConstruct() {\n this.refreshTooltip();\n }\n /**\n *\n * @param tooltip The tooltip value\n * @param allowEmptyString Set it to true to allow the title to be set to `''`. This is necessary\n * when the browser adds a default tooltip the element and the tooltip service will be displayed\n * next to a browser tooltip causing confusion.\n */\n setBrowserTooltip(tooltip, allowEmptyString) {\n const name = \"title\";\n const eGui = this.ctrl.getGui();\n if (!eGui) {\n return;\n }\n if (tooltip != null && (tooltip != \"\" || allowEmptyString)) {\n eGui.setAttribute(name, tooltip);\n } else {\n eGui.removeAttribute(name);\n }\n }\n updateTooltipText() {\n const { getTooltipValue } = this.ctrl;\n if (getTooltipValue) {\n this.tooltip = getTooltipValue();\n }\n }\n createTooltipFeatureIfNeeded() {\n if (this.tooltipManager == null) {\n const tooltipManager = this.beans.registry.createDynamicBean(\"tooltipStateManager\", true, this.ctrl, () => this.tooltip);\n if (tooltipManager) {\n this.tooltipManager = this.createBean(tooltipManager, this.beans.context);\n }\n }\n }\n attemptToShowTooltip() {\n this.tooltipManager?.prepareToShowTooltip();\n }\n attemptToHideTooltip() {\n this.tooltipManager?.hideTooltip();\n }\n setTooltipAndRefresh(tooltip) {\n this.tooltip = tooltip;\n this.refreshTooltip();\n }\n refreshTooltip(clearWithEmptyString) {\n this.browserTooltips = this.beans.gos.get(\"enableBrowserTooltips\");\n this.updateTooltipText();\n if (this.browserTooltips) {\n this.setBrowserTooltip(this.tooltip);\n this.tooltipManager = this.destroyBean(this.tooltipManager, this.beans.context);\n } else {\n this.setBrowserTooltip(clearWithEmptyString ? \"\" : null, clearWithEmptyString);\n this.createTooltipFeatureIfNeeded();\n }\n }\n destroy() {\n this.tooltipManager = this.destroyBean(this.tooltipManager, this.beans.context);\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/agStack/tooltip/baseTooltipStateManager.ts\nvar SHOW_SWITCH_TOOLTIP_DIFF = 1e3;\nvar FADE_OUT_TOOLTIP_TIMEOUT = 1e3;\nvar INTERACTIVE_HIDE_DELAY = 100;\nvar lastTooltipHideTime;\nvar isLocked = false;\nvar BaseTooltipStateManager = class extends AgBeanStub {\n constructor(tooltipCtrl, getTooltipValue) {\n super();\n this.tooltipCtrl = tooltipCtrl;\n this.getTooltipValue = getTooltipValue;\n this.interactionEnabled = false;\n this.isInteractingWithTooltip = false;\n this.state = 0 /* NOTHING */;\n // when showing the tooltip, we need to make sure it's the most recent instance we request, as due to\n // async we could request two tooltips before the first instance returns, in which case we should\n // disregard the second instance.\n this.tooltipInstanceCount = 0;\n this.tooltipMouseTrack = false;\n }\n wireBeans(beans) {\n this.popupSvc = beans.popupSvc;\n }\n postConstruct() {\n if (this.gos.get(\"tooltipInteraction\")) {\n this.interactionEnabled = true;\n }\n this.tooltipTrigger = this.getTooltipTrigger();\n this.tooltipMouseTrack = this.gos.get(\"tooltipMouseTrack\");\n const el = this.tooltipCtrl.getGui();\n if (this.tooltipTrigger === 0 /* HOVER */) {\n this.addManagedListeners(el, {\n mouseenter: this.onMouseEnter.bind(this),\n mouseleave: this.onMouseLeave.bind(this)\n });\n }\n if (this.tooltipTrigger === 1 /* FOCUS */) {\n this.addManagedListeners(el, {\n focusin: this.onFocusIn.bind(this),\n focusout: this.onFocusOut.bind(this)\n });\n }\n this.addManagedListeners(el, { mousemove: this.onMouseMove.bind(this) });\n if (!this.interactionEnabled) {\n this.addManagedListeners(el, {\n mousedown: this.onMouseDown.bind(this),\n keydown: this.onKeyDown.bind(this)\n });\n }\n }\n getGridOptionsTooltipDelay(delayOption) {\n const delay = this.gos.get(delayOption);\n return Math.max(200, delay);\n }\n getTooltipDelay(type) {\n return this.tooltipCtrl[`getTooltip${type}DelayOverride`]?.() ?? this.getGridOptionsTooltipDelay(`tooltip${type}Delay`);\n }\n destroy() {\n this.setToDoNothing();\n super.destroy();\n }\n getTooltipTrigger() {\n const trigger = this.gos.get(\"tooltipTrigger\");\n if (!trigger || trigger === \"hover\") {\n return 0 /* HOVER */;\n }\n return 1 /* FOCUS */;\n }\n onMouseEnter(e) {\n if (this.interactionEnabled && this.interactiveTooltipTimeoutId) {\n this.unlockService();\n this.startHideTimeout();\n }\n if (_isIOSUserAgent()) {\n return;\n }\n if (isLocked) {\n this.showTooltipTimeoutId = window.setTimeout(() => {\n this.prepareToShowTooltip(e);\n }, INTERACTIVE_HIDE_DELAY);\n } else {\n this.prepareToShowTooltip(e);\n }\n }\n onMouseMove(e) {\n if (this.lastMouseEvent) {\n this.lastMouseEvent = e;\n }\n if (this.tooltipMouseTrack && this.state === 2 /* SHOWING */ && this.tooltipComp) {\n this.positionTooltip();\n }\n }\n onMouseDown() {\n this.setToDoNothing();\n }\n onMouseLeave() {\n if (this.interactionEnabled) {\n this.lockService();\n } else {\n this.setToDoNothing();\n }\n }\n onFocusIn() {\n this.prepareToShowTooltip();\n }\n onFocusOut(e) {\n const relatedTarget = e.relatedTarget;\n const parentCompGui = this.tooltipCtrl.getGui();\n const tooltipGui = this.tooltipComp?.getGui();\n if (this.isInteractingWithTooltip || parentCompGui.contains(relatedTarget) || this.interactionEnabled && tooltipGui?.contains(relatedTarget)) {\n return;\n }\n this.setToDoNothing();\n }\n onKeyDown() {\n if (this.isInteractingWithTooltip) {\n this.isInteractingWithTooltip = false;\n }\n this.setToDoNothing();\n }\n prepareToShowTooltip(mouseEvent) {\n if (this.state != 0 /* NOTHING */ || isLocked) {\n return;\n }\n let delay = 0;\n if (mouseEvent) {\n delay = this.isLastTooltipHiddenRecently() ? this.getTooltipDelay(\"SwitchShow\") : this.getTooltipDelay(\"Show\");\n }\n this.lastMouseEvent = mouseEvent || null;\n this.showTooltipTimeoutId = window.setTimeout(this.showTooltip.bind(this), delay);\n this.state = 1 /* WAITING_TO_SHOW */;\n }\n isLastTooltipHiddenRecently() {\n const now = Date.now();\n const then = lastTooltipHideTime;\n return now - then < SHOW_SWITCH_TOOLTIP_DIFF;\n }\n setToDoNothing(fromHideTooltip) {\n if (!fromHideTooltip && this.state === 2 /* SHOWING */) {\n this.hideTooltip();\n }\n if (this.onBodyScrollEventCallback) {\n this.onBodyScrollEventCallback();\n this.onBodyScrollEventCallback = void 0;\n }\n this.clearEventHandlers();\n if (this.onDocumentKeyDownCallback) {\n this.onDocumentKeyDownCallback();\n this.onDocumentKeyDownCallback = void 0;\n }\n this.clearTimeouts();\n this.state = 0 /* NOTHING */;\n this.lastMouseEvent = null;\n }\n showTooltip() {\n const value = this.getTooltipValue();\n const ctrl = this.tooltipCtrl;\n if (!_exists(value) || ctrl.shouldDisplayTooltip && !ctrl.shouldDisplayTooltip()) {\n this.setToDoNothing();\n return;\n }\n const params = this.gos.addCommon({\n location: ctrl.getLocation?.() ?? \"UNKNOWN\",\n value,\n hideTooltipCallback: () => this.hideTooltip(true),\n ...ctrl.getAdditionalParams?.()\n });\n this.state = 2 /* SHOWING */;\n this.tooltipInstanceCount++;\n const callback = this.newTooltipComponentCallback.bind(this, this.tooltipInstanceCount);\n this.createTooltipComp(params, callback);\n }\n hideTooltip(forceHide) {\n if (!forceHide && this.isInteractingWithTooltip) {\n return;\n }\n if (this.tooltipComp) {\n this.destroyTooltipComp();\n lastTooltipHideTime = Date.now();\n }\n this.eventSvc.dispatchEvent({\n type: \"tooltipHide\",\n parentGui: this.tooltipCtrl.getGui()\n });\n if (forceHide) {\n this.isInteractingWithTooltip = false;\n }\n this.setToDoNothing(true);\n }\n newTooltipComponentCallback(tooltipInstanceCopy, tooltipComp) {\n const compNoLongerNeeded = this.state !== 2 /* SHOWING */ || this.tooltipInstanceCount !== tooltipInstanceCopy;\n if (compNoLongerNeeded) {\n this.destroyBean(tooltipComp);\n return;\n }\n const eGui = tooltipComp.getGui();\n this.tooltipComp = tooltipComp;\n if (!eGui.classList.contains(\"ag-tooltip\")) {\n eGui.classList.add(\"ag-tooltip-custom\");\n }\n if (this.tooltipTrigger === 0 /* HOVER */) {\n eGui.classList.add(\"ag-tooltip-animate\");\n }\n if (this.interactionEnabled) {\n eGui.classList.add(\"ag-tooltip-interactive\");\n }\n const translate = this.getLocaleTextFunc();\n const addPopupRes = this.popupSvc?.addPopup({\n eChild: eGui,\n ariaLabel: translate(\"ariaLabelTooltip\", \"Tooltip\")\n });\n if (addPopupRes) {\n this.tooltipPopupDestroyFunc = addPopupRes.hideFunc;\n }\n this.positionTooltip();\n if (this.tooltipTrigger === 1 /* FOCUS */) {\n const listener = () => this.setToDoNothing();\n [this.onBodyScrollEventCallback] = this.addManagedEventListeners({\n bodyScroll: listener\n });\n this.setEventHandlers(listener);\n }\n if (this.interactionEnabled) {\n [this.tooltipMouseEnterListener, this.tooltipMouseLeaveListener] = this.addManagedElementListeners(eGui, {\n mouseenter: this.onTooltipMouseEnter.bind(this),\n mouseleave: this.onTooltipMouseLeave.bind(this)\n });\n [this.onDocumentKeyDownCallback] = this.addManagedElementListeners(_getDocument(this.beans), {\n keydown: (e) => {\n if (!eGui.contains(e?.target)) {\n this.onKeyDown();\n }\n }\n });\n if (this.tooltipTrigger === 1 /* FOCUS */) {\n [this.tooltipFocusInListener, this.tooltipFocusOutListener] = this.addManagedElementListeners(eGui, {\n focusin: this.onTooltipFocusIn.bind(this),\n focusout: this.onTooltipFocusOut.bind(this)\n });\n }\n }\n this.eventSvc.dispatchEvent({\n type: \"tooltipShow\",\n tooltipGui: eGui,\n parentGui: this.tooltipCtrl.getGui()\n });\n this.startHideTimeout();\n }\n onTooltipMouseEnter() {\n this.isInteractingWithTooltip = true;\n this.unlockService();\n }\n onTooltipMouseLeave() {\n if (this.isTooltipFocused()) {\n return;\n }\n this.isInteractingWithTooltip = false;\n this.lockService();\n }\n onTooltipFocusIn() {\n this.isInteractingWithTooltip = true;\n }\n isTooltipFocused() {\n const tooltipGui = this.tooltipComp?.getGui();\n const activeEl = _getActiveDomElement(this.beans);\n return !!tooltipGui && tooltipGui.contains(activeEl);\n }\n onTooltipFocusOut(e) {\n const parentGui = this.tooltipCtrl.getGui();\n if (this.isTooltipFocused()) {\n return;\n }\n this.isInteractingWithTooltip = false;\n if (parentGui.contains(e.relatedTarget)) {\n this.startHideTimeout();\n } else {\n this.hideTooltip();\n }\n }\n positionTooltip() {\n const params = {\n type: \"tooltip\",\n ePopup: this.tooltipComp.getGui(),\n nudgeY: 18,\n skipObserver: this.tooltipMouseTrack\n };\n if (this.lastMouseEvent) {\n this.popupSvc?.positionPopupUnderMouseEvent({\n ...params,\n mouseEvent: this.lastMouseEvent\n });\n } else {\n this.popupSvc?.positionPopupByComponent({\n ...params,\n eventSource: this.tooltipCtrl.getGui(),\n position: \"under\",\n keepWithinBounds: true,\n nudgeY: 5\n });\n }\n }\n destroyTooltipComp() {\n this.tooltipComp.getGui().classList.add(\"ag-tooltip-hiding\");\n const tooltipPopupDestroyFunc = this.tooltipPopupDestroyFunc;\n const tooltipComp = this.tooltipComp;\n const delay = this.tooltipTrigger === 0 /* HOVER */ ? FADE_OUT_TOOLTIP_TIMEOUT : 0;\n window.setTimeout(() => {\n tooltipPopupDestroyFunc();\n this.destroyBean(tooltipComp);\n }, delay);\n this.clearTooltipListeners();\n this.tooltipPopupDestroyFunc = void 0;\n this.tooltipComp = void 0;\n }\n clearTooltipListeners() {\n for (const listener of [\n this.tooltipMouseEnterListener,\n this.tooltipMouseLeaveListener,\n this.tooltipFocusInListener,\n this.tooltipFocusOutListener\n ]) {\n if (listener) {\n listener();\n }\n }\n this.tooltipMouseEnterListener = this.tooltipMouseLeaveListener = this.tooltipFocusInListener = this.tooltipFocusOutListener = null;\n }\n lockService() {\n isLocked = true;\n this.interactiveTooltipTimeoutId = window.setTimeout(() => {\n this.unlockService();\n this.setToDoNothing();\n }, INTERACTIVE_HIDE_DELAY);\n }\n unlockService() {\n isLocked = false;\n this.clearInteractiveTimeout();\n }\n startHideTimeout() {\n this.clearHideTimeout();\n this.hideTooltipTimeoutId = window.setTimeout(this.hideTooltip.bind(this), this.getTooltipDelay(\"Hide\"));\n }\n clearShowTimeout() {\n if (!this.showTooltipTimeoutId) {\n return;\n }\n window.clearTimeout(this.showTooltipTimeoutId);\n this.showTooltipTimeoutId = void 0;\n }\n clearHideTimeout() {\n if (!this.hideTooltipTimeoutId) {\n return;\n }\n window.clearTimeout(this.hideTooltipTimeoutId);\n this.hideTooltipTimeoutId = void 0;\n }\n clearInteractiveTimeout() {\n if (!this.interactiveTooltipTimeoutId) {\n return;\n }\n window.clearTimeout(this.interactiveTooltipTimeoutId);\n this.interactiveTooltipTimeoutId = void 0;\n }\n clearTimeouts() {\n this.clearShowTimeout();\n this.clearHideTimeout();\n this.clearInteractiveTimeout();\n }\n};\n\n// packages/ag-grid-community/src/agStack/tooltip/agHighlightTooltipFeature.ts\nvar AgHighlightTooltipFeature = class extends AgTooltipFeature {\n constructor(ctrl, highlightTracker, beans) {\n super(ctrl, beans);\n this.highlightTracker = highlightTracker;\n this.onHighlight = this.onHighlight.bind(this);\n }\n postConstruct() {\n super.postConstruct();\n this.wireHighlightListeners();\n }\n wireHighlightListeners() {\n this.addManagedPropertyListener(\"tooltipTrigger\", ({ currentValue }) => {\n this.setTooltipMode(currentValue);\n });\n this.setTooltipMode(this.gos.get(\"tooltipTrigger\"));\n this.highlightTracker.addEventListener(\"itemHighlighted\", this.onHighlight);\n }\n onHighlight(event) {\n if (this.tooltipMode !== 1 /* FOCUS */) {\n return;\n }\n if (event.highlighted) {\n this.attemptToShowTooltip();\n } else {\n this.attemptToHideTooltip();\n }\n }\n setTooltipMode(tooltipTriggerMode = \"focus\") {\n this.tooltipMode = tooltipTriggerMode === \"focus\" ? 1 /* FOCUS */ : 0 /* HOVER */;\n }\n destroy() {\n this.highlightTracker.removeEventListener(\"itemHighlighted\", this.onHighlight);\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/agStack/tooltip/agTooltipComponent.ts\nvar AgTooltipComponent = class extends AgPopupComponent {\n constructor() {\n super({ tag: \"div\", cls: \"ag-tooltip\" });\n }\n // will need to type params\n init(params) {\n const { value } = params;\n const eGui = this.getGui();\n eGui.textContent = _toString(value);\n const locationKebabCase = params.location.replace(/([a-z])([A-Z0-9])/g, \"$1-$2\").toLowerCase();\n eGui.classList.add(`ag-${locationKebabCase}-tooltip`);\n }\n};\n\n// packages/ag-grid-community/src/agStack/tooltip/tooltip.css\nvar tooltip_default = \".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip),&:where(.ag-cell-formula-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}\";\n\n// packages/ag-grid-community/src/agStack/popup/basePopupService.ts\nvar instanceIdSeq = 0;\nvar WAIT_FOR_POPUP_CONTENT_RESIZE = 200;\nvar BasePopupService = class extends AgBeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"popupSvc\";\n this.popupList = [];\n }\n postConstruct() {\n this.addManagedEventListeners({ stylesChanged: this.handleThemeChange.bind(this) });\n }\n getPopupParent() {\n const ePopupParent = this.gos.get(\"popupParent\");\n if (ePopupParent) {\n return ePopupParent;\n }\n return this.getDefaultPopupParent();\n }\n positionPopupUnderMouseEvent(params) {\n const { ePopup, nudgeX, nudgeY, skipObserver } = params;\n this.positionPopup({\n ePopup,\n nudgeX,\n nudgeY,\n keepWithinBounds: true,\n skipObserver,\n updatePosition: () => this.calculatePointerAlign(params.mouseEvent),\n postProcessCallback: () => this.callPostProcessPopup(params.additionalParams, params.type, params.ePopup, null, params.mouseEvent)\n });\n }\n calculatePointerAlign(e) {\n const parentRect = this.getParentRect();\n return {\n x: e.clientX - parentRect.left,\n y: e.clientY - parentRect.top\n };\n }\n positionPopupByComponent(params) {\n const {\n ePopup,\n nudgeX,\n nudgeY,\n keepWithinBounds,\n eventSource,\n alignSide = \"left\",\n position = \"over\",\n type\n } = params;\n const sourceRect = eventSource.getBoundingClientRect();\n const parentRect = this.getParentRect();\n this.setAlignedTo(eventSource, ePopup);\n const updatePosition = () => {\n let x = sourceRect.left - parentRect.left;\n if (alignSide === \"right\") {\n x -= ePopup.offsetWidth - sourceRect.width;\n }\n let y;\n if (position === \"over\") {\n y = sourceRect.top - parentRect.top;\n this.setAlignedStyles(ePopup, \"over\");\n } else {\n this.setAlignedStyles(ePopup, \"under\");\n const alignSide2 = this.shouldRenderUnderOrAbove(ePopup, sourceRect, parentRect, params.nudgeY || 0);\n if (alignSide2 === \"under\") {\n y = sourceRect.top - parentRect.top + sourceRect.height;\n } else {\n y = sourceRect.top - ePopup.offsetHeight - (nudgeY || 0) * 2 - parentRect.top;\n }\n }\n return { x, y };\n };\n this.positionPopup({\n ePopup,\n nudgeX,\n nudgeY,\n keepWithinBounds,\n updatePosition,\n postProcessCallback: () => this.callPostProcessPopup(params.additionalParams, type, ePopup, eventSource, null)\n });\n }\n positionPopupForMenu(params) {\n const { eventSource, ePopup, event } = params;\n const sourceRect = eventSource.getBoundingClientRect();\n const parentRect = this.getParentRect();\n this.setAlignedTo(eventSource, ePopup);\n let minWidthSet = false;\n const updatePosition = () => {\n const y = this.keepXYWithinBounds(ePopup, sourceRect.top - parentRect.top, 0 /* Vertical */);\n const minWidth = ePopup.clientWidth > 0 ? ePopup.clientWidth : 200;\n if (!minWidthSet) {\n ePopup.style.minWidth = `${minWidth}px`;\n minWidthSet = true;\n }\n const widthOfParent = parentRect.right - parentRect.left;\n const maxX = widthOfParent - minWidth;\n let x;\n if (this.gos.get(\"enableRtl\")) {\n x = xLeftPosition();\n if (x < 0) {\n x = xRightPosition();\n this.setAlignedStyles(ePopup, \"left\");\n }\n if (x > maxX) {\n x = 0;\n this.setAlignedStyles(ePopup, \"right\");\n }\n } else {\n x = xRightPosition();\n if (x > maxX) {\n x = xLeftPosition();\n this.setAlignedStyles(ePopup, \"right\");\n }\n if (x < 0) {\n x = 0;\n this.setAlignedStyles(ePopup, \"left\");\n }\n }\n return { x, y };\n function xRightPosition() {\n return sourceRect.right - parentRect.left - 2;\n }\n function xLeftPosition() {\n return sourceRect.left - parentRect.left - minWidth;\n }\n };\n this.positionPopup({\n ePopup,\n keepWithinBounds: true,\n updatePosition,\n postProcessCallback: () => this.callPostProcessPopup(\n params.additionalParams,\n \"subMenu\",\n ePopup,\n eventSource,\n event instanceof MouseEvent ? event : void 0\n )\n });\n }\n shouldRenderUnderOrAbove(ePopup, targetCompRect, parentRect, nudgeY) {\n const spaceAvailableUnder = parentRect.bottom - targetCompRect.bottom;\n const spaceAvailableAbove = targetCompRect.top - parentRect.top;\n const spaceRequired = ePopup.offsetHeight + nudgeY;\n if (spaceAvailableUnder > spaceRequired) {\n return \"under\";\n }\n if (spaceAvailableAbove > spaceRequired || spaceAvailableAbove > spaceAvailableUnder) {\n return \"above\";\n }\n return \"under\";\n }\n setAlignedStyles(ePopup, positioned) {\n const popupIdx = this.getPopupIndex(ePopup);\n if (popupIdx === -1) {\n return;\n }\n const popup = this.popupList[popupIdx];\n const { alignedToElement } = popup;\n if (!alignedToElement) {\n return;\n }\n const positions = [\"right\", \"left\", \"over\", \"above\", \"under\"];\n for (const position of positions) {\n alignedToElement.classList.remove(`ag-has-popup-positioned-${position}`);\n ePopup.classList.remove(`ag-popup-positioned-${position}`);\n }\n if (!positioned) {\n return;\n }\n alignedToElement.classList.add(`ag-has-popup-positioned-${positioned}`);\n ePopup.classList.add(`ag-popup-positioned-${positioned}`);\n }\n setAlignedTo(eventSource, ePopup) {\n const popupIdx = this.getPopupIndex(ePopup);\n if (popupIdx !== -1) {\n const popup = this.popupList[popupIdx];\n popup.alignedToElement = eventSource;\n }\n }\n positionPopup(params) {\n const { ePopup, keepWithinBounds, nudgeX, nudgeY, skipObserver, updatePosition } = params;\n const lastSize = { width: 0, height: 0 };\n const updatePopupPosition = (fromResizeObserver = false) => {\n let { x, y } = updatePosition();\n if (fromResizeObserver && ePopup.clientWidth === lastSize.width && ePopup.clientHeight === lastSize.height) {\n return;\n }\n lastSize.width = ePopup.clientWidth;\n lastSize.height = ePopup.clientHeight;\n if (nudgeX) {\n x += nudgeX;\n }\n if (nudgeY) {\n y += nudgeY;\n }\n if (keepWithinBounds) {\n x = this.keepXYWithinBounds(ePopup, x, 1 /* Horizontal */);\n y = this.keepXYWithinBounds(ePopup, y, 0 /* Vertical */);\n }\n ePopup.style.left = `${x}px`;\n ePopup.style.top = `${y}px`;\n if (params.postProcessCallback) {\n params.postProcessCallback();\n }\n };\n updatePopupPosition();\n if (!skipObserver) {\n const resizeObserverDestroyFunc = _observeResize(this.beans, ePopup, () => updatePopupPosition(true));\n setTimeout(() => resizeObserverDestroyFunc(), WAIT_FOR_POPUP_CONTENT_RESIZE);\n }\n }\n getParentRect() {\n const eDocument = _getDocument(this.beans);\n let popupParent = this.getPopupParent();\n if (popupParent === eDocument.body) {\n popupParent = eDocument.documentElement;\n } else if (getComputedStyle(popupParent).position === \"static\") {\n popupParent = popupParent.offsetParent;\n }\n return _getElementRectWithOffset(popupParent);\n }\n keepXYWithinBounds(ePopup, position, direction) {\n const isVertical = direction === 0 /* Vertical */;\n const sizeProperty = isVertical ? \"clientHeight\" : \"clientWidth\";\n const anchorProperty = isVertical ? \"top\" : \"left\";\n const offsetProperty = isVertical ? \"height\" : \"width\";\n const scrollPositionProperty = isVertical ? \"scrollTop\" : \"scrollLeft\";\n const eDocument = _getDocument(this.beans);\n const docElement = eDocument.documentElement;\n const popupParent = this.getPopupParent();\n const popupRect = ePopup.getBoundingClientRect();\n const parentRect = popupParent.getBoundingClientRect();\n const documentRect = eDocument.documentElement.getBoundingClientRect();\n const isBody = popupParent === eDocument.body;\n const offsetSize = Math.ceil(popupRect[offsetProperty]);\n const getSize2 = isVertical ? _getAbsoluteHeight : _getAbsoluteWidth;\n let sizeOfParent = isBody ? getSize2(docElement) + docElement[scrollPositionProperty] : popupParent[sizeProperty];\n if (isBody) {\n sizeOfParent -= Math.abs(documentRect[anchorProperty] - parentRect[anchorProperty]);\n }\n const max = sizeOfParent - offsetSize;\n return Math.min(Math.max(position, 0), Math.max(max, 0));\n }\n addPopup(params) {\n const { eChild, ariaLabel, ariaOwns, alwaysOnTop, positionCallback, anchorToElement } = params;\n const pos = this.getPopupIndex(eChild);\n if (pos !== -1) {\n const popup = this.popupList[pos];\n return { hideFunc: popup.hideFunc };\n }\n this.initialisePopupPosition(eChild);\n const wrapperEl = this.createPopupWrapper(eChild, !!alwaysOnTop, ariaLabel, ariaOwns);\n const removeListeners = this.addEventListenersToPopup({ ...params, wrapperEl });\n if (positionCallback) {\n positionCallback();\n }\n this.addPopupToPopupList(eChild, wrapperEl, removeListeners, anchorToElement);\n return {\n hideFunc: removeListeners\n };\n }\n initialisePopupPosition(element) {\n const ePopupParent = this.getPopupParent();\n const ePopupParentRect = ePopupParent.getBoundingClientRect();\n if (!_exists(element.style.top)) {\n element.style.top = `${ePopupParentRect.top * -1}px`;\n }\n if (!_exists(element.style.left)) {\n element.style.left = `${ePopupParentRect.left * -1}px`;\n }\n }\n createPopupWrapper(element, alwaysOnTop, ariaLabel, ariaOwns) {\n const ePopupParent = this.getPopupParent();\n const { environment, gos } = this.beans;\n const eWrapper = _createAgElement({ tag: \"div\" });\n environment.applyThemeClasses(eWrapper);\n eWrapper.classList.add(\"ag-popup\");\n element.classList.add(gos.get(\"enableRtl\") ? \"ag-rtl\" : \"ag-ltr\", \"ag-popup-child\");\n if (!element.hasAttribute(\"role\")) {\n _setAriaRole(element, \"dialog\");\n }\n if (ariaLabel) {\n _setAriaLabel(element, ariaLabel);\n } else if (ariaOwns) {\n element.id || (element.id = `popup-component-${instanceIdSeq}`);\n _setAriaOwns(ariaOwns, element.id);\n }\n eWrapper.appendChild(element);\n ePopupParent.appendChild(eWrapper);\n if (alwaysOnTop) {\n this.setAlwaysOnTop(element, true);\n } else {\n this.bringPopupToFront(element);\n }\n return eWrapper;\n }\n addEventListenersToPopup(params) {\n const beans = this.beans;\n const eDocument = _getDocument(beans);\n const { wrapperEl, eChild: popupEl, closedCallback, afterGuiAttached, closeOnEsc, modal, ariaOwns } = params;\n let popupHidden = false;\n const hidePopupOnKeyboardEvent = (event) => {\n if (!wrapperEl.contains(_getActiveDomElement(beans))) {\n return;\n }\n const key = event.key;\n if (key === KeyCode.ESCAPE && !this.isStopPropagation(event)) {\n removeListeners({ keyboardEvent: event });\n }\n };\n const hidePopupOnMouseEvent = (event) => removeListeners({ mouseEvent: event });\n const hidePopupOnTouchEvent = (event) => removeListeners({ touchEvent: event });\n const removeListeners = (popupParams = {}) => {\n const { mouseEvent, touchEvent, keyboardEvent, forceHide } = popupParams;\n if (!forceHide && // we don't hide popup if the event was on the child, or any\n // children of this child\n (this.isEventFromCurrentPopup({ mouseEvent, touchEvent }, popupEl) || // this method should only be called once. the client can have different\n // paths, each one wanting to close, so this method may be called multiple times.\n popupHidden)) {\n return;\n }\n popupHidden = true;\n wrapperEl.remove();\n eDocument.removeEventListener(\"keydown\", hidePopupOnKeyboardEvent);\n eDocument.removeEventListener(\"mousedown\", hidePopupOnMouseEvent);\n eDocument.removeEventListener(\"touchstart\", hidePopupOnTouchEvent);\n eDocument.removeEventListener(\"contextmenu\", hidePopupOnMouseEvent);\n this.eventSvc.removeListener(\"dragStarted\", hidePopupOnMouseEvent);\n if (closedCallback) {\n closedCallback(mouseEvent || touchEvent || keyboardEvent);\n }\n this.removePopupFromPopupList(popupEl, ariaOwns);\n };\n if (afterGuiAttached) {\n afterGuiAttached({ hidePopup: removeListeners });\n }\n window.setTimeout(() => {\n if (closeOnEsc) {\n eDocument.addEventListener(\"keydown\", hidePopupOnKeyboardEvent);\n }\n if (modal) {\n eDocument.addEventListener(\"mousedown\", hidePopupOnMouseEvent);\n this.eventSvc.addListener(\"dragStarted\", hidePopupOnMouseEvent);\n eDocument.addEventListener(\"touchstart\", hidePopupOnTouchEvent);\n eDocument.addEventListener(\"contextmenu\", hidePopupOnMouseEvent);\n }\n }, 0);\n return removeListeners;\n }\n addPopupToPopupList(element, wrapperEl, removeListeners, anchorToElement) {\n this.popupList.push({\n element,\n wrapper: wrapperEl,\n hideFunc: removeListeners,\n instanceId: instanceIdSeq,\n isAnchored: !!anchorToElement\n });\n if (anchorToElement) {\n this.setPopupPositionRelatedToElement(element, anchorToElement);\n }\n instanceIdSeq = instanceIdSeq + 1;\n }\n getPopupIndex(el) {\n return this.popupList.findIndex((p) => p.element === el);\n }\n setPopupPositionRelatedToElement(popupEl, relativeElement) {\n const popupIndex = this.getPopupIndex(popupEl);\n if (popupIndex === -1) {\n return;\n }\n const popup = this.popupList[popupIndex];\n if (popup.stopAnchoringPromise) {\n popup.stopAnchoringPromise.then((destroyFunc) => destroyFunc && destroyFunc());\n }\n popup.stopAnchoringPromise = void 0;\n popup.isAnchored = false;\n if (!relativeElement) {\n return;\n }\n const destroyPositionTracker = this.keepPopupPositionedRelativeTo({\n element: relativeElement,\n ePopup: popupEl,\n hidePopup: popup.hideFunc\n });\n popup.stopAnchoringPromise = destroyPositionTracker;\n popup.isAnchored = true;\n return destroyPositionTracker;\n }\n removePopupFromPopupList(element, ariaOwns) {\n this.setAlignedStyles(element, null);\n this.setPopupPositionRelatedToElement(element, null);\n if (ariaOwns) {\n _setAriaOwns(ariaOwns, null);\n }\n this.popupList = this.popupList.filter((p) => p.element !== element);\n }\n keepPopupPositionedRelativeTo(params) {\n const eParent = this.getPopupParent();\n const parentRect = eParent.getBoundingClientRect();\n const { element, ePopup } = params;\n const sourceRect = element.getBoundingClientRect();\n const extractFromPixelValue = (pxSize) => Number.parseInt(pxSize.substring(0, pxSize.length - 1), 10);\n const createPosition = (prop, direction) => {\n const initialDiff = parentRect[prop] - sourceRect[prop];\n const initial = extractFromPixelValue(ePopup.style[prop]);\n return {\n initialDiff,\n lastDiff: initialDiff,\n initial,\n last: initial,\n direction\n };\n };\n const topPosition = createPosition(\"top\", 0 /* Vertical */);\n const leftPosition = createPosition(\"left\", 1 /* Horizontal */);\n const fwOverrides = this.beans.frameworkOverrides;\n return new AgPromise((resolve) => {\n fwOverrides.wrapIncoming(() => {\n _wrapInterval(() => {\n const pRect = eParent.getBoundingClientRect();\n const sRect = element.getBoundingClientRect();\n const elementNotInDom = sRect.top == 0 && sRect.left == 0 && sRect.height == 0 && sRect.width == 0;\n if (elementNotInDom) {\n params.hidePopup();\n return;\n }\n const calculateNewPosition = (position, prop) => {\n const current = extractFromPixelValue(ePopup.style[prop]);\n if (position.last !== current) {\n position.initial = current;\n position.last = current;\n }\n const currentDiff = pRect[prop] - sRect[prop];\n if (currentDiff != position.lastDiff) {\n const newValue = this.keepXYWithinBounds(\n ePopup,\n position.initial + position.initialDiff - currentDiff,\n position.direction\n );\n ePopup.style[prop] = `${newValue}px`;\n position.last = newValue;\n }\n position.lastDiff = currentDiff;\n };\n calculateNewPosition(topPosition, \"top\");\n calculateNewPosition(leftPosition, \"left\");\n }, 200).then((intervalId) => {\n const result = () => {\n if (intervalId != null) {\n window.clearInterval(intervalId);\n }\n };\n resolve(result);\n });\n }, \"popupPositioning\");\n });\n }\n isEventFromCurrentPopup(params, target) {\n const { mouseEvent, touchEvent } = params;\n const event = mouseEvent ? mouseEvent : touchEvent;\n if (!event) {\n return false;\n }\n const indexOfThisChild = this.getPopupIndex(target);\n if (indexOfThisChild === -1) {\n return false;\n }\n for (let i = indexOfThisChild; i < this.popupList.length; i++) {\n const popup = this.popupList[i];\n if (_isElementInEventPath(popup.element, event)) {\n return true;\n }\n }\n return this.isElementWithinCustomPopup(event.target);\n }\n isElementWithinCustomPopup(el) {\n const eDocument = _getDocument(this.beans);\n while (el && el !== eDocument.body) {\n if (el.classList.contains(\"ag-custom-component-popup\") || el.parentElement === null) {\n return true;\n }\n el = el.parentElement;\n }\n return false;\n }\n getWrapper(ePopup) {\n while (!ePopup.classList.contains(\"ag-popup\") && ePopup.parentElement) {\n ePopup = ePopup.parentElement;\n }\n return ePopup.classList.contains(\"ag-popup\") ? ePopup : null;\n }\n setAlwaysOnTop(ePopup, alwaysOnTop) {\n const eWrapper = this.getWrapper(ePopup);\n if (!eWrapper) {\n return;\n }\n eWrapper.classList.toggle(\"ag-always-on-top\", !!alwaysOnTop);\n if (alwaysOnTop) {\n this.bringPopupToFront(eWrapper);\n }\n }\n /** @returns true if moved */\n bringPopupToFront(ePopup) {\n const parent = this.getPopupParent();\n const popupList = Array.prototype.slice.call(parent.querySelectorAll(\".ag-popup\"));\n const popupLen = popupList.length;\n const eWrapper = this.getWrapper(ePopup);\n if (!eWrapper || popupLen <= 1 || !parent.contains(ePopup)) {\n return;\n }\n const standardPopupList = [];\n const alwaysOnTopList = [];\n for (const popup of popupList) {\n if (popup === eWrapper) {\n continue;\n }\n if (popup.classList.contains(\"ag-always-on-top\")) {\n alwaysOnTopList.push(popup);\n } else {\n standardPopupList.push(popup);\n }\n }\n const innerElsScrollMap = [];\n const onTopLength = alwaysOnTopList.length;\n const isPopupAlwaysOnTop = eWrapper.classList.contains(\"ag-always-on-top\");\n const shouldBeLast = isPopupAlwaysOnTop || !onTopLength;\n const targetList = shouldBeLast ? [...standardPopupList, ...alwaysOnTopList, eWrapper] : [...standardPopupList, eWrapper, ...alwaysOnTopList];\n for (let i = 0; i <= popupLen; i++) {\n const currentPopup = targetList[i];\n if (popupList[i] === targetList[i] || currentPopup === eWrapper) {\n continue;\n }\n const innerEls = currentPopup.querySelectorAll(\"div\");\n for (const el of innerEls) {\n if (el.scrollTop !== 0) {\n innerElsScrollMap.push([el, el.scrollTop]);\n }\n }\n if (i === 0) {\n parent.prepend(currentPopup);\n } else {\n targetList[i - 1].after(currentPopup);\n }\n }\n while (innerElsScrollMap.length) {\n const currentEl = innerElsScrollMap.pop();\n currentEl[0].scrollTop = currentEl[1];\n }\n }\n handleThemeChange(e) {\n if (e.themeChanged) {\n const environment = this.beans.environment;\n for (const popup of this.popupList) {\n environment.applyThemeClasses(popup.wrapper);\n }\n }\n }\n};\n\n// packages/ag-grid-community/src/widgets/popupService.ts\nvar PopupService = class extends BasePopupService {\n getDefaultPopupParent() {\n return this.beans.ctrlsSvc.get(\"gridCtrl\").getGui();\n }\n callPostProcessPopup(params, type, ePopup, eventSource, mouseEvent) {\n const callback = this.gos.getCallback(\"postProcessPopup\");\n if (callback) {\n const { column, rowNode } = params ?? {};\n const postProcessParams = {\n column,\n rowNode,\n ePopup,\n type,\n eventSource,\n mouseEvent\n };\n callback(postProcessParams);\n }\n }\n getActivePopups() {\n return this.popupList.map((popup) => popup.element);\n }\n hasAnchoredPopup() {\n return this.popupList.some((popup) => popup.isAnchored);\n }\n isStopPropagation(event) {\n return _isStopPropagationForAgGrid(event);\n }\n};\n\n// packages/ag-grid-community/src/widgets/popupModule.ts\nvar PopupModule = {\n moduleName: \"Popup\",\n version: VERSION,\n beans: [PopupService]\n};\n\n// packages/ag-grid-community/src/tooltip/tooltipFeature.ts\nfunction _isShowTooltipWhenTruncated(gos) {\n return gos.get(\"tooltipShowMode\") === \"whenTruncated\";\n}\nfunction _getShouldDisplayTooltip(gos, getElement2) {\n return _isShowTooltipWhenTruncated(gos) ? _isElementOverflowingCallback(getElement2) : void 0;\n}\n\n// packages/ag-grid-community/src/tooltip/tooltipService.ts\nvar getErrorTooltipMessage = (error, translate) => {\n const localisable = error;\n if (typeof localisable.getTranslatedMessage === \"function\") {\n return localisable.getTranslatedMessage(translate);\n }\n return error.message;\n};\nvar getEditErrorsForPosition = (beans, cellCtrl, translate) => {\n const { editModelSvc } = beans;\n const cellValidationErrors = editModelSvc?.getCellValidationModel()?.getCellValidation(cellCtrl)?.errorMessages;\n const rowValidationErrors = editModelSvc?.getRowValidationModel().getRowValidation(cellCtrl)?.errorMessages;\n const errors = cellValidationErrors || rowValidationErrors;\n return errors?.length ? errors.join(translate(\"tooltipValidationErrorSeparator\", \". \")) : void 0;\n};\nvar getCellTruncationCheck = (beans, ctrl) => {\n const isTooltipWhenTruncated = _isShowTooltipWhenTruncated(beans.gos);\n if (!isTooltipWhenTruncated) {\n return void 0;\n }\n if (ctrl.isCellRenderer()) {\n const colDef = ctrl.column.getColDef();\n const isGroupCellRenderer = !!colDef.showRowGroup || colDef.cellRenderer === \"agGroupCellRenderer\";\n if (!isGroupCellRenderer) {\n return void 0;\n }\n return _isElementOverflowingCallback(() => {\n const eCell = ctrl.eGui;\n return eCell.querySelector(\".ag-group-value\") || eCell.querySelector(\".ag-cell-value\") || eCell;\n });\n }\n return _isElementOverflowingCallback(() => {\n const eCell = ctrl.eGui;\n return eCell.children.length === 0 ? eCell : eCell.querySelector(\".ag-cell-value\");\n });\n};\nvar buildCellTooltipDisplayFunctions = (beans, ctrl, shouldDisplayTooltip) => {\n const { editSvc } = beans;\n const { column } = ctrl;\n const isCellTruncated = getCellTruncationCheck(beans, ctrl);\n const shouldDisplayCellTooltip = () => {\n if (editSvc?.isEditing(ctrl)) {\n return false;\n }\n if (!isCellTruncated) {\n return true;\n }\n if (!column.isTooltipEnabled()) {\n return false;\n }\n return isCellTruncated();\n };\n return {\n shouldDisplayDefault: shouldDisplayCellTooltip,\n shouldDisplayColumnTooltip: shouldDisplayCellTooltip,\n shouldDisplayCustomTooltip: shouldDisplayTooltip ?? shouldDisplayCellTooltip\n };\n};\nvar resolveCellTooltip = ({\n beans,\n ctrl,\n value,\n displayFunctions,\n translate\n}) => {\n const { editSvc, formula, gos } = beans;\n const { column, rowNode } = ctrl;\n if (formula?.active && column.isAllowFormula()) {\n const error = formula.getFormulaError(column, rowNode);\n if (error) {\n return {\n value: getErrorTooltipMessage(error, translate),\n location: \"cellFormula\",\n shouldDisplay: () => !!formula?.getFormulaError(column, rowNode)\n };\n }\n }\n const isEditing2 = !!editSvc?.isEditing(ctrl);\n if (!isEditing2) {\n const errorMessages = getEditErrorsForPosition(beans, ctrl, translate);\n if (errorMessages) {\n return {\n value: errorMessages,\n location: \"cellEditor\",\n shouldDisplay: () => !editSvc?.isEditing(ctrl) && !!getEditErrorsForPosition(beans, ctrl, translate)\n };\n }\n }\n const { shouldDisplayCustomTooltip, shouldDisplayColumnTooltip } = displayFunctions;\n if (value != null) {\n return { value, location: \"cell\", shouldDisplay: shouldDisplayCustomTooltip };\n }\n const colDef = column.getColDef();\n const data = rowNode.data;\n if (colDef.tooltipField && _exists(data)) {\n return {\n value: _getValueUsingField(data, colDef.tooltipField, column.isTooltipFieldContainsDots()),\n location: \"cell\",\n shouldDisplay: shouldDisplayColumnTooltip\n };\n }\n const valueGetter = colDef.tooltipValueGetter;\n if (valueGetter) {\n return {\n value: valueGetter(\n _addGridCommonParams(gos, {\n location: \"cell\",\n colDef: column.getColDef(),\n column,\n rowIndex: ctrl.cellPosition.rowIndex,\n node: rowNode,\n data: rowNode.data,\n value: ctrl.value,\n valueFormatted: ctrl.valueFormatted\n })\n ),\n location: \"cell\",\n shouldDisplay: shouldDisplayColumnTooltip\n };\n }\n return null;\n};\nvar TooltipService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"tooltipSvc\";\n }\n setupHeaderTooltip(existingTooltipFeature, ctrl, passedValue, shouldDisplayTooltip) {\n if (existingTooltipFeature) {\n ctrl.destroyBean(existingTooltipFeature);\n }\n const gos = this.gos;\n const isTooltipWhenTruncated = _isShowTooltipWhenTruncated(gos);\n const { column, eGui } = ctrl;\n const colDef = column.getColDef();\n if (!shouldDisplayTooltip && isTooltipWhenTruncated && !colDef.headerComponent) {\n shouldDisplayTooltip = _isElementOverflowingCallback(\n () => eGui.querySelector(\".ag-header-cell-text\")\n );\n }\n const location = \"header\";\n const headerLocation = \"header\";\n const valueFormatted = this.beans.colNames.getDisplayNameForColumn(column, headerLocation, true);\n const value = passedValue ?? valueFormatted;\n const tooltipCtrl = {\n getGui: () => eGui,\n getLocation: () => location,\n getTooltipValue: () => passedValue ?? colDef?.headerTooltipValueGetter?.(\n _addGridCommonParams(gos, { location, colDef, column, value, valueFormatted })\n ) ?? colDef?.headerTooltip,\n shouldDisplayTooltip,\n getAdditionalParams: () => ({\n column,\n colDef: column.getColDef()\n })\n };\n let tooltipFeature = this.createTooltipFeature(tooltipCtrl);\n if (tooltipFeature) {\n tooltipFeature = ctrl.createBean(tooltipFeature);\n ctrl.setRefreshFunction(\"tooltip\", () => tooltipFeature.refreshTooltip());\n }\n return tooltipFeature;\n }\n setupHeaderGroupTooltip(existingTooltipFeature, ctrl, passedValue, shouldDisplayTooltip) {\n if (existingTooltipFeature) {\n ctrl.destroyBean(existingTooltipFeature);\n }\n const gos = this.gos;\n const isTooltipWhenTruncated = _isShowTooltipWhenTruncated(gos);\n const { column, eGui } = ctrl;\n const colDef = column.getColGroupDef();\n if (!shouldDisplayTooltip && isTooltipWhenTruncated && !colDef?.headerGroupComponent) {\n shouldDisplayTooltip = _isElementOverflowingCallback(\n () => eGui.querySelector(\".ag-header-group-text\")\n );\n }\n const location = \"headerGroup\";\n const headerLocation = \"header\";\n const valueFormatted = this.beans.colNames.getDisplayNameForColumnGroup(column, headerLocation);\n const value = passedValue ?? valueFormatted;\n const tooltipCtrl = {\n getGui: () => eGui,\n getLocation: () => location,\n getTooltipValue: () => passedValue ?? colDef?.headerTooltipValueGetter?.(\n _addGridCommonParams(gos, { location, colDef, column, value, valueFormatted })\n ) ?? colDef?.headerTooltip,\n shouldDisplayTooltip,\n getAdditionalParams: () => {\n const additionalParams = {\n column\n };\n if (colDef) {\n additionalParams.colDef = colDef;\n }\n return additionalParams;\n }\n };\n const tooltipFeature = this.createTooltipFeature(tooltipCtrl);\n return tooltipFeature ? ctrl.createBean(tooltipFeature) : tooltipFeature;\n }\n enableCellTooltipFeature(ctrl, value, shouldDisplayTooltip) {\n const { beans } = this;\n const { column, rowNode } = ctrl;\n const displayFunctions = buildCellTooltipDisplayFunctions(beans, ctrl, shouldDisplayTooltip);\n const translate = this.getLocaleTextFunc();\n let resolvedTooltip = null;\n const resolveAndStore = () => {\n resolvedTooltip = resolveCellTooltip({\n beans,\n ctrl,\n value,\n displayFunctions,\n translate\n });\n return resolvedTooltip;\n };\n const getTooltipValue = () => resolveAndStore()?.value;\n const tooltipCtrl = {\n getGui: () => ctrl.eGui,\n getLocation: () => resolvedTooltip?.location ?? \"cell\",\n getTooltipValue,\n shouldDisplayTooltip: () => {\n const tooltip = resolvedTooltip ?? resolveAndStore();\n if (!tooltip) {\n return false;\n }\n return tooltip.shouldDisplay ? tooltip.shouldDisplay() : true;\n },\n getAdditionalParams: () => ({\n column,\n colDef: column.getColDef(),\n rowIndex: ctrl.cellPosition.rowIndex,\n node: rowNode,\n data: rowNode.data,\n valueFormatted: ctrl.valueFormatted\n })\n };\n return this.createTooltipFeature(tooltipCtrl, beans);\n }\n setupFullWidthRowTooltip(existingTooltipFeature, ctrl, value, shouldDisplayTooltip) {\n const tooltipParams = {\n getGui: () => ctrl.getFullWidthElement(),\n getTooltipValue: () => value,\n getLocation: () => \"fullWidthRow\",\n shouldDisplayTooltip\n };\n const beans = this.beans;\n const context = beans.context;\n if (existingTooltipFeature) {\n ctrl.destroyBean(existingTooltipFeature, context);\n }\n const tooltipFeature = this.createTooltipFeature(tooltipParams, beans);\n if (!tooltipFeature) {\n return;\n }\n return ctrl.createBean(tooltipFeature, context);\n }\n setupCellEditorTooltip(cellCtrl, editor) {\n const { beans } = this;\n const { context } = beans;\n const el = editor.getValidationElement?.(true) || !editor.isPopup?.() && cellCtrl.eGui;\n if (!el) {\n return;\n }\n const tooltipParams = {\n getGui: () => el,\n getTooltipValue: () => getEditErrorsForPosition(beans, cellCtrl, this.getLocaleTextFunc()),\n getLocation: () => \"cellEditor\",\n shouldDisplayTooltip: () => {\n const { editModelSvc } = beans;\n const rowValidationMap = editModelSvc?.getRowValidationModel()?.getRowValidationMap();\n const cellValidationMap = editModelSvc?.getCellValidationModel()?.getCellValidationMap();\n const hasRowValidationErrors = !!rowValidationMap && rowValidationMap.size > 0;\n const hasCellValidationErrors = !!cellValidationMap && cellValidationMap.size > 0;\n return hasRowValidationErrors || hasCellValidationErrors;\n }\n };\n const tooltipFeature = this.createTooltipFeature(tooltipParams, beans);\n if (!tooltipFeature) {\n return;\n }\n return cellCtrl.createBean(tooltipFeature, context);\n }\n initCol(column) {\n const { colDef } = column;\n column.tooltipEnabled = _exists(colDef.tooltipField) || _exists(colDef.tooltipValueGetter) || _exists(colDef.tooltipComponent);\n }\n createTooltipFeature(tooltipCtrl, beans) {\n return this.beans.registry.createDynamicBean(\"tooltipFeature\", false, tooltipCtrl, beans);\n }\n};\n\n// packages/ag-grid-community/src/tooltip/tooltipStateManager.ts\nvar TooltipStateManager = class extends BaseTooltipStateManager {\n createTooltipComp(params, callback) {\n const userDetails = _getTooltipCompDetails(this.beans.userCompFactory, params);\n userDetails?.newAgStackInstance().then(callback);\n }\n setEventHandlers(listener) {\n [this.onColumnMovedEventCallback] = this.addManagedEventListeners({\n columnMoved: listener\n });\n }\n clearEventHandlers() {\n this.onColumnMovedEventCallback?.();\n this.onColumnMovedEventCallback = void 0;\n }\n};\n\n// packages/ag-grid-community/src/tooltip/tooltipModule.ts\nvar TooltipModule = {\n moduleName: \"Tooltip\",\n version: VERSION,\n beans: [TooltipService],\n dynamicBeans: {\n tooltipFeature: AgTooltipFeature,\n highlightTooltipFeature: AgHighlightTooltipFeature,\n tooltipStateManager: TooltipStateManager\n },\n userComponents: {\n agTooltipComponent: AgTooltipComponent\n },\n dependsOn: [PopupModule],\n css: [tooltip_default]\n};\n\n// packages/ag-grid-community/src/undoRedo/undoRedoStack.ts\nvar UndoRedoAction = class {\n constructor(cellValueChanges) {\n this.cellValueChanges = cellValueChanges;\n }\n};\nvar RangeUndoRedoAction = class extends UndoRedoAction {\n constructor(cellValueChanges, initialRange, finalRange, ranges) {\n super(cellValueChanges);\n this.initialRange = initialRange;\n this.finalRange = finalRange;\n this.ranges = ranges;\n }\n};\nvar DEFAULT_STACK_SIZE = 10;\nvar UndoRedoStack = class {\n constructor(maxStackSize) {\n this.actionStack = [];\n this.maxStackSize = maxStackSize ? maxStackSize : DEFAULT_STACK_SIZE;\n this.actionStack = new Array(this.maxStackSize);\n }\n pop() {\n return this.actionStack.pop();\n }\n push(item) {\n const shouldAddActions = item.cellValueChanges && item.cellValueChanges.length > 0;\n if (!shouldAddActions) {\n return;\n }\n if (this.actionStack.length === this.maxStackSize) {\n this.actionStack.shift();\n }\n this.actionStack.push(item);\n }\n clear() {\n this.actionStack = [];\n }\n getCurrentStackSize() {\n return this.actionStack.length;\n }\n};\n\n// packages/ag-grid-community/src/undoRedo/undoRedoService.ts\nvar UndoRedoService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"undoRedo\";\n this.cellValueChanges = [];\n this.activeCellEdit = null;\n this.activeRowEdit = null;\n this.isPasting = false;\n this.isRangeInAction = false;\n this.batchEditing = false;\n this.bulkEditing = false;\n this.onCellValueChanged = (event) => {\n const eventCell = { column: event.column, rowIndex: event.rowIndex, rowPinned: event.rowPinned };\n const isCellEditing = this.activeCellEdit !== null && _areCellsEqual(this.activeCellEdit, eventCell);\n const isRowEditing = this.activeRowEdit !== null && _isSameRow(this.activeRowEdit, eventCell);\n const shouldCaptureAction = isCellEditing || isRowEditing || this.isPasting || this.isRangeInAction;\n if (!shouldCaptureAction) {\n return;\n }\n const { rowPinned, rowIndex, column, oldValue, value } = event;\n const cellValueChange = {\n rowPinned,\n rowIndex,\n columnId: column.getColId(),\n newValue: value,\n oldValue\n };\n this.cellValueChanges.push(cellValueChange);\n };\n this.clearStacks = () => {\n this.undoStack.clear();\n this.redoStack.clear();\n };\n }\n postConstruct() {\n const { gos, ctrlsSvc } = this.beans;\n if (!gos.get(\"undoRedoCellEditing\")) {\n return;\n }\n const undoRedoLimit = gos.get(\"undoRedoCellEditingLimit\");\n if (undoRedoLimit <= 0) {\n return;\n }\n this.undoStack = new UndoRedoStack(undoRedoLimit);\n this.redoStack = new UndoRedoStack(undoRedoLimit);\n this.addListeners();\n const listener = this.clearStacks.bind(this);\n this.addManagedEventListeners({\n cellValueChanged: this.onCellValueChanged.bind(this),\n // undo / redo is restricted to actual editing so we clear the stacks when other operations are\n // performed that change the order of the row / cols.\n modelUpdated: (e) => {\n if (!e.keepUndoRedoStack) {\n this.clearStacks();\n }\n },\n columnPivotModeChanged: listener,\n newColumnsLoaded: listener,\n columnGroupOpened: listener,\n columnRowGroupChanged: listener,\n columnMoved: listener,\n columnPinned: listener,\n columnVisible: listener,\n rowDragEnd: listener\n });\n ctrlsSvc.whenReady(this, (p) => {\n this.gridBodyCtrl = p.gridBodyCtrl;\n });\n }\n getCurrentUndoStackSize() {\n return this.undoStack?.getCurrentStackSize() ?? 0;\n }\n getCurrentRedoStackSize() {\n return this.redoStack?.getCurrentStackSize() ?? 0;\n }\n undo(source) {\n const { eventSvc, undoStack, redoStack } = this;\n eventSvc.dispatchEvent({\n type: \"undoStarted\",\n source\n });\n const operationPerformed = this.undoRedo(undoStack, redoStack, \"initialRange\", \"oldValue\", \"undo\");\n eventSvc.dispatchEvent({\n type: \"undoEnded\",\n source,\n operationPerformed\n });\n }\n redo(source) {\n const { eventSvc, undoStack, redoStack } = this;\n eventSvc.dispatchEvent({\n type: \"redoStarted\",\n source\n });\n const operationPerformed = this.undoRedo(redoStack, undoStack, \"finalRange\", \"newValue\", \"redo\");\n eventSvc.dispatchEvent({\n type: \"redoEnded\",\n source,\n operationPerformed\n });\n }\n undoRedo(undoRedoStack, opposingUndoRedoStack, rangeProperty, cellValueChangeProperty, source) {\n if (!undoRedoStack) {\n return false;\n }\n const undoRedoAction = undoRedoStack.pop();\n if (!undoRedoAction?.cellValueChanges) {\n return false;\n }\n this.processAction(\n undoRedoAction,\n (cellValueChange) => cellValueChange[cellValueChangeProperty],\n source\n );\n if (undoRedoAction instanceof RangeUndoRedoAction) {\n this.processRange(undoRedoAction.ranges || [undoRedoAction[rangeProperty]]);\n } else {\n this.processCell(undoRedoAction.cellValueChanges);\n }\n opposingUndoRedoStack.push(undoRedoAction);\n return true;\n }\n processAction(action, valueExtractor, source) {\n const { changeDetectionSvc } = this.beans;\n changeDetectionSvc?.beginDeferred();\n try {\n for (const cellValueChange of action.cellValueChanges) {\n const { rowIndex, rowPinned, columnId } = cellValueChange;\n const rowPosition = { rowIndex, rowPinned };\n const currentRow = _getRowNode(this.beans, rowPosition);\n if (!currentRow?.displayed) {\n continue;\n }\n currentRow.setDataValue(columnId, valueExtractor(cellValueChange), source);\n }\n } finally {\n changeDetectionSvc?.endDeferred();\n }\n }\n processRange(ranges) {\n let lastFocusedCell;\n const rangeSvc = this.beans.rangeSvc;\n rangeSvc.removeAllCellRanges(true);\n ranges.forEach((range, idx) => {\n if (!range) {\n return;\n }\n const startRow = range.startRow;\n const endRow = range.endRow;\n if (idx === ranges.length - 1) {\n lastFocusedCell = {\n rowPinned: startRow.rowPinned,\n rowIndex: startRow.rowIndex,\n columnId: range.startColumn.getColId()\n };\n this.setLastFocusedCell(lastFocusedCell);\n }\n const cellRangeParams = {\n rowStartIndex: startRow.rowIndex,\n rowStartPinned: startRow.rowPinned,\n rowEndIndex: endRow.rowIndex,\n rowEndPinned: endRow.rowPinned,\n columnStart: range.startColumn,\n columns: range.columns\n };\n rangeSvc.addCellRange(cellRangeParams);\n });\n }\n processCell(cellValueChanges) {\n const cellValueChange = cellValueChanges[0];\n const { rowIndex, rowPinned } = cellValueChange;\n const rowPosition = { rowIndex, rowPinned };\n const row = _getRowNode(this.beans, rowPosition);\n const lastFocusedCell = {\n rowPinned: cellValueChange.rowPinned,\n rowIndex: row.rowIndex,\n columnId: cellValueChange.columnId\n };\n this.setLastFocusedCell(lastFocusedCell);\n }\n setLastFocusedCell(lastFocusedCell) {\n const { rowIndex, columnId, rowPinned } = lastFocusedCell;\n const { colModel, focusSvc, rangeSvc } = this.beans;\n const column = colModel.getCol(columnId);\n if (!column) {\n return;\n }\n const { scrollFeature } = this.gridBodyCtrl;\n scrollFeature.ensureIndexVisible(rowIndex);\n scrollFeature.ensureColumnVisible(column);\n const cellPosition = { rowIndex, column, rowPinned };\n focusSvc.setFocusedCell({ ...cellPosition, forceBrowserFocus: true });\n rangeSvc?.setRangeToCell(cellPosition);\n }\n addListeners() {\n this.addManagedEventListeners({\n rowEditingStarted: (e) => {\n this.activeRowEdit = { rowIndex: e.rowIndex, rowPinned: e.rowPinned };\n },\n rowEditingStopped: () => {\n const action = new UndoRedoAction(this.cellValueChanges);\n this.pushActionsToUndoStack(action);\n this.activeRowEdit = null;\n },\n cellEditingStarted: (e) => {\n this.activeCellEdit = { column: e.column, rowIndex: e.rowIndex, rowPinned: e.rowPinned };\n },\n cellEditingStopped: (e) => {\n this.activeCellEdit = null;\n const shouldPushAction = e.valueChanged && !this.activeRowEdit && !this.isPasting && !this.isRangeInAction;\n if (shouldPushAction) {\n const action = new UndoRedoAction(this.cellValueChanges);\n this.pushActionsToUndoStack(action);\n }\n },\n pasteStart: () => {\n this.isPasting = true;\n },\n pasteEnd: () => {\n const action = new UndoRedoAction(this.cellValueChanges);\n this.pushActionsToUndoStack(action);\n this.isPasting = false;\n },\n fillStart: () => {\n this.isRangeInAction = true;\n },\n fillEnd: (event) => {\n const action = new RangeUndoRedoAction(this.cellValueChanges, event.initialRange, event.finalRange);\n this.pushActionsToUndoStack(action);\n this.isRangeInAction = false;\n },\n keyShortcutChangedCellStart: () => {\n this.isRangeInAction = true;\n },\n keyShortcutChangedCellEnd: () => {\n let action;\n const { rangeSvc, gos } = this.beans;\n if (rangeSvc && _isCellSelectionEnabled(gos)) {\n action = new RangeUndoRedoAction(this.cellValueChanges, void 0, void 0, [\n ...rangeSvc.getCellRanges()\n ]);\n } else {\n action = new UndoRedoAction(this.cellValueChanges);\n }\n this.pushActionsToUndoStack(action);\n this.isRangeInAction = false;\n },\n batchEditingStarted: () => this.startBigChange(\"batchEditing\"),\n batchEditingStopped: ({ changes }) => this.stopBigChange(\"batchEditing\", changes),\n bulkEditingStarted: () => this.startBigChange(\"bulkEditing\"),\n bulkEditingStopped: ({ changes }) => this.stopBigChange(\"bulkEditing\", changes)\n });\n }\n startBigChange(key) {\n this.updateBigChange(key, true);\n }\n updateBigChange(key, value) {\n if (key === \"bulkEditing\") {\n this.bulkEditing = value;\n } else {\n this.batchEditing = value;\n }\n }\n stopBigChange(key, changes) {\n if (key === \"bulkEditing\" && !this.bulkEditing || key === \"batchEditing\" && !this.batchEditing) {\n return;\n }\n this.updateBigChange(key, false);\n if (changes?.length === 0) {\n return;\n }\n const action = new UndoRedoAction(changes ?? []);\n this.pushActionsToUndoStack(action);\n this.cellValueChanges = [];\n }\n pushActionsToUndoStack(action) {\n this.undoStack.push(action);\n this.cellValueChanges = [];\n this.redoStack.clear();\n }\n};\n\n// packages/ag-grid-community/src/edit/cell-editing.css\nvar cell_editing_default = \".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) .ag-text-area-input{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}\";\n\n// packages/ag-grid-community/src/edit/cellEditors/checkboxCellEditor.ts\nvar CheckboxCellEditorElement = {\n tag: \"div\",\n cls: \"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit\",\n children: [\n {\n tag: \"ag-checkbox\",\n ref: \"eEditor\",\n role: \"presentation\"\n }\n ]\n};\nvar CheckboxCellEditor = class extends AgAbstractCellEditor {\n constructor() {\n super(CheckboxCellEditorElement, [AgCheckboxSelector]);\n this.eEditor = RefPlaceholder;\n }\n initialiseEditor(params) {\n this.agSetEditValue(params.value);\n const inputEl = this.eEditor.getInputElement();\n inputEl.setAttribute(\"tabindex\", \"-1\");\n this.addManagedListeners(this.eEditor, {\n fieldValueChanged: (event) => this.setAriaLabel(event.selected)\n });\n }\n agSetEditValue(value) {\n this.params.value = value;\n const isSelected = value ?? void 0;\n this.eEditor.setValue(isSelected, true);\n this.setAriaLabel(isSelected);\n }\n getValue() {\n return this.eEditor.getValue();\n }\n focusIn() {\n this.eEditor.getFocusableElement().focus();\n }\n afterGuiAttached() {\n if (this.params.cellStartedEdit) {\n this.focusIn();\n }\n }\n isPopup() {\n return false;\n }\n setAriaLabel(isSelected) {\n const translate = this.getLocaleTextFunc();\n const stateName = _getAriaCheckboxStateName(translate, isSelected);\n const ariaLabel = translate(\"ariaToggleCellValue\", \"Press SPACE to toggle cell value\");\n this.eEditor.setInputAriaLabel(`${ariaLabel} (${stateName})`);\n }\n getValidationElement(tooltip) {\n return tooltip ? this.params.eGridCell : this.eEditor.getInputElement();\n }\n getValidationErrors() {\n const { params } = this;\n const { getValidationErrors } = params;\n const value = this.getValue();\n if (!getValidationErrors) {\n return null;\n }\n return getValidationErrors({\n value,\n internalErrors: null,\n cellEditorParams: params\n });\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agInputTextField.ts\nvar AgInputTextField = class extends AgAbstractInputField {\n constructor(config, className = \"ag-text-field\", inputType = \"text\") {\n super(config, className, inputType);\n }\n postConstruct() {\n super.postConstruct();\n if (this.config.allowedCharPattern) {\n this.preventDisallowedCharacters();\n }\n }\n setValue(value, silent) {\n const eInput = this.eInput;\n if (eInput.value !== value) {\n eInput.value = _exists(value) ? value : \"\";\n }\n return super.setValue(value, silent);\n }\n /** Used to set an initial value into the input without necessarily setting `this.value` or triggering events (e.g. to set an invalid value) */\n setStartValue(value) {\n this.setValue(value, true);\n }\n setCustomValidity(message) {\n const eInput = this.eInput;\n const isInvalid = message.length > 0;\n eInput.setCustomValidity(message);\n if (isInvalid) {\n eInput.reportValidity();\n }\n _setAriaInvalid(eInput, isInvalid);\n }\n preventDisallowedCharacters() {\n const pattern = new RegExp(`[${this.config.allowedCharPattern}]`);\n const preventCharacters = (event) => {\n if (!_isEventFromPrintableCharacter(event)) {\n return;\n }\n if (event.key && !pattern.test(event.key)) {\n event.preventDefault();\n }\n };\n this.addManagedListeners(this.eInput, {\n keydown: preventCharacters,\n paste: (e) => {\n const text = e.clipboardData?.getData(\"text\");\n if (text?.split(\"\").some((c) => !pattern.test(c))) {\n e.preventDefault();\n }\n }\n });\n }\n};\nvar AgInputTextFieldSelector = {\n selector: \"AG-INPUT-TEXT-FIELD\",\n component: AgInputTextField\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agInputDateField.ts\nvar AgInputDateField = class extends AgInputTextField {\n constructor(config) {\n super(config, \"ag-date-field\", \"date\");\n }\n postConstruct() {\n super.postConstruct();\n const usingSafari = _isBrowserSafari();\n this.addManagedListeners(this.eInput, {\n wheel: this.onWheel.bind(this),\n mousedown: () => {\n if (this.isDisabled() || usingSafari) {\n return;\n }\n this.eInput.focus();\n }\n });\n this.eInput.step = \"any\";\n }\n onWheel(e) {\n if (_getActiveDomElement(this.beans) === this.eInput) {\n e.preventDefault();\n }\n }\n setMin(minDate) {\n const min = minDate instanceof Date ? _serialiseDate(minDate ?? null, !!this.includeTime) ?? void 0 : minDate;\n if (this.min === min) {\n return this;\n }\n this.min = min;\n _addOrRemoveAttribute(this.eInput, \"min\", min);\n return this;\n }\n setMax(maxDate) {\n const max = maxDate instanceof Date ? _serialiseDate(maxDate ?? null, !!this.includeTime) ?? void 0 : maxDate;\n if (this.max === max) {\n return this;\n }\n this.max = max;\n _addOrRemoveAttribute(this.eInput, \"max\", max);\n return this;\n }\n setStep(step) {\n if (this.step === step) {\n return this;\n }\n this.step = step;\n _addOrRemoveAttribute(this.eInput, \"step\", step);\n return this;\n }\n setIncludeTime(includeTime) {\n if (this.includeTime === includeTime) {\n return this;\n }\n this.includeTime = includeTime;\n super.setInputType(includeTime ? \"datetime-local\" : \"date\");\n if (includeTime) {\n this.setStep(1);\n }\n return this;\n }\n getDate() {\n if (!this.eInput.validity.valid) {\n return void 0;\n }\n return _parseDateTimeFromString(this.getValue()) ?? void 0;\n }\n setDate(date, silent) {\n this.setValue(_serialiseDate(date ?? null, this.includeTime), silent);\n }\n};\nvar AgInputDateFieldSelector = {\n selector: \"AG-INPUT-DATE-FIELD\",\n component: AgInputDateField\n};\n\n// packages/ag-grid-community/src/edit/cellEditors/simpleCellEditor.ts\nvar SimpleCellEditor = class extends AgAbstractCellEditor {\n constructor(cellEditorInput) {\n super();\n this.cellEditorInput = cellEditorInput;\n this.eEditor = RefPlaceholder;\n }\n initialiseEditor(params) {\n const { cellEditorInput } = this;\n this.setTemplate(\n { tag: \"div\", cls: \"ag-cell-edit-wrapper\", children: [cellEditorInput.getTemplate()] },\n cellEditorInput.getAgComponents()\n );\n const { eEditor } = this;\n const { cellStartedEdit, eventKey, suppressPreventDefault } = params;\n eEditor.getInputElement().setAttribute(\"title\", \"\");\n cellEditorInput.init(eEditor, params);\n let startValue;\n let shouldSetStartValue = true;\n if (cellStartedEdit) {\n this.focusAfterAttached = true;\n if (eventKey === KeyCode.BACKSPACE || eventKey === KeyCode.DELETE) {\n startValue = \"\";\n } else if (eventKey && eventKey.length === 1) {\n if (suppressPreventDefault) {\n shouldSetStartValue = false;\n } else {\n startValue = eventKey;\n }\n } else {\n startValue = cellEditorInput.getStartValue();\n if (eventKey !== KeyCode.F2) {\n this.highlightAllOnFocus = true;\n }\n }\n } else {\n this.focusAfterAttached = false;\n startValue = cellEditorInput.getStartValue();\n }\n if (shouldSetStartValue && startValue != null) {\n eEditor.setStartValue(startValue);\n }\n this.addGuiEventListener(\"keydown\", (event) => {\n const { key } = event;\n if (key === KeyCode.PAGE_UP || key === KeyCode.PAGE_DOWN) {\n event.preventDefault();\n }\n });\n }\n afterGuiAttached() {\n const translate = this.getLocaleTextFunc();\n const eInput = this.eEditor;\n eInput.setInputAriaLabel(translate(\"ariaInputEditor\", \"Input Editor\"));\n if (!this.focusAfterAttached) {\n return;\n }\n if (!_isBrowserSafari()) {\n eInput.getFocusableElement().focus();\n }\n const inputEl = eInput.getInputElement();\n if (this.highlightAllOnFocus) {\n inputEl.select();\n } else {\n this.cellEditorInput.setCaret?.();\n }\n }\n // gets called when tabbing through cells and in full row edit mode\n focusIn() {\n const { eEditor } = this;\n const focusEl = eEditor.getFocusableElement();\n const inputEl = eEditor.getInputElement();\n focusEl.focus();\n inputEl.select();\n }\n getValue() {\n return this.cellEditorInput.getValue();\n }\n agSetEditValue(value) {\n this.params.value = value;\n const startValue = this.cellEditorInput.getStartValue();\n this.eEditor.setStartValue(startValue ?? null);\n }\n isPopup() {\n return false;\n }\n getValidationElement() {\n return this.eEditor.getInputElement();\n }\n getValidationErrors() {\n return this.cellEditorInput.getValidationErrors();\n }\n};\n\n// packages/ag-grid-community/src/edit/cellEditors/dateCellEditor.ts\nvar DateCellElement = {\n tag: \"ag-input-date-field\",\n ref: \"eEditor\",\n cls: \"ag-cell-editor\"\n};\nvar DateCellEditorInput = class {\n constructor(getDataTypeService, getLocaleTextFunc) {\n this.getDataTypeService = getDataTypeService;\n this.getLocaleTextFunc = getLocaleTextFunc;\n }\n getTemplate() {\n return DateCellElement;\n }\n getAgComponents() {\n return [AgInputDateFieldSelector];\n }\n init(eEditor, params) {\n this.eEditor = eEditor;\n this.params = params;\n const { min, max, step, colDef } = params;\n if (min != null) {\n eEditor.setMin(min);\n }\n if (max != null) {\n eEditor.setMax(max);\n }\n if (step != null) {\n eEditor.setStep(step);\n }\n this.includeTime = params.includeTime ?? this.getDataTypeService()?.getDateIncludesTimeFlag?.(colDef.cellDataType);\n if (this.includeTime != null) {\n eEditor.setIncludeTime(this.includeTime);\n }\n }\n getValidationErrors() {\n const eInput = this.eEditor.getInputElement();\n const value = eInput.valueAsDate;\n const { params } = this;\n const { min, max, getValidationErrors } = params;\n let internalErrors = [];\n const translate = this.getLocaleTextFunc();\n if (value instanceof Date && !isNaN(value.getTime())) {\n if (min) {\n const minValue = min instanceof Date ? min : new Date(min);\n if (value < minValue) {\n const minDateString = minValue.toLocaleDateString();\n internalErrors.push(\n translate(\"minDateValidation\", `Date must be after ${minDateString}`, [minDateString])\n );\n }\n }\n if (max) {\n const maxValue = max instanceof Date ? max : new Date(max);\n if (value > maxValue) {\n const maxDateString = maxValue.toLocaleDateString();\n internalErrors.push(\n translate(\"maxDateValidation\", `Date must be before ${maxDateString}`, [maxDateString])\n );\n }\n }\n }\n if (!internalErrors.length) {\n internalErrors = null;\n }\n if (getValidationErrors) {\n return getValidationErrors({ value, cellEditorParams: params, internalErrors });\n }\n return internalErrors;\n }\n getValue() {\n const { eEditor, params } = this;\n const value = eEditor.getDate();\n if (!_exists(value) && !_exists(params.value)) {\n return params.value;\n }\n return value ?? null;\n }\n getStartValue() {\n const { value } = this.params;\n if (!(value instanceof Date)) {\n return void 0;\n }\n return _serialiseDate(value, this.includeTime ?? false);\n }\n};\nvar DateCellEditor = class extends SimpleCellEditor {\n constructor() {\n super(\n new DateCellEditorInput(\n () => this.beans.dataTypeSvc,\n () => this.getLocaleTextFunc()\n )\n );\n }\n};\n\n// packages/ag-grid-community/src/edit/cellEditors/dateStringCellEditor.ts\nvar DateStringCellElement = {\n tag: \"ag-input-date-field\",\n ref: \"eEditor\",\n cls: \"ag-cell-editor\"\n};\nvar DateStringCellEditorInput = class {\n constructor(getDataTypeService, getLocaleTextFunc) {\n this.getDataTypeService = getDataTypeService;\n this.getLocaleTextFunc = getLocaleTextFunc;\n }\n getTemplate() {\n return DateStringCellElement;\n }\n getAgComponents() {\n return [AgInputDateFieldSelector];\n }\n init(eEditor, params) {\n this.eEditor = eEditor;\n this.params = params;\n const { min, max, step, colDef } = params;\n if (min != null) {\n eEditor.setMin(min);\n }\n if (max != null) {\n eEditor.setMax(max);\n }\n if (step != null) {\n eEditor.setStep(step);\n }\n this.includeTime = params.includeTime ?? this.getDataTypeService()?.getDateIncludesTimeFlag?.(colDef.cellDataType);\n if (this.includeTime != null) {\n eEditor.setIncludeTime(this.includeTime);\n }\n }\n getValidationErrors() {\n const { eEditor, params } = this;\n const raw = eEditor.getInputElement().value;\n const value = this.formatDate(this.parseDate(raw ?? void 0));\n const { min, max, getValidationErrors } = params;\n let internalErrors = [];\n if (value) {\n const date = new Date(value);\n const translate = this.getLocaleTextFunc();\n if (min) {\n const minDate = new Date(min);\n if (date < minDate) {\n const minDateString = minDate.toLocaleDateString();\n internalErrors.push(\n translate(\"minDateValidation\", `Date must be after ${minDateString}`, [minDateString])\n );\n }\n }\n if (max) {\n const maxDate = new Date(max);\n if (date > maxDate) {\n const maxDateString = maxDate.toLocaleDateString();\n internalErrors.push(\n translate(\"maxDateValidation\", `Date must be before ${maxDateString}`, [maxDateString])\n );\n }\n }\n }\n if (!internalErrors.length) {\n internalErrors = null;\n }\n if (getValidationErrors) {\n return getValidationErrors({\n value: this.getValue(),\n cellEditorParams: params,\n internalErrors\n });\n }\n return internalErrors;\n }\n getValue() {\n const { params, eEditor } = this;\n const value = this.formatDate(eEditor.getDate());\n if (!_exists(value) && !_exists(params.value)) {\n return params.value;\n }\n return params.parseValue(value ?? \"\");\n }\n getStartValue() {\n return _serialiseDate(this.parseDate(this.params.value ?? void 0) ?? null, this.includeTime ?? false);\n }\n parseDate(value) {\n const dataTypeSvc = this.getDataTypeService();\n return dataTypeSvc ? dataTypeSvc.getDateParserFunction(this.params.column)(value) : _parseDateTimeFromString(value) ?? void 0;\n }\n formatDate(value) {\n const dataTypeSvc = this.getDataTypeService();\n return dataTypeSvc ? dataTypeSvc.getDateFormatterFunction(this.params.column)(value) : _serialiseDate(value ?? null, this.includeTime ?? false) ?? void 0;\n }\n};\nvar DateStringCellEditor = class extends SimpleCellEditor {\n constructor() {\n super(\n new DateStringCellEditorInput(\n () => this.beans.dataTypeSvc,\n () => this.getLocaleTextFunc()\n )\n );\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agInputTextArea.ts\nvar AgInputTextArea = class extends AgAbstractInputField {\n constructor(config) {\n super(config, \"ag-text-area\", null, \"textarea\");\n }\n setValue(value, silent) {\n const ret = super.setValue(value, silent);\n this.eInput.value = value;\n return ret;\n }\n setCols(cols) {\n this.eInput.cols = cols;\n return this;\n }\n setRows(rows) {\n this.eInput.rows = rows;\n return this;\n }\n};\nvar AgInputTextAreaSelector = {\n selector: \"AG-INPUT-TEXT-AREA\",\n component: AgInputTextArea\n};\n\n// packages/ag-grid-community/src/edit/cellEditors/largeTextCellEditor.ts\nvar LargeTextCellElement = {\n tag: \"div\",\n cls: \"ag-large-text\",\n children: [\n {\n tag: \"ag-input-text-area\",\n ref: \"eEditor\",\n cls: \"ag-large-text-input\"\n }\n ]\n};\nvar LargeTextCellEditor = class extends AgAbstractCellEditor {\n constructor() {\n super(LargeTextCellElement, [AgInputTextAreaSelector]);\n this.eEditor = RefPlaceholder;\n }\n initialiseEditor(params) {\n const { eEditor } = this;\n const { cellStartedEdit, eventKey, maxLength, cols, rows } = params;\n this.focusAfterAttached = cellStartedEdit;\n eEditor.getInputElement().setAttribute(\"title\", \"\");\n eEditor.setMaxLength(maxLength || 200).setCols(cols || 60).setRows(rows || 10);\n let startValue;\n if (cellStartedEdit) {\n this.focusAfterAttached = true;\n if (eventKey === KeyCode.BACKSPACE || eventKey === KeyCode.DELETE) {\n startValue = \"\";\n } else if (eventKey && eventKey.length === 1) {\n startValue = eventKey;\n } else {\n startValue = this.getStartValue(params);\n if (eventKey !== KeyCode.F2) {\n this.highlightAllOnFocus = true;\n }\n }\n } else {\n this.focusAfterAttached = false;\n startValue = this.getStartValue(params);\n }\n if (startValue != null) {\n eEditor.setValue(startValue, true);\n }\n this.addGuiEventListener(\"keydown\", this.onKeyDown.bind(this));\n this.activateTabIndex();\n }\n getStartValue(params) {\n const { value } = params;\n return value?.toString() ?? value;\n }\n agSetEditValue(value) {\n this.params.value = value;\n const startValue = this.getStartValue(this.params);\n this.eEditor.setValue(startValue ?? \"\", true);\n }\n onKeyDown(event) {\n const key = event.key;\n if (key === KeyCode.LEFT || key === KeyCode.UP || key === KeyCode.RIGHT || key === KeyCode.DOWN || event.shiftKey && key === KeyCode.ENTER) {\n event.stopPropagation();\n }\n }\n afterGuiAttached() {\n const { eEditor, focusAfterAttached, highlightAllOnFocus } = this;\n const translate = this.getLocaleTextFunc();\n eEditor.setInputAriaLabel(translate(\"ariaInputEditor\", \"Input Editor\"));\n if (focusAfterAttached) {\n eEditor.getFocusableElement().focus();\n if (highlightAllOnFocus) {\n eEditor.getInputElement().select();\n }\n }\n }\n getValue() {\n const { eEditor, params } = this;\n const { value } = params;\n const editorValue = eEditor.getValue();\n if (!_exists(editorValue) && !_exists(value)) {\n return value;\n }\n return params.parseValue(editorValue);\n }\n getValidationElement() {\n return this.eEditor.getInputElement();\n }\n getValidationErrors() {\n const { params } = this;\n const { maxLength, getValidationErrors } = params;\n const translate = this.getLocaleTextFunc();\n const value = this.getValue();\n let internalErrors = [];\n if (typeof value === \"string\" && maxLength != null && value.length > maxLength) {\n internalErrors.push(\n translate(\"maxLengthValidation\", `Must be ${maxLength} characters or fewer.`, [String(maxLength)])\n );\n }\n if (!internalErrors.length) {\n internalErrors = null;\n }\n if (getValidationErrors) {\n return getValidationErrors({\n value,\n internalErrors,\n cellEditorParams: params\n });\n }\n return internalErrors;\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agInputNumberField.ts\nvar AgInputNumberField = class extends AgInputTextField {\n constructor(config) {\n super(config, \"ag-number-field\", \"number\");\n }\n postConstruct() {\n super.postConstruct();\n const eInput = this.eInput;\n this.addManagedListeners(eInput, {\n blur: () => {\n const floatedValue = Number.parseFloat(eInput.value);\n const value = isNaN(floatedValue) ? \"\" : this.normalizeValue(floatedValue.toString());\n if (this.value !== value) {\n this.setValue(value);\n }\n },\n wheel: this.onWheel.bind(this)\n });\n eInput.step = \"any\";\n const { precision, min, max, step } = this.config;\n if (typeof precision === \"number\") {\n this.setPrecision(precision);\n }\n if (typeof min === \"number\") {\n this.setMin(min);\n }\n if (typeof max === \"number\") {\n this.setMax(max);\n }\n if (typeof step === \"number\") {\n this.setStep(step);\n }\n }\n onWheel(e) {\n if (_getActiveDomElement(this.beans) === this.eInput) {\n e.preventDefault();\n }\n }\n normalizeValue(value) {\n if (value === \"\") {\n return \"\";\n }\n if (this.precision != null) {\n value = this.adjustPrecision(value);\n }\n return value;\n }\n adjustPrecision(value, isScientificNotation) {\n const precision = this.precision;\n if (precision == null) {\n return value;\n }\n if (isScientificNotation) {\n const floatString = Number.parseFloat(value).toFixed(precision);\n return Number.parseFloat(floatString).toString();\n }\n const parts = String(value).split(\".\");\n if (parts.length > 1) {\n if (parts[1].length <= precision) {\n return value;\n } else if (precision > 0) {\n return `${parts[0]}.${parts[1].slice(0, precision)}`;\n }\n }\n return parts[0];\n }\n setMin(min) {\n if (this.min === min) {\n return this;\n }\n this.min = min;\n _addOrRemoveAttribute(this.eInput, \"min\", min);\n return this;\n }\n setMax(max) {\n if (this.max === max) {\n return this;\n }\n this.max = max;\n _addOrRemoveAttribute(this.eInput, \"max\", max);\n return this;\n }\n setPrecision(precision) {\n this.precision = precision;\n return this;\n }\n setStep(step) {\n if (this.step === step) {\n return this;\n }\n this.step = step;\n _addOrRemoveAttribute(this.eInput, \"step\", step);\n return this;\n }\n setValue(value, silent) {\n return this.setValueOrInputValue(\n (v) => super.setValue(v, silent),\n () => this,\n value\n );\n }\n setStartValue(value) {\n return this.setValueOrInputValue(\n (v) => super.setValue(v, true),\n (v) => {\n this.eInput.value = v;\n },\n value\n );\n }\n setValueOrInputValue(setValueFunc, setInputValueOnlyFunc, value) {\n if (_exists(value)) {\n let setInputValueOnly = this.isScientificNotation(value);\n if (setInputValueOnly && this.eInput.validity.valid) {\n return setValueFunc(value);\n }\n if (!setInputValueOnly) {\n value = this.adjustPrecision(value);\n const normalizedValue = this.normalizeValue(value);\n setInputValueOnly = value != normalizedValue;\n }\n if (setInputValueOnly) {\n return setInputValueOnlyFunc(value);\n }\n }\n return setValueFunc(value);\n }\n getValue(ignoreValidity = false) {\n const eInput = this.eInput;\n if (!eInput.validity.valid && !ignoreValidity) {\n return void 0;\n }\n const inputValue = eInput.value;\n if (this.isScientificNotation(inputValue)) {\n return this.adjustPrecision(inputValue, true);\n }\n return super.getValue();\n }\n isScientificNotation(value) {\n return typeof value === \"string\" && value.includes(\"e\");\n }\n};\nvar AgInputNumberFieldSelector = {\n selector: \"AG-INPUT-NUMBER-FIELD\",\n component: AgInputNumberField\n};\n\n// packages/ag-grid-community/src/edit/cellEditors/numberCellEditor.ts\nvar NumberCellElement = {\n tag: \"ag-input-number-field\",\n ref: \"eEditor\",\n cls: \"ag-cell-editor\"\n};\nvar NumberCellEditorInput = class {\n constructor(getLocaleTextFunc) {\n this.getLocaleTextFunc = getLocaleTextFunc;\n }\n getTemplate() {\n return NumberCellElement;\n }\n getAgComponents() {\n return [AgInputNumberFieldSelector];\n }\n init(eEditor, params) {\n this.eEditor = eEditor;\n this.params = params;\n const { max, min, precision, step } = params;\n if (max != null) {\n eEditor.setMax(max);\n }\n if (min != null) {\n eEditor.setMin(min);\n }\n if (precision != null) {\n eEditor.setPrecision(precision);\n }\n if (step != null) {\n eEditor.setStep(step);\n }\n const editorEl = eEditor.getInputElement();\n if (params.preventStepping) {\n eEditor.addManagedElementListeners(editorEl, { keydown: this.preventStepping });\n } else if (params.showStepperButtons) {\n editorEl.classList.add(\"ag-number-field-input-stepper\");\n }\n }\n getValidationErrors() {\n const { params } = this;\n const { min, max, getValidationErrors } = params;\n const eInput = this.eEditor.getInputElement();\n const value = eInput.valueAsNumber;\n const translate = this.getLocaleTextFunc();\n let internalErrors = [];\n if (typeof value === \"number\") {\n if (min != null && value < min) {\n internalErrors.push(\n translate(\"minValueValidation\", `Must be greater than or equal to ${min}.`, [String(min)])\n );\n }\n if (max != null && value > max) {\n internalErrors.push(\n translate(\"maxValueValidation\", `Must be less than or equal to ${max}.`, [String(max)])\n );\n }\n }\n if (!internalErrors.length) {\n internalErrors = null;\n }\n if (getValidationErrors) {\n return getValidationErrors({\n value,\n cellEditorParams: params,\n internalErrors\n });\n }\n return internalErrors;\n }\n preventStepping(e) {\n if (e.key === KeyCode.UP || e.key === KeyCode.DOWN) {\n e.preventDefault();\n }\n }\n getValue() {\n const { eEditor, params } = this;\n const value = eEditor.getValue();\n if (!_exists(value) && !_exists(params.value)) {\n return params.value;\n }\n let parsedValue = params.parseValue(value);\n if (parsedValue == null) {\n return parsedValue;\n }\n if (typeof parsedValue === \"string\") {\n if (parsedValue === \"\") {\n return null;\n }\n parsedValue = Number(parsedValue);\n }\n return isNaN(parsedValue) ? null : parsedValue;\n }\n getStartValue() {\n return this.params.value;\n }\n setCaret() {\n if (_isBrowserSafari()) {\n this.eEditor.getInputElement().focus({ preventScroll: true });\n }\n }\n};\nvar NumberCellEditor = class extends SimpleCellEditor {\n constructor() {\n super(new NumberCellEditorInput(() => this.getLocaleTextFunc()));\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agList.css\nvar agList_default = \".ag-list-item{align-items:center;display:flex;height:var(--ag-list-item-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}\";\n\n// packages/ag-grid-community/src/agStack/widgets/agListItem.ts\nvar ACTIVE_CLASS = \"ag-active-item\";\nvar getAgListElement = (cssIdentifier, label) => ({\n tag: \"div\",\n cls: `ag-list-item ag-${cssIdentifier}-list-item`,\n attrs: { role: \"option\" },\n children: [\n {\n tag: \"span\",\n cls: `ag-list-item-text ag-${cssIdentifier}-list-item-text`,\n ref: \"eText\",\n children: label\n }\n ]\n});\nvar AgListItem = class extends AgComponentStub {\n constructor(cssIdentifier, label, value) {\n super(getAgListElement(cssIdentifier, label));\n this.label = label;\n this.value = value;\n this.eText = RefPlaceholder;\n }\n postConstruct() {\n this.createTooltip();\n this.addEventListeners();\n }\n setHighlighted(highlighted) {\n const eGui = this.getGui();\n eGui.classList.toggle(ACTIVE_CLASS, highlighted);\n _setAriaSelected(eGui, highlighted);\n this.dispatchLocalEvent({\n type: \"itemHighlighted\",\n highlighted\n });\n }\n getHeight() {\n return this.getGui().clientHeight;\n }\n setIndex(idx, setSize) {\n const eGui = this.getGui();\n _setAriaPosInSet(eGui, idx);\n _setAriaSetSize(eGui, setSize);\n }\n createTooltip() {\n const tooltipCtrl = {\n getTooltipValue: () => this.label,\n getGui: () => this.getGui(),\n getLocation: () => \"UNKNOWN\",\n // only show tooltips for items where the text cannot be fully displayed\n shouldDisplayTooltip: () => _isHorizontalScrollShowing(this.eText)\n };\n const tooltipFeature = this.createOptionalManagedBean(\n this.beans.registry.createDynamicBean(\n \"highlightTooltipFeature\",\n false,\n tooltipCtrl,\n this\n )\n );\n if (tooltipFeature) {\n this.tooltipFeature = tooltipFeature;\n }\n }\n addEventListeners() {\n const parentComponent = this.getParentComponent();\n if (!parentComponent) {\n return;\n }\n this.addGuiEventListener(\"mouseover\", () => {\n parentComponent.highlightItem(this);\n });\n this.addGuiEventListener(\"mousedown\", (e) => {\n e.preventDefault();\n e.stopPropagation();\n parentComponent.setValue(this.value);\n });\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agList.ts\nvar AgList = class extends AgComponentStub {\n constructor(cssIdentifier = \"default\") {\n super({ tag: \"div\", cls: `ag-list ag-${cssIdentifier}-list` });\n this.cssIdentifier = cssIdentifier;\n this.options = [];\n this.listItems = [];\n this.highlightedItem = null;\n this.registerCSS(agList_default);\n }\n postConstruct() {\n const eGui = this.getGui();\n this.addManagedElementListeners(eGui, { mouseleave: () => this.clearHighlighted() });\n }\n handleKeyDown(e) {\n const key = e.key;\n switch (key) {\n case KeyCode.ENTER:\n if (!this.highlightedItem) {\n this.setValue(this.getValue());\n } else {\n const pos = this.listItems.indexOf(this.highlightedItem);\n this.setValueByIndex(pos);\n }\n break;\n case KeyCode.DOWN:\n case KeyCode.UP:\n e.preventDefault();\n this.navigate(key);\n break;\n case KeyCode.PAGE_DOWN:\n case KeyCode.PAGE_UP:\n case KeyCode.PAGE_HOME:\n case KeyCode.PAGE_END:\n e.preventDefault();\n this.navigateToPage(key);\n break;\n }\n }\n addOptions(listOptions) {\n for (const listOption of listOptions) {\n this.addOption(listOption);\n }\n return this;\n }\n addOption(listOption) {\n const { value, text } = listOption;\n const valueToRender = text ?? value;\n this.options.push({ value, text: valueToRender });\n this.renderOption(value, valueToRender);\n this.updateIndices();\n return this;\n }\n clearOptions() {\n this.options = [];\n this.reset(true);\n for (const item of this.listItems) {\n item.destroy();\n }\n _clearElement(this.getGui());\n this.listItems = [];\n this.refreshAriaRole();\n }\n updateOptions(listOptions) {\n const needsUpdate = this.options !== listOptions;\n if (needsUpdate) {\n this.clearOptions();\n this.addOptions(listOptions);\n }\n return needsUpdate;\n }\n setValue(value, silent) {\n if (this.value === value) {\n this.fireItemSelected();\n return this;\n }\n if (value == null) {\n this.reset(silent);\n return this;\n }\n const idx = this.options.findIndex((option) => option.value === value);\n if (idx !== -1) {\n const option = this.options[idx];\n this.value = option.value;\n this.displayValue = option.text;\n this.highlightItem(this.listItems[idx]);\n if (!silent) {\n this.fireChangeEvent();\n }\n }\n return this;\n }\n setValueByIndex(idx) {\n return this.setValue(this.options[idx].value);\n }\n getValue() {\n return this.value;\n }\n getDisplayValue() {\n return this.displayValue;\n }\n refreshHighlighted() {\n this.clearHighlighted();\n const idx = this.options.findIndex((option) => option.value === this.value);\n if (idx !== -1) {\n this.highlightItem(this.listItems[idx]);\n }\n }\n highlightItem(item) {\n const itemEl = item.getGui();\n if (!_isVisible(itemEl)) {\n return;\n }\n this.clearHighlighted();\n item.setHighlighted(true);\n this.highlightedItem = item;\n const eGui = this.getGui();\n const { scrollTop, clientHeight } = eGui;\n const { offsetTop, offsetHeight } = itemEl;\n if (offsetTop + offsetHeight > scrollTop + clientHeight || offsetTop < scrollTop) {\n itemEl.scrollIntoView({ block: \"nearest\" });\n }\n }\n hideItemTooltip() {\n this.highlightedItem?.tooltipFeature?.attemptToHideTooltip();\n }\n destroy() {\n this.hideItemTooltip();\n super.destroy();\n }\n reset(silent) {\n this.value = null;\n this.displayValue = null;\n this.clearHighlighted();\n if (!silent) {\n this.fireChangeEvent();\n }\n }\n clearHighlighted() {\n this.highlightedItem?.setHighlighted(false);\n this.highlightedItem = null;\n }\n renderOption(value, text) {\n const item = new AgListItem(this.cssIdentifier, text, value);\n item.setParentComponent(this);\n const listItem = this.createManagedBean(item);\n this.listItems.push(listItem);\n this.getGui().appendChild(listItem.getGui());\n }\n navigate(key) {\n const isDown = key === KeyCode.DOWN;\n let itemToHighlight;\n const { listItems, highlightedItem } = this;\n if (!highlightedItem) {\n itemToHighlight = isDown ? listItems[0] : _last(listItems);\n } else {\n const currentIdx = listItems.indexOf(highlightedItem);\n let nextPos = currentIdx + (isDown ? 1 : -1);\n nextPos = Math.min(Math.max(nextPos, 0), listItems.length - 1);\n itemToHighlight = listItems[nextPos];\n }\n this.highlightItem(itemToHighlight);\n }\n navigateToPage(key) {\n const { listItems, highlightedItem } = this;\n if (!highlightedItem || listItems.length === 0) {\n return;\n }\n const currentIdx = listItems.indexOf(highlightedItem);\n const rowCount = this.options.length - 1;\n const itemHeight = listItems[0].getHeight();\n const pageSize = Math.floor(this.getGui().clientHeight / itemHeight);\n let newIndex = -1;\n if (key === KeyCode.PAGE_HOME) {\n newIndex = 0;\n } else if (key === KeyCode.PAGE_END) {\n newIndex = rowCount;\n } else if (key === KeyCode.PAGE_DOWN) {\n newIndex = Math.min(currentIdx + pageSize, rowCount);\n } else if (key === KeyCode.PAGE_UP) {\n newIndex = Math.max(currentIdx - pageSize, 0);\n }\n if (newIndex === -1) {\n return;\n }\n this.highlightItem(listItems[newIndex]);\n }\n refreshAriaRole() {\n _setAriaRole(this.getGui(), this.options.length === 0 ? \"presentation\" : \"listbox\");\n }\n updateIndices() {\n this.refreshAriaRole();\n const listItems = this.listItems;\n const len = listItems.length;\n listItems.forEach((item, idx) => {\n item.setIndex(idx + 1, len);\n });\n }\n fireChangeEvent() {\n this.dispatchLocalEvent({ type: \"fieldValueChanged\" });\n this.fireItemSelected();\n }\n fireItemSelected() {\n this.dispatchLocalEvent({ type: \"selectedItem\" });\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agPickerField.css\nvar agPickerField_default = \".ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-picker-button-background-color);border:var(--ag-picker-button-border);border-radius:5px;min-height:max(var(--ag-list-item-height),calc(var(--ag-spacing)*4));overflow:hidden;&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}}.ag-picker-field-wrapper:where(.ag-picker-has-focus),.ag-picker-field-wrapper:where(:focus-within){background-color:var(--ag-picker-button-focus-background-color);border:var(--ag-picker-button-focus-border);box-shadow:var(--ag-focus-shadow);&:where(.invalid){box-shadow:var(--ag-focus-error-shadow)}}.ag-picker-field-wrapper:disabled{opacity:.5}\";\n\n// packages/ag-grid-community/src/agStack/widgets/agPickerField.ts\nvar AgPickerFieldElement = {\n tag: \"div\",\n cls: \"ag-picker-field\",\n role: \"presentation\",\n children: [\n { tag: \"div\", ref: \"eLabel\" },\n {\n tag: \"div\",\n ref: \"eWrapper\",\n cls: \"ag-wrapper ag-picker-field-wrapper ag-picker-collapsed\",\n children: [\n { tag: \"div\", ref: \"eDisplayField\", cls: \"ag-picker-field-display\" },\n { tag: \"div\", ref: \"eIcon\", cls: \"ag-picker-field-icon\", attrs: { \"aria-hidden\": \"true\" } }\n ]\n }\n ]\n};\nvar AgPickerField = class extends AgAbstractField {\n constructor(config) {\n super(config, config?.template || AgPickerFieldElement, config?.agComponents || [], config?.className);\n this.isPickerDisplayed = false;\n this.skipClick = false;\n this.pickerGap = 4;\n this.hideCurrentPicker = null;\n this.eLabel = RefPlaceholder;\n this.eWrapper = RefPlaceholder;\n this.eDisplayField = RefPlaceholder;\n this.eIcon = RefPlaceholder;\n this.registerCSS(agPickerField_default);\n this.ariaRole = config?.ariaRole;\n this.onPickerFocusIn = this.onPickerFocusIn.bind(this);\n this.onPickerFocusOut = this.onPickerFocusOut.bind(this);\n if (!config) {\n return;\n }\n const { pickerGap, maxPickerHeight, variableWidth, minPickerWidth, maxPickerWidth } = config;\n if (pickerGap != null) {\n this.pickerGap = pickerGap;\n }\n this.variableWidth = !!variableWidth;\n if (maxPickerHeight != null) {\n this.setPickerMaxHeight(maxPickerHeight);\n }\n if (minPickerWidth != null) {\n this.setPickerMinWidth(minPickerWidth);\n }\n if (maxPickerWidth != null) {\n this.setPickerMaxWidth(maxPickerWidth);\n }\n }\n postConstruct() {\n super.postConstruct();\n this.setupAria();\n const displayId = `ag-${this.getCompId()}-display`;\n this.eDisplayField.setAttribute(\"id\", displayId);\n const ariaEl = this.getAriaElement();\n this.addManagedElementListeners(ariaEl, { keydown: this.onKeyDown.bind(this) });\n this.addManagedElementListeners(this.eLabel, { mousedown: this.onLabelOrWrapperMouseDown.bind(this) });\n this.addManagedElementListeners(this.eWrapper, { mousedown: this.onLabelOrWrapperMouseDown.bind(this) });\n const { pickerIcon, inputWidth } = this.config;\n if (pickerIcon) {\n const icon = this.beans.iconSvc.createIconNoSpan(pickerIcon);\n if (icon) {\n this.eIcon.appendChild(icon);\n }\n }\n if (inputWidth != null) {\n this.setInputWidth(inputWidth);\n }\n }\n setupAria() {\n const ariaEl = this.getAriaElement();\n ariaEl.setAttribute(\"tabindex\", this.gos.get(\"tabIndex\").toString());\n _setAriaExpanded(ariaEl, false);\n if (this.ariaRole) {\n _setAriaRole(ariaEl, this.ariaRole);\n }\n }\n onLabelOrWrapperMouseDown(e) {\n if (e) {\n const focusableEl = this.getFocusableElement();\n if (focusableEl !== this.eWrapper && e?.target === focusableEl) {\n return;\n }\n e.preventDefault();\n this.getFocusableElement().focus();\n }\n if (this.skipClick) {\n this.skipClick = false;\n return;\n }\n if (this.isDisabled()) {\n return;\n }\n if (this.isPickerDisplayed) {\n this.hidePicker();\n } else {\n this.showPicker();\n }\n }\n onKeyDown(e) {\n switch (e.key) {\n case KeyCode.UP:\n case KeyCode.DOWN:\n case KeyCode.ENTER:\n case KeyCode.SPACE:\n e.preventDefault();\n this.onLabelOrWrapperMouseDown();\n break;\n case KeyCode.ESCAPE:\n if (this.isPickerDisplayed) {\n e.preventDefault();\n e.stopPropagation();\n if (this.hideCurrentPicker) {\n this.hideCurrentPicker();\n }\n }\n break;\n }\n }\n showPicker() {\n this.isPickerDisplayed = true;\n if (!this.pickerComponent) {\n this.pickerComponent = this.createPickerComponent();\n }\n const pickerGui = this.pickerComponent.getGui();\n pickerGui.addEventListener(\"focusin\", this.onPickerFocusIn);\n pickerGui.addEventListener(\"focusout\", this.onPickerFocusOut);\n this.hideCurrentPicker = this.renderAndPositionPicker();\n this.toggleExpandedStyles(true);\n }\n renderAndPositionPicker() {\n const ePicker = this.pickerComponent.getGui();\n if (!this.gos.get(\"suppressScrollWhenPopupsAreOpen\")) {\n [this.destroyMouseWheelFunc] = this.addManagedEventListeners({\n bodyScroll: () => {\n this.hidePicker();\n }\n });\n }\n const translate = this.getLocaleTextFunc();\n const {\n config: { pickerAriaLabelKey, pickerAriaLabelValue, modalPicker = true },\n maxPickerHeight,\n minPickerWidth,\n maxPickerWidth,\n variableWidth,\n beans,\n eWrapper\n } = this;\n const popupParams = {\n modal: modalPicker,\n eChild: ePicker,\n closeOnEsc: true,\n closedCallback: () => {\n const shouldRestoreFocus = _isNothingFocused(beans);\n this.beforeHidePicker();\n if (shouldRestoreFocus && this.isAlive()) {\n this.getFocusableElement().focus();\n }\n },\n ariaLabel: translate(pickerAriaLabelKey, pickerAriaLabelValue),\n anchorToElement: eWrapper\n };\n ePicker.style.position = \"absolute\";\n const popupSvc = beans.popupSvc;\n const addPopupRes = popupSvc.addPopup(popupParams);\n if (variableWidth) {\n if (minPickerWidth) {\n ePicker.style.minWidth = minPickerWidth;\n }\n ePicker.style.width = _formatSize(_getAbsoluteWidth(eWrapper));\n if (maxPickerWidth) {\n ePicker.style.maxWidth = maxPickerWidth;\n }\n } else {\n _setElementWidth(ePicker, maxPickerWidth ?? _getAbsoluteWidth(eWrapper));\n }\n const maxHeight = maxPickerHeight ?? `${_getInnerHeight(popupSvc.getPopupParent())}px`;\n ePicker.style.setProperty(\"max-height\", maxHeight);\n this.alignPickerToComponent();\n return addPopupRes.hideFunc;\n }\n alignPickerToComponent() {\n if (!this.pickerComponent) {\n return;\n }\n const {\n pickerGap,\n config: { pickerType },\n beans: { popupSvc, gos },\n eWrapper,\n pickerComponent\n } = this;\n const alignSide = gos.get(\"enableRtl\") ? \"right\" : \"left\";\n popupSvc.positionPopupByComponent({\n type: pickerType,\n eventSource: eWrapper,\n ePopup: pickerComponent.getGui(),\n position: \"under\",\n alignSide,\n keepWithinBounds: true,\n nudgeY: pickerGap\n });\n }\n beforeHidePicker() {\n if (this.destroyMouseWheelFunc) {\n this.destroyMouseWheelFunc();\n this.destroyMouseWheelFunc = void 0;\n }\n this.toggleExpandedStyles(false);\n const pickerGui = this.pickerComponent.getGui();\n pickerGui.removeEventListener(\"focusin\", this.onPickerFocusIn);\n pickerGui.removeEventListener(\"focusout\", this.onPickerFocusOut);\n this.isPickerDisplayed = false;\n this.pickerComponent = void 0;\n this.hideCurrentPicker = null;\n }\n toggleExpandedStyles(expanded) {\n if (!this.isAlive()) {\n return;\n }\n const ariaEl = this.getAriaElement();\n _setAriaExpanded(ariaEl, expanded);\n const classList = this.eWrapper.classList;\n classList.toggle(\"ag-picker-expanded\", expanded);\n classList.toggle(\"ag-picker-collapsed\", !expanded);\n }\n onPickerFocusIn() {\n this.togglePickerHasFocus(true);\n }\n onPickerFocusOut(e) {\n if (!this.pickerComponent?.getGui().contains(e.relatedTarget)) {\n this.togglePickerHasFocus(false);\n }\n }\n togglePickerHasFocus(focused) {\n if (!this.pickerComponent) {\n return;\n }\n this.eWrapper.classList.toggle(\"ag-picker-has-focus\", focused);\n }\n hidePicker() {\n if (this.hideCurrentPicker) {\n this.hideCurrentPicker();\n this.dispatchLocalEvent({\n type: \"pickerHidden\"\n });\n }\n }\n setInputWidth(width) {\n _setElementWidth(this.eWrapper, width);\n return this;\n }\n getFocusableElement() {\n return this.eWrapper;\n }\n setPickerGap(gap) {\n this.pickerGap = gap;\n return this;\n }\n setPickerMinWidth(width) {\n if (typeof width === \"number\") {\n width = `${width}px`;\n }\n this.minPickerWidth = width == null ? void 0 : width;\n return this;\n }\n setPickerMaxWidth(width) {\n if (typeof width === \"number\") {\n width = `${width}px`;\n }\n this.maxPickerWidth = width == null ? void 0 : width;\n return this;\n }\n setPickerMaxHeight(height) {\n if (typeof height === \"number\") {\n height = `${height}px`;\n }\n this.maxPickerHeight = height == null ? void 0 : height;\n return this;\n }\n destroy() {\n this.hidePicker();\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agSelect.css\nvar agSelect_default = \".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}.ag-select:where(:not(.ag-cell-editor,.ag-label-align-top)){min-height:var(--ag-list-item-height)}:where(.ag-select){.ag-picker-field-wrapper{cursor:default;padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}.ag-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}:where(.ag-ltr) .ag-select-list-item{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-select-list-item{padding-right:var(--ag-spacing)}.ag-select-list-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\";\n\n// packages/ag-grid-community/src/agStack/widgets/agSelect.ts\nvar AgSelect = class extends AgPickerField {\n constructor(config) {\n super({\n pickerAriaLabelKey: \"ariaLabelSelectField\",\n pickerAriaLabelValue: \"Select Field\",\n pickerType: \"ag-list\",\n className: \"ag-select\",\n pickerIcon: \"selectOpen\",\n ariaRole: \"combobox\",\n ...config\n });\n this.registerCSS(agSelect_default);\n }\n postConstruct() {\n this.tooltipFeature = this.createOptionalManagedBean(\n this.beans.registry.createDynamicBean(\n \"tooltipFeature\",\n false,\n {\n shouldDisplayTooltip: _isElementOverflowingCallback(() => this.eDisplayField),\n getGui: () => this.getGui()\n }\n )\n );\n super.postConstruct();\n this.createListComponent();\n this.eWrapper.tabIndex = this.gos.get(\"tabIndex\");\n const { options, value, placeholder } = this.config;\n if (options != null) {\n this.addOptions(options);\n }\n if (value != null) {\n this.setValue(value, true);\n }\n if (placeholder && value == null) {\n this.eDisplayField.textContent = placeholder;\n }\n this.addManagedElementListeners(this.eWrapper, { focusout: this.onWrapperFocusOut.bind(this) });\n }\n onWrapperFocusOut(e) {\n if (!this.eWrapper.contains(e.relatedTarget)) {\n this.hidePicker();\n }\n }\n createListComponent() {\n const listComponent = this.createBean(\n new AgList(\"select\")\n );\n this.listComponent = listComponent;\n listComponent.setParentComponent(this);\n const eListAriaEl = listComponent.getAriaElement();\n const listId = `ag-select-list-${listComponent.getCompId()}`;\n eListAriaEl.setAttribute(\"id\", listId);\n _setAriaControlsAndLabel(this.getAriaElement(), eListAriaEl);\n listComponent.addManagedElementListeners(listComponent.getGui(), {\n mousedown: (e) => {\n e?.preventDefault();\n }\n });\n listComponent.addManagedListeners(listComponent, {\n selectedItem: () => {\n this.hidePicker();\n this.dispatchLocalEvent({ type: \"selectedItem\" });\n },\n fieldValueChanged: () => {\n if (!this.listComponent) {\n return;\n }\n this.setValue(this.listComponent.getValue(), false, true);\n this.hidePicker();\n }\n });\n }\n createPickerComponent() {\n return this.listComponent;\n }\n beforeHidePicker() {\n this.listComponent?.hideItemTooltip();\n super.beforeHidePicker();\n }\n onKeyDown(e) {\n const { key } = e;\n if (key === KeyCode.TAB) {\n this.hidePicker();\n }\n switch (key) {\n case KeyCode.ENTER:\n case KeyCode.UP:\n case KeyCode.DOWN:\n case KeyCode.PAGE_UP:\n case KeyCode.PAGE_DOWN:\n case KeyCode.PAGE_HOME:\n case KeyCode.PAGE_END:\n e.preventDefault();\n if (this.isPickerDisplayed) {\n this.listComponent?.handleKeyDown(e);\n } else {\n super.onKeyDown(e);\n }\n break;\n case KeyCode.ESCAPE:\n super.onKeyDown(e);\n break;\n case KeyCode.SPACE:\n if (this.isPickerDisplayed) {\n e.preventDefault();\n } else {\n super.onKeyDown(e);\n }\n break;\n }\n }\n showPicker() {\n const listComponent = this.listComponent;\n if (!listComponent) {\n return;\n }\n super.showPicker();\n listComponent.refreshHighlighted();\n }\n addOptions(options) {\n for (const option of options) {\n this.addOption(option);\n }\n return this;\n }\n addOption(option) {\n this.listComponent.addOption(option);\n return this;\n }\n clearOptions() {\n this.listComponent?.clearOptions();\n this.setValue(void 0, true);\n return this;\n }\n updateOptions(options) {\n if (this.listComponent?.updateOptions(options)) {\n this.setValue(void 0, true);\n }\n return this;\n }\n setValue(value, silent, fromPicker) {\n const {\n listComponent,\n config: { placeholder },\n eDisplayField,\n tooltipFeature\n } = this;\n if (this.value === value || !listComponent) {\n return this;\n }\n if (!fromPicker) {\n listComponent.setValue(value, true);\n }\n const newValue = listComponent.getValue();\n if (newValue === this.getValue()) {\n return this;\n }\n let displayValue = listComponent.getDisplayValue();\n if (displayValue == null && placeholder) {\n displayValue = placeholder;\n }\n eDisplayField.textContent = displayValue;\n tooltipFeature?.setTooltipAndRefresh(displayValue ?? null);\n return super.setValue(value, silent);\n }\n destroy() {\n this.listComponent = this.destroyBean(this.listComponent);\n super.destroy();\n }\n};\nvar AgSelectSelector = {\n selector: \"AG-SELECT\",\n component: AgSelect\n};\n\n// packages/ag-grid-community/src/edit/cellEditors/selectCellEditor.ts\nvar SelectCellElement = {\n tag: \"div\",\n cls: \"ag-cell-edit-wrapper\",\n children: [\n {\n tag: \"ag-select\",\n ref: \"eEditor\",\n cls: \"ag-cell-editor\"\n }\n ]\n};\nvar SelectCellEditor = class extends AgAbstractCellEditor {\n constructor() {\n super(SelectCellElement, [AgSelectSelector]);\n this.eEditor = RefPlaceholder;\n this.startedByEnter = false;\n }\n wireBeans(beans) {\n this.valueSvc = beans.valueSvc;\n }\n initialiseEditor(params) {\n this.focusAfterAttached = params.cellStartedEdit;\n const { eEditor, valueSvc, gos } = this;\n const { values, value, eventKey } = params;\n if (_missing(values)) {\n _warn(58);\n return;\n }\n this.startedByEnter = eventKey != null ? eventKey === KeyCode.ENTER : false;\n let hasValue = false;\n values.forEach((currentValue) => {\n const option = { value: currentValue };\n const valueFormatted = valueSvc.formatValue(params.column, null, currentValue);\n const valueFormattedExits = valueFormatted !== null && valueFormatted !== void 0;\n option.text = valueFormattedExits ? valueFormatted : currentValue;\n eEditor.addOption(option);\n hasValue = hasValue || value === currentValue;\n });\n if (hasValue) {\n eEditor.setValue(params.value ?? void 0, true);\n } else if (params.values.length) {\n eEditor.setValue(params.values[0], true);\n }\n const { valueListGap, valueListMaxWidth, valueListMaxHeight } = params;\n if (valueListGap != null) {\n eEditor.setPickerGap(valueListGap);\n }\n if (valueListMaxHeight != null) {\n eEditor.setPickerMaxHeight(valueListMaxHeight);\n }\n if (valueListMaxWidth != null) {\n eEditor.setPickerMaxWidth(valueListMaxWidth);\n }\n if (gos.get(\"editType\") !== \"fullRow\") {\n this.addManagedListeners(this.eEditor, { selectedItem: () => params.stopEditing() });\n }\n }\n afterGuiAttached() {\n if (this.focusAfterAttached) {\n this.eEditor.getFocusableElement().focus();\n }\n if (this.startedByEnter) {\n setTimeout(() => {\n if (this.isAlive()) {\n this.eEditor.showPicker();\n }\n });\n }\n }\n focusIn() {\n this.eEditor.getFocusableElement().focus();\n }\n agSetEditValue(value) {\n this.params.value = value;\n this.eEditor.setValue(value ?? void 0, true);\n }\n getValue() {\n return this.eEditor.getValue();\n }\n isPopup() {\n return false;\n }\n getValidationElement() {\n return this.eEditor.getAriaElement();\n }\n getValidationErrors() {\n const { params } = this;\n const { values, getValidationErrors } = params;\n const value = this.getValue();\n let internalErrors = [];\n if (values && value != null && !values.includes(value)) {\n const translate = this.getLocaleTextFunc();\n internalErrors.push(translate(\"invalidSelectionValidation\", \"Invalid selection.\"));\n } else {\n internalErrors = null;\n }\n if (getValidationErrors) {\n return getValidationErrors({\n value,\n internalErrors,\n cellEditorParams: params\n });\n }\n return internalErrors;\n }\n};\n\n// packages/ag-grid-community/src/edit/cellEditors/textCellEditor.ts\nvar TextCellEditorElement = {\n tag: \"ag-input-text-field\",\n ref: \"eEditor\",\n cls: \"ag-cell-editor\"\n};\nvar TextCellEditorInput = class {\n constructor(getLocaleTextFunc) {\n this.getLocaleTextFunc = getLocaleTextFunc;\n }\n getTemplate() {\n return TextCellEditorElement;\n }\n getAgComponents() {\n return [AgInputTextFieldSelector];\n }\n init(eEditor, params) {\n this.eEditor = eEditor;\n this.params = params;\n const maxLength = params.maxLength;\n if (maxLength != null) {\n eEditor.setMaxLength(maxLength);\n }\n }\n getValidationErrors() {\n const { params } = this;\n const { maxLength, getValidationErrors } = params;\n const value = this.getValue();\n const translate = this.getLocaleTextFunc();\n let internalErrors = [];\n if (maxLength != null && typeof value === \"string\" && value.length > maxLength) {\n internalErrors.push(\n translate(\"maxLengthValidation\", `Must be ${maxLength} characters or fewer.`, [String(maxLength)])\n );\n }\n if (!internalErrors.length) {\n internalErrors = null;\n }\n if (getValidationErrors) {\n return getValidationErrors({ value, cellEditorParams: params, internalErrors });\n }\n return internalErrors;\n }\n getValue() {\n const { eEditor, params } = this;\n const value = eEditor.getValue();\n if (!_exists(value) && !_exists(params.value)) {\n return params.value;\n }\n return params.parseValue(value);\n }\n getStartValue() {\n const params = this.params;\n const formatValue = params.useFormatter || params.column.getColDef().refData;\n return formatValue ? params.formatValue(params.value) : params.value;\n }\n setCaret() {\n if (_isBrowserSafari()) {\n this.eEditor.getInputElement().focus({ preventScroll: true });\n }\n const eInput = this.eEditor;\n const value = eInput.getValue();\n const len = _exists(value) && value.length || 0;\n if (len) {\n eInput.getInputElement().setSelectionRange(len, len);\n }\n }\n};\nvar TextCellEditor = class extends SimpleCellEditor {\n constructor() {\n super(new TextCellEditorInput(() => this.getLocaleTextFunc()));\n }\n};\n\n// packages/ag-grid-community/src/edit/editApi.ts\nfunction undoCellEditing(beans) {\n beans.undoRedo?.undo(\"api\");\n}\nfunction redoCellEditing(beans) {\n beans.undoRedo?.redo(\"api\");\n}\nfunction getEditRowValues(beans, rowNode) {\n return beans.editModelSvc?.getEditRowDataValue(rowNode, { checkSiblings: true });\n}\nfunction getEditingCells(beans) {\n const edits = beans.editModelSvc?.getEditMap();\n const positions = [];\n edits?.forEach((editRow, rowNode) => {\n const { rowIndex, rowPinned } = rowNode;\n editRow.forEach((editValue, column) => {\n const { editorValue, pendingValue, sourceValue: oldValue, state } = editValue;\n const diff = _sourceAndPendingDiffer(editValue);\n let newValue = editorValue ?? pendingValue;\n if (newValue === UNEDITED) {\n newValue = void 0;\n }\n const edit = {\n newValue,\n oldValue,\n state,\n column,\n colId: column.getColId(),\n colKey: column.getColId(),\n rowIndex,\n rowPinned\n };\n const editing = state === \"editing\";\n const changed = !editing && diff;\n if (editing || changed) {\n positions.push(edit);\n }\n });\n });\n return positions;\n}\nfunction stopEditing(beans, cancel = false) {\n const { editSvc } = beans;\n if (editSvc?.isBatchEditing()) {\n if (cancel) {\n for (const cellPosition of beans.editModelSvc?.getEditPositions() ?? []) {\n if (cellPosition.state === \"editing\") {\n editSvc.revertSingleCellEdit(cellPosition);\n }\n }\n } else {\n _syncFromEditors(beans, { persist: true });\n }\n _destroyEditors(beans, void 0, { cancel });\n } else {\n editSvc?.stopEditing(void 0, { cancel, source: \"edit\", forceStop: !cancel, forceCancel: cancel });\n }\n}\nfunction isEditing(beans, cellPosition) {\n const cellCtrl = _getCellCtrl(beans, cellPosition);\n return !!beans.editSvc?.isEditing(cellCtrl);\n}\nfunction startEditingCell(beans, params) {\n const { key, colKey, rowIndex, rowPinned } = params;\n const { editSvc, colModel } = beans;\n const column = colModel.getCol(colKey);\n if (!column) {\n _warn(12, { colKey });\n return;\n }\n const cellPosition = {\n rowIndex,\n rowPinned: rowPinned || null,\n column\n };\n const rowNode = _getRowNode(beans, cellPosition);\n if (!rowNode) {\n _warn(290, { rowIndex, rowPinned });\n return;\n }\n if (!editSvc?.isCellEditable({ rowNode, column }, \"api\")) {\n return;\n }\n const notPinned = rowPinned == null;\n if (notPinned) {\n ensureIndexVisible(beans, rowIndex);\n }\n ensureColumnVisible(beans, colKey);\n editSvc?.startEditing(\n {\n rowNode,\n column\n },\n {\n event: key ? new KeyboardEvent(\"keydown\", { key }) : void 0,\n source: \"api\",\n editable: true\n }\n );\n}\nfunction validateEdit(beans) {\n return beans.editSvc?.validateEdit() || null;\n}\nfunction getCurrentUndoSize(beans) {\n return beans.undoRedo?.getCurrentUndoStackSize() ?? 0;\n}\nfunction getCurrentRedoSize(beans) {\n return beans.undoRedo?.getCurrentRedoStackSize() ?? 0;\n}\n\n// packages/ag-grid-community/src/edit/cellEditors/popupEditorWrapper.ts\nvar PopupEditorElement = { tag: \"div\", cls: \"ag-popup-editor\", attrs: { tabindex: \"-1\" } };\nvar PopupEditorWrapper = class extends AgPopupComponent {\n constructor(params) {\n super(PopupEditorElement);\n this.params = params;\n }\n postConstruct() {\n _setDomData(this.gos, this.getGui(), \"popupEditorWrapper\", true);\n this.addKeyDownListener();\n }\n addKeyDownListener() {\n const eGui = this.getGui();\n const params = this.params;\n const listener = (event) => {\n if (!_isUserSuppressingKeyboardEvent(this.gos, event, params.node, params.column, true)) {\n params.onKeyDown(event);\n }\n };\n this.addManagedElementListeners(eGui, { keydown: listener });\n }\n};\n\n// packages/ag-grid-community/src/edit/strategy/strategyUtils.ts\nfunction shouldStartEditing(beans, { column }, event, cellStartedEdit, source = \"ui\") {\n if (event instanceof KeyboardEvent && (event.key === KeyCode.TAB || event.key === KeyCode.ENTER || event.key === KeyCode.F2 || event.key === KeyCode.BACKSPACE && cellStartedEdit)) {\n return true;\n }\n const extendingRange = event?.shiftKey && beans.rangeSvc?.getCellRanges().length != 0;\n if (extendingRange) {\n return false;\n }\n const colDef = column?.getColDef();\n const clickCount = deriveClickCount(beans.gos, colDef);\n const type = event?.type;\n if (type === \"click\" && event?.detail === 1 && clickCount === 1) {\n return true;\n }\n if (type === \"dblclick\" && event?.detail === 2 && clickCount === 2) {\n return true;\n }\n if (source === \"api\") {\n return !!cellStartedEdit;\n }\n return false;\n}\nfunction deriveClickCount(gos, colDef) {\n if (gos.get(\"suppressClickEdit\") === true) {\n return 0;\n }\n if (gos.get(\"singleClickEdit\") === true) {\n return 1;\n }\n if (colDef?.singleClickEdit) {\n return 1;\n }\n return 2;\n}\nfunction existingEditing(beans, editPosition) {\n return beans.editModelSvc?.hasEdits(editPosition, { withOpenEditor: true }) ?? false;\n}\nfunction isCellEditable(beans, editPosition) {\n const column = editPosition.column;\n const rowNode = editPosition.rowNode;\n const colDef = column.getColDef();\n if (!rowNode) {\n return existingEditing(beans, editPosition);\n }\n const editable = colDef.editable;\n if (rowNode.group && colDef.groupRowEditable != null) {\n if (beans.rowGroupingEditValueSvc?.isGroupCellEditable(rowNode, column)) {\n return true;\n }\n return existingEditing(beans, editPosition);\n }\n if (column.isColumnFunc(rowNode, editable)) {\n return true;\n }\n return existingEditing(beans, editPosition);\n}\nfunction isFullRowCellEditable(beans, position, source = \"ui\") {\n const editable = isCellEditable(beans, position);\n if (editable || source === \"ui\") {\n return editable;\n }\n const { rowNode, column } = position;\n for (const col of beans.colModel.getCols()) {\n if (col !== column && isCellEditable(beans, { rowNode, column: col })) {\n return true;\n }\n }\n return false;\n}\n\n// packages/ag-grid-community/src/edit/styles/style-utils.ts\nvar editHighlightFn = (edit, includeEditing = false) => {\n if (edit !== void 0) {\n return _sourceAndPendingDiffer(edit) || includeEditing && edit.state === \"editing\";\n }\n};\nfunction _hasEdits(beans, position, includeEditing = false) {\n return editHighlightFn(beans.editModelSvc?.getEdit(position), includeEditing);\n}\nvar nodeHasLeafEdit = (children, editModelSvc, column) => {\n if (!children) {\n return;\n }\n for (let i = 0, len = children.length; i < len; ++i) {\n const child = children[i];\n if (child.data) {\n const highlight = editHighlightFn(editModelSvc?.getEdit({ rowNode: child, column })) || editHighlightFn(editModelSvc?.getEdit({ rowNode: child.pinnedSibling, column }));\n if (highlight) {\n return true;\n }\n }\n if (nodeHasLeafEdit(child.childrenAfterGroup, editModelSvc, column)) {\n return true;\n }\n }\n};\nfunction _hasLeafEdits(beans, position) {\n const { column, rowNode } = position;\n if (beans.gos.get(\"groupTotalRow\") && !rowNode?.footer) {\n return false;\n }\n return nodeHasLeafEdit(rowNode?.childrenAfterGroup, beans.editModelSvc, column);\n}\nfunction _hasPinnedEdits(beans, { rowNode, column }) {\n rowNode = rowNode.pinnedSibling;\n if (!rowNode) {\n return;\n }\n return editHighlightFn(\n beans.editModelSvc?.getEdit({\n rowNode,\n column\n })\n );\n}\n\n// packages/ag-grid-community/src/edit/styles/cellEditStyleFeature.ts\nvar CellEditStyleFeature = class extends BeanStub {\n constructor(cellCtrl, beans) {\n super();\n this.cellCtrl = cellCtrl;\n this.beans = beans;\n this.editSvc = beans.editSvc;\n this.editModelSvc = beans.editModelSvc;\n }\n setComp(comp) {\n this.cellComp = comp;\n this.applyCellStyles();\n }\n applyCellStyles() {\n const { cellCtrl, editSvc, beans } = this;\n if (editSvc?.isBatchEditing() && editSvc.isEditing()) {\n const state = _hasEdits(beans, cellCtrl) || _hasLeafEdits(beans, cellCtrl) || _hasPinnedEdits(beans, cellCtrl);\n this.applyBatchingStyle(state);\n } else {\n this.applyBatchingStyle(false);\n }\n const hasErrors = !!this.editModelSvc?.getCellValidationModel().hasCellValidation(this.cellCtrl);\n this.cellComp.toggleCss(\"ag-cell-editing-error\", hasErrors);\n }\n applyBatchingStyle(newState) {\n this.cellComp.toggleCss(\"ag-cell-editing\", newState ?? false);\n this.cellComp.toggleCss(\"ag-cell-batch-edit\", (newState && this.editSvc?.isBatchEditing()) ?? false);\n }\n};\n\n// packages/ag-grid-community/src/edit/styles/rowEditStyleFeature.ts\nvar RowEditStyleFeature = class extends BeanStub {\n constructor(rowCtrl, beans) {\n super();\n this.rowCtrl = rowCtrl;\n this.beans = beans;\n this.gos = beans.gos;\n this.editSvc = beans.editSvc;\n this.editModelSvc = beans.editModelSvc;\n }\n applyRowStyles() {\n const { rowCtrl, editModelSvc, beans } = this;\n let rowNode = rowCtrl.rowNode;\n let edits = editModelSvc?.getEditRow(rowNode);\n const hasErrors = this.editModelSvc?.getRowValidationModel().hasRowValidation({ rowNode });\n if (!edits && rowNode.pinnedSibling) {\n rowNode = rowNode.pinnedSibling;\n edits = editModelSvc?.getEditRow(rowNode);\n }\n if (edits) {\n const editing = Array.from(edits.keys()).some((column) => {\n const position = { rowNode, column };\n return _hasEdits(beans, position, true) || _hasLeafEdits(beans, position) || _hasPinnedEdits(beans, position);\n });\n this.applyStyle(hasErrors, editing);\n return;\n }\n this.applyStyle(hasErrors);\n }\n applyStyle(hasErrors = false, editing = false) {\n const batchEdit = !!this.editSvc?.isBatchEditing();\n const fullRow = this.gos.get(\"editType\") === \"fullRow\";\n this.rowCtrl?.forEachGui(void 0, ({ rowComp }) => {\n rowComp.toggleCss(\"ag-row-editing\", fullRow && editing);\n rowComp.toggleCss(\"ag-row-batch-edit\", fullRow && editing && batchEdit);\n rowComp.toggleCss(\"ag-row-inline-editing\", editing);\n rowComp.toggleCss(\"ag-row-not-inline-editing\", !editing);\n rowComp.toggleCss(\"ag-row-editing-invalid\", fullRow && editing && hasErrors);\n });\n }\n};\n\n// packages/ag-grid-community/src/edit/utils/refresh.ts\nvar purgeRows = ({ rowModel, pinnedRowModel, editModelSvc }, rowNodes) => {\n const found = /* @__PURE__ */ new Set();\n rowModel.forEachNode((node) => rowNodes.has(node) && found.add(node));\n pinnedRowModel?.forEachPinnedRow(\"top\", (node) => rowNodes.has(node) && found.add(node));\n pinnedRowModel?.forEachPinnedRow(\"bottom\", (node) => rowNodes.has(node) && found.add(node));\n for (const rowNode of rowNodes) {\n if (!found.has(rowNode)) {\n editModelSvc.removeEdits({ rowNode });\n }\n }\n return found;\n};\nvar purgeCells = ({ editModelSvc }, rowNodes, columns) => {\n for (const rowNode of rowNodes) {\n editModelSvc?.getEditRow(rowNode)?.forEach((_, column) => !columns.has(column) && editModelSvc.removeEdits({ rowNode, column }));\n }\n};\nvar _refreshEditCells = (beans) => () => {\n const columns = new Set(beans.colModel.getCols());\n const updates = beans.editModelSvc.getEditMap(true);\n const rowNodes = new Set(updates.keys());\n purgeCells(beans, purgeRows(beans, rowNodes), columns);\n};\n\n// packages/ag-grid-community/src/edit/editService.ts\nvar KEEP_EDITOR_SOURCES = /* @__PURE__ */ new Set([\"undo\", \"redo\", \"paste\", \"bulk\", \"rangeSvc\"]);\nvar INTERNAL_EDITOR_SOURCES = /* @__PURE__ */ new Set([\"ui\", \"api\"]);\nvar STOP_EDIT_SOURCE_TRANSFORM = {\n paste: \"api\",\n rangeSvc: \"api\",\n fillHandle: \"api\",\n cellClear: \"api\",\n bulk: \"api\"\n};\nvar STOP_EDIT_SOURCE_TRANSFORM_KEYS = new Set(Object.keys(STOP_EDIT_SOURCE_TRANSFORM));\nvar SET_DATA_SOURCE_AS_API = /* @__PURE__ */ new Set([\"paste\", \"rangeSvc\", \"cellClear\", \"redo\", \"undo\"]);\nvar CANCEL_PARAMS = { cancel: true, source: \"api\" };\nvar COMMIT_PARAMS = { cancel: false, source: \"api\" };\nvar CHECK_SIBLING = { checkSiblings: true };\nvar FORCE_REFRESH = { force: true, suppressFlash: true };\nvar FORCE_REFRESH_FLASH = { force: true };\nvar EditService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"editSvc\";\n this.committing = false;\n this.batch = false;\n this.batchStartDispatched = false;\n this.stopping = false;\n this.rangeSelectionWhileEditing = 0;\n }\n postConstruct() {\n const { beans } = this;\n this.model = beans.editModelSvc;\n this.valueSvc = beans.valueSvc;\n this.rangeSvc = beans.rangeSvc;\n this.addManagedPropertyListener(\"editType\", ({ currentValue }) => {\n this.stopEditing(void 0, CANCEL_PARAMS);\n this.createStrategy(currentValue);\n });\n const handler = _refreshEditCells(beans);\n const stopInvalidEdits = () => {\n const hasCellValidation = this.model.getCellValidationModel().getCellValidationMap().size > 0;\n const hasRowValidation = this.model.getRowValidationModel().getRowValidationMap().size > 0;\n if (hasCellValidation || hasRowValidation) {\n this.stopEditing(void 0, CANCEL_PARAMS);\n } else if (this.isEditing()) {\n if (this.batch) {\n _destroyEditors(beans, this.model.getEditPositions());\n } else {\n this.stopEditing(void 0, COMMIT_PARAMS);\n }\n }\n return false;\n };\n this.addManagedEventListeners({\n columnPinned: handler,\n columnVisible: handler,\n columnRowGroupChanged: handler,\n rowExpansionStateChanged: handler,\n pinnedRowsChanged: handler,\n displayedRowsChanged: handler,\n sortChanged: stopInvalidEdits,\n filterChanged: stopInvalidEdits,\n cellFocused: this.onCellFocused.bind(this)\n });\n }\n isBatchEditing() {\n return this.batch;\n }\n startBatchEditing() {\n if (this.batch) {\n return;\n }\n this.batch = true;\n this.batchStartDispatched = false;\n this.stopEditing(void 0, CANCEL_PARAMS);\n }\n stopBatchEditing(params) {\n if (!this.batch) {\n return;\n }\n if (params) {\n this.stopEditing(void 0, params);\n }\n if (this.batchStartDispatched) {\n this.dispatchBatchStopped(/* @__PURE__ */ new Map(), false);\n }\n this.batch = false;\n this.batchStartDispatched = false;\n }\n /** Lazily dispatch batchEditingStarted when the first write or editor open occurs during a batch session. */\n ensureBatchStarted() {\n if (!this.batch || this.batchStartDispatched) {\n return;\n }\n this.batchStartDispatched = true;\n this.dispatchBatchEvent(\"batchEditingStarted\", /* @__PURE__ */ new Map());\n }\n createStrategy(editType) {\n const { beans, gos, strategy } = this;\n const name = getEditType(gos, editType);\n if (strategy) {\n if (strategy.beanName === name) {\n return strategy;\n }\n this.destroyStrategy();\n }\n return this.strategy = this.createOptionalManagedBean(\n beans.registry.createDynamicBean(name, true)\n );\n }\n destroyStrategy() {\n if (!this.strategy) {\n return;\n }\n this.strategy.destroy();\n this.strategy = this.destroyBean(this.strategy);\n }\n shouldStartEditing(position, event, cellStartedEdit, source = \"ui\") {\n const shouldStart = shouldStartEditing(this.beans, position, event, cellStartedEdit, source);\n if (shouldStart) {\n this.strategy ?? (this.strategy = this.createStrategy());\n }\n return shouldStart;\n }\n shouldStopEditing(position, event, source = \"ui\") {\n return this.strategy?.shouldStop(position, event, source) ?? null;\n }\n shouldCancelEditing(position, event, source = \"ui\") {\n return this.strategy?.shouldCancel(position, event, source) ?? null;\n }\n validateEdit() {\n return _validateEdit(this.beans);\n }\n isEditing(position, params) {\n return this.model.hasEdits(position ?? void 0, params ?? CHECK_SIBLING);\n }\n isRowEditing(rowNode, params) {\n return !!rowNode && this.model.hasRowEdits(rowNode, params);\n }\n enableRangeSelectionWhileEditing() {\n if (this.beans.rangeSvc && this.gos.get(\"cellSelection\")) {\n this.rangeSelectionWhileEditing++;\n }\n }\n disableRangeSelectionWhileEditing() {\n this.rangeSelectionWhileEditing = Math.max(0, this.rangeSelectionWhileEditing - 1);\n }\n isRangeSelectionEnabledWhileEditing() {\n return this.rangeSelectionWhileEditing > 0;\n }\n /** @returns whether to prevent default on event */\n startEditing(position, params) {\n const { startedEdit = true, event = null, source = \"ui\", ignoreEventKey = false, silent } = params;\n this.strategy ?? (this.strategy = this.createStrategy());\n const editable = params.editable ?? this.isCellEditable(position, \"api\");\n if (!editable) {\n return;\n }\n const cellCtrl = _getCellCtrl(this.beans, position);\n if (cellCtrl && !cellCtrl.comp) {\n params.editable = void 0;\n cellCtrl.onCompAttachedFuncs.push(() => this.startEditing(position, params));\n return;\n }\n const res = this.shouldStartEditing(position, event, startedEdit, source);\n if (res === false && source !== \"api\") {\n if (this.isEditing(position)) {\n this.stopEditing();\n }\n return;\n }\n if (!this.batch && this.shouldStopEditing(position, void 0, source) && !params.continueEditing) {\n this.stopEditing(void 0, { source });\n }\n if (res) {\n this.ensureBatchStarted();\n }\n this.strategy.start({\n position,\n event,\n source,\n ignoreEventKey,\n startedEdit,\n silent\n });\n }\n stopEditing(position, params) {\n const context = this.prepareStopContext(position, params);\n if (!context) {\n return false;\n }\n this.stopping = true;\n let res = false;\n let { edits } = context;\n try {\n const outcome = this.processStopRequest(context);\n res || (res = outcome.res);\n edits = outcome.edits;\n this.finishStopEditing({\n ...context,\n edits,\n params,\n position,\n res\n });\n return res;\n } finally {\n this.rangeSelectionWhileEditing = 0;\n this.stopping = false;\n }\n }\n prepareStopContext(position, params) {\n const {\n event = null,\n cancel = false,\n source = \"ui\",\n forceCancel = false,\n forceStop = false,\n commit = false\n } = params || {};\n if (STOP_EDIT_SOURCE_TRANSFORM_KEYS.has(source) && this.batch) {\n if (position?.rowNode && position?.column) {\n this.bulkRefreshCell(position);\n }\n return null;\n }\n const treatAsSource = this.committing ? STOP_EDIT_SOURCE_TRANSFORM[source] : source;\n const isEditingOrBatchWithEdits = this.committing || this.isEditing(position) || this.batch && this.model.hasEdits(position, CHECK_SIBLING);\n if (!isEditingOrBatchWithEdits || !this.strategy || this.stopping) {\n return null;\n }\n const cellCtrl = _getCellCtrl(this.beans, position);\n if (cellCtrl) {\n cellCtrl.onEditorAttachedFuncs = [];\n }\n const willStop = !cancel && (!!this.shouldStopEditing(position, event, treatAsSource) || (this.committing || source === \"paste\") && !this.batch) || forceStop;\n const willCancel = cancel && !!this.shouldCancelEditing(position, event, treatAsSource) || forceCancel;\n return {\n cancel,\n cellCtrl,\n edits: this.model.getEditMap(true),\n event: event ?? null,\n forceCancel,\n forceStop,\n commit,\n position,\n source,\n treatAsSource,\n willCancel,\n willStop\n };\n }\n processStopRequest(context) {\n const { event, position, willCancel, willStop } = context;\n if (willStop || willCancel) {\n return this.handleStopOrCancel(context);\n }\n if (this.shouldHandleMidBatchKey(event, position)) {\n return {\n res: false,\n edits: this.handleMidBatchKey(event, position, context)\n };\n }\n _syncFromEditors(this.beans, { persist: true });\n if (this.batch) {\n this.strategy?.cleanupEditors(position);\n }\n return { res: false, edits: this.model.getEditMap() };\n }\n handleStopOrCancel(context) {\n const { beans, model } = this;\n const { cancel, commit, edits, event, source, willCancel, willStop } = context;\n const persist = !this.batch || !willCancel;\n _syncFromEditors(beans, { persist, isCancelling: willCancel || cancel, isStopping: willStop });\n const freshEdits = model.getEditMap();\n const shouldCommit = !willCancel && (!this.batch || commit);\n const editsToDelete = shouldCommit ? this.processEdits(freshEdits, source) : [];\n if (cancel) {\n this.strategy?.stopCancelled(context.forceCancel);\n } else {\n this.strategy?.stopCommitted(event, commit);\n }\n this.clearValidationIfNoOpenEditors();\n for (const position of editsToDelete) {\n model.clearEditValue(position);\n }\n this.bulkRefreshMap(edits);\n for (const pos of model.getEditPositions(freshEdits)) {\n const cellCtrl = _getCellCtrl(beans, pos);\n const valueChanged = _sourceAndPendingDiffer(pos);\n cellCtrl?.refreshCell({ force: true, suppressFlash: !valueChanged });\n }\n return { res: willStop, edits: freshEdits };\n }\n shouldHandleMidBatchKey(event, position) {\n return event instanceof KeyboardEvent && this.batch && !!this.strategy?.midBatchInputsAllowed(position) && this.isEditing(position, { withOpenEditor: true });\n }\n handleMidBatchKey(event, position, context) {\n const { beans, model } = this;\n const { cellCtrl, edits } = context;\n const { key } = event;\n const isEnter = key === KeyCode.ENTER;\n const isEscape = key === KeyCode.ESCAPE;\n const isTab = key === KeyCode.TAB;\n if (isEnter || isTab || isEscape) {\n if (isEnter || isTab) {\n _syncFromEditors(beans, { persist: true });\n } else if (isEscape && cellCtrl) {\n const { rowNode, column } = cellCtrl;\n if (this.batch && rowNode && column) {\n const pos = { rowNode, column };\n _destroyEditors(beans, [pos], { silent: true });\n this.model.stop(pos, true, true);\n _getCellCtrl(beans, pos)?.refreshCell(FORCE_REFRESH);\n } else {\n this.revertSingleCellEdit(cellCtrl);\n }\n }\n if (this.batch) {\n this.strategy?.cleanupEditors();\n } else {\n _destroyEditors(beans, model.getEditPositions(), { event, cancel: isEscape });\n }\n event.preventDefault();\n this.bulkRefreshMap(edits, { suppressFlash: true });\n return model.getEditMap();\n }\n return edits;\n }\n finishStopEditing({\n cellCtrl,\n edits,\n params,\n position,\n res,\n commit,\n forceCancel,\n willCancel,\n willStop\n }) {\n const beans = this.beans;\n if (res && position) {\n if (!this.batch || commit) {\n this.model.removeEdits(position);\n }\n }\n this.navigateAfterEdit(params, cellCtrl?.cellPosition);\n _purgeUnchangedEdits(beans);\n this.clearValidationIfNoOpenEditors();\n const { rowRenderer, formula } = beans;\n if (willCancel) {\n rowRenderer.refreshRows({ rowNodes: Array.from(edits.keys()) });\n }\n if (this.batch) {\n if (formula) {\n formula.refreshFormulas(true);\n } else {\n rowRenderer.refreshRows({ suppressFlash: true, force: true });\n }\n const batchCommit = willStop && commit;\n const batchCancel = willCancel && forceCancel;\n if (batchCommit || batchCancel) {\n this.dispatchBatchStopped(edits, batchCommit);\n }\n }\n }\n /** Dispatch batchEditingStopped if batchEditingStarted was (or should have been) dispatched. */\n dispatchBatchStopped(edits, commit) {\n let eventEdits;\n if (commit) {\n eventEdits = _filterChangedEdits(edits);\n if (eventEdits.size > 0) {\n this.ensureBatchStarted();\n }\n }\n if (this.batchStartDispatched) {\n this.batchStartDispatched = false;\n this.dispatchBatchEvent(\"batchEditingStopped\", eventEdits ?? /* @__PURE__ */ new Map());\n }\n }\n clearValidationIfNoOpenEditors() {\n const hasOpenEditors = this.model.hasEdits(void 0, { withOpenEditor: true });\n if (!hasOpenEditors) {\n this.model.getCellValidationModel().clearCellValidationMap();\n this.model.getRowValidationModel().clearRowValidationMap();\n }\n }\n navigateAfterEdit(params, cellPosition) {\n if (!params || !cellPosition) {\n return;\n }\n const { event, suppressNavigateAfterEdit } = params;\n const isKeyBoardEvent = event instanceof KeyboardEvent;\n if (!isKeyBoardEvent || suppressNavigateAfterEdit) {\n return;\n }\n const { key, shiftKey } = event;\n const navAfterEdit = this.gos.get(\"enterNavigatesVerticallyAfterEdit\");\n if (key !== KeyCode.ENTER || !navAfterEdit) {\n return;\n }\n const direction = shiftKey ? KeyCode.UP : KeyCode.DOWN;\n this.beans.navigation?.navigateToNextCell(null, direction, cellPosition, false);\n }\n processEdits(edits, source) {\n const rowNodes = Array.from(edits.keys());\n const hasValidationErrors = this.model.getCellValidationModel().getCellValidationMap().size > 0 || this.model.getRowValidationModel().getRowValidationMap().size > 0;\n const editsToDelete = [];\n const { changeDetectionSvc } = this.beans;\n changeDetectionSvc?.beginDeferred();\n try {\n for (const rowNode of rowNodes) {\n const editRow = edits.get(rowNode);\n for (const column of editRow.keys()) {\n const editValue = editRow.get(column);\n const position = { rowNode, column };\n if (_sourceAndPendingDiffer(editValue) && !hasValidationErrors) {\n const cellCtrl = _getCellCtrl(this.beans, position);\n const success = this.setNodeDataValue(\n rowNode,\n column,\n editValue.pendingValue,\n cellCtrl,\n source\n );\n if (!success) {\n editsToDelete.push(position);\n }\n }\n }\n }\n } finally {\n changeDetectionSvc?.endDeferred();\n }\n return editsToDelete;\n }\n /**\n * Commits a value to the row node's data via `rowNode.setDataValue`.\n *\n * This is a low-level helper that only writes to data; it does NOT update the\n * edit model. Callers are responsible for any model reconciliation — see\n * `syncEditAfterCommit` for the non-batch case and `processEdits` for the\n * batch-finalisation case (where edits are removed immediately after commit).\n */\n setNodeDataValue(rowNode, column, newValue, cellCtrl, originalSource = \"edit\") {\n const translatedSource = INTERNAL_EDITOR_SOURCES.has(originalSource) ? \"edit\" : originalSource;\n if (cellCtrl) {\n cellCtrl.suppressRefreshCell = true;\n }\n this.committing = true;\n try {\n return rowNode.setDataValue(column, newValue, translatedSource);\n } finally {\n this.committing = false;\n if (cellCtrl) {\n cellCtrl.suppressRefreshCell = false;\n }\n }\n }\n /**\n * Syncs the edit model after a non-batch commit so sourceValue never becomes stale.\n * On success, re-reads the actual committed value from data (via getValue) because\n * a custom valueSetter may transform or store it differently than the passed value.\n * On failure, reverts the pending edit back to sourceValue.\n *\n * Skipped when an editor is open (state === 'editing'), because the upcoming\n * stopEditing flow will call _syncFromEditors which reads from the editor widget;\n * updating sourceValue here would cause that flow to re-commit stale editor content.\n *\n * NOTE: The re-read via `getValue` happens after `setNodeDataValue` has dispatched\n * `cellValueChanged`. If a `cellValueChanged` listener synchronously mutates the\n * same data field, the re-read will pick up that mutation. This is acceptable because\n * the listener intentionally transformed the value and the model should track the\n * actual committed state.\n */\n syncEditAfterCommit(position, success) {\n const edit = this.model.getEdit(position);\n if (edit && edit.state !== \"editing\") {\n if (success) {\n this.beans.editModelSvc?.setEdit(position, { sourceValue: edit.pendingValue });\n } else {\n this.model.clearEditValue(position);\n }\n }\n }\n setEditMap(edits, params) {\n this.strategy ?? (this.strategy = this.createStrategy());\n this.strategy?.setEditMap(edits, params);\n this.bulkRefreshMap(edits);\n let refreshParams = FORCE_REFRESH;\n if (params?.forceRefreshOfEditCellsOnly) {\n refreshParams = {\n ...getRowColumnsFromMap(edits),\n ...FORCE_REFRESH\n };\n }\n this.beans.rowRenderer.refreshCells(refreshParams);\n }\n dispatchEditValuesChanged({ rowNode, column }, edit = {}) {\n if (!rowNode || !column || !edit) {\n return;\n }\n const { pendingValue, sourceValue } = edit;\n const { rowIndex, rowPinned, data } = rowNode;\n this.beans.eventSvc.dispatchEvent({\n type: \"cellEditValuesChanged\",\n node: rowNode,\n rowIndex,\n rowPinned,\n column,\n source: \"api\",\n data,\n newValue: pendingValue,\n oldValue: sourceValue,\n value: pendingValue,\n colDef: column.getColDef()\n });\n }\n bulkRefreshCell(position, params) {\n if (_isClientSideRowModel(this.gos, this.beans.rowModel)) {\n this.refCell(position, this.model.getEdit(position), params);\n }\n }\n bulkRefreshMap(editMap, params) {\n if (_isClientSideRowModel(this.gos, this.beans.rowModel)) {\n editMap.forEach((editRow, rowNode) => {\n for (const column of editRow.keys()) {\n this.refCell({ rowNode, column }, editRow.get(column), params);\n }\n });\n }\n }\n refCell({ rowNode, column }, edit, params = {}) {\n const { beans, gos } = this;\n const updatedNodes = /* @__PURE__ */ new Set([rowNode]);\n const refreshNodes = /* @__PURE__ */ new Set();\n const pinnedSibling = rowNode.pinnedSibling;\n if (pinnedSibling) {\n updatedNodes.add(pinnedSibling);\n }\n const sibling = rowNode.sibling;\n if (sibling) {\n refreshNodes.add(sibling);\n }\n let parent = rowNode.parent;\n while (parent) {\n if (parent.sibling?.footer && gos.get(\"groupTotalRow\")) {\n refreshNodes.add(parent.sibling);\n } else if (!parent.parent && parent.sibling && gos.get(\"grandTotalRow\")) {\n refreshNodes.add(parent.sibling);\n } else {\n refreshNodes.add(parent);\n }\n parent = parent.parent;\n }\n for (const node of updatedNodes) {\n this.dispatchEditValuesChanged({ rowNode: node, column }, edit);\n }\n for (const node of updatedNodes) {\n _getCellCtrl(beans, { rowNode: node, column })?.refreshCell(params);\n }\n for (const node of refreshNodes) {\n const cellCtrl = _getCellCtrl(beans, { rowNode: node, column });\n if (cellCtrl) {\n cellCtrl.refreshCell(params);\n if (!params.force && this.batch) {\n cellCtrl.editStyleFeature?.applyCellStyles?.();\n }\n }\n }\n }\n stopAllEditing(cancel = false, source = \"ui\") {\n if (this.isEditing()) {\n this.stopEditing(void 0, { cancel, source });\n }\n }\n isCellEditable(position, source = \"ui\") {\n const { gos, beans } = this;\n const rowNode = position.rowNode;\n if (rowNode.group && position.column.getColDef().groupRowEditable == null) {\n if (gos.get(\"treeData\")) {\n if (!rowNode.data && !gos.get(\"enableGroupEdit\")) {\n return false;\n }\n } else if (!gos.get(\"enableGroupEdit\")) {\n return false;\n }\n }\n const isEditable = getEditType(gos) === \"fullRow\" ? isFullRowCellEditable(beans, position, source) : isCellEditable(beans, position);\n if (isEditable) {\n this.strategy ?? (this.strategy = this.createStrategy());\n }\n return isEditable;\n }\n cellEditingInvalidCommitBlocks() {\n return this.gos.get(\"invalidEditValueMode\") === \"block\";\n }\n checkNavWithValidation(position, event, focus = true) {\n if (this.hasValidationErrors(position)) {\n const cellCtrl = _getCellCtrl(this.beans, position);\n if (this.cellEditingInvalidCommitBlocks()) {\n event?.preventDefault?.();\n if (focus) {\n if (cellCtrl && !cellCtrl.hasBrowserFocus()) {\n cellCtrl.focusCell();\n }\n cellCtrl?.comp?.getCellEditor()?.focusIn?.();\n }\n return \"block-stop\";\n }\n if (cellCtrl) {\n this.revertSingleCellEdit(cellCtrl);\n }\n return \"revert-continue\";\n }\n return \"continue\";\n }\n revertSingleCellEdit(cellPosition, focus = false) {\n const cellCtrl = _getCellCtrl(this.beans, cellPosition);\n if (!cellCtrl?.comp?.getCellEditor()) {\n return;\n }\n _destroyEditors(this.beans, [cellPosition], { silent: true });\n this.model.clearEditValue(cellPosition);\n _setupEditor(this.beans, cellPosition, { silent: true });\n _populateModelValidationErrors(this.beans);\n cellCtrl?.refreshCell(FORCE_REFRESH);\n if (!focus) {\n return;\n }\n cellCtrl?.focusCell();\n cellCtrl?.comp?.getCellEditor()?.focusIn?.();\n }\n hasValidationErrors(position) {\n _populateModelValidationErrors(this.beans);\n const cellCtrl = _getCellCtrl(this.beans, position);\n if (cellCtrl) {\n cellCtrl.refreshCell(FORCE_REFRESH);\n cellCtrl.rowCtrl.rowEditStyleFeature?.applyRowStyles();\n }\n let invalid = false;\n if (position?.rowNode) {\n invalid || (invalid = this.model.getRowValidationModel().hasRowValidation({ rowNode: position.rowNode }));\n if (position.column) {\n invalid || (invalid = this.model.getCellValidationModel().hasCellValidation({ rowNode: position.rowNode, column: position.column }));\n }\n } else {\n invalid || (invalid = this.model.getCellValidationModel().getCellValidationMap().size > 0);\n invalid || (invalid = this.model.getRowValidationModel().getRowValidationMap().size > 0);\n }\n return invalid;\n }\n moveToNextCell(prev, backwards, event, source = \"ui\") {\n let res;\n const editing = this.isEditing();\n const preventNavigation = editing && this.checkNavWithValidation(void 0, event) === \"block-stop\";\n if (prev instanceof CellCtrl && editing) {\n res = this.strategy?.moveToNextEditingCell(prev, backwards, event, source, preventNavigation);\n }\n if (res === null) {\n return res;\n }\n res = res || !!this.beans.focusSvc.focusedHeader;\n if (res === false && !preventNavigation) {\n this.stopEditing();\n }\n return res;\n }\n /**\n * Gets the pending edit value for a cell (used by ValueService).\n * Returns undefined to fallback to committed data/valueGetter.\n */\n getPendingEditValue(rowNode, column, from) {\n if (from === \"data\") {\n return void 0;\n }\n if (from === \"batch\" && !this.batch) {\n return void 0;\n }\n const edit = this.model.getEdit({ rowNode, column }, CHECK_SIBLING);\n if (!edit) {\n return void 0;\n }\n if (this.stopping && !this.batch && !edit.editorState?.cellStartedEditing) {\n return void 0;\n }\n if (from === \"edit\") {\n const editorValue = edit.editorValue;\n if (editorValue != null && editorValue !== UNEDITED) {\n return editorValue;\n }\n }\n const pendingValue = edit.pendingValue;\n if (pendingValue !== UNEDITED) {\n return pendingValue;\n }\n return void 0;\n }\n getCellDataValue(position) {\n const edit = this.model.getEdit(position, CHECK_SIBLING);\n if (edit) {\n const newValue = edit.pendingValue;\n if (newValue !== UNEDITED) {\n return newValue;\n }\n const sourceValue = edit.sourceValue;\n if (sourceValue != null) {\n return sourceValue;\n }\n }\n return this.valueSvc.getValue(position.column, position.rowNode, \"data\");\n }\n addStopEditingWhenGridLosesFocus(viewports) {\n _addStopEditingWhenGridLosesFocus(this, this.beans, viewports);\n }\n createPopupEditorWrapper(params) {\n return new PopupEditorWrapper(params);\n }\n batchResetToSourceValue(position) {\n if (!this.batch) {\n return false;\n }\n const existing = this.model.getEdit(position);\n if (!existing) {\n return false;\n }\n const { pendingValue, sourceValue, state } = existing;\n if (pendingValue === sourceValue) {\n return false;\n }\n if (state === \"editing\") {\n return false;\n }\n this.dispatchEditValuesChanged(position, { ...existing, pendingValue: sourceValue });\n this.beans.editModelSvc?.removeEdits(position);\n _getCellCtrl(this.beans, position)?.refreshCell(FORCE_REFRESH);\n return true;\n }\n /**\n * Applies a data value change to a cell, handling batch editing, undo/redo, paste, and range operations.\n */\n setDataValue(position, newValue, eventSource) {\n try {\n const batch = this.batch;\n const editing = this.isEditing(batch ? void 0 : position);\n if ((!editing || this.committing) && !batch && !SET_DATA_SOURCE_AS_API.has(eventSource)) {\n return;\n }\n if (!editing && !batch && eventSource === \"paste\") {\n return;\n }\n if (eventSource === \"batch\" && !batch) {\n return;\n }\n if (eventSource === \"edit\") {\n if (editing && this.applyEditorValue(position, newValue)) {\n return true;\n }\n if (!batch) {\n return;\n }\n }\n this.strategy ?? (this.strategy = this.createStrategy());\n if (eventSource === \"batch\" || eventSource === \"edit\") {\n return this.applyDirectValue(position, newValue, eventSource);\n }\n const beans = this.beans;\n let source;\n if (batch) {\n source = \"ui\";\n } else if (this.committing) {\n source = eventSource ?? \"api\";\n } else {\n source = \"api\";\n }\n if (!eventSource || KEEP_EDITOR_SOURCES.has(eventSource)) {\n return this.applyDirectValue(position, newValue, eventSource);\n }\n const result = this.applyExistingEdit(position, newValue, eventSource, source);\n if (result !== void 0) {\n return result;\n }\n _syncFromEditor(beans, position, newValue, eventSource, void 0, { persist: true });\n this.ensureBatchStarted();\n this.stopEditing(position, {\n source,\n suppressNavigateAfterEdit: true\n });\n return true;\n } finally {\n this.committing = false;\n }\n }\n /** Handles setDataValue when an edit already exists for the cell. */\n applyExistingEdit(position, newValue, eventSource, source) {\n const existing = this.model.getEdit(position);\n if (!existing) {\n return void 0;\n }\n if (existing.pendingValue === newValue) {\n return false;\n }\n if (existing.sourceValue !== newValue) {\n _syncFromEditor(this.beans, position, newValue, eventSource, void 0, { persist: true });\n this.ensureBatchStarted();\n this.stopEditing(position, {\n source,\n suppressNavigateAfterEdit: true\n });\n return true;\n }\n this.beans.editModelSvc?.removeEdits(position);\n this.ensureBatchStarted();\n this.dispatchEditValuesChanged(position, {\n ...existing,\n pendingValue: newValue\n });\n return true;\n }\n /**\n * Pushes a value into an open cell editor without closing it or committing.\n * Updates editorValue and pendingValue in the edit model, then refreshes the editor DOM.\n * Returns true if an editor was open and updated, false otherwise.\n */\n applyEditorValue(position, newValue) {\n const beans = this.beans;\n const cellCtrl = _getCellCtrl(beans, position);\n const editor = cellCtrl?.comp?.getCellEditor();\n if (!cellCtrl || !editor) {\n return false;\n }\n _syncFromEditor(beans, position, newValue, \"edit\", void 0, { persist: true });\n cellCtrl.editStyleFeature?.applyCellStyles?.();\n if (\"agSetEditValue\" in editor) {\n editor.agSetEditValue(newValue);\n return true;\n }\n if (editor.refresh && cellCtrl.editCompDetails) {\n editor.refresh({ ...cellCtrl.editCompDetails.params, value: newValue });\n return true;\n }\n const restoreFocus = cellCtrl.hasBrowserFocus();\n if (restoreFocus) {\n cellCtrl.onEditorAttachedFuncs.push(() => {\n const latestCellCtrl = _getCellCtrl(this.beans, position);\n latestCellCtrl?.focusCell(true);\n latestCellCtrl?.comp?.getCellEditor()?.focusIn?.();\n });\n }\n _destroyEditors(beans, [position], { silent: true, cancel: true });\n _setupEditor(beans, position, { silent: true });\n _populateModelValidationErrors(beans);\n _getCellCtrl(beans, position)?.refreshCell(FORCE_REFRESH);\n return true;\n }\n /** editApi or undoRedoApi apply change without involving the editor. */\n applyDirectValue(position, newValue, eventSource) {\n const beans = this.beans;\n if (this.batch) {\n if (eventSource === \"batch\" && _getCellCtrl(beans, position)?.comp?.getCellEditor()) {\n const { editModelSvc, valueSvc } = beans;\n const { rowNode, column } = position;\n const existingEdit = editModelSvc?.getEdit(position);\n if (existingEdit?.sourceValue === void 0) {\n editModelSvc?.setEdit(position, {\n sourceValue: valueSvc.getValue(column, rowNode, \"data\")\n });\n }\n editModelSvc?.setEdit(position, { pendingValue: newValue });\n } else {\n _syncFromEditor(beans, position, newValue, eventSource, void 0, { persist: true });\n if (eventSource !== \"batch\") {\n this.cleanupEditors();\n }\n }\n _purgeUnchangedEdits(beans);\n this.ensureBatchStarted();\n this.bulkRefreshCell(position);\n return true;\n }\n _syncFromEditor(beans, position, newValue, eventSource, void 0, { persist: true });\n const cellCtrl = _getCellCtrl(beans, position);\n const success = this.setNodeDataValue(position.rowNode, position.column, newValue, cellCtrl, eventSource);\n this.syncEditAfterCommit(position, success);\n _purgeUnchangedEdits(beans);\n _getCellCtrl(beans, position)?.refreshCell(success ? FORCE_REFRESH_FLASH : FORCE_REFRESH);\n return success;\n }\n handleColDefChanged(cellCtrl) {\n _refreshEditorOnColDefChanged(this.beans, cellCtrl);\n }\n destroy() {\n this.model.clear();\n this.destroyStrategy();\n super.destroy();\n }\n prepDetailsDuringBatch(position, params) {\n const { model } = this;\n if (!this.batch) {\n return;\n }\n const hasEdits = model.hasRowEdits(position.rowNode, CHECK_SIBLING);\n if (!hasEdits) {\n return;\n }\n const { rowNode } = position;\n const { compDetails, valueToDisplay } = params;\n if (compDetails) {\n const { params: params2 } = compDetails;\n params2.data = model.getEditRowDataValue(rowNode, CHECK_SIBLING);\n return { compDetails };\n }\n return { valueToDisplay };\n }\n cleanupEditors() {\n this.strategy?.cleanupEditors();\n }\n dispatchCellEvent(position, event, type, payload) {\n this.strategy?.dispatchCellEvent(position, event, type, payload);\n }\n dispatchBatchEvent(type, edits) {\n this.eventSvc.dispatchEvent(this.createBatchEditEvent(type, edits));\n }\n createBatchEditEvent(type, edits) {\n return _addGridCommonParams(this.gos, {\n type,\n ...type === \"batchEditingStopped\" ? {\n changes: this.toEventChangeList(edits)\n } : {}\n });\n }\n toEventChangeList(edits) {\n return this.model.getEditPositions(edits).map((edit) => ({\n rowIndex: edit.rowNode.rowIndex,\n rowPinned: edit.rowNode.rowPinned,\n columnId: edit.column.getColId(),\n newValue: edit.pendingValue,\n oldValue: edit.sourceValue\n }));\n }\n applyBulkEdit({ rowNode, column }, ranges) {\n if (!ranges || ranges.length === 0) {\n return;\n }\n const { beans, rangeSvc, valueSvc } = this;\n const { formula } = beans;\n _syncFromEditors(beans, { persist: true });\n const edits = this.model.getEditMap(true);\n let editValue = edits.get(rowNode)?.get(column)?.pendingValue;\n let bulkStartDispatched = false;\n if (!this.batch) {\n this.eventSvc.dispatchEvent({ type: \"bulkEditingStarted\" });\n bulkStartDispatched = true;\n }\n const isFormula = formula?.isFormula(editValue) ?? false;\n ranges.forEach((range) => {\n const hasFormulaColumnsInRange = range.columns.some((col) => col?.isAllowFormula());\n rangeSvc?.forEachRowInRange(range, (position) => {\n const rowNode2 = _getRowNode(beans, position);\n if (rowNode2 === void 0) {\n return;\n }\n const editRow = edits.get(rowNode2) ?? /* @__PURE__ */ new Map();\n let valueForColumn = editValue;\n for (const column2 of range.columns) {\n if (!column2) {\n continue;\n }\n const isFormulaForColumn = !!isFormula && column2.isAllowFormula();\n if (this.isCellEditable({ rowNode: rowNode2, column: column2 }, \"api\")) {\n const sourceValue = valueSvc.getValue(column2, rowNode2, \"data\", true);\n let pendingValue = valueSvc.parseValue(\n column2,\n rowNode2 ?? null,\n valueForColumn,\n sourceValue\n );\n if (Number.isNaN(pendingValue)) {\n pendingValue = null;\n }\n editRow.set(column2, {\n editorValue: void 0,\n pendingValue,\n sourceValue,\n state: \"changed\",\n editorState: {\n isCancelAfterEnd: void 0,\n isCancelBeforeStart: void 0\n }\n });\n }\n if (isFormulaForColumn) {\n valueForColumn = formula?.updateFormulaByOffset({ value: valueForColumn, columnDelta: 1 });\n }\n }\n if (editRow.size > 0) {\n edits.set(rowNode2, editRow);\n }\n if (isFormula && hasFormulaColumnsInRange) {\n editValue = formula?.updateFormulaByOffset({ value: editValue, rowDelta: 1 });\n }\n });\n this.setEditMap(edits);\n if (this.batch) {\n this.cleanupEditors();\n _purgeUnchangedEdits(beans);\n this.ensureBatchStarted();\n return;\n }\n this.committing = true;\n try {\n this.stopEditing(void 0, { source: \"bulk\" });\n } finally {\n this.committing = false;\n if (bulkStartDispatched) {\n this.eventSvc.dispatchEvent({ type: \"bulkEditingStopped\", changes: this.toEventChangeList(edits) });\n }\n }\n });\n const cellCtrl = _getCellCtrl(beans, { rowNode, column });\n if (cellCtrl) {\n cellCtrl.focusCell(true);\n }\n }\n createCellStyleFeature(cellCtrl) {\n return new CellEditStyleFeature(cellCtrl, this.beans);\n }\n createRowStyleFeature(rowCtrl) {\n return new RowEditStyleFeature(rowCtrl, this.beans);\n }\n setEditingCells(cells, params) {\n const { beans } = this;\n const { colModel, valueSvc } = beans;\n const edits = /* @__PURE__ */ new Map();\n for (let { colId, column, colKey, rowIndex, rowPinned, newValue: pendingValue, state } of cells) {\n const col = colId ? colModel.getCol(colId) : colKey ? colModel.getCol(colKey) : column;\n if (!col) {\n continue;\n }\n const rowNode = _getRowNode(beans, { rowIndex, rowPinned });\n if (!rowNode) {\n continue;\n }\n const sourceValue = valueSvc.getValue(col, rowNode, \"data\", true);\n if (!params?.forceRefreshOfEditCellsOnly && !_sourceAndPendingDiffer({ pendingValue, sourceValue }) && state !== \"editing\") {\n continue;\n }\n let editRow = edits.get(rowNode);\n if (!editRow) {\n editRow = /* @__PURE__ */ new Map();\n edits.set(rowNode, editRow);\n }\n if (pendingValue === void 0) {\n pendingValue = UNEDITED;\n }\n editRow.set(col, {\n editorValue: void 0,\n pendingValue,\n sourceValue,\n state: state ?? \"changed\",\n editorState: {\n isCancelAfterEnd: void 0,\n isCancelBeforeStart: void 0\n }\n });\n }\n this.setEditMap(edits, params);\n }\n onCellFocused(event) {\n const cellCtrl = _getCellCtrl(this.beans, event);\n if (!cellCtrl || !this.isEditing(cellCtrl, CHECK_SIBLING)) {\n return;\n }\n const edit = this.model.getEdit(cellCtrl);\n if (!edit || !_sourceAndPendingDiffer(edit)) {\n return;\n }\n const translate = this.getLocaleTextFunc();\n const label = translate(\"ariaPendingChange\", \"Pending Change\");\n this.beans.ariaAnnounce?.announceValue(label, \"pendingChange\");\n }\n allowedFocusTargetOnValidation(cellPosition) {\n return _getCellCtrl(this.beans, cellPosition);\n }\n};\nfunction getRowColumnsFromMap(edits) {\n return {\n rowNodes: edits ? Array.from(edits.keys()) : void 0,\n columns: edits ? [...new Set(Array.from(edits.values()).flatMap((er) => Array.from(er.keys())))] : void 0\n };\n}\nfunction getEditType(gos, editType) {\n return editType ?? gos.get(\"editType\") ?? \"singleCell\";\n}\n\n// packages/ag-grid-community/src/edit/strategy/baseEditStrategy.ts\nvar BaseEditStrategy = class extends BeanStub {\n postConstruct() {\n this.model = this.beans.editModelSvc;\n this.editSvc = this.beans.editSvc;\n this.addManagedEventListeners({\n cellFocused: this.onCellFocusChanged?.bind(this),\n cellFocusCleared: this.onCellFocusChanged?.bind(this)\n });\n }\n clearEdits(position) {\n this.model.clearEditValue(position);\n }\n onCellFocusChanged(event) {\n let cellCtrl;\n const previous = event[\"previousParams\"];\n const { editSvc, beans } = this;\n const sourceEvent = event.type === \"cellFocused\" ? event.sourceEvent : null;\n if (previous) {\n cellCtrl = _getCellCtrl(beans, previous);\n }\n const { gos, editModelSvc } = beans;\n const isFocusCleared = event.type === \"cellFocusCleared\";\n if (editSvc.isEditing(void 0, { withOpenEditor: true })) {\n const { column, rowIndex, rowPinned } = event;\n const cellPositionFromEvent = {\n column,\n rowNode: _getRowNode(beans, { rowIndex, rowPinned })\n };\n const isBlock = gos.get(\"invalidEditValueMode\") === \"block\";\n if (isBlock) {\n return;\n }\n const shouldRevert = !isBlock;\n const hasError = !!editModelSvc?.getCellValidationModel().hasCellValidation(cellPositionFromEvent);\n const shouldCancel = shouldRevert && hasError;\n const result = previous || isFocusCleared ? editSvc.stopEditing(void 0, {\n cancel: shouldCancel,\n source: isFocusCleared && shouldRevert ? \"api\" : void 0,\n event: sourceEvent\n }) : true;\n if (!result) {\n if (editSvc.isBatchEditing()) {\n editSvc.cleanupEditors();\n } else {\n editSvc.stopEditing(void 0, { source: \"api\" });\n }\n }\n }\n cellCtrl?.refreshCell({ suppressFlash: true, force: true });\n }\n stopCancelled(forceCancel) {\n const preserveBatch = this.editSvc.isBatchEditing() && !forceCancel;\n for (const cell of this.model.getEditPositions()) {\n _destroyEditor(this.beans, cell, { cancel: true }, _getCellCtrl(this.beans, cell));\n this.model.stop(cell, preserveBatch, true);\n }\n return true;\n }\n stopCommitted(event, commit) {\n const editingCells = this.model.getEditPositions();\n const results = { all: [], pass: [], fail: [] };\n for (const cell of editingCells) {\n results.all.push(cell);\n if ((this.model.getCellValidationModel().getCellValidation(cell)?.errorMessages?.length ?? 0) > 0) {\n results.fail.push(cell);\n } else {\n results.pass.push(cell);\n }\n }\n const actions = this.processValidationResults(results);\n const preserveBatch = this.editSvc.isBatchEditing() && !commit;\n for (const cell of actions.destroy) {\n _destroyEditor(this.beans, cell, { event }, _getCellCtrl(this.beans, cell));\n this.model.stop(cell, preserveBatch, false);\n }\n for (const cell of actions.keep) {\n const cellCtrl = _getCellCtrl(this.beans, cell);\n if (!this.editSvc.cellEditingInvalidCommitBlocks() && cellCtrl) {\n this.editSvc.revertSingleCellEdit(cellCtrl);\n }\n }\n return true;\n }\n cleanupEditors({ rowNode } = {}, includeEditing) {\n _syncFromEditors(this.beans, { persist: false });\n const positions = this.model.getEditPositions();\n const discard = [];\n if (rowNode) {\n for (const pos of positions) {\n if (pos.rowNode !== rowNode) {\n discard.push(pos);\n }\n }\n } else {\n for (const pos of positions) {\n discard.push(pos);\n }\n }\n _destroyEditors(this.beans, discard);\n _purgeUnchangedEdits(this.beans, includeEditing);\n }\n setFocusOutOnEditor(cellCtrl) {\n cellCtrl.comp?.getCellEditor()?.focusOut?.();\n }\n setFocusInOnEditor(cellCtrl) {\n const comp = cellCtrl.comp;\n const editor = comp?.getCellEditor();\n if (editor?.focusIn) {\n editor.focusIn();\n } else {\n const isFullRow = this.beans.gos.get(\"editType\") === \"fullRow\";\n cellCtrl.focusCell(isFullRow);\n cellCtrl.onEditorAttachedFuncs.push(() => comp?.getCellEditor()?.focusIn?.());\n }\n }\n setupEditors(params) {\n const { event, ignoreEventKey = false, startedEdit, position, cells = this.model.getEditPositions() } = params;\n const key = event instanceof KeyboardEvent && !ignoreEventKey && event.key || void 0;\n _setupEditors(this.beans, cells, position, key, event, startedEdit);\n }\n dispatchCellEvent(position, event, type, payload) {\n const cellCtrl = _getCellCtrl(this.beans, position);\n if (cellCtrl) {\n this.eventSvc.dispatchEvent({ ...cellCtrl.createEvent(event ?? null, type), ...payload });\n }\n }\n dispatchRowEvent(position, type, silent) {\n if (silent) {\n return;\n }\n const rowCtrl = _getRowCtrl(this.beans, position);\n if (rowCtrl) {\n this.eventSvc.dispatchEvent(rowCtrl.createRowEvent(type));\n }\n }\n shouldStop(_position, event, source = \"ui\") {\n const batch = this.editSvc.isBatchEditing();\n if (batch && source === \"api\") {\n return true;\n }\n if (batch && (source === \"ui\" || source === \"edit\")) {\n return false;\n }\n if (source === \"api\") {\n return true;\n }\n if (event instanceof KeyboardEvent && !batch) {\n return event.key === KeyCode.ENTER;\n }\n return null;\n }\n shouldCancel(_position, event, source = \"ui\") {\n const batch = this.editSvc.isBatchEditing();\n if (event instanceof KeyboardEvent && !batch) {\n const result = event.key === KeyCode.ESCAPE;\n if (result) {\n return true;\n }\n }\n if (batch && source === \"api\") {\n return true;\n }\n if (source === \"api\") {\n return true;\n }\n return false;\n }\n setEditMap(edits, params) {\n if (!params?.update) {\n this.editSvc.stopEditing(void 0, { cancel: true, source: \"api\" });\n }\n const cells = [];\n edits.forEach((editRow, rowNode) => {\n editRow.forEach((cellData, column) => {\n if (cellData.state === \"editing\") {\n cells.push({ ...cellData, rowNode, column });\n }\n });\n });\n if (params?.update) {\n edits = new Map([...this.model.getEditMap(), ...edits]);\n }\n this.model?.setEditMap(edits);\n if (cells.length > 0) {\n const position = cells.at(-1);\n const key = position.pendingValue === UNEDITED ? void 0 : position.pendingValue;\n this.start({ position, event: new KeyboardEvent(\"keydown\", { key }), source: \"api\" });\n const cellCtrl = _getCellCtrl(this.beans, position);\n if (cellCtrl) {\n this.setFocusInOnEditor(cellCtrl);\n }\n }\n }\n destroy() {\n this.cleanupEditors();\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/edit/strategy/fullRowEditStrategy.ts\nvar FullRowEditStrategy = class extends BaseEditStrategy {\n constructor() {\n super(...arguments);\n this.beanName = \"fullRow\";\n this.startedRows = /* @__PURE__ */ new Set();\n }\n shouldStop(position, event, _source = \"ui\") {\n const { rowNode: currentRowNode, beans } = this;\n const { rowNode } = position || {};\n const oldRowCtrl = _getRowCtrl(beans, { rowNode: currentRowNode });\n if (!oldRowCtrl) {\n return true;\n }\n const res = super.shouldStop({ rowNode: currentRowNode }, event, _source);\n if (res !== null) {\n return res;\n }\n if (!currentRowNode) {\n return false;\n }\n return rowNode !== currentRowNode;\n }\n midBatchInputsAllowed({ rowNode }) {\n if (!rowNode) {\n return false;\n }\n return this.model.hasEdits({ rowNode });\n }\n clearEdits(position) {\n this.model.clearEditValue(position);\n }\n start(params) {\n const { position, silent, startedEdit, event, ignoreEventKey } = params;\n const { rowNode } = position;\n const { beans, model, startedRows } = this;\n if (this.rowNode !== rowNode) {\n super.cleanupEditors(position);\n }\n const columns = beans.visibleCols.allCols;\n const cells = [];\n const editableColumns = [];\n for (const column of columns) {\n if (column.isCellEditable(rowNode)) {\n editableColumns.push(column);\n }\n }\n if (editableColumns.length == 0) {\n return;\n }\n if (!startedRows.has(rowNode)) {\n this.dispatchRowEvent({ rowNode }, \"rowEditingStarted\", silent);\n startedRows.add(rowNode);\n }\n for (const column of editableColumns) {\n const position2 = {\n rowNode,\n column\n };\n cells.push(position2);\n model.start(position2);\n }\n this.rowNode = rowNode;\n this.setupEditors({ cells, position, startedEdit, event, ignoreEventKey });\n }\n processValidationResults(results) {\n const anyFailed = results.fail.length > 0;\n if (anyFailed && this.editSvc.cellEditingInvalidCommitBlocks()) {\n return {\n destroy: [],\n keep: results.all\n };\n }\n return {\n destroy: results.all,\n keep: []\n };\n }\n stopCancelled(forceCancel) {\n const { rowNode, model } = this;\n if (rowNode && !model.hasRowEdits(rowNode)) {\n return false;\n }\n super.stopCancelled(forceCancel);\n this.cleanupEditors({ rowNode }, true);\n this.rowNode = void 0;\n return true;\n }\n stopCommitted(event, commit) {\n const { rowNode, beans, model, editSvc } = this;\n if (rowNode && !model.hasRowEdits(rowNode)) {\n return false;\n }\n const changedRows = [];\n model.getEditMap().forEach((rowEdits, rowNode2) => {\n if (!rowEdits || rowEdits.size === 0) {\n return;\n }\n for (const edit of rowEdits.values()) {\n if (_sourceAndPendingDiffer(edit)) {\n changedRows.push(rowNode2);\n break;\n }\n }\n });\n _populateModelValidationErrors(beans);\n if (editSvc.checkNavWithValidation({ rowNode }) === \"block-stop\") {\n return false;\n }\n super.stopCommitted(event, commit);\n if (commit || !editSvc.isBatchEditing()) {\n for (const rowNode2 of changedRows) {\n this.dispatchRowEvent({ rowNode: rowNode2 }, \"rowValueChanged\");\n }\n }\n this.cleanupEditors({ rowNode }, true);\n this.rowNode = void 0;\n return true;\n }\n onCellFocusChanged(event) {\n const { rowIndex } = event;\n const prev = event[\"previousParams\"];\n if (prev?.rowIndex === rowIndex || event.sourceEvent instanceof KeyboardEvent) {\n return;\n }\n const { beans, gos, model } = this;\n if (beans.editSvc?.isRangeSelectionEnabledWhileEditing()) {\n return;\n }\n const prevCell = _getCellCtrl(beans, prev);\n const isBlock = gos.get(\"invalidEditValueMode\") === \"block\";\n if (isBlock && prevCell && (model.getCellValidationModel().getCellValidation(prevCell) || model.getRowValidationModel().getRowValidation(prevCell))) {\n return;\n }\n super.onCellFocusChanged(event);\n }\n cleanupEditors(position = {}, includeEditing) {\n super.cleanupEditors(position, includeEditing);\n const { startedRows } = this;\n for (const rowNode of startedRows) {\n this.dispatchRowEvent({ rowNode }, \"rowEditingStopped\");\n this.destroyEditorsForRow(rowNode);\n }\n startedRows.clear();\n }\n /**\n * Destroys all editors for a row that started full row editing, including editors\n * that are not represented in the edit model (e.g. empty/unedited editors).\n */\n destroyEditorsForRow(rowNode) {\n const rowCtrl = _getRowCtrl(this.beans, { rowNode });\n if (!rowCtrl) {\n return;\n }\n const destroyParams = {};\n for (const cellCtrl of rowCtrl.getAllCellCtrls()) {\n if (cellCtrl.comp?.getCellEditor()) {\n _destroyEditor(this.beans, cellCtrl, destroyParams, cellCtrl);\n }\n }\n }\n // returns null if no navigation should be performed\n moveToNextEditingCell(prevCell, backwards, event, source = \"ui\", preventNavigation = false) {\n const { beans, model, gos, editSvc } = this;\n const prevPos = prevCell.cellPosition;\n let nextCell;\n model.suspend(true);\n try {\n nextCell = beans.navigation?.findNextCellToFocusOn(prevPos, {\n backwards,\n startEditing: true,\n // Default behaviour for fullRow is skip to the next cell,\n // editable or not. FullRow editing might have some editable\n // and some not editable cells in the row.\n // More complex logic needed to skip to the\n // next FullRow editable cell,\n skipToNextEditableCell: false\n });\n } finally {\n model.suspend(false);\n }\n if (nextCell === false) {\n return null;\n }\n if (nextCell == null) {\n return false;\n }\n const nextPos = nextCell.cellPosition;\n const prevEditable = prevCell.isCellEditable();\n const nextEditable = nextCell.isCellEditable();\n const rowsMatch = nextPos && prevPos.rowIndex === nextPos.rowIndex && prevPos.rowPinned === nextPos.rowPinned;\n if (prevEditable) {\n this.setFocusOutOnEditor(prevCell);\n }\n this.restoreEditors();\n const suppressStartEditOnTab = gos.get(\"suppressStartEditOnTab\");\n if (nextEditable && !preventNavigation) {\n if (suppressStartEditOnTab) {\n nextCell.focusCell(true, event);\n } else {\n if (!nextCell.comp?.getCellEditor()) {\n _setupEditor(beans, nextCell, { event, cellStartedEdit: true });\n }\n this.setFocusInOnEditor(nextCell);\n nextCell.focusCell(false, event);\n }\n } else {\n if (nextEditable && preventNavigation) {\n this.setFocusInOnEditor(nextCell);\n }\n nextCell.focusCell(true, event);\n }\n if (!rowsMatch && !preventNavigation) {\n editSvc?.stopEditing({ rowNode: prevCell.rowNode }, { event, forceStop: true });\n if (editSvc?.isRowEditing(prevCell.rowNode, { withOpenEditor: true })) {\n this.cleanupEditors(nextCell, true);\n }\n if (suppressStartEditOnTab) {\n nextCell.focusCell(true, event);\n } else {\n editSvc.startEditing(nextCell, {\n startedEdit: true,\n event,\n source,\n ignoreEventKey: true,\n editable: nextEditable || void 0\n });\n }\n }\n prevCell.rowCtrl?.refreshRow({ suppressFlash: true, force: true });\n return true;\n }\n restoreEditors() {\n const { beans, model } = this;\n model.getEditMap().forEach(\n (rowEdits, rowNode) => rowEdits.forEach(({ state }, column) => {\n if (state !== \"editing\") {\n return;\n }\n const cellCtrl = _getCellCtrl(beans, {\n rowNode,\n column\n });\n if (cellCtrl && !cellCtrl.comp?.getCellEditor()) {\n _setupEditor(beans, cellCtrl, { silent: true });\n }\n })\n );\n }\n destroy() {\n super.destroy();\n this.rowNode = void 0;\n this.startedRows.clear();\n }\n};\n\n// packages/ag-grid-community/src/edit/strategy/singleCellEditStrategy.ts\nvar SingleCellEditStrategy = class extends BaseEditStrategy {\n constructor() {\n super(...arguments);\n this.beanName = \"singleCell\";\n }\n shouldStop(position, event, source = \"ui\") {\n const res = super.shouldStop(position, event, source);\n if (res !== null) {\n return res;\n }\n const rowNode = position?.rowNode;\n const column = position?.column;\n const trackedRowNode = this.rowNode;\n const trackedColumn = this.column;\n if ((!trackedRowNode || !trackedColumn) && rowNode && column) {\n return null;\n }\n if (trackedRowNode !== rowNode || trackedColumn !== column) {\n return true;\n }\n if (!trackedRowNode && !trackedColumn) {\n return this.model.hasEdits(void 0, { withOpenEditor: true });\n }\n return false;\n }\n midBatchInputsAllowed(position) {\n return this.model.hasEdits(position);\n }\n start(params) {\n const { position, startedEdit, event, ignoreEventKey } = params;\n if (this.rowNode !== position.rowNode || this.column !== position.column) {\n super.cleanupEditors();\n }\n this.rowNode = position.rowNode;\n this.column = position.column;\n this.model.start(position);\n this.setupEditors({ cells: [position], position, startedEdit, event, ignoreEventKey });\n }\n dispatchRowEvent(_position, _type, _silent) {\n }\n processValidationResults(results) {\n const anyFailed = results.fail.length > 0;\n if (anyFailed && this.editSvc.cellEditingInvalidCommitBlocks()) {\n return {\n destroy: [],\n keep: results.all\n };\n }\n return {\n destroy: results.all,\n keep: []\n };\n }\n stopCancelled(forceCancel) {\n super.stopCancelled(forceCancel);\n return this.clearPosition();\n }\n stopCommitted(event, commit) {\n super.stopCommitted(event, commit);\n return this.clearPosition();\n }\n clearPosition() {\n this.rowNode = void 0;\n this.column = void 0;\n return true;\n }\n onCellFocusChanged(event) {\n const { colModel, editSvc } = this.beans;\n const { rowIndex, column, rowPinned } = event;\n const rowNode = _getRowNode(this.beans, { rowIndex, rowPinned });\n const curColId = _getColId(column);\n const curCol = colModel.getCol(curColId);\n const previous = event[\"previousParams\"];\n if (previous) {\n const prevColId = _getColId(previous.column);\n if (previous?.rowIndex === rowIndex && prevColId === curColId && previous?.rowPinned === rowPinned) {\n return;\n }\n }\n if (event.type == \"cellFocused\" && (editSvc?.isRangeSelectionEnabledWhileEditing() || editSvc?.isEditing({ rowNode, column: curCol }, { withOpenEditor: true }))) {\n return;\n }\n super.onCellFocusChanged(event);\n }\n // returns null if no navigation should be performed\n moveToNextEditingCell(prevCell, backwards, event, source = \"ui\", preventNavigation = false) {\n const focusedCell = this.beans.focusSvc.getFocusedCell();\n if (focusedCell) {\n prevCell = _getCellByPosition(this.beans, focusedCell) ?? prevCell;\n }\n const prevPos = prevCell.cellPosition;\n let nextCell;\n const shouldSuspend = this.beans.gos.get(\"editType\") === \"fullRow\";\n if (shouldSuspend) {\n this.model.suspend(true);\n }\n if (!preventNavigation) {\n prevCell.eGui.focus();\n this.editSvc?.stopEditing(prevCell, { source: this.editSvc?.isBatchEditing() ? \"ui\" : \"api\", event });\n }\n try {\n nextCell = this.beans.navigation?.findNextCellToFocusOn(prevPos, {\n backwards,\n startEditing: true\n // Default behaviour for fullRow is skip to the next cell,\n // editable or not. FullRow editing might have some editable\n // and some not editable cells in the row.\n // More complex logic needed to skip to the\n // next FullRow editable cell,\n // skipToNextEditableCell: false,\n });\n } finally {\n if (shouldSuspend) {\n this.model.suspend(false);\n }\n }\n if (nextCell === false) {\n return null;\n }\n if (nextCell == null) {\n return false;\n }\n const nextPos = nextCell.cellPosition;\n const prevEditable = prevCell.isCellEditable();\n const nextEditable = nextCell.isCellEditable();\n const rowsMatch = nextPos && prevPos.rowIndex === nextPos.rowIndex && prevPos.rowPinned === nextPos.rowPinned;\n if (prevEditable && !preventNavigation) {\n this.setFocusOutOnEditor(prevCell);\n }\n const suppressStartEditOnTab = this.gos.get(\"suppressStartEditOnTab\");\n let startEditingCalled = false;\n if (!rowsMatch && !preventNavigation) {\n super.cleanupEditors(nextCell, true);\n if (suppressStartEditOnTab) {\n nextCell.focusCell(true, event);\n } else {\n startEditingCalled = true;\n this.editSvc.startEditing(nextCell, {\n startedEdit: true,\n event,\n source,\n ignoreEventKey: true,\n editable: nextEditable\n });\n }\n }\n if (nextEditable && !preventNavigation) {\n nextCell.focusCell(false, event);\n if (suppressStartEditOnTab) {\n nextCell.focusCell(true, event);\n } else if (!nextCell.comp?.getCellEditor()) {\n if (!startEditingCalled) {\n const alreadyEditing = this.editSvc?.isEditing(nextCell, { withOpenEditor: true });\n _setupEditor(this.beans, nextCell, { event, cellStartedEdit: true, silent: alreadyEditing });\n }\n this.setFocusInOnEditor(nextCell);\n this.cleanupEditors(nextCell);\n }\n } else {\n if (nextEditable && preventNavigation) {\n this.setFocusInOnEditor(nextCell);\n }\n nextCell.focusCell(true, event);\n }\n prevCell.rowCtrl?.refreshRow({ suppressFlash: true, force: true });\n return true;\n }\n destroy() {\n super.destroy();\n this.rowNode = void 0;\n this.column = void 0;\n }\n};\n\n// packages/ag-grid-community/src/edit/editModule.ts\nvar EditCoreModule = {\n moduleName: \"EditCore\",\n version: VERSION,\n beans: [EditModelService, EditService],\n apiFunctions: {\n getEditingCells,\n getEditRowValues,\n getCellEditorInstances,\n startEditingCell,\n stopEditing,\n isEditing,\n validateEdit\n },\n dynamicBeans: {\n singleCell: SingleCellEditStrategy,\n fullRow: FullRowEditStrategy\n },\n dependsOn: [PopupModule, TooltipModule],\n css: [cell_editing_default]\n};\nvar UndoRedoEditModule = {\n moduleName: \"UndoRedoEdit\",\n version: VERSION,\n beans: [UndoRedoService],\n apiFunctions: {\n undoCellEditing,\n redoCellEditing,\n getCurrentUndoSize,\n getCurrentRedoSize\n },\n dependsOn: [EditCoreModule]\n};\nvar TextEditorModule = {\n moduleName: \"TextEditor\",\n version: VERSION,\n userComponents: { agCellEditor: TextCellEditor, agTextCellEditor: TextCellEditor },\n dependsOn: [EditCoreModule]\n};\nvar NumberEditorModule = {\n moduleName: \"NumberEditor\",\n version: VERSION,\n userComponents: {\n agNumberCellEditor: {\n classImp: NumberCellEditor\n }\n },\n dependsOn: [EditCoreModule]\n};\nvar DateEditorModule = {\n moduleName: \"DateEditor\",\n version: VERSION,\n userComponents: {\n agDateCellEditor: DateCellEditor,\n agDateStringCellEditor: DateStringCellEditor\n },\n dependsOn: [EditCoreModule]\n};\nvar CheckboxEditorModule = {\n moduleName: \"CheckboxEditor\",\n version: VERSION,\n userComponents: {\n agCheckboxCellEditor: CheckboxCellEditor\n },\n dependsOn: [EditCoreModule]\n};\nvar SelectEditorModule = {\n moduleName: \"SelectEditor\",\n version: VERSION,\n userComponents: { agSelectCellEditor: SelectCellEditor },\n dependsOn: [EditCoreModule]\n};\nvar LargeTextEditorModule = {\n moduleName: \"LargeTextEditor\",\n version: VERSION,\n userComponents: { agLargeTextCellEditor: LargeTextCellEditor },\n dependsOn: [EditCoreModule]\n};\nvar CustomEditorModule = {\n moduleName: \"CustomEditor\",\n version: VERSION,\n dependsOn: [EditCoreModule]\n};\n\n// packages/ag-grid-community/src/filter/columnFilterUtils.ts\nvar FILTER_HANDLER_MAP = {\n agSetColumnFilter: \"agSetColumnFilterHandler\",\n agMultiColumnFilter: \"agMultiColumnFilterHandler\",\n agGroupColumnFilter: \"agGroupColumnFilterHandler\",\n agNumberColumnFilter: \"agNumberColumnFilterHandler\",\n agBigIntColumnFilter: \"agBigIntColumnFilterHandler\",\n agDateColumnFilter: \"agDateColumnFilterHandler\",\n agTextColumnFilter: \"agTextColumnFilterHandler\"\n};\nvar FILTER_HANDLERS = new Set(Object.values(FILTER_HANDLER_MAP));\nfunction getFilterUiFromWrapper(filterWrapper, skipCreate) {\n const filterUi = filterWrapper.filterUi;\n if (!filterUi) {\n return null;\n }\n if (filterUi.created) {\n return filterUi.promise;\n }\n if (skipCreate) {\n return null;\n }\n const promise = filterUi.create(filterUi.refreshed);\n const createdFilterUi = filterUi;\n createdFilterUi.created = true;\n createdFilterUi.promise = promise;\n return promise;\n}\nfunction _refreshHandlerAndUi(getFilterUi, handler, handlerParams, model, state, source, additionalEventAttributes) {\n handler.refresh?.({ ...handlerParams, model, source, additionalEventAttributes });\n return getFilterUi().then((filterUi) => {\n if (filterUi) {\n const { filter, filterParams } = filterUi;\n _refreshFilterUi(filter, filterParams, model, state, source, additionalEventAttributes);\n }\n });\n}\nfunction _refreshFilterUi(filter, filterParams, model, state, source, additionalEventAttributes) {\n filter?.refresh?.({\n ...filterParams,\n model,\n state,\n source,\n additionalEventAttributes\n });\n}\nfunction getAndRefreshFilterUi(getFilterUi, getModel, getState2, additionalEventAttributes) {\n const filterUi = getFilterUi();\n if (filterUi?.created) {\n filterUi.promise.then((filter) => {\n const model = getModel();\n _refreshFilterUi(\n filter,\n filterUi.filterParams,\n model,\n getState2() ?? { model },\n \"ui\",\n additionalEventAttributes\n );\n });\n }\n}\nfunction _updateFilterModel(params) {\n let state;\n let shouldUpdateModel = false;\n let model;\n const { action, filterParams, getFilterUi, getModel, getState: getState2, updateState, updateModel, processModelToApply } = params;\n switch (action) {\n case \"apply\": {\n const oldState = getState2();\n model = oldState?.model ?? null;\n if (processModelToApply) {\n model = processModelToApply(model);\n }\n state = {\n // keep the other UI state\n state: oldState?.state,\n model\n };\n shouldUpdateModel = true;\n break;\n }\n case \"clear\": {\n state = {\n // wipe other UI state\n model: null\n };\n if (!filterParams?.buttons?.includes(\"apply\")) {\n shouldUpdateModel = true;\n model = null;\n }\n break;\n }\n case \"reset\": {\n state = {\n // wipe other UI state\n model: null\n };\n shouldUpdateModel = true;\n model = null;\n break;\n }\n case \"cancel\": {\n state = {\n // wipe other UI state\n model: getModel()\n };\n break;\n }\n }\n updateState(state);\n if (shouldUpdateModel) {\n updateModel(model);\n } else {\n getAndRefreshFilterUi(getFilterUi, getModel, getState2, { fromAction: action });\n }\n}\nfunction _getFilterModel(model, colId) {\n return model[colId] ?? null;\n}\n\n// packages/ag-grid-community/src/headerRendering/cells/floatingFilter/headerFilterCellCtrl.ts\nvar HeaderFilterCellCtrl = class extends AbstractHeaderCellCtrl {\n constructor() {\n super(...arguments);\n this.iconCreated = false;\n }\n wireComp(comp, eGui, eButtonShowMainFilter, eFloatingFilterBody, compBeanInput) {\n this.comp = comp;\n const compBean = setupCompBean(this, this.beans.context, compBeanInput);\n this.eButtonShowMainFilter = eButtonShowMainFilter;\n this.eFloatingFilterBody = eFloatingFilterBody;\n this.setGui(eGui, compBean);\n this.setupActive();\n this.refreshHeaderStyles();\n this.setupWidth(compBean);\n this.setupLeft(compBean);\n this.setupHover(compBean);\n this.setupFocus(compBean);\n this.setupAria();\n this.setupFilterButton();\n this.setupUserComp();\n this.setupSyncWithFilter(compBean);\n this.setupUi();\n compBean.addManagedElementListeners(this.eButtonShowMainFilter, { click: this.showParentFilter.bind(this) });\n this.setupFilterChangedListener(compBean);\n const colDefChanged = () => this.onColDefChanged(compBean);\n compBean.addManagedListeners(this.column, { colDefChanged });\n compBean.addManagedEventListeners({\n filterSwitched: ({ column }) => {\n if (column === this.column) {\n colDefChanged();\n }\n }\n });\n compBean.addDestroyFunc(() => {\n this.eButtonShowMainFilter = null;\n this.eFloatingFilterBody = null;\n this.userCompDetails = null;\n this.clearComponent();\n });\n }\n resizeHeader() {\n }\n moveHeader() {\n }\n getHeaderClassParams() {\n const { column, beans } = this;\n const colDef = column.colDef;\n return _addGridCommonParams(beans.gos, {\n colDef,\n column,\n floatingFilter: true\n });\n }\n setupActive() {\n const colDef = this.column.getColDef();\n const filterExists = !!colDef.filter;\n const floatingFilterExists = !!colDef.floatingFilter;\n this.active = filterExists && floatingFilterExists;\n }\n setupUi() {\n this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton && this.active);\n this.comp.addOrRemoveBodyCssClass(\"ag-floating-filter-full-body\", this.suppressFilterButton);\n this.comp.addOrRemoveBodyCssClass(\"ag-floating-filter-body\", !this.suppressFilterButton);\n if (!this.active || this.iconCreated) {\n return;\n }\n const eMenuIcon = _createIconNoSpan(\"filter\", this.beans, this.column);\n if (eMenuIcon) {\n this.iconCreated = true;\n this.eButtonShowMainFilter.appendChild(eMenuIcon);\n }\n }\n setupFocus(compBean) {\n compBean.createManagedBean(\n new ManagedFocusFeature(this.eGui, {\n shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this),\n onTabKeyDown: this.onTabKeyDown.bind(this),\n handleKeyDown: this.handleKeyDown.bind(this),\n onFocusIn: this.onFocusIn.bind(this)\n })\n );\n }\n setupAria() {\n const localeTextFunc = this.getLocaleTextFunc();\n _setAriaLabel(this.eButtonShowMainFilter, localeTextFunc(\"ariaFilterMenuOpen\", \"Open Filter Menu\"));\n }\n onTabKeyDown(e) {\n const { beans } = this;\n const activeEl = _getActiveDomElement(beans);\n const wrapperHasFocus = activeEl === this.eGui;\n if (wrapperHasFocus) {\n return;\n }\n const nextFocusableEl = _findNextFocusableElement(beans, this.eGui, null, e.shiftKey);\n if (nextFocusableEl) {\n beans.headerNavigation?.scrollToColumn(this.column);\n e.preventDefault();\n nextFocusableEl.focus();\n return;\n }\n const nextFocusableColumn = this.findNextColumnWithFloatingFilter(e.shiftKey);\n if (!nextFocusableColumn) {\n return;\n }\n if (beans.focusSvc.focusHeaderPosition({\n headerPosition: {\n headerRowIndex: this.rowCtrl.rowIndex,\n column: nextFocusableColumn\n },\n event: e\n })) {\n e.preventDefault();\n }\n }\n findNextColumnWithFloatingFilter(backwards) {\n const presentedColsService = this.beans.visibleCols;\n let nextCol = this.column;\n do {\n nextCol = backwards ? presentedColsService.getColBefore(nextCol) : presentedColsService.getColAfter(nextCol);\n if (!nextCol) {\n break;\n }\n } while (!nextCol.getColDef().filter || !nextCol.getColDef().floatingFilter);\n return nextCol;\n }\n handleKeyDown(e) {\n super.handleKeyDown(e);\n const wrapperHasFocus = this.getWrapperHasFocus();\n switch (e.key) {\n case KeyCode.UP:\n case KeyCode.DOWN:\n case KeyCode.LEFT:\n case KeyCode.RIGHT:\n if (wrapperHasFocus) {\n return;\n }\n _stopPropagationForAgGrid(e);\n case KeyCode.ENTER:\n if (wrapperHasFocus) {\n if (_focusInto(this.eGui)) {\n e.preventDefault();\n }\n }\n break;\n case KeyCode.ESCAPE:\n if (!wrapperHasFocus) {\n this.eGui.focus();\n }\n }\n }\n onFocusIn(e) {\n const isRelatedWithin = this.eGui.contains(e.relatedTarget);\n if (isRelatedWithin) {\n return;\n }\n const notFromHeaderWrapper = !!e.relatedTarget && !e.relatedTarget.classList.contains(\"ag-floating-filter\");\n const fromWithinHeader = !!e.relatedTarget && _isElementChildOfClass(e.relatedTarget, \"ag-floating-filter\");\n if (notFromHeaderWrapper && fromWithinHeader && e.target === this.eGui) {\n const lastFocusEvent = this.lastFocusEvent;\n const fromTab = !!(lastFocusEvent && lastFocusEvent.key === KeyCode.TAB);\n if (lastFocusEvent && fromTab) {\n const shouldFocusLast = lastFocusEvent.shiftKey;\n _focusInto(this.eGui, shouldFocusLast);\n }\n }\n this.focusThis();\n }\n setupHover(compBean) {\n this.beans.colHover?.addHeaderFilterColumnHoverListener(compBean, this.comp, this.column, this.eGui);\n }\n setupLeft(compBean) {\n const setLeftFeature = new SetLeftFeature(this.column, this.eGui, this.beans);\n compBean.createManagedBean(setLeftFeature);\n }\n setupFilterButton() {\n this.suppressFilterButton = !this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column);\n this.highlightFilterButtonWhenActive = !_isLegacyMenuEnabled(this.gos);\n }\n setupUserComp() {\n if (!this.active) {\n return;\n }\n const compDetails = this.beans.colFilter?.getFloatingFilterCompDetails(\n this.column,\n () => this.showParentFilter()\n );\n if (compDetails) {\n this.setCompDetails(compDetails);\n }\n }\n setCompDetails(compDetails) {\n this.userCompDetails = compDetails;\n this.comp.setCompDetails(compDetails);\n }\n showParentFilter() {\n const eventSource = this.suppressFilterButton ? this.eFloatingFilterBody : this.eButtonShowMainFilter;\n this.beans.menuSvc?.showFilterMenu({\n column: this.column,\n buttonElement: eventSource,\n containerType: \"floatingFilter\",\n positionBy: \"button\"\n });\n }\n setupSyncWithFilter(compBean) {\n if (!this.active) {\n return;\n }\n const {\n beans: { colFilter },\n column,\n gos\n } = this;\n const syncWithFilter = (event) => {\n if (event?.source === \"filterDestroyed\" && (!this.isAlive() || !colFilter?.isAlive())) {\n return;\n }\n const compPromise = this.comp.getFloatingFilterComp();\n if (!compPromise) {\n return;\n }\n compPromise.then((comp) => {\n if (comp) {\n if (gos.get(\"enableFilterHandlers\")) {\n const eventWithParams = event;\n let source = \"filter\";\n if (eventWithParams?.afterFloatingFilter) {\n source = \"ui\";\n } else if (eventWithParams?.afterDataChange) {\n source = \"dataChanged\";\n } else if (event?.source === \"api\") {\n source = \"api\";\n }\n this.updateFloatingFilterParams(this.userCompDetails, source);\n return;\n }\n const parentModel = colFilter?.getCurrentFloatingFilterParentModel(column);\n const filterChangedEvent = event ? {\n // event can have additional params like `afterDataChange` which need to be passed through\n ...event,\n columns: event.columns ?? [],\n source: event.source === \"api\" ? \"api\" : \"columnFilter\"\n } : null;\n comp.onParentModelChanged(parentModel, filterChangedEvent);\n }\n });\n };\n [this.destroySyncListener] = compBean.addManagedListeners(column, { filterChanged: syncWithFilter });\n if (colFilter?.isFilterActive(column)) {\n syncWithFilter(null);\n }\n }\n setupWidth(compBean) {\n const listener = () => {\n const width = `${this.column.getActualWidth()}px`;\n this.comp.setWidth(width);\n };\n compBean.addManagedListeners(this.column, { widthChanged: listener });\n listener();\n }\n setupFilterChangedListener(compBean) {\n if (this.active) {\n [this.destroyFilterChangedListener] = compBean.addManagedListeners(this.column, {\n filterChanged: this.updateFilterButton.bind(this)\n });\n this.updateFilterButton();\n }\n }\n updateFilterButton() {\n if (!this.suppressFilterButton && this.comp) {\n const isFilterAllowed = !!this.beans.filterManager?.isFilterAllowed(this.column);\n this.comp.setButtonWrapperDisplayed(isFilterAllowed);\n if (this.highlightFilterButtonWhenActive && isFilterAllowed) {\n this.eButtonShowMainFilter.classList.toggle(\"ag-filter-active\", this.column.isFilterActive());\n }\n }\n }\n onColDefChanged(compBean) {\n const wasActive = this.active;\n this.setupActive();\n const becomeActive = !wasActive && this.active;\n if (wasActive && !this.active) {\n this.destroySyncListener();\n this.destroyFilterChangedListener();\n }\n const colFilter = this.beans.colFilter;\n const newCompDetails = this.active ? colFilter?.getFloatingFilterCompDetails(this.column, () => this.showParentFilter()) : null;\n const compPromise = this.comp.getFloatingFilterComp();\n if (!compPromise || !newCompDetails) {\n this.updateCompDetails(compBean, newCompDetails, becomeActive);\n } else {\n compPromise.then((compInstance) => {\n if (!compInstance || colFilter?.areFilterCompsDifferent(this.userCompDetails ?? null, newCompDetails)) {\n this.updateCompDetails(compBean, newCompDetails, becomeActive);\n } else {\n this.updateFloatingFilterParams(newCompDetails, \"colDef\");\n }\n });\n }\n }\n updateCompDetails(compBean, compDetails, becomeActive) {\n if (!this.isAlive()) {\n return;\n }\n this.setCompDetails(compDetails);\n this.setupFilterButton();\n this.setupUi();\n if (becomeActive) {\n this.setupSyncWithFilter(compBean);\n this.setupFilterChangedListener(compBean);\n }\n }\n updateFloatingFilterParams(userCompDetails, source) {\n if (!userCompDetails) {\n return;\n }\n let params = userCompDetails.params;\n this.comp.getFloatingFilterComp()?.then((floatingFilter) => {\n if (typeof floatingFilter?.refresh === \"function\") {\n if (this.gos.get(\"enableFilterHandlers\")) {\n params = {\n ...params,\n model: _getFilterModel(this.beans.colFilter?.model ?? {}, this.column.getColId()),\n source\n };\n }\n floatingFilter.refresh(params);\n }\n });\n }\n addResizeAndMoveKeyboardListeners() {\n }\n destroy() {\n super.destroy();\n this.destroySyncListener = null;\n this.destroyFilterChangedListener = null;\n }\n};\n\n// packages/ag-grid-community/src/misc/menu/menuApi.ts\nfunction showColumnMenu(beans, colKey) {\n const column = beans.colModel.getCol(colKey);\n if (!column) {\n _error(12, { colKey });\n return;\n }\n beans.menuSvc?.showColumnMenu({\n column,\n positionBy: \"auto\"\n });\n}\nfunction hidePopupMenu(beans) {\n beans.menuSvc?.hidePopupMenu();\n}\n\n// packages/ag-grid-community/src/misc/menu/menuService.ts\nvar MenuService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"menuSvc\";\n }\n postConstruct() {\n const { enterpriseMenuFactory, filterMenuFactory } = this.beans;\n this.activeMenuFactory = enterpriseMenuFactory ?? filterMenuFactory;\n }\n showColumnMenu(params) {\n this.showColumnMenuCommon(this.activeMenuFactory, params, \"columnMenu\");\n }\n showFilterMenu(params) {\n this.showColumnMenuCommon(getFilterMenuFactory(this.beans), params, params.containerType, true);\n }\n showHeaderContextMenu(column, mouseEvent, touchEvent) {\n this.activeMenuFactory?.showMenuAfterContextMenuEvent(column, mouseEvent, touchEvent);\n }\n hidePopupMenu() {\n this.beans.contextMenuSvc?.hideActiveMenu();\n this.activeMenuFactory?.hideActiveMenu();\n }\n hideFilterMenu() {\n getFilterMenuFactory(this.beans)?.hideActiveMenu();\n }\n isColumnMenuInHeaderEnabled(column) {\n const { suppressHeaderMenuButton } = column.getColDef();\n return !suppressHeaderMenuButton && !!this.activeMenuFactory?.isMenuEnabled(column) && (_isLegacyMenuEnabled(this.gos) || !!this.beans.enterpriseMenuFactory);\n }\n isFilterMenuInHeaderEnabled(column) {\n return !column.getColDef().suppressHeaderFilterButton && !!this.beans.filterManager?.isFilterAllowed(column);\n }\n isHeaderContextMenuEnabled(column) {\n const colDef = column && isColumn(column) ? column.getColDef() : column?.getColGroupDef();\n return !colDef?.suppressHeaderContextMenu && this.gos.get(\"columnMenu\") === \"new\";\n }\n isHeaderMenuButtonAlwaysShowEnabled() {\n return this.isSuppressMenuHide();\n }\n isHeaderMenuButtonEnabled() {\n const menuHides = !this.isSuppressMenuHide();\n const onIpadAndMenuHides = _isIOSUserAgent() && menuHides;\n return !onIpadAndMenuHides;\n }\n isHeaderFilterButtonEnabled(column) {\n return this.isFilterMenuInHeaderEnabled(column) && !_isLegacyMenuEnabled(this.gos) && !this.isFloatingFilterButtonDisplayed(column);\n }\n isFilterMenuItemEnabled(column) {\n return !!this.beans.filterManager?.isFilterAllowed(column) && !_isLegacyMenuEnabled(this.gos) && !this.isFilterMenuInHeaderEnabled(column) && !this.isFloatingFilterButtonDisplayed(column);\n }\n isFloatingFilterButtonEnabled(column) {\n return !column.getColDef().suppressFloatingFilterButton;\n }\n isFloatingFilterButtonDisplayed(column) {\n return !!column.getColDef().floatingFilter && this.isFloatingFilterButtonEnabled(column);\n }\n isSuppressMenuHide() {\n const gos = this.gos;\n const suppressMenuHide = gos.get(\"suppressMenuHide\");\n if (_isLegacyMenuEnabled(gos)) {\n return gos.exists(\"suppressMenuHide\") ? suppressMenuHide : false;\n }\n return suppressMenuHide;\n }\n showColumnMenuCommon(menuFactory, params, containerType, filtersOnly) {\n const { positionBy, onClosedCallback } = params;\n const column = params.column;\n if (positionBy === \"button\") {\n const { buttonElement } = params;\n menuFactory?.showMenuAfterButtonClick(column, buttonElement, containerType, onClosedCallback, filtersOnly);\n } else if (positionBy === \"mouse\") {\n const { mouseEvent } = params;\n menuFactory?.showMenuAfterMouseEvent(column, mouseEvent, containerType, onClosedCallback, filtersOnly);\n } else if (column) {\n const beans = this.beans;\n const ctrlsSvc = beans.ctrlsSvc;\n ctrlsSvc.getScrollFeature().ensureColumnVisible(column, \"auto\");\n _requestAnimationFrame(beans, () => {\n const headerCellCtrl = ctrlsSvc.getHeaderRowContainerCtrl(column.getPinned())?.getHeaderCtrlForColumn(column);\n if (headerCellCtrl) {\n menuFactory?.showMenuAfterButtonClick(\n column,\n headerCellCtrl.getAnchorElementForMenu(filtersOnly),\n containerType,\n onClosedCallback,\n filtersOnly\n );\n }\n });\n }\n }\n};\nfunction _setColMenuVisible(column, visible, source) {\n if (column.menuVisible !== visible) {\n column.menuVisible = visible;\n column.dispatchColEvent(\"menuVisibleChanged\", source);\n }\n}\nfunction getFilterMenuFactory(beans) {\n const { enterpriseMenuFactory, filterMenuFactory, gos } = beans;\n return enterpriseMenuFactory && _isLegacyMenuEnabled(gos) ? enterpriseMenuFactory : filterMenuFactory;\n}\n\n// packages/ag-grid-community/src/misc/menu/sharedMenuModule.ts\nvar SharedMenuModule = {\n moduleName: \"SharedMenu\",\n version: VERSION,\n beans: [MenuService],\n apiFunctions: {\n showColumnMenu,\n hidePopupMenu\n }\n};\n\n// packages/ag-grid-community/src/filter/column-filters.css\nvar column_filters_default = \".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;:where(.ag-set-filter-group-closed-icon),:where(.ag-set-filter-group-indeterminate-icon),:where(.ag-set-filter-group-opened-icon){cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper{min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>:where(.ag-date-floating-filter-wrapper),>:where(.ag-floating-filter-input),>:where(.ag-input-field){flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(.ag-input-field-input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:var(--ag-widget-container-vertical-padding);:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}\";\n\n// packages/ag-grid-community/src/filter/columnFilterApi.ts\nfunction isColumnFilterPresent(beans) {\n const filterManager = beans.filterManager;\n return !!filterManager?.isColumnFilterPresent() || !!filterManager?.isAggregateFilterPresent();\n}\nfunction getColumnFilterInstance(beans, key) {\n return beans.filterManager?.getColumnFilterInstance(key) ?? Promise.resolve(void 0);\n}\nfunction destroyFilter(beans, key) {\n const column = beans.colModel.getColDefCol(key);\n if (column) {\n return beans.colFilter?.destroyFilter(column, \"api\");\n }\n}\nfunction setFilterModel(beans, model) {\n beans.frameworkOverrides.wrapIncoming(() => beans.filterManager?.setFilterModel(model));\n}\nfunction getFilterModel(beans) {\n return beans.filterManager?.getFilterModel() ?? {};\n}\nfunction getColumnFilterModel(beans, key, useUnapplied) {\n const { gos, colModel, colFilter } = beans;\n if (useUnapplied && !gos.get(\"enableFilterHandlers\")) {\n _warn(288);\n useUnapplied = false;\n }\n const column = colModel.getColDefCol(key);\n return column ? colFilter?.getModelForColumn(column, useUnapplied) ?? null : null;\n}\nfunction setColumnFilterModel(beans, column, model) {\n return beans.filterManager?.setColumnFilterModel(column, model) ?? Promise.resolve();\n}\nfunction showColumnFilter(beans, colKey) {\n const column = beans.colModel.getCol(colKey);\n if (!column) {\n _error(12, { colKey });\n return;\n }\n beans.menuSvc?.showFilterMenu({\n column,\n containerType: \"columnFilter\",\n positionBy: \"auto\"\n });\n}\nfunction hideColumnFilter(beans) {\n beans.menuSvc?.hideFilterMenu();\n}\nfunction getColumnFilterHandler(beans, colKey) {\n const column = beans.colModel.getCol(colKey);\n if (!column) {\n _error(12, { colKey });\n return void 0;\n }\n return beans.colFilter?.getHandler(column, true);\n}\nfunction doFilterAction(beans, params) {\n const { colModel, colFilter, gos } = beans;\n if (!gos.get(\"enableFilterHandlers\")) {\n _warn(287);\n return;\n }\n const { colId, action } = params;\n if (colId) {\n const column = colModel.getColById(colId);\n if (column) {\n colFilter?.updateModel(column, action);\n }\n } else {\n colFilter?.updateAllModels(action);\n }\n}\n\n// packages/ag-grid-community/src/filter/filterDataTypeUtils.ts\nvar MONTH_LOCALE_TEXT = {\n january: \"January\",\n february: \"February\",\n march: \"March\",\n april: \"April\",\n may: \"May\",\n june: \"June\",\n july: \"July\",\n august: \"August\",\n september: \"September\",\n october: \"October\",\n november: \"November\",\n december: \"December\"\n};\nvar MONTH_KEYS = [\n \"january\",\n \"february\",\n \"march\",\n \"april\",\n \"may\",\n \"june\",\n \"july\",\n \"august\",\n \"september\",\n \"october\",\n \"november\",\n \"december\"\n];\nfunction setFilterNumberComparator(a, b) {\n if (a == null) {\n return -1;\n }\n if (b == null) {\n return 1;\n }\n return Number.parseFloat(a) - Number.parseFloat(b);\n}\nfunction setFilterBigIntComparator(a, b) {\n if (a == null) {\n return -1;\n }\n if (b == null) {\n return 1;\n }\n const valueA = _parseBigIntOrNull(a);\n const valueB = _parseBigIntOrNull(b);\n if (valueA != null && valueB != null) {\n if (valueA === valueB) {\n return 0;\n }\n return valueA > valueB ? 1 : -1;\n }\n return String(a).localeCompare(String(b));\n}\nfunction isValidDate(value) {\n return value instanceof Date && !isNaN(value.getTime());\n}\nvar filterParamsForEachDataType = {\n number: () => void 0,\n bigint: () => void 0,\n boolean: () => ({\n maxNumConditions: 1,\n debounceMs: 0,\n filterOptions: [\n \"empty\",\n {\n displayKey: \"true\",\n displayName: \"True\",\n predicate: (_filterValues, cellValue) => cellValue,\n numberOfInputs: 0\n },\n {\n displayKey: \"false\",\n displayName: \"False\",\n predicate: (_filterValues, cellValue) => cellValue === false,\n numberOfInputs: 0\n }\n ]\n }),\n date: () => ({ isValidDate }),\n dateString: ({ dataTypeDefinition }) => ({\n comparator: (filterDate, cellValue) => {\n const cellAsDate = dataTypeDefinition.dateParser(cellValue);\n if (cellValue == null || cellAsDate < filterDate) {\n return -1;\n }\n if (cellAsDate > filterDate) {\n return 1;\n }\n return 0;\n },\n isValidDate: (value) => typeof value === \"string\" && isValidDate(dataTypeDefinition.dateParser(value))\n }),\n dateTime: (args) => filterParamsForEachDataType.date(args),\n dateTimeString: (args) => filterParamsForEachDataType.dateString(args),\n object: () => void 0,\n text: () => void 0\n};\nvar setFilterParamsForEachDataType = {\n number: () => ({ comparator: setFilterNumberComparator }),\n bigint: () => ({ comparator: setFilterBigIntComparator }),\n boolean: ({ t }) => ({\n valueFormatter: (params) => _exists(params.value) ? t(String(params.value), params.value ? \"True\" : \"False\") : t(\"blanks\", \"(Blanks)\")\n }),\n date: ({ formatValue, t }) => ({\n valueFormatter: (params) => {\n const valueFormatted = formatValue(params);\n return _exists(valueFormatted) ? valueFormatted : t(\"blanks\", \"(Blanks)\");\n },\n treeList: true,\n treeListFormatter: (pathKey, level) => {\n if (pathKey === \"NaN\") {\n return t(\"invalidDate\", \"Invalid Date\");\n }\n if (level === 1 && pathKey != null) {\n const monthKey = MONTH_KEYS[Number(pathKey) - 1];\n return t(monthKey, MONTH_LOCALE_TEXT[monthKey]);\n }\n return pathKey ?? t(\"blanks\", \"(Blanks)\");\n },\n treeListPathGetter: (date) => _getDateParts(date, false)\n }),\n dateString: ({ formatValue, dataTypeDefinition, t }) => ({\n valueFormatter: (params) => {\n const valueFormatted = formatValue(params);\n return _exists(valueFormatted) ? valueFormatted : t(\"blanks\", \"(Blanks)\");\n },\n treeList: true,\n treeListPathGetter: (value) => _getDateParts(dataTypeDefinition.dateParser(value ?? void 0), false),\n treeListFormatter: (pathKey, level) => {\n if (level === 1 && pathKey != null) {\n const monthKey = MONTH_KEYS[Number(pathKey) - 1];\n return t(monthKey, MONTH_LOCALE_TEXT[monthKey]);\n }\n return pathKey ?? t(\"blanks\", \"(Blanks)\");\n }\n }),\n dateTime: (args) => {\n const params = setFilterParamsForEachDataType.date(args);\n params.treeListPathGetter = _getDateParts;\n return params;\n },\n dateTimeString(args) {\n const convertToDate = args.dataTypeDefinition.dateParser;\n const params = setFilterParamsForEachDataType.dateString(args);\n params.treeListPathGetter = (value) => _getDateParts(convertToDate(value ?? void 0));\n return params;\n },\n object: ({ formatValue, t }) => ({\n valueFormatter: (params) => {\n const valueFormatted = formatValue(params);\n return _exists(valueFormatted) ? valueFormatted : t(\"blanks\", \"(Blanks)\");\n }\n }),\n text: () => void 0\n};\nfunction _getFilterParamsForDataType(filter, existingFilterParams, existingFilterValueGetter, dataTypeDefinition, formatValue, beans, translate) {\n let filterParams = existingFilterParams;\n let filterValueGetter = existingFilterValueGetter;\n const usingSetFilter = filter === \"agSetColumnFilter\";\n if (!filterValueGetter && dataTypeDefinition.baseDataType === \"object\" && !usingSetFilter) {\n filterValueGetter = ({ column, node }) => formatValue({ column, node, value: beans.valueSvc.getValue(column, node, \"data\") });\n }\n const filterParamsMap = usingSetFilter ? setFilterParamsForEachDataType : filterParamsForEachDataType;\n const filterParamsGetter = filterParamsMap[dataTypeDefinition.baseDataType];\n const newFilterParams = filterParamsGetter({ dataTypeDefinition, formatValue, t: translate });\n filterParams = typeof existingFilterParams === \"object\" ? {\n ...newFilterParams,\n ...existingFilterParams\n } : newFilterParams;\n return { filterParams, filterValueGetter };\n}\nvar defaultFilters = {\n boolean: \"agTextColumnFilter\",\n date: \"agDateColumnFilter\",\n dateString: \"agDateColumnFilter\",\n dateTime: \"agDateColumnFilter\",\n dateTimeString: \"agDateColumnFilter\",\n bigint: \"agBigIntColumnFilter\",\n number: \"agNumberColumnFilter\",\n object: \"agTextColumnFilter\",\n text: \"agTextColumnFilter\"\n};\nvar defaultFloatingFilters = {\n boolean: \"agTextColumnFloatingFilter\",\n date: \"agDateColumnFloatingFilter\",\n dateString: \"agDateColumnFloatingFilter\",\n dateTime: \"agDateColumnFloatingFilter\",\n dateTimeString: \"agDateColumnFloatingFilter\",\n bigint: \"agBigIntColumnFloatingFilter\",\n number: \"agNumberColumnFloatingFilter\",\n object: \"agTextColumnFloatingFilter\",\n text: \"agTextColumnFloatingFilter\"\n};\nfunction _getDefaultSimpleFilter(cellDataType, isFloating = false) {\n const filterSet = isFloating ? defaultFloatingFilters : defaultFilters;\n return filterSet[cellDataType ?? \"text\"];\n}\n\n// packages/ag-grid-community/src/filter/floating/floatingFilterMapper.ts\nfunction _getDefaultFloatingFilterType(frameworkOverrides, def, getFromDefault) {\n if (def == null) {\n return null;\n }\n let defaultFloatingFilterType = null;\n const { compName, jsComp, fwComp } = _getFilterCompKeys(frameworkOverrides, def);\n if (compName) {\n const floatingFilterTypeMap = {\n agSetColumnFilter: \"agSetColumnFloatingFilter\",\n agMultiColumnFilter: \"agMultiColumnFloatingFilter\",\n agGroupColumnFilter: \"agGroupColumnFloatingFilter\",\n agNumberColumnFilter: \"agNumberColumnFloatingFilter\",\n agBigIntColumnFilter: \"agBigIntColumnFloatingFilter\",\n agDateColumnFilter: \"agDateColumnFloatingFilter\",\n agTextColumnFilter: \"agTextColumnFloatingFilter\"\n };\n defaultFloatingFilterType = floatingFilterTypeMap[compName];\n } else {\n const usingDefaultFilter = jsComp == null && fwComp == null && def.filter === true;\n if (usingDefaultFilter) {\n defaultFloatingFilterType = getFromDefault();\n }\n }\n return defaultFloatingFilterType;\n}\n\n// packages/ag-grid-community/src/filter/columnFilterService.ts\nvar DUMMY_HANDLER = {\n filterHandler: () => ({\n doesFilterPass: () => true\n })\n};\nfunction isAggFilter(column, isPivotMode, isPivotActive, groupFilterEnabled) {\n const isSecondary = !column.isPrimary();\n if (isSecondary) {\n return true;\n }\n const isShowingPrimaryColumns = !isPivotActive;\n const isValueActive = column.isValueActive();\n if (!isValueActive || !isShowingPrimaryColumns) {\n return false;\n }\n if (isPivotMode) {\n return true;\n }\n return groupFilterEnabled;\n}\nvar ColumnFilterService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"colFilter\";\n this.allColumnFilters = /* @__PURE__ */ new Map();\n this.allColumnListeners = /* @__PURE__ */ new Map();\n this.activeAggregateFilters = [];\n this.activeColumnFilters = [];\n // this is true when the grid is processing the filter change. this is used by the cell comps, so that they\n // don't flash when data changes due to filter changes. there is no need to flash when filter changes as the\n // user is in control, so doesn't make sense to show flashing changes. for example, go to main demo where\n // this feature is turned off (hack code to always return false for isSuppressFlashingCellsBecauseFiltering(), put in)\n // 100,000 rows and group by country. then do some filtering. all the cells flash, which is silly.\n this.processingFilterChange = false;\n // when we're waiting for cell data types to be inferred, we need to defer filter model updates\n this.modelUpdates = [];\n this.columnModelUpdates = [];\n /** This contains the UI state for handler columns */\n this.state = /* @__PURE__ */ new Map();\n this.handlerMap = {\n ...FILTER_HANDLER_MAP\n };\n this.isGlobalButtons = false;\n this.activeFilterComps = /* @__PURE__ */ new Set();\n }\n postConstruct() {\n this.addManagedEventListeners({\n gridColumnsChanged: this.onColumnsChanged.bind(this),\n dataTypesInferred: this.processFilterModelUpdateQueue.bind(this)\n });\n this.addManagedPropertyListener(\"pivotMode\", this.onPivotModeChanged.bind(this));\n const gos = this.gos;\n const initialFilterModel = {\n ...gos.get(\"initialState\")?.filter?.filterModel ?? {}\n };\n this.initialModel = initialFilterModel;\n this.model = {\n ...initialFilterModel\n };\n if (!gos.get(\"enableFilterHandlers\")) {\n delete this.handlerMap[\"agMultiColumnFilter\"];\n }\n }\n refreshModel() {\n this.onNewRowsLoaded(\"rowDataUpdated\");\n }\n setModel(model, source = \"api\", forceUpdateActive) {\n const { colModel, dataTypeSvc, filterManager } = this.beans;\n if (dataTypeSvc?.isPendingInference) {\n this.modelUpdates.push({ model, source });\n return;\n }\n const allPromises = [];\n const previousModel = this.getModel(true);\n if (model) {\n const modelKeys = new Set(Object.keys(model));\n this.allColumnFilters.forEach((filterWrapper, colId) => {\n const newModel = model[colId];\n allPromises.push(this.setModelOnFilterWrapper(filterWrapper, newModel));\n modelKeys.delete(colId);\n });\n modelKeys.forEach((colId) => {\n const column = colModel.getColDefCol(colId) || colModel.getCol(colId);\n if (!column) {\n _warn(62, { colId });\n return;\n }\n if (!column.isFilterAllowed()) {\n _warn(63, { colId });\n return;\n }\n const filterWrapper = this.getOrCreateFilterWrapper(column, true);\n if (!filterWrapper) {\n _warn(64, { colId });\n return;\n }\n allPromises.push(this.setModelOnFilterWrapper(filterWrapper, model[colId], true));\n });\n } else {\n this.model = {};\n this.allColumnFilters.forEach((filterWrapper) => {\n allPromises.push(this.setModelOnFilterWrapper(filterWrapper, null));\n });\n }\n AgPromise.all(allPromises).then(() => {\n const currentModel = this.getModel(true);\n const columns = [];\n this.allColumnFilters.forEach((filterWrapper, colId) => {\n const before = previousModel ? previousModel[colId] : null;\n const after = currentModel ? currentModel[colId] : null;\n if (!_jsonEquals(before, after)) {\n columns.push(filterWrapper.column);\n }\n });\n if (columns.length > 0) {\n filterManager?.onFilterChanged({ columns, source });\n } else if (forceUpdateActive) {\n this.updateActive(\"filterChanged\");\n }\n });\n }\n getModel(excludeInitialState) {\n const result = {};\n const {\n allColumnFilters,\n initialModel,\n beans: { colModel }\n } = this;\n allColumnFilters.forEach((filterWrapper, key) => {\n const model = this.getModelFromFilterWrapper(filterWrapper);\n if (_exists(model)) {\n result[key] = model;\n }\n });\n if (!excludeInitialState) {\n for (const colId of Object.keys(initialModel)) {\n const model = initialModel[colId];\n if (_exists(model) && !allColumnFilters.has(colId) && colModel.getCol(colId)?.isFilterAllowed()) {\n result[colId] = model;\n }\n }\n }\n return result;\n }\n setState(model, state, source = \"api\") {\n this.state.clear();\n if (state) {\n for (const colId of Object.keys(state)) {\n const newState = state[colId];\n this.state.set(colId, {\n model: _getFilterModel(this.model, colId),\n state: newState\n });\n }\n }\n this.setModel(model, source, true);\n }\n getState() {\n const state = this.state;\n if (!state.size) {\n return void 0;\n }\n const newState = {};\n let hasNewState = false;\n state.forEach((colState, colId) => {\n const actualState = colState.state;\n if (actualState != null) {\n hasNewState = true;\n newState[colId] = actualState;\n }\n });\n return hasNewState ? newState : void 0;\n }\n getModelFromFilterWrapper(filterWrapper) {\n const column = filterWrapper.column;\n const colId = column.getColId();\n if (filterWrapper.isHandler) {\n return _getFilterModel(this.model, colId);\n }\n const filter = filterWrapper.filter;\n if (filter) {\n if (typeof filter.getModel !== \"function\") {\n _warn(66);\n return null;\n }\n return filter.getModel();\n }\n return _getFilterModel(this.initialModel, colId);\n }\n isFilterPresent() {\n return this.activeColumnFilters.length > 0;\n }\n isAggFilterPresent() {\n return !!this.activeAggregateFilters.length;\n }\n disableFilters() {\n this.initialModel = {};\n const { allColumnFilters } = this;\n if (allColumnFilters.size) {\n allColumnFilters.forEach(\n (filterWrapper) => this.disposeFilterWrapper(filterWrapper, \"advancedFilterEnabled\")\n );\n return true;\n }\n return false;\n }\n updateActiveFilters() {\n const isFilterActive = (filter) => {\n if (!filter) {\n return false;\n }\n if (!filter.isFilterActive) {\n _warn(67);\n return false;\n }\n return filter.isFilterActive();\n };\n const { colModel, gos } = this.beans;\n const groupFilterEnabled = !!_getGroupAggFiltering(gos);\n const activeAggregateFilters = [];\n const activeColumnFilters = [];\n const addFilter = (column, filterActive, doesFilterPassWrapper) => {\n if (filterActive) {\n if (isAggFilter(column, colModel.isPivotMode(), colModel.isPivotActive(), groupFilterEnabled)) {\n activeAggregateFilters.push(doesFilterPassWrapper);\n } else {\n activeColumnFilters.push(doesFilterPassWrapper);\n }\n }\n };\n const promises = [];\n this.allColumnFilters.forEach((filterWrapper) => {\n const column = filterWrapper.column;\n const colId = column.getColId();\n if (filterWrapper.isHandler) {\n promises.push(\n AgPromise.resolve().then(() => {\n addFilter(column, this.isHandlerActive(column), {\n colId,\n isHandler: true,\n handler: filterWrapper.handler,\n handlerParams: filterWrapper.handlerParams\n });\n })\n );\n } else {\n const promise = getFilterUiFromWrapper(filterWrapper);\n if (promise) {\n promises.push(\n promise.then((filter) => {\n addFilter(column, isFilterActive(filter), {\n colId,\n isHandler: false,\n comp: filter\n });\n })\n );\n }\n }\n });\n return AgPromise.all(promises).then(() => {\n this.activeAggregateFilters = activeAggregateFilters;\n this.activeColumnFilters = activeColumnFilters;\n });\n }\n updateFilterFlagInColumns(source, additionalEventAttributes) {\n const promises = [];\n this.allColumnFilters.forEach((filterWrapper) => {\n const column = filterWrapper.column;\n if (filterWrapper.isHandler) {\n promises.push(\n AgPromise.resolve().then(() => {\n this.setColFilterActive(\n column,\n this.isHandlerActive(column),\n source,\n additionalEventAttributes\n );\n })\n );\n } else {\n const promise = getFilterUiFromWrapper(filterWrapper);\n if (promise) {\n promises.push(\n promise.then((filter) => {\n this.setColFilterActive(\n column,\n filter.isFilterActive(),\n source,\n additionalEventAttributes\n );\n })\n );\n }\n }\n });\n this.beans.groupFilter?.updateFilterFlags(source, additionalEventAttributes);\n return AgPromise.all(promises);\n }\n doFiltersPass(node, colIdToSkip, targetAggregates) {\n const { data, aggData } = node;\n const targetedFilters = targetAggregates ? this.activeAggregateFilters : this.activeColumnFilters;\n const targetedData = targetAggregates ? aggData : data;\n const model = this.model;\n for (let i = 0; i < targetedFilters.length; i++) {\n const filter = targetedFilters[i];\n const { colId, isHandler } = filter;\n if (colId === colIdToSkip) {\n continue;\n }\n if (isHandler) {\n const { handler, handlerParams } = filter;\n if (!handler.doesFilterPass({\n node,\n data: targetedData,\n model: _getFilterModel(model, colId),\n handlerParams\n })) {\n return false;\n }\n } else {\n const comp = filter.comp;\n if (typeof comp.doesFilterPass !== \"function\") {\n _error(91);\n continue;\n }\n if (!comp.doesFilterPass({ node, data: targetedData })) {\n return false;\n }\n }\n }\n return true;\n }\n getHandlerParams(column) {\n const wrapper = this.allColumnFilters.get(column.getColId());\n return wrapper?.isHandler ? wrapper.handlerParams : void 0;\n }\n // sometimes (especially in React) the filter can call onFilterChanged when we are in the middle\n // of a render cycle. this would be bad, so we wait for render cycle to complete when this happens.\n // this happens in react when we change React State in the grid (eg setting RowCtrl's in RowContainer)\n // which results in React State getting applied in the main application, triggering a useEffect() to\n // be kicked off adn then the application calling the grid's API. in AG-6554, the custom filter was\n // getting it's useEffect() triggered in this way.\n callOnFilterChangedOutsideRenderCycle(params) {\n const { rowRenderer, filterManager } = this.beans;\n const action = () => {\n if (this.isAlive()) {\n filterManager?.onFilterChanged(params);\n }\n };\n if (rowRenderer.isRefreshInProgress()) {\n setTimeout(action, 0);\n } else {\n action();\n }\n }\n updateBeforeFilterChanged(params = {}) {\n const { column, additionalEventAttributes } = params;\n const colId = column?.getColId();\n return this.updateActiveFilters().then(\n () => this.updateFilterFlagInColumns(\"filterChanged\", additionalEventAttributes).then(() => {\n this.allColumnFilters.forEach((filterWrapper) => {\n const { column: filterColumn, isHandler } = filterWrapper;\n if (colId === filterColumn.getColId()) {\n return;\n }\n if (isHandler) {\n filterWrapper.handler.onAnyFilterChanged?.();\n }\n getFilterUiFromWrapper(filterWrapper, isHandler)?.then((filter) => {\n if (typeof filter?.onAnyFilterChanged === \"function\") {\n filter.onAnyFilterChanged();\n }\n });\n });\n this.processingFilterChange = true;\n })\n );\n }\n updateAfterFilterChanged() {\n this.processingFilterChange = false;\n }\n isSuppressFlashingCellsBecauseFiltering() {\n const allowShowChangeAfterFilter = this.gos.get(\"allowShowChangeAfterFilter\") ?? false;\n return !allowShowChangeAfterFilter && this.processingFilterChange;\n }\n onNewRowsLoaded(source) {\n const promises = [];\n this.allColumnFilters.forEach((filterWrapper) => {\n const isHandler = filterWrapper.isHandler;\n if (isHandler) {\n filterWrapper.handler.onNewRowsLoaded?.();\n }\n const promise = getFilterUiFromWrapper(filterWrapper, isHandler);\n if (promise) {\n promises.push(\n promise.then((filter) => {\n filter.onNewRowsLoaded?.();\n })\n );\n }\n });\n AgPromise.all(promises).then(() => this.updateActive(source, { afterDataChange: true }));\n }\n updateActive(source, additionalEventAttributes) {\n this.updateFilterFlagInColumns(source, additionalEventAttributes).then(() => this.updateActiveFilters());\n }\n createGetValue(filterColumn, filterValueGetterOverride) {\n const { filterValueSvc, colModel } = this.beans;\n return (rowNode, column) => {\n const columnToUse = column ? colModel.getCol(column) : filterColumn;\n return columnToUse ? filterValueSvc.getValue(columnToUse, rowNode, filterValueGetterOverride) : void 0;\n };\n }\n isFilterActive(column) {\n const filterWrapper = this.cachedFilter(column);\n if (filterWrapper?.isHandler) {\n return this.isHandlerActive(column);\n }\n const filter = filterWrapper?.filter;\n if (filter) {\n return filter.isFilterActive();\n }\n return _getFilterModel(this.initialModel, column.getColId()) != null;\n }\n isHandlerActive(column) {\n const active = _exists(_getFilterModel(this.model, column.getColId()));\n if (active) {\n return active;\n }\n const groupFilter = this.beans.groupFilter;\n return groupFilter?.isGroupFilter(column) ? groupFilter.isFilterActive(column) : false;\n }\n getOrCreateFilterUi(column) {\n const filterWrapper = this.getOrCreateFilterWrapper(column, true);\n return filterWrapper ? getFilterUiFromWrapper(filterWrapper) : null;\n }\n getFilterUiForDisplay(column) {\n const filterWrapper = this.getOrCreateFilterWrapper(column, true);\n if (!filterWrapper) {\n return null;\n }\n const compPromise = getFilterUiFromWrapper(filterWrapper);\n if (!compPromise) {\n return null;\n }\n return compPromise.then((comp) => ({\n comp,\n params: filterWrapper.filterUi.filterParams,\n isHandler: filterWrapper.isHandler\n }));\n }\n getHandler(column, createIfMissing) {\n const filterWrapper = this.getOrCreateFilterWrapper(column, createIfMissing);\n return filterWrapper?.isHandler ? filterWrapper.handler : void 0;\n }\n getOrCreateFilterWrapper(column, createIfMissing) {\n if (!column.isFilterAllowed()) {\n return void 0;\n }\n let filterWrapper = this.cachedFilter(column);\n if (!filterWrapper && createIfMissing) {\n filterWrapper = this.createFilterWrapper(column);\n this.setColumnFilterWrapper(column, filterWrapper);\n }\n return filterWrapper;\n }\n cachedFilter(column) {\n return this.allColumnFilters.get(column.getColId());\n }\n getDefaultFilter(column, isFloating = false) {\n return this.getDefaultFilterFromDataType(() => this.beans.dataTypeSvc?.getBaseDataType(column), isFloating);\n }\n getDefaultFilterFromDataType(getCellDataType, isFloating = false) {\n if (_isSetFilterByDefault(this.gos)) {\n return isFloating ? \"agSetColumnFloatingFilter\" : \"agSetColumnFilter\";\n }\n return _getDefaultSimpleFilter(getCellDataType(), isFloating);\n }\n getDefaultFloatingFilter(column) {\n return this.getDefaultFilter(column, true);\n }\n createFilterComp(column, filterDef, defaultFilter, getFilterParams, isHandler, source) {\n const createFilterCompDetails = () => {\n const params = this.createFilterCompParams(column, isHandler, source);\n const updatedParams = getFilterParams(params, isHandler);\n return _getFilterDetails(this.beans.userCompFactory, filterDef, updatedParams, defaultFilter);\n };\n const compDetails = createFilterCompDetails();\n if (!compDetails) {\n return null;\n }\n const createFilterUi = (update) => {\n return (update ? createFilterCompDetails() : compDetails).newAgStackInstance();\n };\n return {\n compDetails,\n createFilterUi\n };\n }\n createFilterInstance(column, filterDef, defaultFilter, getFilterParams) {\n const selectableFilter = this.beans.selectableFilter;\n if (selectableFilter?.isSelectable(filterDef)) {\n filterDef = selectableFilter.getFilterDef(column, filterDef);\n }\n const { handler, handlerParams, handlerGenerator } = this.createHandler(column, filterDef, defaultFilter) ?? {};\n const filterCompDetails = this.createFilterComp(\n column,\n filterDef,\n defaultFilter,\n getFilterParams,\n !!handler,\n \"init\"\n );\n if (!filterCompDetails) {\n return {\n compDetails: null,\n createFilterUi: null,\n handler,\n handlerGenerator,\n handlerParams\n };\n }\n const { compDetails, createFilterUi } = filterCompDetails;\n if (this.isGlobalButtons) {\n const hasLocalButtons = !!compDetails.params?.buttons?.length;\n if (!hasLocalButtons) {\n _warn(281, { colId: column.getColId() });\n }\n }\n return {\n compDetails,\n handler,\n handlerGenerator,\n handlerParams,\n createFilterUi\n };\n }\n createBaseFilterParams(column, forFloatingFilter) {\n const { filterManager, rowModel } = this.beans;\n return _addGridCommonParams(this.gos, {\n column,\n colDef: column.getColDef(),\n getValue: this.createGetValue(column),\n doesRowPassOtherFilter: forFloatingFilter ? () => true : (node) => filterManager?.doesRowPassOtherFilters(column.getColId(), node) ?? true,\n // to avoid breaking changes to `filterParams` defined as functions\n // we need to provide the below options even though they are not valid for handlers\n rowModel\n });\n }\n createFilterCompParams(column, useHandler, source, forFloatingFilter) {\n const filterChangedCallback = this.filterChangedCallbackFactory(column);\n const params = this.createBaseFilterParams(column, forFloatingFilter);\n params.filterChangedCallback = filterChangedCallback;\n params.filterModifiedCallback = forFloatingFilter ? () => {\n } : (additionalEventAttributes) => this.filterModified(column, additionalEventAttributes);\n if (useHandler) {\n const displayParams = params;\n const colId = column.getColId();\n const model = _getFilterModel(this.model, colId);\n displayParams.model = model;\n displayParams.state = this.state.get(colId) ?? {\n model\n };\n displayParams.onModelChange = (model2, additionalEventAttributes) => {\n this.updateStoredModel(colId, model2);\n this.refreshHandlerAndUi(column, model2, \"ui\", false, additionalEventAttributes).then(() => {\n filterChangedCallback({ ...additionalEventAttributes, source: \"columnFilter\" });\n });\n };\n displayParams.onStateChange = (state) => {\n this.updateState(column, state);\n this.updateOrRefreshFilterUi(column);\n };\n displayParams.onAction = (action, additionalEventAttributes, event) => {\n this.updateModel(column, action, additionalEventAttributes);\n this.dispatchLocalEvent({\n type: \"filterAction\",\n column,\n action,\n event\n });\n };\n displayParams.getHandler = () => this.getHandler(column, true);\n displayParams.onUiChange = (additionalEventAttributes) => this.filterUiChanged(column, additionalEventAttributes);\n displayParams.source = source;\n }\n return params;\n }\n createFilterUiForHandler(compDetails, createFilterUi) {\n return createFilterUi ? {\n created: false,\n create: createFilterUi,\n filterParams: compDetails.params,\n compDetails\n } : null;\n }\n createFilterUiLegacy(compDetails, createFilterUi, updateInstanceCallback) {\n const promise = createFilterUi();\n const filterUi = {\n created: true,\n create: createFilterUi,\n filterParams: compDetails.params,\n compDetails,\n promise\n };\n promise.then(updateInstanceCallback);\n return filterUi;\n }\n createFilterWrapper(column) {\n const { compDetails, handler, handlerGenerator, handlerParams, createFilterUi } = this.createFilterInstance(\n column,\n column.getColDef(),\n this.getDefaultFilter(column),\n (params) => params\n );\n const colId = column.getColId();\n if (handler) {\n delete this.initialModel[colId];\n handler.init?.({\n ...handlerParams,\n source: \"init\",\n model: _getFilterModel(this.model, colId)\n });\n return {\n column,\n isHandler: true,\n handler,\n handlerGenerator,\n handlerParams,\n filterUi: this.createFilterUiForHandler(compDetails, createFilterUi)\n };\n }\n if (createFilterUi) {\n const filterWrapper = {\n column,\n filterUi: null,\n isHandler: false\n };\n filterWrapper.filterUi = this.createFilterUiLegacy(compDetails, createFilterUi, (filterComp) => {\n filterWrapper.filter = filterComp ?? void 0;\n });\n return filterWrapper;\n }\n return {\n column,\n filterUi: null,\n isHandler: false\n };\n }\n createHandlerFunc(column, filterDef, defaultFilter) {\n const { gos, frameworkOverrides, registry } = this.beans;\n let doesFilterPass;\n const getFilterHandlerFromDef = (filterDef2) => {\n const filter = filterDef2.filter;\n if (isColumnFilterComp(filter)) {\n const handler = filter.handler;\n if (handler) {\n return handler;\n }\n doesFilterPass = filter.doesFilterPass;\n if (doesFilterPass) {\n return () => ({\n doesFilterPass\n });\n }\n return void 0;\n }\n return typeof filter === \"string\" ? filter : void 0;\n };\n const enableFilterHandlers = gos.get(\"enableFilterHandlers\");\n const providedFilterHandler = enableFilterHandlers ? getFilterHandlerFromDef(filterDef) : void 0;\n const resolveProvidedFilterHandler = (handlerName2) => () => this.createBean(registry.createDynamicBean(handlerName2, true));\n let filterHandler;\n let handlerName;\n if (typeof providedFilterHandler === \"string\") {\n const userFilterHandler = gos.get(\"filterHandlers\")?.[providedFilterHandler];\n if (userFilterHandler != null) {\n filterHandler = userFilterHandler;\n } else if (FILTER_HANDLERS.has(providedFilterHandler)) {\n filterHandler = resolveProvidedFilterHandler(providedFilterHandler);\n handlerName = providedFilterHandler;\n }\n } else {\n filterHandler = providedFilterHandler;\n }\n if (!filterHandler) {\n let filterName;\n const { compName, jsComp, fwComp } = _getFilterCompKeys(frameworkOverrides, filterDef);\n if (compName) {\n filterName = compName;\n } else {\n const usingDefaultFilter = jsComp == null && fwComp == null && filterDef.filter === true;\n if (usingDefaultFilter) {\n filterName = defaultFilter;\n }\n }\n handlerName = this.handlerMap[filterName];\n if (handlerName) {\n filterHandler = resolveProvidedFilterHandler(handlerName);\n }\n }\n if (!filterHandler) {\n if (!enableFilterHandlers) {\n return void 0;\n }\n if (_isClientSideRowModel(gos)) {\n _warn(277, { colId: column.getColId() });\n }\n return DUMMY_HANDLER;\n }\n return { filterHandler, handlerNameOrCallback: doesFilterPass ?? handlerName };\n }\n createHandler(column, filterDef, defaultFilter) {\n const handlerFunc = this.createHandlerFunc(column, filterDef, defaultFilter);\n if (!handlerFunc) {\n return void 0;\n }\n const filterParams = _mergeFilterParamsWithApplicationProvidedParams(\n this.beans.userCompFactory,\n filterDef,\n this.createFilterCompParams(column, true, \"init\")\n );\n const { handlerNameOrCallback, filterHandler } = handlerFunc;\n const { handler, handlerParams } = this.createHandlerFromFunc(column, filterHandler, filterParams);\n return {\n handler,\n handlerParams,\n handlerGenerator: handlerNameOrCallback ?? filterHandler\n };\n }\n createHandlerFromFunc(column, filterHandler, filterParams) {\n const colDef = column.getColDef();\n const handler = filterHandler(_addGridCommonParams(this.gos, { column, colDef }));\n const handlerParams = this.createHandlerParams(column, filterParams);\n return { handler, handlerParams };\n }\n createHandlerParams(column, filterParams) {\n const colDef = column.getColDef();\n const colId = column.getColId();\n const filterChangedCallback = this.filterChangedCallbackFactory(column);\n return _addGridCommonParams(this.gos, {\n colDef,\n column,\n getValue: this.createGetValue(column),\n doesRowPassOtherFilter: (node) => this.beans.filterManager?.doesRowPassOtherFilters(colId, node) ?? true,\n onModelChange: (newModel, additionalEventAttributes) => {\n this.updateStoredModel(colId, newModel);\n this.refreshHandlerAndUi(column, newModel, \"handler\", false, additionalEventAttributes).then(() => {\n filterChangedCallback({ ...additionalEventAttributes, source: \"columnFilter\" });\n });\n },\n onModelAsStringChange: () => {\n column.dispatchColEvent(\"filterChanged\", \"filterChanged\");\n this.dispatchLocalEvent({\n type: \"filterModelAsStringChanged\",\n column\n });\n },\n filterParams\n });\n }\n onColumnsChanged() {\n const columns = [];\n const { colModel, filterManager, groupFilter } = this.beans;\n this.allColumnFilters.forEach((wrapper, colId) => {\n let currentColumn;\n if (wrapper.column.isPrimary()) {\n currentColumn = colModel.getColDefCol(colId);\n } else {\n currentColumn = colModel.getCol(colId);\n }\n if (currentColumn && currentColumn === wrapper.column) {\n return;\n }\n columns.push(wrapper.column);\n this.disposeFilterWrapper(wrapper, \"columnChanged\");\n this.disposeColumnListener(colId);\n });\n const allFiltersAreGroupFilters = groupFilter && columns.every((col) => groupFilter.isGroupFilter(col));\n if (columns.length > 0 && !allFiltersAreGroupFilters) {\n filterManager?.onFilterChanged({ columns, source: \"api\" });\n }\n }\n isFilterAllowed(column) {\n const isFilterAllowed = column.isFilterAllowed();\n if (!isFilterAllowed) {\n return false;\n }\n const groupFilter = this.beans.groupFilter;\n if (groupFilter?.isGroupFilter(column)) {\n return groupFilter.isFilterAllowed(column);\n }\n return true;\n }\n getFloatingFilterCompDetails(column, showParentFilter) {\n const { userCompFactory, frameworkOverrides, selectableFilter, gos } = this.beans;\n const parentFilterInstance = (callback) => {\n const filterComponent = this.getOrCreateFilterUi(column);\n filterComponent?.then((instance) => {\n callback(_unwrapUserComp(instance));\n });\n };\n const colDef = column.getColDef();\n const filterDef = selectableFilter?.isSelectable(colDef) ? selectableFilter.getFilterDef(column, colDef) : colDef;\n const defaultFloatingFilterType = _getDefaultFloatingFilterType(frameworkOverrides, filterDef, () => this.getDefaultFloatingFilter(column)) ?? \"agReadOnlyFloatingFilter\";\n const isReactive = gos.get(\"enableFilterHandlers\");\n const filterParams = _mergeFilterParamsWithApplicationProvidedParams(\n userCompFactory,\n filterDef,\n this.createFilterCompParams(column, isReactive, \"init\", true)\n );\n const params = _addGridCommonParams(gos, {\n column,\n filterParams,\n currentParentModel: () => this.getCurrentFloatingFilterParentModel(column),\n parentFilterInstance,\n showParentFilter\n });\n if (isReactive) {\n const displayParams = params;\n const colId = column.getColId();\n const filterChangedCallback = this.filterChangedCallbackFactory(column);\n displayParams.onUiChange = (additionalEventAttributes) => this.floatingFilterUiChanged(column, additionalEventAttributes);\n displayParams.model = _getFilterModel(this.model, colId);\n displayParams.onModelChange = (model, additionalEventAttributes) => {\n this.updateStoredModel(colId, model);\n this.refreshHandlerAndUi(column, model, \"floating\", true, additionalEventAttributes).then(() => {\n filterChangedCallback({ ...additionalEventAttributes, source: \"columnFilter\" });\n });\n };\n displayParams.getHandler = () => this.getHandler(column, true);\n displayParams.source = \"init\";\n }\n return _getFloatingFilterCompDetails(userCompFactory, colDef, params, defaultFloatingFilterType);\n }\n getCurrentFloatingFilterParentModel(column) {\n return this.getModelFromFilterWrapper(this.cachedFilter(column) ?? { column });\n }\n destroyFilterUi(filterWrapper, column, compDetails, createFilterUi) {\n const source = \"paramsUpdated\";\n if (filterWrapper.isHandler) {\n const colId = column.getColId();\n delete this.initialModel[colId];\n this.state.delete(colId);\n const filterUi = filterWrapper.filterUi;\n const newFilterUi = this.createFilterUiForHandler(compDetails, createFilterUi);\n filterWrapper.filterUi = newFilterUi;\n const eventSvc = this.eventSvc;\n if (filterUi?.created) {\n filterUi.promise.then((filter) => {\n this.destroyBean(filter);\n eventSvc.dispatchEvent({\n type: \"filterDestroyed\",\n source,\n column\n });\n });\n } else {\n eventSvc.dispatchEvent({\n type: \"filterHandlerDestroyed\",\n source,\n column\n });\n }\n } else {\n this.destroyFilter(column, source);\n }\n }\n // destroys the filter, so it no longer takes part\n destroyFilter(column, source = \"api\") {\n const colId = column.getColId();\n const filterWrapper = this.allColumnFilters.get(colId);\n this.disposeColumnListener(colId);\n delete this.initialModel[colId];\n if (filterWrapper) {\n this.disposeFilterWrapper(filterWrapper, source).then((wasActive) => {\n if (wasActive && this.isAlive()) {\n this.beans.filterManager?.onFilterChanged({\n columns: [column],\n source: \"api\"\n });\n }\n });\n }\n }\n disposeColumnListener(colId) {\n const columnListener = this.allColumnListeners.get(colId);\n if (columnListener) {\n this.allColumnListeners.delete(colId);\n columnListener();\n }\n }\n disposeFilterWrapper(filterWrapper, source) {\n let isActive = false;\n const { column, isHandler, filterUi } = filterWrapper;\n const colId = column.getColId();\n if (isHandler) {\n isActive = this.isHandlerActive(column);\n this.destroyBean(filterWrapper.handler);\n delete this.model[colId];\n this.state.delete(colId);\n }\n const removeFilter = () => {\n this.setColFilterActive(column, false, \"filterDestroyed\");\n this.allColumnFilters.delete(colId);\n this.eventSvc.dispatchEvent({\n type: \"filterDestroyed\",\n source,\n column\n });\n };\n if (filterUi) {\n if (filterUi.created) {\n return filterUi.promise.then((filter) => {\n isActive = isHandler ? isActive : !!filter?.isFilterActive();\n this.destroyBean(filter);\n removeFilter();\n return isActive;\n });\n } else {\n removeFilter();\n }\n }\n return AgPromise.resolve(isActive);\n }\n filterChangedCallbackFactory(column) {\n return (additionalEventAttributes) => {\n this.callOnFilterChangedOutsideRenderCycle({\n additionalEventAttributes,\n columns: [column],\n column,\n source: additionalEventAttributes?.source ?? \"columnFilter\"\n });\n };\n }\n filterParamsChanged(colId, source = \"api\") {\n const filterWrapper = this.allColumnFilters.get(colId);\n if (!filterWrapper) {\n return;\n }\n const beans = this.beans;\n const column = filterWrapper.column;\n const colDef = column.getColDef();\n const isFilterAllowed = column.isFilterAllowed();\n const defaultFilter = this.getDefaultFilter(column);\n const selectableFilter = beans.selectableFilter;\n const filterDef = selectableFilter?.isSelectable(colDef) ? selectableFilter.getFilterDef(column, colDef) : colDef;\n const handlerFunc = isFilterAllowed ? this.createHandlerFunc(column, filterDef, this.getDefaultFilter(column)) : void 0;\n const isHandler = !!handlerFunc;\n const wasHandler = filterWrapper.isHandler;\n if (wasHandler != isHandler) {\n this.destroyFilter(column, \"paramsUpdated\");\n return;\n }\n const { compDetails, createFilterUi } = (isFilterAllowed ? this.createFilterComp(column, filterDef, defaultFilter, (params) => params, isHandler, \"colDef\") : null) ?? { compDetails: null, createFilterUi: null };\n const newFilterParams = compDetails?.params ?? _mergeFilterParamsWithApplicationProvidedParams(\n beans.userCompFactory,\n filterDef,\n this.createFilterCompParams(column, isHandler, \"colDef\")\n );\n if (wasHandler) {\n const handlerGenerator = handlerFunc?.handlerNameOrCallback ?? handlerFunc?.filterHandler;\n const existingModel = _getFilterModel(this.model, colId);\n if (filterWrapper.handlerGenerator != handlerGenerator) {\n const oldHandler = filterWrapper.handler;\n const { handler, handlerParams } = this.createHandlerFromFunc(\n column,\n handlerFunc.filterHandler,\n newFilterParams\n );\n filterWrapper.handler = handler;\n filterWrapper.handlerParams = handlerParams;\n filterWrapper.handlerGenerator = handlerGenerator;\n delete this.model[colId];\n handler.init?.({ ...handlerParams, source: \"init\", model: null });\n this.destroyBean(oldHandler);\n if (existingModel != null) {\n this.beans.filterManager?.onFilterChanged({\n columns: [column],\n source\n });\n }\n } else {\n const handlerParams = this.createHandlerParams(column, compDetails?.params);\n filterWrapper.handlerParams = handlerParams;\n filterWrapper.handler.refresh?.({\n ...handlerParams,\n source: \"colDef\",\n model: existingModel\n });\n }\n }\n if (this.areFilterCompsDifferent(filterWrapper.filterUi?.compDetails ?? null, compDetails) || !filterWrapper.filterUi || !compDetails) {\n this.destroyFilterUi(filterWrapper, column, compDetails, createFilterUi);\n return;\n }\n filterWrapper.filterUi.filterParams = newFilterParams;\n getFilterUiFromWrapper(filterWrapper, wasHandler)?.then((filter) => {\n const shouldRefreshFilter = filter?.refresh ? filter.refresh(newFilterParams) : true;\n if (shouldRefreshFilter === false) {\n this.destroyFilterUi(filterWrapper, column, compDetails, createFilterUi);\n } else {\n this.dispatchLocalEvent({\n type: \"filterParamsChanged\",\n column,\n params: newFilterParams\n });\n }\n });\n }\n refreshHandlerAndUi(column, model, source, createIfMissing, additionalEventAttributes) {\n const filterWrapper = this.cachedFilter(column);\n if (!filterWrapper) {\n if (createIfMissing) {\n this.getOrCreateFilterWrapper(column, true);\n }\n return AgPromise.resolve();\n }\n if (!filterWrapper.isHandler) {\n return AgPromise.resolve();\n }\n const { filterUi, handler, handlerParams } = filterWrapper;\n return _refreshHandlerAndUi(\n () => {\n if (filterUi) {\n const { created, filterParams } = filterUi;\n if (created) {\n return filterUi.promise.then((filter) => {\n return filter ? { filter, filterParams } : void 0;\n });\n } else {\n filterUi.refreshed = true;\n }\n }\n return AgPromise.resolve(void 0);\n },\n handler,\n handlerParams,\n model,\n this.state.get(column.getColId()) ?? { model },\n source,\n additionalEventAttributes\n );\n }\n setColumnFilterWrapper(column, filterWrapper) {\n const colId = column.getColId();\n this.allColumnFilters.set(colId, filterWrapper);\n this.allColumnListeners.set(\n colId,\n this.addManagedListeners(column, { colDefChanged: () => this.filterParamsChanged(colId) })[0]\n );\n }\n areFilterCompsDifferent(oldCompDetails, newCompDetails) {\n if (!newCompDetails || !oldCompDetails) {\n return true;\n }\n const { componentClass: oldComponentClass } = oldCompDetails;\n const { componentClass: newComponentClass } = newCompDetails;\n const isSameComponentClass = oldComponentClass === newComponentClass || // react hooks returns new wrappers, so check nested render method\n oldComponentClass?.render && newComponentClass?.render && oldComponentClass.render === newComponentClass.render;\n return !isSameComponentClass;\n }\n hasFloatingFilters() {\n const gridColumns = this.beans.colModel.getCols();\n return gridColumns.some((col) => col.getColDef().floatingFilter);\n }\n getFilterInstance(key) {\n const column = this.beans.colModel.getColDefCol(key);\n if (!column) {\n return Promise.resolve(void 0);\n }\n const filterPromise = this.getOrCreateFilterUi(column);\n if (!filterPromise) {\n return Promise.resolve(null);\n }\n return new Promise((resolve) => {\n filterPromise.then((filter) => {\n resolve(_unwrapUserComp(filter));\n });\n });\n }\n processFilterModelUpdateQueue() {\n this.modelUpdates.forEach(({ model, source }) => this.setModel(model, source));\n this.modelUpdates = [];\n this.columnModelUpdates.forEach(({ key, model, resolve }) => {\n this.setModelForColumn(key, model).then(() => resolve());\n });\n this.columnModelUpdates = [];\n }\n getModelForColumn(column, useUnapplied) {\n if (useUnapplied) {\n const { state, model } = this;\n const colId = column.getColId();\n const colState = state.get(colId);\n if (colState) {\n return colState.model ?? null;\n }\n return _getFilterModel(model, colId);\n }\n const filterWrapper = this.cachedFilter(column);\n return filterWrapper ? this.getModelFromFilterWrapper(filterWrapper) : null;\n }\n setModelForColumn(key, model) {\n if (this.beans.dataTypeSvc?.isPendingInference) {\n let resolve = () => {\n };\n const promise = new Promise((res) => {\n resolve = res;\n });\n this.columnModelUpdates.push({ key, model, resolve });\n return promise;\n }\n return new Promise((resolve) => {\n this.setModelForColumnLegacy(key, model).then((result) => resolve(result));\n });\n }\n getStateForColumn(colId) {\n return this.state.get(colId) ?? {\n model: _getFilterModel(this.model, colId)\n };\n }\n setModelForColumnLegacy(key, model) {\n const column = this.beans.colModel.getColDefCol(key);\n const filterWrapper = column ? this.getOrCreateFilterWrapper(column, true) : null;\n return filterWrapper ? this.setModelOnFilterWrapper(filterWrapper, model) : AgPromise.resolve();\n }\n setColDefPropsForDataType(colDef, dataTypeDefinition, formatValue) {\n const providedFilter = colDef.filter;\n const filter = providedFilter === true ? this.getDefaultFilterFromDataType(() => dataTypeDefinition.baseDataType) : providedFilter;\n if (typeof filter !== \"string\") {\n return;\n }\n let filterParams;\n let filterValueGetter;\n const beans = this.beans;\n const { filterParams: colDefFilterParams, filterValueGetter: colDefFilterValueGetter } = colDef;\n if (filter === \"agMultiColumnFilter\") {\n ({ filterParams, filterValueGetter } = beans.multiFilter?.getParamsForDataType(\n colDefFilterParams,\n colDefFilterValueGetter,\n dataTypeDefinition,\n formatValue\n ) ?? {});\n } else {\n ({ filterParams, filterValueGetter } = _getFilterParamsForDataType(\n filter,\n colDefFilterParams,\n colDefFilterValueGetter,\n dataTypeDefinition,\n formatValue,\n beans,\n this.getLocaleTextFunc()\n ));\n }\n colDef.filterParams = filterParams;\n if (filterValueGetter) {\n colDef.filterValueGetter = filterValueGetter;\n }\n }\n // additionalEventAttributes is used by provided simple floating filter, so it can add 'floatingFilter=true' to the event\n setColFilterActive(column, active, source, additionalEventAttributes) {\n if (column.filterActive !== active) {\n column.filterActive = active;\n column.dispatchColEvent(\"filterActiveChanged\", source);\n }\n column.dispatchColEvent(\"filterChanged\", source, additionalEventAttributes);\n }\n setModelOnFilterWrapper(filterWrapper, newModel, justCreated) {\n return new AgPromise((resolve) => {\n if (filterWrapper.isHandler) {\n const column = filterWrapper.column;\n const colId = column.getColId();\n const existingModel = this.model[colId];\n this.updateStoredModel(colId, newModel);\n if (justCreated && newModel === existingModel) {\n resolve();\n return;\n }\n this.refreshHandlerAndUi(column, newModel, \"api\").then(() => resolve());\n return;\n }\n const uiPromise = getFilterUiFromWrapper(filterWrapper);\n if (uiPromise) {\n uiPromise.then((filter) => {\n if (typeof filter?.setModel !== \"function\") {\n _warn(65);\n resolve();\n return;\n }\n (filter.setModel(newModel) || AgPromise.resolve()).then(() => resolve());\n });\n return;\n }\n resolve();\n });\n }\n /** for handlers only */\n updateStoredModel(colId, model) {\n if (_exists(model)) {\n this.model[colId] = model;\n } else {\n delete this.model[colId];\n }\n const oldState = this.state.get(colId);\n const newState = {\n model,\n state: oldState?.state\n };\n this.state.set(colId, newState);\n }\n filterModified(column, additionalEventAttributes) {\n this.getOrCreateFilterUi(column)?.then((filterInstance) => {\n this.eventSvc.dispatchEvent({\n type: \"filterModified\",\n column,\n filterInstance,\n ...additionalEventAttributes\n });\n });\n }\n filterUiChanged(column, additionalEventAttributes) {\n if (this.gos.get(\"enableFilterHandlers\")) {\n this.eventSvc.dispatchEvent({\n type: \"filterUiChanged\",\n column,\n ...additionalEventAttributes\n });\n }\n }\n floatingFilterUiChanged(column, additionalEventAttributes) {\n if (this.gos.get(\"enableFilterHandlers\")) {\n this.eventSvc.dispatchEvent({\n type: \"floatingFilterUiChanged\",\n column,\n ...additionalEventAttributes\n });\n }\n }\n updateModel(column, action, additionalEventAttributes) {\n const colId = column.getColId();\n const filterWrapper = this.cachedFilter(column);\n const getFilterUi = () => filterWrapper?.filterUi;\n _updateFilterModel({\n action,\n filterParams: filterWrapper?.filterUi?.filterParams,\n getFilterUi,\n getModel: () => _getFilterModel(this.model, colId),\n getState: () => this.state.get(colId),\n updateState: (state) => this.updateState(column, state),\n updateModel: (model) => getFilterUi()?.filterParams?.onModelChange(model, { ...additionalEventAttributes, fromAction: action }),\n processModelToApply: filterWrapper?.isHandler ? filterWrapper.handler.processModelToApply?.bind(filterWrapper.handler) : void 0\n });\n }\n updateAllModels(action, additionalEventAttributes) {\n const promises = [];\n this.allColumnFilters.forEach((filter, colId) => {\n const column = this.beans.colModel.getColDefCol(colId);\n if (column) {\n _updateFilterModel({\n action,\n filterParams: filter.filterUi?.filterParams,\n getFilterUi: () => filter.filterUi,\n getModel: () => _getFilterModel(this.model, colId),\n getState: () => this.state.get(colId),\n updateState: (state) => this.updateState(column, state),\n updateModel: (model) => {\n this.updateStoredModel(colId, model);\n this.dispatchLocalEvent({\n type: \"filterAction\",\n column,\n action\n });\n promises.push(this.refreshHandlerAndUi(column, model, \"ui\"));\n },\n processModelToApply: filter?.isHandler ? filter.handler.processModelToApply?.bind(filter.handler) : void 0\n });\n }\n });\n if (promises.length) {\n AgPromise.all(promises).then(() => {\n this.callOnFilterChangedOutsideRenderCycle({\n source: \"columnFilter\",\n additionalEventAttributes,\n columns: []\n });\n });\n }\n }\n updateOrRefreshFilterUi(column) {\n const colId = column.getColId();\n getAndRefreshFilterUi(\n () => this.cachedFilter(column)?.filterUi,\n () => _getFilterModel(this.model, colId),\n () => this.state.get(colId)\n );\n }\n updateState(column, state) {\n this.state.set(column.getColId(), state);\n this.dispatchLocalEvent({\n type: \"filterStateChanged\",\n column,\n state\n });\n }\n // for tool panel only\n canApplyAll() {\n const { state, model, activeFilterComps } = this;\n for (const comp of activeFilterComps) {\n if (comp.source === \"COLUMN_MENU\") {\n return false;\n }\n }\n let hasChanges = false;\n for (const colId of state.keys()) {\n const colState = state.get(colId);\n if (colState.valid === false) {\n return false;\n }\n if ((colState.model ?? null) !== _getFilterModel(model, colId)) {\n hasChanges = true;\n }\n }\n return hasChanges;\n }\n hasUnappliedModel(colId) {\n const { model, state } = this;\n return (state.get(colId)?.model ?? null) !== _getFilterModel(model, colId);\n }\n setGlobalButtons(isGlobal) {\n this.isGlobalButtons = isGlobal;\n this.dispatchLocalEvent({\n type: \"filterGlobalButtons\",\n isGlobal\n });\n }\n shouldKeepStateOnDetach(column, lastContainerType) {\n if (lastContainerType === \"newFiltersToolPanel\") {\n return true;\n }\n const filterPanelSvc = this.beans.filterPanelSvc;\n if (filterPanelSvc?.isActive) {\n return !!filterPanelSvc.getState(column.getColId());\n }\n return false;\n }\n /**\n * When filters are applied in pivotMode, they are stored in `activeAggregateFilters`.\n * When users disable pivotMode (e.g. via sidebar), they expect any applied filters to\n * still be active but just re-applied to the non-pivoted data.\n * This should also apply vice-versa (i.e. applying a filter and then pivoting)\n */\n onPivotModeChanged(event) {\n const { colModel, pivotColsSvc } = this.beans;\n const groupFilterEnabled = !!_getGroupAggFiltering(this.gos);\n const isPivotMode = event.currentValue;\n const from = isPivotMode ? this.activeColumnFilters : this.activeAggregateFilters;\n const to = isPivotMode ? this.activeAggregateFilters : this.activeColumnFilters;\n const moved = [];\n for (const filter of from) {\n const column = colModel.getColById(filter.colId);\n const isPivotActive = isPivotMode && !!pivotColsSvc?.columns.length;\n if (column && isPivotMode === isAggFilter(column, isPivotMode, isPivotActive, groupFilterEnabled)) {\n to.push(filter);\n moved.push(filter);\n }\n }\n _removeAllFromArray(from, moved);\n }\n destroy() {\n super.destroy();\n this.allColumnFilters.forEach((filterWrapper) => this.disposeFilterWrapper(filterWrapper, \"gridDestroyed\"));\n this.allColumnListeners.clear();\n this.state.clear();\n this.activeFilterComps.clear();\n }\n};\n\n// packages/ag-grid-community/src/filter/filterApi.ts\nfunction isAnyFilterPresent(beans) {\n return !!beans.filterManager?.isAnyFilterPresent();\n}\nfunction onFilterChanged(beans, source = \"api\") {\n beans.filterManager?.onFilterChanged({ source });\n}\n\n// packages/ag-grid-community/src/filter/filterManager.ts\nvar FilterManager = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"filterManager\";\n // when we're waiting for cell data types to be inferred, we need to defer filter model updates\n this.advFilterModelUpdateQueue = [];\n }\n wireBeans(beans) {\n this.quickFilter = beans.quickFilter;\n this.advancedFilter = beans.advancedFilter;\n this.colFilter = beans.colFilter;\n }\n postConstruct() {\n const refreshFiltersForAggregations = this.refreshFiltersForAggregations.bind(this);\n const updateAdvFilterColumns = this.updateAdvFilterColumns.bind(this);\n this.addManagedEventListeners({\n columnValueChanged: refreshFiltersForAggregations,\n columnPivotChanged: refreshFiltersForAggregations,\n columnPivotModeChanged: refreshFiltersForAggregations,\n newColumnsLoaded: updateAdvFilterColumns,\n columnVisible: updateAdvFilterColumns,\n advancedFilterEnabledChanged: ({ enabled }) => this.onAdvFilterEnabledChanged(enabled),\n dataTypesInferred: this.processFilterModelUpdateQueue.bind(this)\n });\n this.externalFilterPresent = this.isExternalFilterPresentCallback();\n this.addManagedPropertyListeners([\"isExternalFilterPresent\", \"doesExternalFilterPass\"], () => {\n this.onFilterChanged({ source: \"api\" });\n });\n this.updateAggFiltering();\n this.addManagedPropertyListener(\"groupAggFiltering\", () => {\n this.updateAggFiltering();\n this.onFilterChanged();\n });\n if (this.quickFilter) {\n this.addManagedListeners(this.quickFilter, {\n quickFilterChanged: () => this.onFilterChanged({ source: \"quickFilter\" })\n });\n }\n const { gos } = this;\n this.alwaysPassFilter = gos.get(\"alwaysPassFilter\");\n this.addManagedPropertyListener(\"alwaysPassFilter\", () => {\n this.alwaysPassFilter = gos.get(\"alwaysPassFilter\");\n this.onFilterChanged({ source: \"api\" });\n });\n }\n isExternalFilterPresentCallback() {\n const isFilterPresent = this.gos.getCallback(\"isExternalFilterPresent\");\n return typeof isFilterPresent === \"function\" && isFilterPresent({});\n }\n doesExternalFilterPass(node) {\n const doesFilterPass = this.gos.get(\"doesExternalFilterPass\");\n return typeof doesFilterPass === \"function\" && doesFilterPass(node);\n }\n setFilterState(model, state, source = \"api\") {\n if (this.isAdvFilterEnabled()) {\n return;\n }\n this.colFilter?.setState(model, state, source);\n }\n setFilterModel(model, source = \"api\", skipWarning) {\n if (this.isAdvFilterEnabled()) {\n if (!skipWarning) {\n this.warnAdvFilters();\n }\n return;\n }\n this.colFilter?.setModel(model, source);\n }\n getFilterModel() {\n return this.colFilter?.getModel() ?? {};\n }\n getFilterState() {\n return this.colFilter?.getState();\n }\n isColumnFilterPresent() {\n return !!this.colFilter?.isFilterPresent();\n }\n isAggregateFilterPresent() {\n return !!this.colFilter?.isAggFilterPresent();\n }\n isChildFilterPresent() {\n return this.isColumnFilterPresent() || this.isQuickFilterPresent() || this.externalFilterPresent || this.isAdvFilterPresent();\n }\n isAnyFilterPresent() {\n return this.isChildFilterPresent() || this.isAggregateFilterPresent();\n }\n isAdvFilterPresent() {\n return this.isAdvFilterEnabled() && this.advancedFilter.isFilterPresent();\n }\n onAdvFilterEnabledChanged(enabled) {\n if (enabled) {\n if (this.colFilter?.disableFilters()) {\n this.onFilterChanged({ source: \"advancedFilter\" });\n }\n } else if (this.advancedFilter?.isFilterPresent()) {\n this.advancedFilter.setModel(null);\n this.onFilterChanged({ source: \"advancedFilter\" });\n }\n }\n isAdvFilterEnabled() {\n return !!this.advancedFilter?.isEnabled();\n }\n isAdvFilterHeaderActive() {\n return this.isAdvFilterEnabled() && this.advancedFilter.isHeaderActive();\n }\n refreshFiltersForAggregations() {\n if (_getGroupAggFiltering(this.gos) && this.isAnyFilterPresent()) {\n this.onFilterChanged();\n }\n }\n onFilterChanged(params = {}) {\n const { source, additionalEventAttributes, columns = [] } = params;\n this.externalFilterPresent = this.isExternalFilterPresentCallback();\n (this.colFilter ? this.colFilter.updateBeforeFilterChanged(params) : AgPromise.resolve()).then(() => {\n const filterChangedEvent = {\n source,\n type: \"filterChanged\",\n columns\n };\n if (additionalEventAttributes) {\n _mergeDeep(filterChangedEvent, additionalEventAttributes);\n }\n this.eventSvc.dispatchEvent(filterChangedEvent);\n this.colFilter?.updateAfterFilterChanged();\n });\n }\n isSuppressFlashingCellsBecauseFiltering() {\n return !!this.colFilter?.isSuppressFlashingCellsBecauseFiltering();\n }\n isQuickFilterPresent() {\n return !!this.quickFilter?.isFilterPresent();\n }\n updateAggFiltering() {\n this.aggFiltering = !!_getGroupAggFiltering(this.gos);\n }\n isAggregateQuickFilterPresent() {\n return this.isQuickFilterPresent() && this.shouldApplyQuickFilterAfterAgg();\n }\n isNonAggregateQuickFilterPresent() {\n return this.isQuickFilterPresent() && !this.shouldApplyQuickFilterAfterAgg();\n }\n shouldApplyQuickFilterAfterAgg() {\n return (this.aggFiltering || this.beans.colModel.isPivotMode()) && !this.gos.get(\"applyQuickFilterBeforePivotOrAgg\");\n }\n doesRowPassOtherFilters(colIdToSkip, rowNode) {\n return this.doesRowPassFilter({ rowNode, colIdToSkip });\n }\n doesRowPassAggregateFilters(params) {\n const { rowNode } = params;\n if (this.alwaysPassFilter?.(rowNode)) {\n return true;\n }\n if (this.isAggregateQuickFilterPresent() && !this.quickFilter.doesRowPass(rowNode)) {\n return false;\n }\n if (this.isAggregateFilterPresent() && !this.colFilter.doFiltersPass(rowNode, params.colIdToSkip, true)) {\n return false;\n }\n return true;\n }\n doesRowPassFilter(params) {\n const { rowNode } = params;\n if (this.alwaysPassFilter?.(rowNode)) {\n return true;\n }\n if (this.isNonAggregateQuickFilterPresent() && !this.quickFilter.doesRowPass(rowNode)) {\n return false;\n }\n if (this.externalFilterPresent && !this.doesExternalFilterPass(rowNode)) {\n return false;\n }\n if (this.isColumnFilterPresent() && !this.colFilter.doFiltersPass(rowNode, params.colIdToSkip)) {\n return false;\n }\n if (this.isAdvFilterPresent() && !this.advancedFilter.doesFilterPass(rowNode)) {\n return false;\n }\n return true;\n }\n // for group filters, can change dynamically whether they are allowed or not\n isFilterAllowed(column) {\n if (this.isAdvFilterEnabled()) {\n return false;\n }\n return !!this.colFilter?.isFilterAllowed(column);\n }\n getAdvFilterModel() {\n return this.isAdvFilterEnabled() ? this.advancedFilter.getModel() : null;\n }\n setAdvFilterModel(expression, source = \"api\") {\n if (!this.isAdvFilterEnabled()) {\n return;\n }\n if (this.beans.dataTypeSvc?.isPendingInference) {\n this.advFilterModelUpdateQueue.push(expression);\n return;\n }\n this.advancedFilter.setModel(expression ?? null);\n this.onFilterChanged({ source });\n }\n toggleAdvFilterBuilder(show, source) {\n if (!this.isAdvFilterEnabled()) {\n return;\n }\n this.advancedFilter.getCtrl().toggleFilterBuilder({ source, force: show });\n }\n updateAdvFilterColumns() {\n if (!this.isAdvFilterEnabled()) {\n return;\n }\n if (this.advancedFilter.updateValidity()) {\n this.onFilterChanged({ source: \"advancedFilter\" });\n }\n }\n hasFloatingFilters() {\n if (this.isAdvFilterEnabled()) {\n return false;\n }\n return !!this.colFilter?.hasFloatingFilters();\n }\n getColumnFilterInstance(key) {\n if (this.isAdvFilterEnabled()) {\n this.warnAdvFilters();\n return Promise.resolve(void 0);\n }\n return this.colFilter?.getFilterInstance(key) ?? Promise.resolve(void 0);\n }\n warnAdvFilters() {\n _warn(68);\n }\n setupAdvFilterHeaderComp(eCompToInsertBefore) {\n this.advancedFilter?.getCtrl().setupHeaderComp(eCompToInsertBefore);\n }\n getHeaderRowCount() {\n return this.isAdvFilterHeaderActive() ? 1 : 0;\n }\n getHeaderHeight() {\n return this.isAdvFilterHeaderActive() ? this.advancedFilter.getCtrl().getHeaderHeight() : 0;\n }\n processFilterModelUpdateQueue() {\n for (const model of this.advFilterModelUpdateQueue) {\n this.setAdvFilterModel(model);\n }\n this.advFilterModelUpdateQueue = [];\n }\n setColumnFilterModel(key, model) {\n if (this.isAdvFilterEnabled()) {\n this.warnAdvFilters();\n return Promise.resolve();\n }\n return this.colFilter?.setModelForColumn(key, model) ?? Promise.resolve();\n }\n};\n\n// packages/ag-grid-community/src/filter/filterButtonComp.ts\nfunction getElement(className) {\n return {\n tag: \"div\",\n cls: className\n };\n}\nvar FilterButtonComp = class extends Component {\n constructor(config) {\n const { className = \"ag-filter-apply-panel\" } = config ?? {};\n super(getElement(className));\n this.listeners = [];\n this.validationMessage = null;\n this.className = className;\n }\n updateButtons(buttons, useForm) {\n const oldButtons = this.buttons;\n this.buttons = buttons;\n if (oldButtons === buttons) {\n return;\n }\n const eGui = this.getGui();\n _clearElement(eGui);\n let eApplyButton;\n this.destroyListeners();\n const fragment = document.createDocumentFragment();\n const className = this.className;\n const addButton = ({ type, label }) => {\n const clickListener = (event) => {\n this.dispatchLocalEvent({\n type,\n event\n });\n };\n if (![\"apply\", \"clear\", \"reset\", \"cancel\"].includes(type)) {\n _warn(75);\n }\n const isApply = type === \"apply\";\n const buttonType = isApply && useForm ? \"submit\" : \"button\";\n const button = _createElement({\n tag: \"button\",\n attrs: { type: buttonType },\n ref: `${type}FilterButton`,\n cls: `ag-button ag-standard-button ${className}-button${isApply ? \" \" + className + \"-apply-button\" : \"\"}`,\n children: label\n });\n this.activateTabIndex([button]);\n if (isApply) {\n eApplyButton = button;\n }\n const keydownListener = (event) => {\n if (event.key === KeyCode.ENTER) {\n event.preventDefault();\n clickListener(event);\n }\n };\n const listeners = this.listeners;\n button.addEventListener(\"click\", clickListener);\n listeners.push(() => button.removeEventListener(\"click\", clickListener));\n button.addEventListener(\"keydown\", keydownListener);\n listeners.push(() => button.removeEventListener(\"keydown\", keydownListener));\n fragment.append(button);\n };\n for (const button of buttons) {\n addButton(button);\n }\n this.eApply = eApplyButton;\n const tooltip = this.validationTooltipFeature;\n if (eApplyButton && !tooltip) {\n this.validationTooltipFeature = this.createOptionalManagedBean(\n this.beans.registry.createDynamicBean(\"tooltipFeature\", false, {\n getGui: () => this.eApply,\n getLocation: () => \"advancedFilter\",\n getTooltipShowDelayOverride: () => 1e3\n })\n );\n } else if (!eApplyButton && tooltip) {\n this.validationTooltipFeature = this.destroyBean(tooltip);\n }\n eGui.append(fragment);\n }\n getApplyButton() {\n return this.eApply;\n }\n updateValidity(valid, message = null) {\n const eApplyButton = this.eApply;\n if (!eApplyButton) {\n return;\n }\n _setDisabled(eApplyButton, !valid);\n this.validationMessage = message;\n this.validationTooltipFeature?.setTooltipAndRefresh(this.validationMessage);\n }\n destroyListeners() {\n for (const destroyFunc of this.listeners) {\n destroyFunc();\n }\n this.listeners = [];\n }\n destroy() {\n this.destroyListeners();\n super.destroy();\n }\n};\nvar AgFilterButtonSelector = {\n selector: \"AG-FILTER-BUTTON\",\n component: FilterButtonComp\n};\n\n// packages/ag-grid-community/src/filter/filterWrapperComp.ts\nvar FilterWrapperComp = class extends Component {\n constructor(column, wrapper, eventParent, updateModel, isGlobalButtons, enableGlobalButtonCheck) {\n super();\n this.column = column;\n this.wrapper = wrapper;\n this.eventParent = eventParent;\n this.updateModel = updateModel;\n this.isGlobalButtons = isGlobalButtons;\n this.enableGlobalButtonCheck = enableGlobalButtonCheck;\n this.hidePopup = null;\n this.applyActive = false;\n }\n postConstruct() {\n const { comp, params: originalParams } = this.wrapper;\n const params = originalParams;\n const useForm = params.useForm;\n const tag = useForm ? \"form\" : \"div\";\n this.setTemplate({\n tag,\n cls: \"ag-filter-wrapper\"\n });\n if (useForm) {\n this.addManagedElementListeners(this.getGui(), {\n submit: (e) => {\n e?.preventDefault();\n },\n keydown: this.handleKeyDown.bind(this)\n });\n }\n this.appendChild(comp.getGui());\n this.params = params;\n this.resetButtonsPanel(params);\n this.addManagedListeners(this.eventParent, {\n filterParamsChanged: ({ column, params: eventParams }) => {\n if (column === this.column) {\n this.resetButtonsPanel(eventParams, this.params);\n }\n },\n filterStateChanged: ({ column, state }) => {\n if (column === this.column) {\n this.eButtons?.updateValidity(state.valid !== false);\n }\n },\n filterAction: ({ column, action, event: keyboardEvent }) => {\n if (column === this.column) {\n this.afterAction(action, keyboardEvent);\n }\n },\n ...this.enableGlobalButtonCheck ? {\n filterGlobalButtons: ({ isGlobal }) => {\n if (isGlobal !== this.isGlobalButtons) {\n this.isGlobalButtons = isGlobal;\n const currentParams = this.params;\n this.resetButtonsPanel(currentParams, currentParams, true);\n }\n }\n } : void 0\n });\n }\n afterGuiAttached(params) {\n if (params) {\n this.hidePopup = params.hidePopup;\n }\n }\n resetButtonsPanel(newParams, oldParams, forceUpdate) {\n const { buttons: oldButtons, readOnly: oldReadOnly } = oldParams ?? {};\n const { buttons: newButtons, readOnly, useForm } = newParams;\n if (!forceUpdate && oldReadOnly === readOnly && _jsonEquals(oldButtons, newButtons)) {\n return;\n }\n const hasButtons = newButtons && newButtons.length > 0 && !newParams.readOnly && !this.isGlobalButtons;\n let eButtonsPanel = this.eButtons;\n if (hasButtons) {\n const buttons = newButtons.map((type) => {\n const localeKey = `${type}Filter`;\n return { type, label: translateForFilter(this, localeKey) };\n });\n this.applyActive = _isUseApplyButton(this.params);\n if (!eButtonsPanel) {\n eButtonsPanel = this.createBean(new FilterButtonComp());\n this.appendChild(eButtonsPanel.getGui());\n const column = this.column;\n const getListener = (action) => ({ event }) => {\n this.updateModel(column, action, { fromButtons: true });\n this.afterAction(action, event);\n };\n eButtonsPanel?.addManagedListeners(eButtonsPanel, {\n apply: getListener(\"apply\"),\n clear: getListener(\"clear\"),\n reset: getListener(\"reset\"),\n cancel: getListener(\"cancel\")\n });\n this.eButtons = eButtonsPanel;\n }\n eButtonsPanel.updateButtons(buttons, useForm);\n } else {\n this.applyActive = false;\n if (eButtonsPanel) {\n _removeFromParent(eButtonsPanel.getGui());\n this.eButtons = this.destroyBean(eButtonsPanel);\n }\n }\n }\n close(e) {\n const hidePopup = this.hidePopup;\n if (!hidePopup) {\n return;\n }\n const keyboardEvent = e;\n const key = keyboardEvent?.key;\n let params;\n if (key === KeyCode.ENTER || key === KeyCode.SPACE) {\n params = { keyboardEvent };\n }\n hidePopup(params);\n this.hidePopup = null;\n }\n afterAction(action, event) {\n const { params, applyActive } = this;\n const closeOnApply = params?.closeOnApply;\n switch (action) {\n case \"apply\": {\n event?.preventDefault();\n if (closeOnApply && applyActive) {\n this.close(event);\n }\n break;\n }\n case \"reset\": {\n if (closeOnApply && applyActive) {\n this.close();\n }\n break;\n }\n case \"cancel\": {\n if (closeOnApply) {\n this.close(event);\n }\n break;\n }\n }\n }\n handleKeyDown(event) {\n if (!event.defaultPrevented && event.key === KeyCode.ENTER && this.applyActive) {\n this.updateModel(this.column, \"apply\", { fromButtons: true });\n this.afterAction(\"apply\", event);\n }\n }\n destroy() {\n this.hidePopup = null;\n this.eButtons = this.destroyBean(this.eButtons);\n }\n};\n\n// packages/ag-grid-community/src/filter/legacyFilter.css\nvar legacyFilter_default = \":where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}\";\n\n// packages/ag-grid-community/src/filter/filterComp.ts\nvar FilterElement = { tag: \"div\", cls: \"ag-filter\" };\nvar FilterComp = class extends Component {\n constructor(column, source, enableGlobalButtonCheck) {\n super(FilterElement);\n this.column = column;\n this.source = source;\n this.enableGlobalButtonCheck = enableGlobalButtonCheck;\n this.wrapper = null;\n }\n postConstruct() {\n this.beans.colFilter?.activeFilterComps.add(this);\n this.createFilter(true);\n this.addManagedEventListeners({ filterDestroyed: this.onFilterDestroyed.bind(this) });\n }\n hasFilter() {\n return this.wrapper != null;\n }\n getFilter() {\n return this.wrapper?.then((wrapper) => wrapper.comp) ?? null;\n }\n afterInit() {\n return this.wrapper?.then(() => {\n }) ?? AgPromise.resolve();\n }\n afterGuiAttached(params) {\n this.afterGuiAttachedParams = params;\n this.wrapper?.then((wrapper) => {\n this.comp?.afterGuiAttached(params);\n wrapper?.comp?.afterGuiAttached?.(params);\n });\n }\n afterGuiDetached() {\n this.wrapper?.then((wrapper) => {\n wrapper?.comp?.afterGuiDetached?.();\n });\n }\n createFilter(init) {\n const {\n column,\n source,\n beans: { colFilter }\n } = this;\n const filterPromise = colFilter.getFilterUiForDisplay(column) ?? null;\n this.wrapper = filterPromise;\n filterPromise?.then((wrapper) => {\n if (!wrapper) {\n return;\n }\n const { isHandler, comp } = wrapper;\n let filterGui;\n if (isHandler) {\n const enableGlobalButtonCheck = !!this.enableGlobalButtonCheck;\n const displayComp = this.createBean(\n new FilterWrapperComp(\n column,\n wrapper,\n colFilter,\n colFilter.updateModel.bind(colFilter),\n enableGlobalButtonCheck && colFilter.isGlobalButtons,\n enableGlobalButtonCheck\n )\n );\n this.comp = displayComp;\n filterGui = displayComp.getGui();\n } else {\n this.registerCSS(legacyFilter_default);\n filterGui = comp.getGui();\n if (!_exists(filterGui)) {\n _warn(69, { guiFromFilter: filterGui });\n }\n }\n this.appendChild(filterGui);\n if (init) {\n this.eventSvc.dispatchEvent({\n type: \"filterOpened\",\n column,\n source,\n eGui: this.getGui()\n });\n } else {\n comp.afterGuiAttached?.(this.afterGuiAttachedParams);\n }\n });\n }\n onFilterDestroyed(event) {\n const { source, column } = event;\n if ((source === \"api\" || source === \"paramsUpdated\") && column.getId() === this.column.getId() && this.beans.colModel.getColDefCol(this.column)) {\n _clearElement(this.getGui());\n this.comp = this.destroyBean(this.comp);\n this.createFilter();\n }\n }\n destroy() {\n this.beans.colFilter?.activeFilterComps.delete(this);\n this.eventSvc.dispatchEvent({\n type: \"filterClosed\",\n column: this.column\n });\n this.wrapper = null;\n this.comp = this.destroyBean(this.comp);\n this.afterGuiAttachedParams = void 0;\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/filter/filterMenuFactory.ts\nvar FilterMenuFactory = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"filterMenuFactory\";\n }\n wireBeans(beans) {\n this.popupSvc = beans.popupSvc;\n }\n hideActiveMenu() {\n this.hidePopup?.();\n }\n showMenuAfterMouseEvent(column, mouseEvent, containerType, onClosedCallback) {\n if (column && !column.isColumn) {\n return;\n }\n this.showPopup(\n column,\n (eMenu) => {\n this.popupSvc?.positionPopupUnderMouseEvent({\n additionalParams: { column },\n type: containerType,\n mouseEvent,\n ePopup: eMenu\n });\n },\n containerType,\n mouseEvent.target,\n _isLegacyMenuEnabled(this.gos),\n onClosedCallback\n );\n }\n showMenuAfterButtonClick(column, eventSource, containerType, onClosedCallback) {\n if (column && !column.isColumn) {\n return;\n }\n let multiplier = -1;\n let alignSide = \"left\";\n const isLegacyMenuEnabled = _isLegacyMenuEnabled(this.gos);\n if (!isLegacyMenuEnabled && this.gos.get(\"enableRtl\")) {\n multiplier = 1;\n alignSide = \"right\";\n }\n const nudgeX = isLegacyMenuEnabled ? void 0 : 4 * multiplier;\n const nudgeY = isLegacyMenuEnabled ? void 0 : 4;\n this.showPopup(\n column,\n (eMenu) => {\n this.popupSvc?.positionPopupByComponent({\n type: containerType,\n eventSource,\n ePopup: eMenu,\n nudgeX,\n nudgeY,\n alignSide,\n keepWithinBounds: true,\n position: \"under\",\n additionalParams: { column }\n });\n },\n containerType,\n eventSource,\n isLegacyMenuEnabled,\n onClosedCallback\n );\n }\n showPopup(column, positionCallback, containerType, eventSource, isLegacyMenuEnabled, onClosedCallback) {\n const comp = column ? this.createBean(new FilterComp(column, \"COLUMN_MENU\")) : void 0;\n this.activeMenu = comp;\n if (!comp?.hasFilter() || !column) {\n _error(57);\n return;\n }\n const eMenu = _createElement({\n tag: \"div\",\n cls: `ag-menu${!isLegacyMenuEnabled ? \" ag-filter-menu\" : \"\"}`,\n role: \"presentation\"\n });\n [this.tabListener] = this.addManagedElementListeners(eMenu, {\n keydown: (e) => this.trapFocusWithin(e, eMenu)\n });\n eMenu.appendChild(comp?.getGui());\n let hidePopup;\n const afterGuiDetached = () => comp?.afterGuiDetached();\n const anchorToElement = _isColumnMenuAnchoringEnabled(this.gos) ? eventSource ?? this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody : void 0;\n const closedCallback = (e) => {\n _setColMenuVisible(column, false, \"contextMenu\");\n const isKeyboardEvent = e instanceof KeyboardEvent;\n if (this.tabListener) {\n this.tabListener = this.tabListener();\n }\n if (isKeyboardEvent && eventSource && _isVisible(eventSource)) {\n const focusableEl = _findTabbableParent(eventSource);\n focusableEl?.focus({ preventScroll: true });\n }\n afterGuiDetached();\n this.destroyBean(this.activeMenu);\n this.dispatchVisibleChangedEvent(false, containerType, column);\n onClosedCallback?.();\n };\n const translate = this.getLocaleTextFunc();\n const ariaLabel = isLegacyMenuEnabled && containerType !== \"columnFilter\" ? translate(\"ariaLabelColumnMenu\", \"Column Menu\") : translate(\"ariaLabelColumnFilter\", \"Column Filter\");\n const addPopupRes = this.popupSvc?.addPopup({\n modal: true,\n eChild: eMenu,\n closeOnEsc: true,\n closedCallback,\n positionCallback: () => positionCallback(eMenu),\n anchorToElement,\n ariaLabel\n });\n if (addPopupRes) {\n this.hidePopup = hidePopup = addPopupRes.hideFunc;\n }\n comp.afterInit().then(() => {\n positionCallback(eMenu);\n comp.afterGuiAttached({ container: containerType, hidePopup });\n });\n _setColMenuVisible(column, true, \"contextMenu\");\n this.dispatchVisibleChangedEvent(true, containerType, column);\n }\n trapFocusWithin(e, menu) {\n if (e.key !== KeyCode.TAB || e.defaultPrevented || _findNextFocusableElement(this.beans, menu, false, e.shiftKey)) {\n return;\n }\n e.preventDefault();\n _focusInto(menu, e.shiftKey);\n }\n dispatchVisibleChangedEvent(visible, containerType, column) {\n this.eventSvc.dispatchEvent({\n type: \"columnMenuVisibleChanged\",\n visible,\n switchingTab: false,\n key: containerType,\n column: column ?? null,\n columnGroup: null\n });\n }\n isMenuEnabled(column) {\n return column.isFilterAllowed() && (column.getColDef().menuTabs ?? [\"filterMenuTab\"]).includes(\"filterMenuTab\");\n }\n showMenuAfterContextMenuEvent() {\n }\n destroy() {\n this.destroyBean(this.activeMenu);\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/filter/filterValueService.ts\nvar FilterValueService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"filterValueSvc\";\n }\n getValue(column, rowNode, filterValueGetterOverride) {\n if (!rowNode) {\n return;\n }\n const colDef = column.getColDef();\n const { selectableFilter, valueSvc, formula } = this.beans;\n const filterValueGetter = filterValueGetterOverride ?? selectableFilter?.getFilterValueGetter(column.getColId()) ?? colDef.filterValueGetter;\n if (filterValueGetter) {\n return this.executeFilterValueGetter(filterValueGetter, rowNode.data, column, rowNode, colDef);\n }\n const value = valueSvc.getValue(column, rowNode, \"data\");\n if (column.isAllowFormula() && formula?.isFormula(value)) {\n return formula.resolveValue(column, rowNode);\n }\n return value;\n }\n executeFilterValueGetter(valueGetter, data, column, node, colDef) {\n const { expressionSvc, valueSvc } = this.beans;\n const params = _addGridCommonParams(this.gos, {\n data,\n node,\n column,\n colDef,\n getValue: valueSvc.getValueCallback.bind(valueSvc, node)\n });\n if (typeof valueGetter === \"function\") {\n return valueGetter(params);\n }\n return expressionSvc?.evaluate(valueGetter, params);\n }\n};\n\n// packages/ag-grid-community/src/filter/floating/provided/readOnlyFloatingFilter.ts\nvar ReadOnlyFloatingFilterElement = {\n tag: \"div\",\n cls: \"ag-floating-filter-input\",\n role: \"presentation\",\n children: [\n {\n tag: \"ag-input-text-field\",\n ref: \"eFloatingFilterText\"\n }\n ]\n};\nvar ReadOnlyFloatingFilter = class extends Component {\n constructor() {\n super(ReadOnlyFloatingFilterElement, [AgInputTextFieldSelector]);\n this.eFloatingFilterText = RefPlaceholder;\n }\n init(params) {\n this.params = params;\n const displayName = this.beans.colNames.getDisplayNameForColumn(params.column, \"header\", true);\n this.eFloatingFilterText.setDisabled(true).setInputAriaLabel(`${displayName} ${this.getLocaleTextFunc()(\"ariaFilterInput\", \"Filter Input\")}`);\n if (this.gos.get(\"enableFilterHandlers\")) {\n const reactiveParams = params;\n const handler = reactiveParams.getHandler();\n if (handler.getModelAsString) {\n const modelAsString = handler.getModelAsString(reactiveParams.model);\n this.eFloatingFilterText.setValue(modelAsString);\n }\n }\n }\n onParentModelChanged(parentModel) {\n if (parentModel == null) {\n this.eFloatingFilterText.setValue(\"\");\n return;\n }\n this.params.parentFilterInstance((filterInstance) => {\n if (filterInstance.getModelAsString) {\n const modelAsString = filterInstance.getModelAsString(parentModel);\n this.eFloatingFilterText.setValue(modelAsString);\n }\n });\n }\n refresh(params) {\n this.init(params);\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agRadioButton.ts\nvar AgRadioButton = class extends AgCheckbox {\n constructor(config) {\n super(config, \"ag-radio-button\", \"radio\");\n }\n isSelected() {\n return this.eInput.checked;\n }\n toggle() {\n if (this.eInput.disabled) {\n return;\n }\n if (!this.isSelected()) {\n this.setValue(true);\n }\n }\n addInputListeners() {\n super.addInputListeners();\n this.addManagedEventListeners({ checkboxChanged: this.onChange.bind(this) });\n }\n /**\n * This ensures that if another radio button in the same named group is selected, we deselect this radio button.\n * By default the browser does this for you, but we are managing classes ourselves in order to ensure input\n * elements are styled correctly in IE11, and the DOM 'changed' event is only fired when a button is selected,\n * not deselected, so we need to use our own event.\n */\n onChange(event) {\n const eInput = this.eInput;\n if (event.selected && event.name && eInput.name && eInput.name === event.name && event.id && eInput.id !== event.id) {\n this.setValue(false, true);\n }\n }\n};\nvar AgRadioButtonSelector = {\n selector: \"AG-RADIO-BUTTON\",\n component: AgRadioButton\n};\n\n// packages/ag-grid-community/src/filter/provided/optionsFactory.ts\nvar OptionsFactory = class {\n constructor() {\n this.customFilterOptions = {};\n }\n init(params, defaultOptions) {\n this.filterOptions = params.filterOptions ?? defaultOptions;\n this.mapCustomOptions();\n this.defaultOption = this.getDefaultItem(params.defaultOption);\n }\n refresh(params, defaultOptions) {\n const filterOptions = params.filterOptions ?? defaultOptions;\n if (this.filterOptions !== filterOptions) {\n this.filterOptions = filterOptions;\n this.customFilterOptions = {};\n this.mapCustomOptions();\n }\n this.defaultOption = this.getDefaultItem(params.defaultOption);\n }\n mapCustomOptions() {\n const { filterOptions } = this;\n if (!filterOptions) {\n return;\n }\n for (const filterOption of filterOptions) {\n if (typeof filterOption === \"string\") {\n continue;\n }\n const requiredProperties = [[\"displayKey\"], [\"displayName\"], [\"predicate\", \"test\"]];\n const propertyCheck = (keys) => {\n if (!keys.some((key) => filterOption[key] != null)) {\n _warn(72, { keys });\n return false;\n }\n return true;\n };\n if (!requiredProperties.every(propertyCheck)) {\n this.filterOptions = filterOptions.filter((v) => v === filterOption) || [];\n continue;\n }\n this.customFilterOptions[filterOption.displayKey] = filterOption;\n }\n }\n getDefaultItem(defaultOption) {\n const { filterOptions } = this;\n if (defaultOption) {\n return defaultOption;\n } else if (filterOptions.length >= 1) {\n const firstFilterOption = filterOptions[0];\n if (typeof firstFilterOption === \"string\") {\n return firstFilterOption;\n } else if (firstFilterOption.displayKey) {\n return firstFilterOption.displayKey;\n } else {\n _warn(73);\n }\n } else {\n _warn(74);\n }\n return void 0;\n }\n getCustomOption(name) {\n return this.customFilterOptions[name];\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/simpleFilterUtils.ts\nfunction removeItems(items, startPosition, deleteCount) {\n return deleteCount == null ? items.splice(startPosition) : items.splice(startPosition, deleteCount);\n}\nfunction isBlank(cellValue) {\n return cellValue == null || typeof cellValue === \"string\" && cellValue.trim().length === 0;\n}\nfunction getDefaultJoinOperator(defaultJoinOperator) {\n return defaultJoinOperator === \"AND\" || defaultJoinOperator === \"OR\" ? defaultJoinOperator : \"AND\";\n}\nfunction evaluateCustomFilter(customFilterOption, values, cellValue) {\n if (customFilterOption == null) {\n return;\n }\n const { predicate } = customFilterOption;\n if (predicate != null && !values.some((v) => v == null)) {\n return predicate(values, cellValue);\n }\n}\nfunction validateAndUpdateConditions(conditions, maxNumConditions) {\n let numConditions = conditions.length;\n if (numConditions > maxNumConditions) {\n conditions.splice(maxNumConditions);\n _warn(78);\n numConditions = maxNumConditions;\n }\n return numConditions;\n}\nvar zeroInputTypes = /* @__PURE__ */ new Set([\n \"empty\",\n \"notBlank\",\n \"blank\",\n \"today\",\n \"yesterday\",\n \"tomorrow\",\n \"thisWeek\",\n \"lastWeek\",\n \"nextWeek\",\n \"thisMonth\",\n \"lastMonth\",\n \"nextMonth\",\n \"thisQuarter\",\n \"lastQuarter\",\n \"nextQuarter\",\n \"thisYear\",\n \"lastYear\",\n \"nextYear\",\n \"yearToDate\",\n \"last7Days\",\n \"last30Days\",\n \"last90Days\",\n \"last6Months\",\n \"last12Months\",\n \"last24Months\"\n]);\nfunction getNumberOfInputs(type, optionsFactory) {\n const customOpts = optionsFactory.getCustomOption(type);\n if (customOpts) {\n const { numberOfInputs } = customOpts;\n return numberOfInputs != null ? numberOfInputs : 1;\n }\n if (type && zeroInputTypes.has(type)) {\n return 0;\n } else if (type === \"inRange\") {\n return 2;\n }\n return 1;\n}\n\n// packages/ag-grid-community/src/filter/provided/simpleFilter.ts\nvar SimpleFilter = class extends ProvidedFilter {\n constructor(filterNameKey, mapValuesFromModel, defaultOptions) {\n super(filterNameKey, \"simple-filter\");\n this.mapValuesFromModel = mapValuesFromModel;\n this.defaultOptions = defaultOptions;\n this.eTypes = [];\n this.eJoinPanels = [];\n this.eJoinAnds = [];\n this.eJoinOrs = [];\n this.eConditionBodies = [];\n this.listener = () => this.onUiChanged();\n this.lastUiCompletePosition = null;\n this.joinOperatorId = 0;\n }\n setParams(params) {\n super.setParams(params);\n const optionsFactory = new OptionsFactory();\n this.optionsFactory = optionsFactory;\n optionsFactory.init(params, this.defaultOptions);\n this.commonUpdateSimpleParams(params);\n this.createOption();\n this.createMissingConditionsAndOperators();\n }\n updateParams(newParams, oldParams) {\n this.optionsFactory.refresh(newParams, this.defaultOptions);\n super.updateParams(newParams, oldParams);\n this.commonUpdateSimpleParams(newParams);\n }\n commonUpdateSimpleParams(params) {\n this.setNumConditions(params);\n this.defaultJoinOperator = getDefaultJoinOperator(params.defaultJoinOperator);\n this.filterPlaceholder = params.filterPlaceholder;\n this.createFilterListOptions();\n _addOrRemoveAttribute(this.getGui(), \"tabindex\", this.isReadOnly() ? \"-1\" : null);\n }\n // floating filter calls this when user applies filter from floating filter\n onFloatingFilterChanged(type, value) {\n this.setTypeFromFloatingFilter(type);\n this.setValueFromFloatingFilter(value);\n this.onUiChanged(\"immediately\", true);\n }\n setTypeFromFloatingFilter(type) {\n this.eTypes.forEach((eType, position) => {\n const value = position === 0 ? type : this.optionsFactory.defaultOption;\n eType.setValue(value, true);\n });\n }\n getModelFromUi() {\n const conditions = this.getUiCompleteConditions();\n if (conditions.length === 0) {\n return null;\n }\n if (this.maxNumConditions > 1 && conditions.length > 1) {\n return {\n filterType: this.filterType,\n operator: this.getJoinOperator(),\n conditions\n };\n }\n return conditions[0];\n }\n getConditionTypes() {\n return this.eTypes.map((eType) => eType.getValue());\n }\n getConditionType(position) {\n return this.eTypes[position].getValue();\n }\n getJoinOperator() {\n const { eJoinOrs: eJoinOperatorsOr, defaultJoinOperator } = this;\n return eJoinOperatorsOr.length === 0 ? defaultJoinOperator : eJoinOperatorsOr[0].getValue() === true ? \"OR\" : \"AND\";\n }\n areNonNullModelsEqual(a, b) {\n const aIsSimple = !a.operator;\n const bIsSimple = !b.operator;\n const oneSimpleOneCombined = !aIsSimple && bIsSimple || aIsSimple && !bIsSimple;\n if (oneSimpleOneCombined) {\n return false;\n }\n let res;\n if (aIsSimple) {\n const aSimple = a;\n const bSimple = b;\n res = this.areSimpleModelsEqual(aSimple, bSimple);\n } else {\n const aCombined = a;\n const bCombined = b;\n res = aCombined.operator === bCombined.operator && _areEqual(\n aCombined.conditions,\n bCombined.conditions,\n (aModel, bModel) => this.areSimpleModelsEqual(aModel, bModel)\n );\n }\n return res;\n }\n setModelIntoUi(model, isInitialLoad) {\n if (model == null) {\n this.resetUiToDefaults(isInitialLoad);\n return AgPromise.resolve();\n }\n const isCombined = model.operator;\n if (isCombined) {\n const combinedModel = model;\n let conditions = combinedModel.conditions;\n if (conditions == null) {\n conditions = [];\n _warn(77);\n }\n const numConditions = validateAndUpdateConditions(conditions, this.maxNumConditions);\n const numPrevConditions = this.getNumConditions();\n if (numConditions < numPrevConditions) {\n this.removeConditionsAndOperators(numConditions);\n } else if (numConditions > numPrevConditions) {\n for (let i = numPrevConditions; i < numConditions; i++) {\n this.createJoinOperatorPanel();\n this.createOption();\n }\n }\n const orChecked = combinedModel.operator === \"OR\";\n this.eJoinAnds.forEach((eJoinOperatorAnd) => eJoinOperatorAnd.setValue(!orChecked, true));\n this.eJoinOrs.forEach((eJoinOperatorOr) => eJoinOperatorOr.setValue(orChecked, true));\n conditions.forEach((condition, position) => {\n this.eTypes[position].setValue(condition.type, true);\n this.setConditionIntoUi(condition, position);\n });\n } else {\n const simpleModel = model;\n if (this.getNumConditions() > 1) {\n this.removeConditionsAndOperators(1);\n }\n this.eTypes[0].setValue(simpleModel.type, true);\n this.setConditionIntoUi(simpleModel, 0);\n }\n this.lastUiCompletePosition = this.getNumConditions() - 1;\n this.createMissingConditionsAndOperators();\n this.updateUiVisibility();\n if (!isInitialLoad) {\n this.params.onUiChange(this.getUiChangeEventParams());\n }\n return AgPromise.resolve();\n }\n setNumConditions(params) {\n let maxNumConditions = params.maxNumConditions ?? 2;\n if (maxNumConditions < 1) {\n _warn(79);\n maxNumConditions = 1;\n }\n this.maxNumConditions = maxNumConditions;\n let numAlwaysVisibleConditions = params.numAlwaysVisibleConditions ?? 1;\n if (numAlwaysVisibleConditions < 1) {\n _warn(80);\n numAlwaysVisibleConditions = 1;\n }\n if (numAlwaysVisibleConditions > maxNumConditions) {\n _warn(81);\n numAlwaysVisibleConditions = maxNumConditions;\n }\n this.numAlwaysVisibleConditions = numAlwaysVisibleConditions;\n }\n createOption() {\n const eGui = this.getGui();\n const eType = this.createManagedBean(new AgSelect());\n this.eTypes.push(eType);\n eType.addCss(\"ag-filter-select\");\n eGui.appendChild(eType.getGui());\n const eConditionBody = this.createEValue();\n this.eConditionBodies.push(eConditionBody);\n eGui.appendChild(eConditionBody);\n this.putOptionsIntoDropdown(eType);\n this.resetType(eType);\n const position = this.getNumConditions() - 1;\n this.forEachPositionInput(position, (element) => this.resetInput(element));\n this.addChangedListeners(eType, position);\n }\n createJoinOperatorPanel() {\n const eJoinOperatorPanel = _createElement({ tag: \"div\", cls: \"ag-filter-condition\" });\n this.eJoinPanels.push(eJoinOperatorPanel);\n const eJoinOperatorAnd = this.createJoinOperator(this.eJoinAnds, eJoinOperatorPanel, \"and\");\n const eJoinOperatorOr = this.createJoinOperator(this.eJoinOrs, eJoinOperatorPanel, \"or\");\n this.getGui().appendChild(eJoinOperatorPanel);\n const index = this.eJoinPanels.length - 1;\n const uniqueGroupId = this.joinOperatorId++;\n this.resetJoinOperatorAnd(eJoinOperatorAnd, index, uniqueGroupId);\n this.resetJoinOperatorOr(eJoinOperatorOr, index, uniqueGroupId);\n if (!this.isReadOnly()) {\n eJoinOperatorAnd.onValueChange(this.listener);\n eJoinOperatorOr.onValueChange(this.listener);\n }\n }\n createJoinOperator(eJoinOperators, eJoinOperatorPanel, andOr) {\n const eJoinOperator = this.createManagedBean(new AgRadioButton());\n eJoinOperators.push(eJoinOperator);\n const baseClass = \"ag-filter-condition-operator\";\n eJoinOperator.addCss(baseClass);\n eJoinOperator.addCss(`${baseClass}-${andOr}`);\n eJoinOperatorPanel.appendChild(eJoinOperator.getGui());\n return eJoinOperator;\n }\n createFilterListOptions() {\n this.filterListOptions = this.optionsFactory.filterOptions.map(\n (option) => typeof option === \"string\" ? this.createBoilerplateListOption(option) : this.createCustomListOption(option)\n );\n }\n putOptionsIntoDropdown(eType) {\n const { filterListOptions } = this;\n for (const listOption of filterListOptions) {\n eType.addOption(listOption);\n }\n eType.setDisabled(filterListOptions.length <= 1);\n }\n createBoilerplateListOption(option) {\n return { value: option, text: this.translate(option) };\n }\n createCustomListOption(option) {\n const { displayKey } = option;\n const customOption = this.optionsFactory.getCustomOption(option.displayKey);\n return {\n value: displayKey,\n text: customOption ? this.getLocaleTextFunc()(customOption.displayKey, customOption.displayName) : this.translate(displayKey)\n };\n }\n createBodyTemplate() {\n return null;\n }\n getAgComponents() {\n return [];\n }\n updateUiVisibility() {\n const joinOperator = this.getJoinOperator();\n this.updateNumConditions();\n this.updateConditionStatusesAndValues(this.lastUiCompletePosition, joinOperator);\n }\n updateNumConditions() {\n let lastUiCompletePosition = -1;\n let areAllConditionsUiComplete = true;\n for (let position = 0; position < this.getNumConditions(); position++) {\n if (this.isConditionUiComplete(position)) {\n lastUiCompletePosition = position;\n } else {\n areAllConditionsUiComplete = false;\n }\n }\n if (this.shouldAddNewConditionAtEnd(areAllConditionsUiComplete)) {\n this.createJoinOperatorPanel();\n this.createOption();\n } else {\n const activePosition = this.lastUiCompletePosition ?? this.getNumConditions() - 2;\n if (lastUiCompletePosition < activePosition) {\n this.removeConditionsAndOperators(activePosition + 1);\n const removeStartPosition = lastUiCompletePosition + 1;\n const numConditionsToRemove = activePosition - removeStartPosition;\n if (numConditionsToRemove > 0) {\n this.removeConditionsAndOperators(removeStartPosition, numConditionsToRemove);\n }\n this.createMissingConditionsAndOperators();\n }\n }\n this.lastUiCompletePosition = lastUiCompletePosition;\n }\n updateConditionStatusesAndValues(lastUiCompletePosition, joinOperator) {\n this.eTypes.forEach((eType, position) => {\n const disabled = this.isConditionDisabled(position, lastUiCompletePosition);\n eType.setDisabled(disabled || this.filterListOptions.length <= 1);\n if (position === 1) {\n _setDisabled(this.eJoinPanels[0], disabled);\n this.eJoinAnds[0].setDisabled(disabled);\n this.eJoinOrs[0].setDisabled(disabled);\n }\n });\n this.eConditionBodies.forEach((element, index) => {\n _setDisplayed(element, this.isConditionBodyVisible(index));\n });\n const orChecked = (joinOperator ?? this.getJoinOperator()) === \"OR\";\n for (const eJoinOperatorAnd of this.eJoinAnds) {\n eJoinOperatorAnd.setValue(!orChecked, true);\n }\n for (const eJoinOperatorOr of this.eJoinOrs) {\n eJoinOperatorOr.setValue(orChecked, true);\n }\n this.forEachInput((element, index, position, numberOfInputs) => {\n this.setElementDisplayed(element, index < numberOfInputs);\n this.setElementDisabled(element, this.isConditionDisabled(position, lastUiCompletePosition));\n });\n this.resetPlaceholder();\n }\n shouldAddNewConditionAtEnd(areAllConditionsUiComplete) {\n return areAllConditionsUiComplete && this.getNumConditions() < this.maxNumConditions && !this.isReadOnly();\n }\n removeConditionsAndOperators(startPosition, deleteCount) {\n if (startPosition >= this.getNumConditions()) {\n return;\n }\n const {\n eTypes,\n eConditionBodies,\n eJoinPanels: eJoinOperatorPanels,\n eJoinAnds: eJoinOperatorsAnd,\n eJoinOrs: eJoinOperatorsOr\n } = this;\n this.removeComponents(eTypes, startPosition, deleteCount);\n this.removeElements(eConditionBodies, startPosition, deleteCount);\n this.removeEValues(startPosition, deleteCount);\n const joinOperatorIndex = Math.max(startPosition - 1, 0);\n this.removeElements(eJoinOperatorPanels, joinOperatorIndex, deleteCount);\n this.removeComponents(eJoinOperatorsAnd, joinOperatorIndex, deleteCount);\n this.removeComponents(eJoinOperatorsOr, joinOperatorIndex, deleteCount);\n }\n removeElements(elements, startPosition, deleteCount) {\n const removedElements = removeItems(elements, startPosition, deleteCount);\n for (const element of removedElements) {\n _removeFromParent(element);\n }\n }\n removeComponents(components, startPosition, deleteCount) {\n const removedComponents = removeItems(components, startPosition, deleteCount);\n for (const comp of removedComponents) {\n _removeFromParent(comp.getGui());\n this.destroyBean(comp);\n }\n }\n afterGuiAttached(params) {\n super.afterGuiAttached(params);\n this.resetPlaceholder();\n if (!params?.suppressFocus) {\n let elementToFocus;\n if (!this.isReadOnly()) {\n const firstInput = this.getInputs(0)[0];\n if (firstInput instanceof AgAbstractInputField && this.isConditionBodyVisible(0)) {\n elementToFocus = firstInput.getInputElement();\n } else {\n elementToFocus = this.eTypes[0]?.getFocusableElement();\n }\n }\n (elementToFocus ?? this.getGui()).focus({ preventScroll: true });\n }\n }\n shouldKeepInvalidInputState() {\n return false;\n }\n afterGuiDetached() {\n super.afterGuiDetached();\n const params = this.params;\n if (this.beans.colFilter?.shouldKeepStateOnDetach(params.column) || this.shouldKeepInvalidInputState()) {\n return;\n }\n params.onStateChange({\n model: params.model\n });\n let lastUiCompletePosition = -1;\n let updatedLastUiCompletePosition = -1;\n let conditionsRemoved = false;\n const joinOperator = this.getJoinOperator();\n for (let position = this.getNumConditions() - 1; position >= 0; position--) {\n if (this.isConditionUiComplete(position)) {\n if (lastUiCompletePosition === -1) {\n lastUiCompletePosition = position;\n updatedLastUiCompletePosition = position;\n }\n } else {\n const shouldRemovePositionAtEnd = position >= this.numAlwaysVisibleConditions && !this.isConditionUiComplete(position - 1);\n const positionBeforeLastUiCompletePosition = position < lastUiCompletePosition;\n if (shouldRemovePositionAtEnd || positionBeforeLastUiCompletePosition) {\n this.removeConditionsAndOperators(position, 1);\n conditionsRemoved = true;\n if (positionBeforeLastUiCompletePosition) {\n updatedLastUiCompletePosition--;\n }\n }\n }\n }\n let shouldUpdateConditionStatusesAndValues = false;\n if (this.getNumConditions() < this.numAlwaysVisibleConditions) {\n this.createMissingConditionsAndOperators();\n shouldUpdateConditionStatusesAndValues = true;\n }\n if (this.shouldAddNewConditionAtEnd(updatedLastUiCompletePosition === this.getNumConditions() - 1)) {\n this.createJoinOperatorPanel();\n this.createOption();\n shouldUpdateConditionStatusesAndValues = true;\n }\n if (shouldUpdateConditionStatusesAndValues) {\n this.updateConditionStatusesAndValues(updatedLastUiCompletePosition, joinOperator);\n }\n if (conditionsRemoved) {\n this.updateJoinOperatorsDisabled();\n }\n this.lastUiCompletePosition = updatedLastUiCompletePosition;\n }\n getModelAsString(model) {\n return this.params.getHandler()?.getModelAsString?.(model) ?? \"\";\n }\n // allow sub-classes to reset HTML placeholders after UI update.\n resetPlaceholder() {\n const globalTranslate = this.getLocaleTextFunc();\n const { filterPlaceholder, eTypes } = this;\n this.forEachInput((element, index, position, numberOfInputs) => {\n if (!(element instanceof AgAbstractInputField)) {\n return;\n }\n const placeholderKey = index === 0 && numberOfInputs > 1 ? \"inRangeStart\" : index === 0 ? \"filterOoo\" : \"inRangeEnd\";\n const ariaLabel = index === 0 && numberOfInputs > 1 ? globalTranslate(\"ariaFilterFromValue\", \"Filter from value\") : index === 0 ? globalTranslate(\"ariaFilterValue\", \"Filter Value\") : globalTranslate(\"ariaFilterToValue\", \"Filter to Value\");\n const filterOptionKey = eTypes[position].getValue();\n const placeholderText = getPlaceholderText(this, filterPlaceholder, placeholderKey, filterOptionKey);\n element.setInputPlaceholder(placeholderText);\n element.setInputAriaLabel(ariaLabel);\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setElementValue(element, value, fromFloatingFilter) {\n if (element instanceof AgAbstractInputField) {\n element.setValue(value != null ? String(value) : null, true);\n }\n }\n setElementDisplayed(element, displayed) {\n if (_isComponent(element)) {\n _setDisplayed(element.getGui(), displayed);\n }\n }\n setElementDisabled(element, disabled) {\n if (_isComponent(element)) {\n _setDisabled(element.getGui(), disabled);\n }\n }\n attachElementOnChange(element, listener) {\n if (element instanceof AgAbstractInputField) {\n element.onValueChange(listener);\n }\n }\n forEachInput(cb) {\n this.getConditionTypes().forEach((type, position) => {\n this.forEachPositionTypeInput(position, type, cb);\n });\n }\n forEachPositionInput(position, cb) {\n const type = this.getConditionType(position);\n this.forEachPositionTypeInput(position, type, cb);\n }\n forEachPositionTypeInput(position, type, cb) {\n const numberOfInputs = getNumberOfInputs(type, this.optionsFactory);\n const inputs = this.getInputs(position);\n for (let index = 0; index < inputs.length; index++) {\n const input = inputs[index];\n if (input != null) {\n cb(input, index, position, numberOfInputs);\n }\n }\n }\n isConditionDisabled(position, lastUiCompletePosition) {\n if (this.isReadOnly()) {\n return true;\n }\n if (position === 0) {\n return false;\n }\n return position > lastUiCompletePosition + 1;\n }\n isConditionBodyVisible(position) {\n const type = this.getConditionType(position);\n const numberOfInputs = getNumberOfInputs(type, this.optionsFactory);\n return numberOfInputs > 0;\n }\n // returns true if the UI represents a working filter, eg all parts are filled out.\n // eg if text filter and textfield blank then returns false.\n isConditionUiComplete(position) {\n if (position >= this.getNumConditions()) {\n return false;\n }\n const type = this.getConditionType(position);\n if (type === \"empty\") {\n return false;\n }\n if (this.getValues(position).some((v) => v == null)) {\n return false;\n }\n if (this.positionHasInvalidInputs(position)) {\n return false;\n }\n return true;\n }\n getNumConditions() {\n return this.eTypes.length;\n }\n getUiCompleteConditions() {\n const conditions = [];\n for (let position = 0; position < this.getNumConditions(); position++) {\n if (this.isConditionUiComplete(position)) {\n conditions.push(this.createCondition(position));\n }\n }\n return conditions;\n }\n createMissingConditionsAndOperators() {\n if (this.isReadOnly()) {\n return;\n }\n for (let i = this.getNumConditions(); i < this.numAlwaysVisibleConditions; i++) {\n this.createJoinOperatorPanel();\n this.createOption();\n }\n }\n resetUiToDefaults(silent) {\n this.removeConditionsAndOperators(this.isReadOnly() ? 1 : this.numAlwaysVisibleConditions);\n this.eTypes.forEach((eType) => this.resetType(eType));\n this.eJoinAnds.forEach(\n (eJoinOperatorAnd, index) => this.resetJoinOperatorAnd(eJoinOperatorAnd, index, this.joinOperatorId + index)\n );\n this.eJoinOrs.forEach(\n (eJoinOperatorOr, index) => this.resetJoinOperatorOr(eJoinOperatorOr, index, this.joinOperatorId + index)\n );\n this.joinOperatorId++;\n this.forEachInput((element) => this.resetInput(element));\n this.resetPlaceholder();\n this.createMissingConditionsAndOperators();\n this.lastUiCompletePosition = null;\n this.updateUiVisibility();\n if (!silent) {\n this.params.onUiChange(this.getUiChangeEventParams());\n }\n }\n resetType(eType) {\n const translate = this.getLocaleTextFunc();\n const filteringLabel = translate(\"ariaFilteringOperator\", \"Filtering operator\");\n eType.setValue(this.optionsFactory.defaultOption, true).setAriaLabel(filteringLabel).setDisabled(this.isReadOnly() || this.filterListOptions.length <= 1);\n }\n resetJoinOperatorAnd(eJoinOperatorAnd, index, uniqueGroupId) {\n this.resetJoinOperator(\n eJoinOperatorAnd,\n index,\n this.defaultJoinOperator === \"AND\",\n this.translate(\"andCondition\"),\n uniqueGroupId\n );\n }\n resetJoinOperatorOr(eJoinOperatorOr, index, uniqueGroupId) {\n this.resetJoinOperator(\n eJoinOperatorOr,\n index,\n this.defaultJoinOperator === \"OR\",\n this.translate(\"orCondition\"),\n uniqueGroupId\n );\n }\n resetJoinOperator(eJoinOperator, index, value, label, uniqueGroupId) {\n this.updateJoinOperatorDisabled(\n eJoinOperator.setValue(value, true).setName(`ag-simple-filter-and-or-${this.getCompId()}-${uniqueGroupId}`).setLabel(label),\n index\n );\n }\n updateJoinOperatorsDisabled() {\n const updater = (eJoinOperator, index) => this.updateJoinOperatorDisabled(eJoinOperator, index);\n this.eJoinAnds.forEach(updater);\n this.eJoinOrs.forEach(updater);\n }\n updateJoinOperatorDisabled(eJoinOperator, index) {\n eJoinOperator.setDisabled(this.isReadOnly() || index > 0);\n }\n resetInput(element) {\n this.setElementValue(element, null);\n this.setElementDisabled(element, this.isReadOnly());\n }\n // puts model values into the UI\n setConditionIntoUi(model, position) {\n const values = this.mapValuesFromModel(model, this.optionsFactory);\n this.forEachInput((element, index, elPosition) => {\n if (elPosition !== position) {\n return;\n }\n this.setElementValue(element, values[index] != null ? values[index] : null);\n });\n }\n // after floating filter changes, this sets the 'value' section. this is implemented by the base class\n // (as that's where value is controlled), the 'type' part from the floating filter is dealt with in this class.\n setValueFromFloatingFilter(value) {\n this.forEachInput((element, index, position) => {\n this.setElementValue(element, index === 0 && position === 0 ? value : null, true);\n });\n }\n addChangedListeners(eType, position) {\n if (this.isReadOnly()) {\n return;\n }\n eType.onValueChange(this.listener);\n this.forEachPositionInput(position, (element) => {\n this.attachElementOnChange(element, this.listener);\n });\n }\n hasInvalidInputs() {\n return false;\n }\n positionHasInvalidInputs(_position) {\n return false;\n }\n isReadOnly() {\n return !!this.params.readOnly;\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/bigInt/bigIntFilterConstants.ts\nvar DEFAULT_BIGINT_FILTER_OPTIONS = [\n \"equals\",\n \"notEqual\",\n \"greaterThan\",\n \"greaterThanOrEqual\",\n \"lessThan\",\n \"lessThanOrEqual\",\n \"inRange\",\n \"blank\",\n \"notBlank\"\n];\n\n// packages/ag-grid-community/src/filter/provided/bigInt/bigIntFilterUtils.ts\nfunction getAllowedCharPattern(filterParams) {\n return filterParams?.allowedCharPattern ?? null;\n}\nfunction mapValuesFromBigIntFilterModel(filterModel, optionsFactory) {\n const { filter, filterTo, type } = filterModel || {};\n return [_parseBigIntOrNull(filter), _parseBigIntOrNull(filterTo)].slice(0, getNumberOfInputs(type, optionsFactory));\n}\n\n// packages/ag-grid-community/src/filter/provided/bigInt/bigIntFilter.ts\nvar BigIntFilter = class extends SimpleFilter {\n constructor() {\n super(\"bigintFilter\", mapValuesFromBigIntFilterModel, DEFAULT_BIGINT_FILTER_OPTIONS);\n this.eValuesFrom = [];\n this.eValuesTo = [];\n this.filterType = \"bigint\";\n this.defaultDebounceMs = 500;\n }\n afterGuiAttached(params) {\n super.afterGuiAttached(params);\n this.refreshInputValidation();\n }\n shouldKeepInvalidInputState() {\n return !_isBrowserFirefox() && this.hasInvalidInputs() && this.getConditionTypes().includes(\"inRange\");\n }\n refreshInputValidation() {\n for (let i = 0; i < this.eValuesFrom.length; i++) {\n const from = this.eValuesFrom[i];\n const to = this.eValuesTo[i];\n this.refreshInputPairValidation(from, to);\n }\n }\n refreshInputPairValidation(from, to, isFrom = false) {\n const { bigintParser } = this.params;\n const fromValue = this.getParsedValue(from, bigintParser);\n const toValue = this.getParsedValue(to, bigintParser);\n const fromInvalid = this.isInvalidValue(from, fromValue);\n const toInvalid = this.isInvalidValue(to, toValue);\n const target = isFrom ? from : to;\n const other = isFrom ? to : from;\n const targetInvalid = isFrom ? fromInvalid : toInvalid;\n const otherInvalid = isFrom ? toInvalid : fromInvalid;\n let validityMessage = \"\";\n if (targetInvalid) {\n const translate = this.getLocaleTextFunc();\n validityMessage = translate(\"invalidBigInt\", \"Invalid BigInt\");\n } else if (!fromInvalid && !toInvalid) {\n const localeKey = getValidityMessageKey(fromValue, toValue, isFrom);\n if (localeKey) {\n validityMessage = this.translate(localeKey, [String(isFrom ? to.getValue() : from.getValue())]);\n }\n }\n target.setCustomValidity(validityMessage);\n if (!otherInvalid) {\n other.setCustomValidity(\"\");\n }\n if (validityMessage.length > 0) {\n this.beans.ariaAnnounce.announceValue(validityMessage, \"dateFilter\");\n }\n }\n getState() {\n return { isInvalid: this.hasInvalidInputs() };\n }\n areStatesEqual(stateA, stateB) {\n return (stateA?.isInvalid ?? false) === (stateB?.isInvalid ?? false);\n }\n refresh(legacyNewParams) {\n const result = super.refresh(legacyNewParams);\n const { state: newState, additionalEventAttributes } = legacyNewParams;\n const oldState = this.state;\n const fromAction = additionalEventAttributes?.fromAction;\n const forceRefreshValidation = fromAction && fromAction != \"apply\";\n if (forceRefreshValidation || newState.model !== oldState.model || !this.areStatesEqual(newState.state, oldState.state)) {\n this.refreshInputValidation();\n }\n return result;\n }\n setElementValue(element, value, fromFloatingFilter) {\n super.setElementValue(element, value, fromFloatingFilter);\n if (value === null) {\n element.setCustomValidity(\"\");\n }\n }\n createEValue() {\n const { params, eValuesFrom, eValuesTo } = this;\n const allowedCharPattern = getAllowedCharPattern(params);\n const eCondition = _createElement({ tag: \"div\", cls: \"ag-filter-body\", role: \"presentation\" });\n const from = this.createFromToElement(eCondition, eValuesFrom, \"from\", allowedCharPattern);\n const to = this.createFromToElement(eCondition, eValuesTo, \"to\", allowedCharPattern);\n const getFieldChangedListener = (fromEl, toEl, isFrom) => () => this.refreshInputPairValidation(fromEl, toEl, isFrom);\n const fromListener = getFieldChangedListener(from, to, true);\n from.onValueChange(fromListener);\n from.addGuiEventListener(\"focusin\", fromListener);\n const toListener = getFieldChangedListener(from, to, false);\n to.onValueChange(toListener);\n to.addGuiEventListener(\"focusin\", toListener);\n return eCondition;\n }\n createFromToElement(eCondition, eValues, fromTo, allowedCharPattern) {\n const eValue = this.createManagedBean(\n allowedCharPattern ? new AgInputTextField({ allowedCharPattern }) : new AgInputTextField()\n );\n eValue.addCss(`ag-filter-${fromTo}`);\n eValue.addCss(\"ag-filter-filter\");\n eValues.push(eValue);\n eCondition.appendChild(eValue.getGui());\n return eValue;\n }\n removeEValues(startPosition, deleteCount) {\n const removeComps = (eGui) => this.removeComponents(eGui, startPosition, deleteCount);\n removeComps(this.eValuesFrom);\n removeComps(this.eValuesTo);\n }\n getValues(position) {\n const result = [];\n this.forEachPositionInput(position, (element, index, _elPosition, numberOfInputs) => {\n if (index < numberOfInputs) {\n result.push(_parseBigIntOrNull(element.getValue() ?? null));\n }\n });\n return result;\n }\n areSimpleModelsEqual(aSimple, bSimple) {\n return aSimple.filter === bSimple.filter && aSimple.filterTo === bSimple.filterTo && aSimple.type === bSimple.type;\n }\n createCondition(position) {\n const type = this.getConditionType(position);\n const model = {\n filterType: this.filterType,\n type\n };\n const values = this.getValues(position);\n if (values.length > 0) {\n model.filter = String(values[0]);\n }\n if (values.length > 1) {\n model.filterTo = String(values[1]);\n }\n return model;\n }\n removeConditionsAndOperators(startPosition, deleteCount) {\n if (this.hasInvalidInputs()) {\n return;\n }\n return super.removeConditionsAndOperators(startPosition, deleteCount);\n }\n getInputs(position) {\n const { eValuesFrom, eValuesTo } = this;\n if (position >= eValuesFrom.length) {\n return [null, null];\n }\n return [eValuesFrom[position], eValuesTo[position]];\n }\n hasInvalidInputs() {\n let invalidInputs = false;\n this.forEachInput((element) => invalidInputs || (invalidInputs = !element.getInputElement().validity.valid));\n return invalidInputs;\n }\n positionHasInvalidInputs(position) {\n let invalidInputs = false;\n this.forEachPositionInput(position, (element) => invalidInputs || (invalidInputs = !element.getInputElement().validity.valid));\n return invalidInputs;\n }\n canApply(_model) {\n return !this.hasInvalidInputs();\n }\n getParsedValue(element, bigintParser) {\n const rawValue = element.getValue();\n if (rawValue == null || typeof rawValue === \"string\" && rawValue.trim() === \"\") {\n return null;\n }\n return bigintParser ? bigintParser(rawValue) : _parseBigIntOrNull(rawValue);\n }\n isInvalidValue(element, parsedValue) {\n const rawValue = element.getValue();\n return rawValue != null && String(rawValue).trim() !== \"\" && parsedValue === null;\n }\n};\nfunction getValidityMessageKey(fromValue, toValue, isFrom) {\n const isInvalid = fromValue != null && toValue != null && fromValue >= toValue;\n if (!isInvalid) {\n return null;\n }\n return `strict${isFrom ? \"Max\" : \"Min\"}ValueValidation`;\n}\n\n// packages/ag-grid-community/src/filter/provided/simpleFilterHandler.ts\nvar SimpleFilterHandler = class extends BeanStub {\n constructor(mapValuesFromModel, defaultOptions) {\n super();\n this.mapValuesFromModel = mapValuesFromModel;\n this.defaultOptions = defaultOptions;\n }\n init(params) {\n const filterParams = params.filterParams;\n const optionsFactory = new OptionsFactory();\n this.optionsFactory = optionsFactory;\n optionsFactory.init(filterParams, this.defaultOptions);\n this.filterModelFormatter = this.createManagedBean(\n new this.FilterModelFormatterClass(optionsFactory, filterParams)\n );\n this.updateParams(params);\n this.validateModel(params);\n }\n refresh(params) {\n if (params.source === \"colDef\") {\n const filterParams = params.filterParams;\n const optionsFactory = this.optionsFactory;\n optionsFactory.refresh(filterParams, this.defaultOptions);\n this.filterModelFormatter.updateParams({ optionsFactory, filterParams });\n this.updateParams(params);\n }\n this.validateModel(params);\n }\n updateParams(params) {\n this.params = params;\n }\n doesFilterPass(params) {\n const model = params.model;\n if (model == null) {\n return true;\n }\n const { operator } = model;\n const models = [];\n if (operator) {\n const combinedModel = model;\n models.push(...combinedModel.conditions ?? []);\n } else {\n models.push(model);\n }\n const combineFunction = operator && operator === \"OR\" ? \"some\" : \"every\";\n const cellValue = this.params.getValue(params.node);\n return models[combineFunction]((m) => this.individualConditionPasses(params, m, cellValue));\n }\n getModelAsString(model, source) {\n return this.filterModelFormatter.getModelAsString(model, source) ?? \"\";\n }\n validateModel(params) {\n const {\n model,\n filterParams: { filterOptions, maxNumConditions }\n } = params;\n if (model == null) {\n return;\n }\n const isCombined = isCombinedFilterModel(model);\n let conditions = isCombined ? model.conditions : [model];\n const newOptionsList = filterOptions?.map((option) => typeof option === \"string\" ? option : option.displayKey) ?? this.defaultOptions;\n const allConditionsExistInNewOptionsList = !conditions || conditions.every((condition) => newOptionsList.find((option) => option === condition.type) !== void 0);\n if (!allConditionsExistInNewOptionsList) {\n this.params = {\n ...params,\n model: null\n };\n params.onModelChange(null);\n return;\n }\n let needsUpdate = false;\n const filterType = this.filterType;\n if (conditions && !conditions.every((condition) => condition.filterType === filterType) || model.filterType !== filterType) {\n conditions = conditions.map((condition) => ({ ...condition, filterType }));\n needsUpdate = true;\n }\n if (typeof maxNumConditions === \"number\" && conditions && conditions.length > maxNumConditions) {\n conditions = conditions.slice(0, maxNumConditions);\n needsUpdate = true;\n }\n if (needsUpdate) {\n const updatedModel = conditions.length > 1 ? {\n ...model,\n filterType,\n conditions\n } : {\n ...conditions[0],\n filterType\n };\n this.params = {\n ...params,\n model: updatedModel\n };\n params.onModelChange(updatedModel);\n }\n }\n /** returns true if the row passes the said condition */\n individualConditionPasses(params, filterModel, cellValue) {\n const optionsFactory = this.optionsFactory;\n const values = this.mapValuesFromModel(filterModel, optionsFactory);\n const customFilterOption = optionsFactory.getCustomOption(filterModel.type);\n const customFilterResult = evaluateCustomFilter(customFilterOption, values, cellValue);\n if (customFilterResult != null) {\n return customFilterResult;\n }\n if (cellValue == null) {\n return this.evaluateNullValue(filterModel.type);\n }\n return this.evaluateNonNullValue(values, cellValue, filterModel, params);\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/scalarFilterHandler.ts\nvar ScalarFilterHandler = class extends SimpleFilterHandler {\n evaluateNullValue(filterType) {\n const {\n includeBlanksInEquals,\n includeBlanksInNotEqual,\n includeBlanksInGreaterThan,\n includeBlanksInLessThan,\n includeBlanksInRange\n } = this.params.filterParams;\n switch (filterType) {\n case \"equals\":\n if (includeBlanksInEquals) {\n return true;\n }\n break;\n case \"notEqual\":\n if (includeBlanksInNotEqual) {\n return true;\n }\n break;\n case \"greaterThan\":\n case \"greaterThanOrEqual\":\n if (includeBlanksInGreaterThan) {\n return true;\n }\n break;\n case \"lessThan\":\n case \"lessThanOrEqual\":\n if (includeBlanksInLessThan) {\n return true;\n }\n break;\n case \"inRange\":\n if (includeBlanksInRange) {\n return true;\n }\n break;\n case \"blank\":\n return true;\n case \"notBlank\":\n return false;\n }\n return false;\n }\n evaluateNonNullValue(values, cellValue, filterModel) {\n const type = filterModel.type;\n if (!this.isValid(cellValue)) {\n return type === \"notEqual\" || type === \"notBlank\";\n }\n const comparator = this.comparator();\n const compareResult = values[0] != null ? comparator(values[0], cellValue) : 0;\n switch (type) {\n case \"equals\":\n return compareResult === 0;\n case \"notEqual\":\n return compareResult !== 0;\n case \"greaterThan\":\n return compareResult > 0;\n case \"greaterThanOrEqual\":\n return compareResult >= 0;\n case \"lessThan\":\n return compareResult < 0;\n case \"lessThanOrEqual\":\n return compareResult <= 0;\n case \"inRange\": {\n const compareToResult = comparator(values[1], cellValue);\n return this.params.filterParams.inRangeInclusive ? compareResult >= 0 && compareToResult <= 0 : compareResult > 0 && compareToResult < 0;\n }\n case \"blank\":\n return isBlank(cellValue);\n case \"notBlank\":\n return !isBlank(cellValue);\n default:\n _warn(76, { filterModelType: type });\n return true;\n }\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/simpleFilterModelFormatter.ts\nvar SCALAR_FILTER_TYPE_KEYS = {\n equals: \"Equals\",\n notEqual: \"NotEqual\",\n greaterThan: \"GreaterThan\",\n greaterThanOrEqual: \"GreaterThanOrEqual\",\n lessThan: \"LessThan\",\n lessThanOrEqual: \"LessThanOrEqual\",\n inRange: \"InRange\"\n};\nvar TEXT_FILTER_TYPE_KEYS = {\n contains: \"Contains\",\n notContains: \"NotContains\",\n equals: \"TextEquals\",\n notEqual: \"TextNotEqual\",\n startsWith: \"StartsWith\",\n endsWith: \"EndsWith\",\n inRange: \"InRange\"\n};\nvar SimpleFilterModelFormatter = class extends BeanStub {\n constructor(optionsFactory, filterParams, valueFormatter) {\n super();\n this.optionsFactory = optionsFactory;\n this.filterParams = filterParams;\n this.valueFormatter = valueFormatter;\n }\n // used by:\n // 1) NumberFloatingFilter & TextFloatingFilter: Always, for both when editable and read only.\n // 2) DateFloatingFilter: Only when read only (as we show text rather than a date picker when read only)\n getModelAsString(model, source) {\n const translate = this.getLocaleTextFunc();\n const forToolPanel = source === \"filterToolPanel\";\n if (!model) {\n return forToolPanel ? translateForFilter(this, \"filterSummaryInactive\") : null;\n }\n const isCombined = model.operator != null;\n if (isCombined) {\n const combinedModel = model;\n const conditions = combinedModel.conditions ?? [];\n const customOptions = conditions.map((condition) => this.getModelAsString(condition, source));\n const joinOperatorTranslateKey = combinedModel.operator === \"AND\" ? \"andCondition\" : \"orCondition\";\n return customOptions.join(` ${translateForFilter(this, joinOperatorTranslateKey)} `);\n } else if (model.type === \"blank\" || model.type === \"notBlank\") {\n return forToolPanel ? translateForFilter(this, model.type === \"blank\" ? \"filterSummaryBlank\" : \"filterSummaryNotBlank\") : translate(model.type, model.type);\n } else {\n const condition = model;\n const customOption = this.optionsFactory.getCustomOption(condition.type);\n const { displayKey, displayName, numberOfInputs } = customOption || {};\n if (displayKey && displayName && numberOfInputs === 0) {\n return translate(displayKey, displayName);\n }\n return this.conditionToString(\n condition,\n forToolPanel,\n condition.type === \"inRange\" || numberOfInputs === 2,\n displayKey,\n displayName\n );\n }\n }\n updateParams(params) {\n const { optionsFactory, filterParams } = params;\n this.optionsFactory = optionsFactory;\n this.filterParams = filterParams;\n }\n conditionForToolPanel(type, isRange, getFilter, getFilterTo, customDisplayKey, customDisplayName) {\n let typeValue;\n const typeKey = this.getTypeKey(type);\n if (typeKey) {\n typeValue = translateForFilter(this, typeKey);\n }\n if (customDisplayKey && customDisplayName) {\n typeValue = this.getLocaleTextFunc()(customDisplayKey, customDisplayName);\n }\n if (typeValue != null) {\n if (isRange) {\n return `${typeValue} ${translateForFilter(this, \"filterSummaryInRangeValues\", [getFilter(), getFilterTo()])}`;\n } else {\n return `${typeValue} ${getFilter()}`;\n }\n }\n return null;\n }\n getTypeKey(type) {\n const suffix = this.filterTypeKeys[type];\n return suffix ? `filterSummary${suffix}` : null;\n }\n formatValue(value) {\n const valueFormatter = this.valueFormatter;\n return valueFormatter ? valueFormatter(value ?? null) ?? \"\" : String(value);\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/bigInt/bigIntFilterModelFormatter.ts\nvar BigIntFilterModelFormatter = class extends SimpleFilterModelFormatter {\n constructor(optionsFactory, filterParams) {\n super(optionsFactory, filterParams, filterParams.bigintFormatter);\n this.filterTypeKeys = SCALAR_FILTER_TYPE_KEYS;\n }\n conditionToString(condition, forToolPanel, isRange, customDisplayKey, customDisplayName) {\n const { filter, filterTo, type } = condition;\n const format = this.formatValue.bind(this);\n const parsedFrom = _parseBigIntOrNull(filter);\n const parsedTo = _parseBigIntOrNull(filterTo);\n if (forToolPanel) {\n const valueForToolPanel = this.conditionForToolPanel(\n type,\n isRange,\n () => format(parsedFrom),\n () => format(parsedTo),\n customDisplayKey,\n customDisplayName\n );\n if (valueForToolPanel != null) {\n return valueForToolPanel;\n }\n }\n if (isRange) {\n return `${format(parsedFrom)}-${format(parsedTo)}`;\n }\n if (filter != null) {\n return format(parsedFrom);\n }\n return `${type}`;\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/bigInt/bigIntFilterHandler.ts\nvar BigIntFilterHandler = class extends ScalarFilterHandler {\n constructor() {\n super(mapValuesFromBigIntFilterModel, DEFAULT_BIGINT_FILTER_OPTIONS);\n this.filterType = \"bigint\";\n this.FilterModelFormatterClass = BigIntFilterModelFormatter;\n }\n comparator() {\n return (left, right) => {\n if (left === right) {\n return 0;\n }\n return left < right ? 1 : -1;\n };\n }\n isValid(value) {\n return _parseBigIntOrNull(value) !== null;\n }\n};\n\n// packages/ag-grid-community/src/filter/floating/provided/floatingFilterTextInputService.ts\nvar FloatingFilterTextInputService = class extends BeanStub {\n constructor(params) {\n super();\n this.params = params;\n this.eInput = RefPlaceholder;\n this.onValueChanged = () => {\n };\n }\n setupGui(parentElement) {\n this.eInput = this.createManagedBean(new AgInputTextField(this.params?.config));\n const eInput = this.eInput.getGui();\n parentElement.appendChild(eInput);\n const listener = (e) => this.onValueChanged(e);\n this.addManagedListeners(eInput, {\n input: listener,\n keydown: listener\n });\n }\n setEditable(editable) {\n this.eInput.setDisabled(!editable);\n }\n getValue() {\n return this.eInput.getValue();\n }\n setValue(value, silent) {\n this.eInput.setValue(value, silent);\n }\n setValueChangedListener(listener) {\n this.onValueChanged = listener;\n }\n setParams({\n ariaLabel,\n autoComplete,\n placeholder\n }) {\n const { eInput } = this;\n eInput.setInputAriaLabel(ariaLabel);\n if (autoComplete !== void 0) {\n eInput.setAutoComplete(autoComplete);\n }\n eInput.toggleCss(\"ag-floating-filter-search-icon\", !!placeholder);\n eInput.setInputPlaceholder(placeholder);\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/text/textFilterUtils.ts\nfunction trimInputForFilter(value) {\n const trimmedInput = value?.trim();\n return trimmedInput === \"\" ? value : trimmedInput;\n}\nfunction mapValuesFromTextFilterModel(filterModel, optionsFactory) {\n const { filter, filterTo, type } = filterModel || {};\n return [filter || null, filterTo || null].slice(0, getNumberOfInputs(type, optionsFactory));\n}\n\n// packages/ag-grid-community/src/filter/floating/provided/simpleFloatingFilter.ts\nvar SimpleFloatingFilter = class extends Component {\n constructor() {\n super(...arguments);\n this.defaultDebounceMs = 0;\n }\n setLastTypeFromModel(model) {\n if (!model) {\n this.lastType = this.optionsFactory.defaultOption;\n return;\n }\n const isCombined = model.operator;\n let condition;\n if (isCombined) {\n const combinedModel = model;\n condition = combinedModel.conditions[0];\n } else {\n condition = model;\n }\n this.lastType = condition.type;\n }\n canWeEditAfterModelFromParentFilter(model) {\n if (!model) {\n return this.isTypeEditable(this.lastType);\n }\n const isCombined = model.operator;\n if (isCombined) {\n return false;\n }\n const simpleModel = model;\n return this.isTypeEditable(simpleModel.type);\n }\n init(params) {\n this.params = params;\n const reactive = this.gos.get(\"enableFilterHandlers\");\n this.reactive = reactive;\n this.setParams(params);\n if (reactive) {\n const reactiveParams = params;\n this.onModelUpdated(reactiveParams.model);\n }\n }\n setParams(params) {\n const optionsFactory = new OptionsFactory();\n this.optionsFactory = optionsFactory;\n optionsFactory.init(params.filterParams, this.defaultOptions);\n this.filterModelFormatter = this.createManagedBean(\n new this.FilterModelFormatterClass(optionsFactory, params.filterParams)\n );\n this.setSimpleParams(params, false);\n }\n setSimpleParams(params, update = true) {\n const defaultOption = this.optionsFactory.defaultOption;\n if (!update) {\n this.lastType = defaultOption;\n }\n this.readOnly = !!params.filterParams.readOnly;\n const editable = this.isTypeEditable(defaultOption);\n this.setEditable(editable);\n }\n refresh(params) {\n this.params = params;\n const reactiveParams = params;\n const reactive = this.reactive;\n if (!reactive || reactiveParams.source === \"colDef\") {\n this.updateParams(params);\n }\n if (reactive) {\n const { source, model } = reactiveParams;\n if (source === \"dataChanged\" || source === \"ui\") {\n return;\n }\n this.onModelUpdated(model);\n }\n }\n updateParams(params) {\n const optionsFactory = this.optionsFactory;\n optionsFactory.refresh(params.filterParams, this.defaultOptions);\n this.setSimpleParams(params);\n this.filterModelFormatter.updateParams({\n optionsFactory,\n filterParams: params.filterParams\n });\n }\n onParentModelChanged(model, event) {\n if (event?.afterFloatingFilter || event?.afterDataChange) {\n return;\n }\n this.onModelUpdated(model);\n }\n isTypeEditable(type) {\n return !!type && !this.readOnly && getNumberOfInputs(type, this.optionsFactory) === 1;\n }\n getAriaLabel(column) {\n const displayName = this.beans.colNames.getDisplayNameForColumn(column, \"header\", true);\n return `${displayName} ${this.getLocaleTextFunc()(\"ariaFilterInput\", \"Filter Input\")}`;\n }\n};\n\n// packages/ag-grid-community/src/filter/floating/provided/textInputFloatingFilter.ts\nvar TextInputFloatingFilterElement = {\n tag: \"div\",\n ref: \"eFloatingFilterInputContainer\",\n cls: \"ag-floating-filter-input\",\n role: \"presentation\"\n};\nvar TextInputFloatingFilter = class extends SimpleFloatingFilter {\n constructor() {\n super(...arguments);\n this.eFloatingFilterInputContainer = RefPlaceholder;\n this.defaultDebounceMs = 500;\n }\n postConstruct() {\n this.setTemplate(TextInputFloatingFilterElement);\n }\n onModelUpdated(model) {\n this.setLastTypeFromModel(model);\n this.setEditable(this.canWeEditAfterModelFromParentFilter(model));\n this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(model));\n }\n setParams(params) {\n this.setupFloatingFilterInputService(params);\n super.setParams(params);\n this.setTextInputParams(params);\n }\n setupFloatingFilterInputService(params) {\n this.inputSvc = this.createFloatingFilterInputService(params);\n this.inputSvc.setupGui(this.eFloatingFilterInputContainer);\n }\n setTextInputParams(params) {\n const { inputSvc, defaultDebounceMs, readOnly } = this;\n const { filterPlaceholder, column, browserAutoComplete, filterParams } = params;\n const filterOptionKey = this.lastType ?? this.optionsFactory.defaultOption;\n const parentFilterPlaceholder = params.filterParams.filterPlaceholder;\n const placeholder = filterPlaceholder === true ? getPlaceholderText(this, parentFilterPlaceholder, \"filterOoo\", filterOptionKey) : filterPlaceholder || void 0;\n inputSvc.setParams({\n ariaLabel: this.getAriaLabel(column),\n autoComplete: browserAutoComplete ?? false,\n placeholder\n });\n this.applyActive = _isUseApplyButton(filterParams);\n if (!readOnly) {\n const debounceMs = getDebounceMs(filterParams, defaultDebounceMs);\n inputSvc.setValueChangedListener(_debounce(this, this.syncUpWithParentFilter.bind(this), debounceMs));\n }\n }\n updateParams(params) {\n super.updateParams(params);\n this.setTextInputParams(params);\n }\n recreateFloatingFilterInputService(params) {\n const { inputSvc } = this;\n const value = inputSvc.getValue();\n _clearElement(this.eFloatingFilterInputContainer);\n this.destroyBean(inputSvc);\n this.setupFloatingFilterInputService(params);\n inputSvc.setValue(value, true);\n }\n syncUpWithParentFilter(e) {\n const isEnterKey = e.key === KeyCode.ENTER;\n const reactive = this.reactive;\n if (reactive) {\n const reactiveParams = this.params;\n reactiveParams.onUiChange();\n }\n if (this.applyActive && !isEnterKey) {\n return;\n }\n const { inputSvc, params, lastType } = this;\n let value = inputSvc.getValue();\n if (params.filterParams.trimInput) {\n value = trimInputForFilter(value);\n inputSvc.setValue(value, true);\n }\n if (reactive) {\n const reactiveParams = params;\n const model = reactiveParams.model;\n const parsedValue = this.convertValue(value);\n const newModel = parsedValue == null ? null : {\n ...model ?? {\n filterType: this.filterType,\n type: lastType ?? this.optionsFactory.defaultOption\n },\n filter: parsedValue\n };\n reactiveParams.onModelChange(newModel, { afterFloatingFilter: true });\n } else {\n params.parentFilterInstance((filterInstance) => {\n filterInstance?.onFloatingFilterChanged(lastType || null, value || null);\n });\n }\n }\n convertValue(value) {\n return value || null;\n }\n setEditable(editable) {\n this.inputSvc.setEditable(editable);\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/bigInt/bigIntFloatingFilter.ts\nvar BigIntFloatingFilter = class extends TextInputFloatingFilter {\n constructor() {\n super(...arguments);\n this.FilterModelFormatterClass = BigIntFilterModelFormatter;\n this.filterType = \"bigint\";\n this.defaultOptions = DEFAULT_BIGINT_FILTER_OPTIONS;\n }\n updateParams(params) {\n const filterParams = params.filterParams;\n const allowedCharPattern = getAllowedCharPattern(filterParams);\n if (allowedCharPattern !== this.allowedCharPattern) {\n this.recreateFloatingFilterInputService(params);\n }\n this.bigintParser = filterParams?.bigintParser;\n super.updateParams(params);\n }\n createFloatingFilterInputService(params) {\n const filterParams = params.filterParams;\n this.allowedCharPattern = getAllowedCharPattern(filterParams);\n this.bigintParser = filterParams?.bigintParser;\n const config = this.allowedCharPattern ? { allowedCharPattern: this.allowedCharPattern } : void 0;\n return this.createManagedBean(new FloatingFilterTextInputService({ config }));\n }\n convertValue(value) {\n if (value == null || value === \"\") {\n return null;\n }\n if (this.bigintParser) {\n return this.bigintParser(value);\n }\n return _parseBigIntOrNull(value);\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/date/dateCompWrapper.ts\nvar CLASS_INPUT_FIELD = \".ag-input-field-input\";\nvar DateCompWrapper = class {\n constructor(context, userCompFactory, colDef, dateComponentParams, eParent, onReady) {\n this.context = context;\n this.eParent = eParent;\n this.alive = true;\n this.debouncedReport = _debounce({ isAlive: () => this.alive }, reportValidity, 500);\n this.timeoutHandle = null;\n const compDetails = _getDateCompDetails(userCompFactory, colDef, dateComponentParams);\n compDetails?.newAgStackInstance().then((dateComp) => {\n if (!this.alive) {\n context.destroyBean(dateComp);\n return;\n }\n this.dateComp = dateComp;\n if (!dateComp) {\n return;\n }\n eParent.appendChild(dateComp.getGui());\n dateComp?.afterGuiAttached?.();\n const { tempValue, disabled } = this;\n if (tempValue) {\n dateComp.setDate(tempValue);\n }\n if (disabled != null) {\n dateComp.setDisabled?.(disabled);\n }\n onReady?.(this);\n });\n }\n destroy() {\n this.alive = false;\n this.dateComp = this.context.destroyBean(this.dateComp);\n }\n getDate() {\n return this.dateComp ? this.dateComp.getDate() : this.tempValue;\n }\n setDate(value) {\n const dateComp = this.dateComp;\n if (dateComp) {\n dateComp.setDate(value);\n } else {\n this.tempValue = value;\n }\n }\n setDisabled(disabled) {\n const dateComp = this.dateComp;\n if (dateComp) {\n dateComp.setDisabled?.(disabled);\n } else {\n this.disabled = disabled;\n }\n }\n setDisplayed(displayed) {\n _setDisplayed(this.eParent, displayed);\n }\n setInputPlaceholder(placeholder) {\n this.dateComp?.setInputPlaceholder?.(placeholder);\n }\n setInputAriaLabel(label) {\n this.dateComp?.setInputAriaLabel?.(label);\n }\n afterGuiAttached(params) {\n this.dateComp?.afterGuiAttached?.(params);\n }\n updateParams(params) {\n this.dateComp?.refresh?.(params);\n }\n setCustomValidity(message, defer = false) {\n const eInput = this.dateComp?.getGui().querySelector(CLASS_INPUT_FIELD);\n if (eInput && \"setCustomValidity\" in eInput) {\n const isInvalid = message.length > 0;\n eInput.setCustomValidity(message);\n if (isInvalid) {\n if (defer) {\n this.timeoutHandle = this.debouncedReport(eInput);\n } else {\n reportValidity(eInput);\n }\n } else if (this.timeoutHandle) {\n window.clearTimeout(this.timeoutHandle);\n }\n _setAriaInvalid(eInput, isInvalid);\n }\n }\n getValidity() {\n return this.dateComp?.getGui().querySelector(CLASS_INPUT_FIELD)?.validity;\n }\n};\nfunction reportValidity(eInput) {\n eInput.reportValidity();\n}\n\n// packages/ag-grid-community/src/filter/provided/date/dateFilterConstants.ts\nvar DEFAULT_DATE_FILTER_OPTIONS = [\n \"equals\",\n \"notEqual\",\n \"lessThan\",\n \"greaterThan\",\n \"inRange\",\n \"blank\",\n \"notBlank\"\n];\n\n// packages/ag-grid-community/src/filter/provided/date/dateFilterUtils.ts\nfunction mapValuesFromDateFilterModel(filterModel, optionsFactory) {\n const { dateFrom, dateTo, type } = filterModel || {};\n return [\n dateFrom && _parseDateTimeFromString(dateFrom, void 0, true) || null,\n dateTo && _parseDateTimeFromString(dateTo, void 0, true) || null\n ].slice(0, getNumberOfInputs(type, optionsFactory));\n}\n\n// packages/ag-grid-community/src/filter/provided/date/dateFilter.ts\nvar DEFAULT_MIN_YEAR = 1e3;\nvar DEFAULT_MAX_YEAR = Infinity;\nvar DateFilter = class extends SimpleFilter {\n constructor() {\n super(\"dateFilter\", mapValuesFromDateFilterModel, DEFAULT_DATE_FILTER_OPTIONS);\n this.eConditionPanelsFrom = [];\n this.eConditionPanelsTo = [];\n this.dateConditionFromComps = [];\n this.dateConditionToComps = [];\n this.minValidYear = DEFAULT_MIN_YEAR;\n this.maxValidYear = DEFAULT_MAX_YEAR;\n this.minValidDate = null;\n this.maxValidDate = null;\n this.filterType = \"date\";\n }\n afterGuiAttached(params) {\n super.afterGuiAttached(params);\n this.dateConditionFromComps[0].afterGuiAttached(params);\n this.refreshInputValidation();\n }\n shouldKeepInvalidInputState() {\n return !_isBrowserFirefox() && this.hasInvalidInputs() && this.getConditionTypes().includes(\"inRange\");\n }\n commonUpdateSimpleParams(params) {\n super.commonUpdateSimpleParams(params);\n const yearParser = (param, fallback) => {\n const value = params[param];\n if (value != null) {\n if (!isNaN(value)) {\n return value == null ? fallback : Number(value);\n } else {\n _warn(82, { param });\n }\n }\n return fallback;\n };\n const minValidYear = yearParser(\"minValidYear\", DEFAULT_MIN_YEAR);\n const maxValidYear = yearParser(\"maxValidYear\", DEFAULT_MAX_YEAR);\n this.minValidYear = minValidYear;\n this.maxValidYear = maxValidYear;\n if (minValidYear > maxValidYear) {\n _warn(83);\n }\n const { minValidDate, maxValidDate } = params;\n const parsedMinValidDate = minValidDate instanceof Date ? minValidDate : _parseDateTimeFromString(minValidDate);\n this.minValidDate = parsedMinValidDate;\n const parsedMaxValidDate = maxValidDate instanceof Date ? maxValidDate : _parseDateTimeFromString(maxValidDate);\n this.maxValidDate = parsedMaxValidDate;\n if (parsedMinValidDate && parsedMaxValidDate && parsedMinValidDate > parsedMaxValidDate) {\n _warn(84);\n }\n }\n refreshInputValidation() {\n for (let i = 0; i < this.dateConditionFromComps.length; i++) {\n this.refreshInputPairValidation(i, false, true);\n }\n }\n refreshInputPairValidation(position, isFrom = false, forceImmediate = false) {\n const { dateConditionFromComps, dateConditionToComps, beans } = this;\n const from = dateConditionFromComps[position];\n const to = dateConditionToComps[position];\n const numberOfInputs = getNumberOfInputs(this.getConditionType(position), this.optionsFactory);\n const fromDate = from.getDate();\n const toDate = to.getDate();\n const localeKey = numberOfInputs >= 2 ? getRangeValidityMessageKey(fromDate, toDate, isFrom) : null;\n const message = localeKey ? this.translate(localeKey, [String(isFrom ? toDate : fromDate)]) : \"\";\n const shouldDebounceReport = !_isBrowserFirefox() && !forceImmediate;\n (isFrom ? from : to).setCustomValidity(message, shouldDebounceReport);\n (isFrom ? to : from).setCustomValidity(\"\", shouldDebounceReport);\n if (message.length > 0) {\n beans.ariaAnnounce.announceValue(message, \"dateFilter\");\n }\n }\n createDateCompWrapper(element, position, fromTo) {\n const {\n beans: { userCompFactory, context, gos },\n params\n } = this;\n const isFrom = fromTo === \"from\";\n const dateCompWrapper = new DateCompWrapper(\n context,\n userCompFactory,\n params.colDef,\n _addGridCommonParams(gos, {\n onDateChanged: () => {\n this.refreshInputPairValidation(position, isFrom);\n this.onUiChanged();\n },\n onFocusIn: () => this.refreshInputPairValidation(position, isFrom),\n filterParams: params,\n location: \"filter\"\n }),\n element\n );\n this.addDestroyFunc(() => dateCompWrapper.destroy());\n return dateCompWrapper;\n }\n getState() {\n return { isInvalid: this.hasInvalidInputs() };\n }\n areStatesEqual(stateA, stateB) {\n return (stateA?.isInvalid ?? false) === (stateB?.isInvalid ?? false);\n }\n setElementValue(element, value) {\n element.setDate(value);\n if (!value) {\n element.setCustomValidity(\"\");\n }\n }\n setElementDisplayed(element, displayed) {\n element.setDisplayed(displayed);\n }\n setElementDisabled(element, disabled) {\n element.setDisabled(disabled);\n }\n createEValue() {\n const eCondition = _createElement({ tag: \"div\", cls: \"ag-filter-body\" });\n this.createFromToElement(eCondition, this.eConditionPanelsFrom, this.dateConditionFromComps, \"from\");\n this.createFromToElement(eCondition, this.eConditionPanelsTo, this.dateConditionToComps, \"to\");\n return eCondition;\n }\n createFromToElement(eCondition, eConditionPanels, dateConditionComps, fromTo) {\n const eConditionPanel = _createElement({ tag: \"div\", cls: `ag-filter-${fromTo} ag-filter-date-${fromTo}` });\n eConditionPanels.push(eConditionPanel);\n eCondition.appendChild(eConditionPanel);\n dateConditionComps.push(this.createDateCompWrapper(eConditionPanel, eConditionPanels.length - 1, fromTo));\n }\n removeEValues(startPosition, deleteCount) {\n this.removeDateComps(this.dateConditionFromComps, startPosition, deleteCount);\n this.removeDateComps(this.dateConditionToComps, startPosition, deleteCount);\n removeItems(this.eConditionPanelsFrom, startPosition, deleteCount);\n removeItems(this.eConditionPanelsTo, startPosition, deleteCount);\n }\n removeDateComps(components, startPosition, deleteCount) {\n const removedComponents = removeItems(components, startPosition, deleteCount);\n for (const comp of removedComponents) {\n comp.destroy();\n }\n }\n isValidDateValue(value) {\n if (value === null) {\n return false;\n }\n const { minValidDate, maxValidDate, minValidYear, maxValidYear } = this;\n if (minValidDate) {\n if (value < minValidDate) {\n return false;\n }\n } else if (value.getUTCFullYear() < minValidYear) {\n return false;\n }\n if (maxValidDate) {\n if (value > maxValidDate) {\n return false;\n }\n } else if (value.getUTCFullYear() > maxValidYear) {\n return false;\n }\n return true;\n }\n hasInvalidInputs() {\n let invalidInputs = false;\n this.forEachInput(\n (element) => invalidInputs || (invalidInputs = element.getDate() != null && !(element.getValidity()?.valid ?? true))\n );\n return invalidInputs;\n }\n positionHasInvalidInputs(position) {\n let invalidInputs = false;\n this.forEachPositionInput(position, (element) => invalidInputs || (invalidInputs = !(element.getValidity()?.valid ?? true)));\n return invalidInputs;\n }\n canApply(_model) {\n return !this.hasInvalidInputs();\n }\n isConditionUiComplete(position) {\n if (!super.isConditionUiComplete(position)) {\n return false;\n }\n let valid = true;\n this.forEachPositionInput(position, (element, index, _pos, numberOfInputs) => {\n if (!valid || index >= numberOfInputs) {\n return;\n }\n valid && (valid = this.isValidDateValue(element.getDate()));\n });\n return valid;\n }\n areSimpleModelsEqual(aSimple, bSimple) {\n return aSimple.dateFrom === bSimple.dateFrom && aSimple.dateTo === bSimple.dateTo && aSimple.type === bSimple.type;\n }\n createCondition(position) {\n const type = this.getConditionType(position);\n const model = {};\n const { params, filterType } = this;\n const values = this.getValues(position);\n const separator = params.useIsoSeparator ? \"T\" : \" \";\n if (values.length > 0) {\n model.dateFrom = _serialiseDate(values[0], true, separator);\n }\n if (values.length > 1) {\n model.dateTo = _serialiseDate(values[1], true, separator);\n }\n return {\n dateFrom: null,\n dateTo: null,\n filterType,\n type,\n ...model\n };\n }\n removeConditionsAndOperators(startPosition, deleteCount) {\n if (this.hasInvalidInputs()) {\n return;\n }\n return super.removeConditionsAndOperators(startPosition, deleteCount);\n }\n resetPlaceholder() {\n const globalTranslate = this.getLocaleTextFunc();\n const placeholder = this.translate(\"dateFormatOoo\");\n const ariaLabel = globalTranslate(\"ariaFilterValue\", \"Filter Value\");\n this.forEachInput((element) => {\n element.setInputPlaceholder(placeholder);\n element.setInputAriaLabel(ariaLabel);\n });\n }\n getInputs(position) {\n const { dateConditionFromComps, dateConditionToComps } = this;\n if (position >= dateConditionFromComps.length) {\n return [null, null];\n }\n return [dateConditionFromComps[position], dateConditionToComps[position]];\n }\n getValues(position) {\n const result = [];\n this.forEachPositionInput(position, (element, index, _elPosition, numberOfInputs) => {\n if (index < numberOfInputs) {\n result.push(element.getDate());\n }\n });\n return result;\n }\n translate(key, variableValues) {\n let normalisedKey = key;\n if (key === \"lessThan\") {\n normalisedKey = \"before\";\n } else if (key === \"greaterThan\") {\n normalisedKey = \"after\";\n }\n return super.translate(normalisedKey, variableValues);\n }\n};\nfunction getRangeValidityMessageKey(fromDate, toDate, isFrom) {\n const isInvalid = fromDate != null && toDate != null && fromDate >= toDate;\n if (!isInvalid) {\n return null;\n }\n return `${isFrom ? \"max\" : \"min\"}DateValidation`;\n}\n\n// packages/ag-grid-community/src/filter/provided/date/dateFilterModelFormatter.ts\nvar DateFilterModelFormatter = class extends SimpleFilterModelFormatter {\n constructor(optionsFactory, filterParams) {\n super(optionsFactory, filterParams, (value) => {\n const { dataTypeSvc, valueSvc } = this.beans;\n const column = filterParams.column;\n const dateFormatFn = dataTypeSvc?.getDateFormatterFunction(column);\n const valueToFormat = dateFormatFn ? dateFormatFn(value ?? void 0) : value;\n return valueSvc.formatValue(column, null, valueToFormat);\n });\n this.filterTypeKeys = SCALAR_FILTER_TYPE_KEYS;\n }\n conditionToString(condition, forToolPanel, isRange, customDisplayKey, customDisplayName) {\n const { type } = condition;\n const dateFrom = _parseDateTimeFromString(condition.dateFrom);\n const dateTo = _parseDateTimeFromString(condition.dateTo);\n const format = this.filterParams.inRangeFloatingFilterDateFormat;\n const formatDate = forToolPanel ? this.formatValue.bind(this) : (value) => _dateToFormattedString(value, format);\n const formattedFrom = () => dateFrom !== null ? formatDate(dateFrom) : \"null\";\n const formattedTo = () => dateTo !== null ? formatDate(dateTo) : \"null\";\n if (dateFrom == null && dateTo == null) {\n return translateForFilter(this, type);\n }\n if (forToolPanel) {\n const valueForToolPanel = this.conditionForToolPanel(\n type,\n isRange,\n formattedFrom,\n formattedTo,\n customDisplayKey,\n customDisplayName\n );\n if (valueForToolPanel != null) {\n return valueForToolPanel;\n }\n }\n if (isRange) {\n return `${formattedFrom()}-${formattedTo()}`;\n }\n if (dateFrom != null) {\n return formatDate(dateFrom);\n }\n return `${type}`;\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/date/dateFilterHandler.ts\nfunction defaultDateComparator(filterDate, cellValue) {\n const cellAsDate = cellValue;\n if (cellAsDate < filterDate) {\n return -1;\n }\n if (cellAsDate > filterDate) {\n return 1;\n }\n return 0;\n}\nvar DateFilterHandler = class extends ScalarFilterHandler {\n constructor() {\n super(mapValuesFromDateFilterModel, DEFAULT_DATE_FILTER_OPTIONS);\n this.filterType = \"date\";\n this.FilterModelFormatterClass = DateFilterModelFormatter;\n this.filterTypeToRangeCache = /* @__PURE__ */ new Map();\n }\n getOrRefreshRangeCacheItem(key, rangeFn) {\n const { filterTypeToRangeCache } = this;\n const now = Date.now();\n let cache = filterTypeToRangeCache.get(key);\n if (cache && cache.expires < now) {\n cache = void 0;\n }\n if (!cache) {\n const [from, to] = rangeFn(new Date(now), new Date(now));\n cache = { from, to, expires: setStartOfNextDay(new Date(now)).getTime() - now };\n filterTypeToRangeCache.set(key, cache);\n }\n return cache;\n }\n comparator() {\n return this.params.filterParams.comparator ?? defaultDateComparator;\n }\n isValid(value) {\n const isValidDate2 = this.params.filterParams.isValidDate;\n return !isValidDate2 || isValidDate2(value);\n }\n evaluateNonNullValue(values, cellValue, filterModel) {\n const type = filterModel.type;\n const comparator = this.comparator();\n if (!this.isValid(cellValue)) {\n return type === \"notEqual\" || type === \"notBlank\";\n }\n const maybeTypeAsPreset = type;\n const presetDateRangeFn = presetDateFilterTypeRelativeFromToMap[maybeTypeAsPreset];\n if (presetDateRangeFn) {\n const { from, to } = this.getOrRefreshRangeCacheItem(maybeTypeAsPreset, presetDateRangeFn);\n return comparator(from, cellValue) >= 0 && comparator(to, cellValue) < 0;\n }\n return super.evaluateNonNullValue(values, cellValue, filterModel);\n }\n};\nvar DEFAULT_FIRST_DAY_OF_WEEK = 1;\nvar cachedFirstDayOfWeek = null;\nvar getFirstDayOfWeek = () => {\n if (cachedFirstDayOfWeek != null) {\n return cachedFirstDayOfWeek;\n }\n let firstDay;\n const locale = typeof navigator === \"undefined\" ? void 0 : navigator.languages?.[0] ?? navigator.language;\n if (locale && typeof Intl !== \"undefined\" && typeof Intl.Locale === \"function\") {\n try {\n const weekInfo = new Intl.Locale(locale).getWeekInfo?.();\n firstDay = weekInfo?.firstDay;\n } catch {\n firstDay = void 0;\n }\n }\n cachedFirstDayOfWeek = firstDay == null ? DEFAULT_FIRST_DAY_OF_WEEK : firstDay % 7;\n return cachedFirstDayOfWeek;\n};\nvar setStartOfDay = (date) => {\n date.setHours(0, 0, 0, 0);\n return date;\n};\nvar setStartOfWeek = (date) => {\n const day = date.getDay();\n const weekStart = getFirstDayOfWeek();\n const diff = (day - weekStart + 7) % 7;\n date.setDate(date.getDate() - diff);\n return setStartOfDay(date);\n};\nvar setPreviousNDay = (date, n = 1) => {\n date.setDate(date.getDate() - n);\n return date;\n};\nvar setStartOfNextDay = (date) => {\n date.setDate(date.getDate() + 1);\n return setStartOfDay(date);\n};\nvar setStartOfNextWeek = (date) => {\n setStartOfWeek(date);\n date.setDate(date.getDate() + 6);\n return setStartOfNextDay(date);\n};\nvar setStartOfMonth = (date) => {\n date.setDate(1);\n return setStartOfDay(date);\n};\nvar setStartOfNextMonth = (date) => {\n date.setDate(1);\n date.setMonth(date.getMonth() + 1);\n return setStartOfDay(date);\n};\nvar setStartOfQuarter = (date) => {\n const quarter = Math.floor(date.getMonth() / 3);\n date.setMonth(quarter * 3);\n return setStartOfMonth(date);\n};\nvar setStartOfNextQuarter = (date) => {\n const quarter = Math.floor(date.getMonth() / 3);\n date.setMonth(quarter * 3 + 2);\n return setStartOfNextMonth(date);\n};\nvar setStartOfYear = (date) => {\n date.setMonth(0, 1);\n return setStartOfDay(date);\n};\nvar setStartOfNextYear = (date) => {\n date.setMonth(12, 0);\n return setStartOfNextDay(date);\n};\nvar setPreviousDay = (date) => setPreviousNDay(date);\nvar setPreviousWeek = (date) => setPreviousDay(setStartOfWeek(date));\nvar setPreviousMonth = (date) => setPreviousDay(setStartOfMonth(date));\nvar setPreviousQuarter = (date) => setPreviousDay(setStartOfQuarter(date));\nvar today = (from, to) => [setStartOfDay(from), setStartOfNextDay(to)];\nvar yesterday = (from, to) => today(setPreviousDay(from), setPreviousDay(to));\nvar thisWeek = (from, to) => [setStartOfWeek(from), setStartOfNextWeek(to)];\nvar lastWeek = (from, to) => thisWeek(setPreviousWeek(from), setPreviousWeek(to));\nvar thisMonth = (from, to) => [setStartOfMonth(from), setStartOfNextMonth(to)];\nvar lastMonth = (from, to) => thisMonth(setPreviousMonth(from), setPreviousMonth(to));\nvar thisQuarter = (from, to) => [setStartOfQuarter(from), setStartOfNextQuarter(to)];\nvar lastQuarter = (from, to) => thisQuarter(setPreviousQuarter(from), setPreviousQuarter(to));\nvar thisYear = (from, to) => [setStartOfYear(from), setStartOfNextYear(to)];\nvar yearToDate = (from, to) => [setStartOfYear(from), setStartOfNextDay(to)];\nvar last7Days = (from, to) => [\n setStartOfDay(setPreviousNDay(from, 7)),\n setStartOfNextDay(to)\n];\nvar last30Days = (from, to) => [\n setStartOfDay(setPreviousNDay(from, 30)),\n setStartOfNextDay(to)\n];\nvar last90Days = (from, to) => [\n setStartOfDay(setPreviousNDay(from, 90)),\n setStartOfNextDay(to)\n];\nvar last6Months = (from, to) => {\n from.setFullYear(from.getFullYear() - 1);\n from.setMonth(from.getMonth() + 6);\n return [setStartOfDay(from), setStartOfNextDay(to)];\n};\nvar last12Months = (from, to) => {\n from.setFullYear(from.getFullYear() - 1);\n return [setStartOfDay(from), setStartOfNextDay(to)];\n};\nvar last24Months = (from, to) => {\n from.setFullYear(from.getFullYear() - 2);\n return [setStartOfDay(from), setStartOfNextDay(to)];\n};\nvar lastYear = (from, to) => {\n from.setFullYear(from.getFullYear() - 1);\n to.setFullYear(to.getFullYear() - 1);\n return thisYear(from, to);\n};\nvar nextYear = (from, to) => {\n from.setFullYear(from.getFullYear() + 1);\n to.setFullYear(to.getFullYear() + 1);\n return thisYear(from, to);\n};\nvar nextQuarter = (from, to) => {\n from.setMonth(from.getMonth() + 3);\n to.setMonth(to.getMonth() + 3);\n return thisQuarter(from, to);\n};\nvar nextMonth = (from, to) => {\n from.setMonth(from.getMonth() + 1);\n to.setMonth(to.getMonth() + 1);\n return thisMonth(from, to);\n};\nvar nextWeek = (from, to) => {\n from.setDate(from.getDate() + 7);\n to.setDate(to.getDate() + 7);\n return thisWeek(from, to);\n};\nvar tomorrow = (from, to) => {\n from.setDate(from.getDate() + 1);\n to.setDate(to.getDate() + 1);\n return today(from, to);\n};\nvar presetDateFilterTypeRelativeFromToMap = {\n today,\n yesterday,\n tomorrow,\n thisWeek,\n lastWeek,\n nextWeek,\n thisMonth,\n lastMonth,\n nextMonth,\n thisQuarter,\n lastQuarter,\n nextQuarter,\n thisYear,\n lastYear,\n nextYear,\n yearToDate,\n last7Days,\n last30Days,\n last90Days,\n last6Months,\n last12Months,\n last24Months,\n setStartOfDay,\n setStartOfWeek,\n setStartOfNextDay,\n setStartOfNextWeek,\n setStartOfMonth,\n setStartOfNextMonth,\n setStartOfQuarter,\n setStartOfNextQuarter,\n setStartOfYear,\n setStartOfNextYear,\n setPreviousDay,\n setPreviousWeek,\n setPreviousMonth,\n setPreviousQuarter\n};\n\n// packages/ag-grid-community/src/filter/provided/date/dateFloatingFilter.ts\nvar DateFloatingFilterElement = {\n tag: \"div\",\n cls: \"ag-floating-filter-input\",\n role: \"presentation\",\n children: [\n {\n tag: \"ag-input-text-field\",\n ref: \"eReadOnlyText\"\n },\n { tag: \"div\", ref: \"eDateWrapper\", cls: \"ag-date-floating-filter-wrapper\" }\n ]\n};\nvar DateFloatingFilter = class extends SimpleFloatingFilter {\n constructor() {\n super(DateFloatingFilterElement, [AgInputTextFieldSelector]);\n this.eReadOnlyText = RefPlaceholder;\n this.eDateWrapper = RefPlaceholder;\n this.FilterModelFormatterClass = DateFilterModelFormatter;\n this.filterType = \"date\";\n this.defaultOptions = DEFAULT_DATE_FILTER_OPTIONS;\n }\n setParams(params) {\n super.setParams(params);\n this.createDateComponent();\n const translate = this.getLocaleTextFunc();\n this.eReadOnlyText.setDisabled(true).setInputAriaLabel(translate(\"ariaDateFilterInput\", \"Date Filter Input\"));\n }\n updateParams(params) {\n super.updateParams(params);\n this.dateComp.updateParams(this.getDateComponentParams());\n this.updateCompOnModelChange(params.currentParentModel());\n }\n updateCompOnModelChange(model) {\n const allowEditing = !this.readOnly && this.canWeEditAfterModelFromParentFilter(model);\n this.setEditable(allowEditing);\n if (allowEditing) {\n const dateModel = model ? _parseDateTimeFromString(model.dateFrom) : null;\n this.dateComp.setDate(dateModel);\n this.eReadOnlyText.setValue(\"\");\n } else {\n this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(model));\n this.dateComp.setDate(null);\n }\n }\n setEditable(editable) {\n _setDisplayed(this.eDateWrapper, editable);\n _setDisplayed(this.eReadOnlyText.getGui(), !editable);\n }\n onModelUpdated(model) {\n super.setLastTypeFromModel(model);\n this.updateCompOnModelChange(model);\n }\n onDateChanged() {\n const filterValueDate = this.dateComp.getDate();\n if (this.reactive) {\n const reactiveParams = this.params;\n reactiveParams.onUiChange();\n const model = reactiveParams.model;\n const filterValueText = _serialiseDate(filterValueDate);\n const newModel = filterValueText == null ? null : {\n ...model ?? {\n filterType: this.filterType,\n type: this.lastType ?? this.optionsFactory.defaultOption\n },\n dateFrom: filterValueText\n };\n reactiveParams.onModelChange(newModel, { afterFloatingFilter: true });\n } else {\n this.params.parentFilterInstance((filterInstance) => {\n filterInstance?.onFloatingFilterChanged(this.lastType || null, filterValueDate);\n });\n }\n }\n getDateComponentParams() {\n const { filterParams } = this.params;\n const debounceMs = getDebounceMs(filterParams, this.defaultDebounceMs);\n return _addGridCommonParams(this.gos, {\n onDateChanged: _debounce(this, this.onDateChanged.bind(this), debounceMs),\n filterParams,\n location: \"floatingFilter\"\n });\n }\n createDateComponent() {\n const {\n beans: { context, userCompFactory },\n eDateWrapper,\n params: { column }\n } = this;\n this.dateComp = new DateCompWrapper(\n context,\n userCompFactory,\n column.getColDef(),\n this.getDateComponentParams(),\n eDateWrapper,\n (dateComp) => {\n dateComp.setInputAriaLabel(this.getAriaLabel(column));\n }\n );\n this.addDestroyFunc(() => this.dateComp.destroy());\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/date/defaultDateComponent.ts\nvar DefaultDateElement = {\n tag: \"div\",\n cls: \"ag-filter-filter\",\n children: [\n {\n tag: \"ag-input-text-field\",\n ref: \"eDateInput\",\n cls: \"ag-date-filter\"\n }\n ]\n};\nvar DefaultDateComponent = class extends Component {\n constructor() {\n super(DefaultDateElement, [AgInputTextFieldSelector]);\n this.eDateInput = RefPlaceholder;\n this.isApply = false;\n this.applyOnFocusOut = false;\n }\n init(params) {\n this.params = params;\n this.setParams(params);\n const inputElement = this.eDateInput.getInputElement();\n this.addManagedListeners(inputElement, {\n // ensures that the input element is focussed when a clear button is clicked,\n // unless using safari as there is no clear button and focus does not work properly\n mouseDown: () => {\n if (this.eDateInput.isDisabled() || this.usingSafariDatePicker) {\n return;\n }\n inputElement.focus({ preventScroll: true });\n },\n input: this.handleInput.bind(this, false),\n change: this.handleInput.bind(this, true),\n focusout: this.handleFocusOut.bind(this),\n focusin: this.handleFocusIn.bind(this)\n });\n }\n handleInput(isChange) {\n if (this.eDateInput.isDisabled()) {\n return;\n }\n if (this.isApply) {\n this.applyOnFocusOut = !isChange;\n if (isChange) {\n this.params.onDateChanged();\n }\n return;\n }\n if (!isChange) {\n this.params.onDateChanged();\n }\n }\n handleFocusOut() {\n if (this.applyOnFocusOut) {\n this.applyOnFocusOut = false;\n this.params.onDateChanged();\n }\n }\n handleFocusIn() {\n this.params.onFocusIn?.();\n }\n setParams(params) {\n const inputElement = this.eDateInput.getInputElement();\n const shouldUseBrowserDatePicker = this.shouldUseBrowserDatePicker(params);\n this.usingSafariDatePicker = shouldUseBrowserDatePicker && _isBrowserSafari();\n const { minValidYear, maxValidYear, minValidDate, maxValidDate, buttons, includeTime, colDef } = params.filterParams || {};\n const dataTypeSvc = this.beans.dataTypeSvc;\n const shouldUseDateTimeLocal = includeTime ?? dataTypeSvc?.getDateIncludesTimeFlag?.(colDef.cellDataType) ?? false;\n if (shouldUseBrowserDatePicker) {\n if (shouldUseDateTimeLocal) {\n inputElement.type = \"datetime-local\";\n inputElement.step = \"1\";\n } else {\n inputElement.type = \"date\";\n }\n } else {\n inputElement.type = \"text\";\n }\n const parsedMinValidDate = parseOrConstructDate(minValidDate, minValidYear, true);\n const parsedMaxValidDate = parseOrConstructDate(maxValidDate, maxValidYear, false);\n if (parsedMinValidDate && parsedMaxValidDate && parsedMinValidDate.getTime() > parsedMaxValidDate.getTime()) {\n _warn(87);\n }\n if (parsedMinValidDate) {\n inputElement.min = _serialiseDate(parsedMinValidDate, shouldUseDateTimeLocal);\n }\n if (parsedMaxValidDate) {\n inputElement.max = _serialiseDate(parsedMaxValidDate, shouldUseDateTimeLocal);\n }\n this.isApply = params.location === \"floatingFilter\" && !!buttons?.includes(\"apply\");\n }\n refresh(params) {\n this.params = params;\n this.setParams(params);\n }\n getDate() {\n return _parseDateTimeFromString(this.eDateInput.getValue());\n }\n setDate(date) {\n const colType = this.params.filterParams.colDef.cellDataType;\n const includeTime = this.beans.dataTypeSvc?.getDateIncludesTimeFlag(colType) ?? false;\n this.eDateInput.setValue(_serialiseDate(date, includeTime));\n }\n setInputPlaceholder(placeholder) {\n this.eDateInput.setInputPlaceholder(placeholder);\n }\n setInputAriaLabel(ariaLabel) {\n this.eDateInput.setAriaLabel(ariaLabel);\n }\n setDisabled(disabled) {\n this.eDateInput.setDisabled(disabled);\n }\n afterGuiAttached(params) {\n if (!params?.suppressFocus) {\n this.eDateInput.getInputElement().focus({ preventScroll: true });\n }\n }\n shouldUseBrowserDatePicker(params) {\n return params?.filterParams?.browserDatePicker ?? true;\n }\n};\nfunction parseOrConstructDate(date, year, isMin) {\n if (date && year) {\n _warn(isMin ? 85 : 86);\n }\n if (date instanceof Date) {\n return date;\n }\n if (date) {\n return _parseDateTimeFromString(date);\n } else if (year) {\n return _parseDateTimeFromString(`${year}-${isMin ? \"01-01\" : \"12-31\"}`);\n }\n return null;\n}\n\n// packages/ag-grid-community/src/filter/provided/number/numberFilterConstants.ts\nvar DEFAULT_NUMBER_FILTER_OPTIONS = [\n \"equals\",\n \"notEqual\",\n \"greaterThan\",\n \"greaterThanOrEqual\",\n \"lessThan\",\n \"lessThanOrEqual\",\n \"inRange\",\n \"blank\",\n \"notBlank\"\n];\n\n// packages/ag-grid-community/src/filter/provided/number/numberFilterUtils.ts\nfunction getAllowedCharPattern2(filterParams) {\n return filterParams?.allowedCharPattern ?? null;\n}\nfunction processNumberFilterValue(value) {\n if (value == null) {\n return null;\n }\n return isNaN(value) ? null : value;\n}\nfunction mapValuesFromNumberFilterModel(filterModel, optionsFactory) {\n const { filter, filterTo, type } = filterModel || {};\n return [processNumberFilterValue(filter), processNumberFilterValue(filterTo)].slice(\n 0,\n getNumberOfInputs(type, optionsFactory)\n );\n}\n\n// packages/ag-grid-community/src/filter/provided/number/numberFilter.ts\nvar NumberFilter = class extends SimpleFilter {\n constructor() {\n super(\"numberFilter\", mapValuesFromNumberFilterModel, DEFAULT_NUMBER_FILTER_OPTIONS);\n this.eValuesFrom = [];\n this.eValuesTo = [];\n this.filterType = \"number\";\n this.defaultDebounceMs = 500;\n }\n afterGuiAttached(params) {\n super.afterGuiAttached(params);\n this.refreshInputValidation();\n }\n shouldKeepInvalidInputState() {\n return !_isBrowserFirefox() && this.hasInvalidInputs() && this.getConditionTypes().includes(\"inRange\");\n }\n refreshInputValidation() {\n for (let i = 0; i < this.eValuesFrom.length; i++) {\n const from = this.eValuesFrom[i];\n const to = this.eValuesTo[i];\n this.refreshInputPairValidation(from, to);\n }\n }\n refreshInputPairValidation(from, to, isFrom = false) {\n const parser = this.params.numberParser;\n const fromValue = getNormalisedValue(parser, from);\n const toValue = getNormalisedValue(parser, to);\n const localeKey = getValidityMessageKey2(fromValue, toValue, isFrom);\n const validityMessage = localeKey ? this.translate(localeKey, [String(isFrom ? toValue : fromValue)]) : \"\";\n (isFrom ? from : to).setCustomValidity(validityMessage);\n (isFrom ? to : from).setCustomValidity(\"\");\n if (validityMessage.length > 0) {\n this.beans.ariaAnnounce.announceValue(validityMessage, \"dateFilter\");\n }\n }\n getState() {\n return { isInvalid: this.hasInvalidInputs() };\n }\n areStatesEqual(stateA, stateB) {\n return (stateA?.isInvalid ?? false) === (stateB?.isInvalid ?? false);\n }\n refresh(legacyNewParams) {\n const result = super.refresh(legacyNewParams);\n const { state: newState, additionalEventAttributes } = legacyNewParams;\n const oldState = this.state;\n const fromAction = additionalEventAttributes?.fromAction;\n const forceRefreshValidation = fromAction && fromAction != \"apply\";\n if (forceRefreshValidation || newState.model !== oldState.model || !this.areStatesEqual(newState.state, oldState.state)) {\n this.refreshInputValidation();\n }\n return result;\n }\n setElementValue(element, value, fromFloatingFilter) {\n const { numberFormatter } = this.params;\n const valueToSet = !fromFloatingFilter && numberFormatter ? numberFormatter(value ?? null) : value;\n super.setElementValue(element, valueToSet);\n if (valueToSet === null) {\n element.setCustomValidity(\"\");\n }\n }\n createEValue() {\n const { params, eValuesFrom, eValuesTo } = this;\n const allowedCharPattern = getAllowedCharPattern2(params);\n const eCondition = _createElement({ tag: \"div\", cls: \"ag-filter-body\", role: \"presentation\" });\n const from = this.createFromToElement(eCondition, eValuesFrom, \"from\", allowedCharPattern);\n const to = this.createFromToElement(eCondition, eValuesTo, \"to\", allowedCharPattern);\n const getFieldChangedListener = (from2, to2, isFrom) => () => this.refreshInputPairValidation(from2, to2, isFrom);\n const fromListener = getFieldChangedListener(from, to, true);\n from.onValueChange(fromListener);\n from.addGuiEventListener(\"focusin\", fromListener);\n const toListener = getFieldChangedListener(from, to, false);\n to.onValueChange(toListener);\n to.addGuiEventListener(\"focusin\", toListener);\n return eCondition;\n }\n createFromToElement(eCondition, eValues, fromTo, allowedCharPattern) {\n const eValue = this.createManagedBean(\n allowedCharPattern ? new AgInputTextField({ allowedCharPattern }) : new AgInputNumberField()\n );\n eValue.addCss(`ag-filter-${fromTo}`);\n eValue.addCss(\"ag-filter-filter\");\n eValues.push(eValue);\n eCondition.appendChild(eValue.getGui());\n return eValue;\n }\n removeEValues(startPosition, deleteCount) {\n const removeComps = (eGui) => this.removeComponents(eGui, startPosition, deleteCount);\n removeComps(this.eValuesFrom);\n removeComps(this.eValuesTo);\n }\n getValues(position) {\n const result = [];\n this.forEachPositionInput(position, (element, index, _elPosition, numberOfInputs) => {\n if (index < numberOfInputs) {\n result.push(processNumberFilterValue(stringToFloat(this.params.numberParser, element.getValue())));\n }\n });\n return result;\n }\n areSimpleModelsEqual(aSimple, bSimple) {\n return aSimple.filter === bSimple.filter && aSimple.filterTo === bSimple.filterTo && aSimple.type === bSimple.type;\n }\n createCondition(position) {\n const type = this.getConditionType(position);\n const model = {\n filterType: this.filterType,\n type\n };\n const values = this.getValues(position);\n if (values.length > 0) {\n model.filter = values[0];\n }\n if (values.length > 1) {\n model.filterTo = values[1];\n }\n return model;\n }\n removeConditionsAndOperators(startPosition, deleteCount) {\n if (this.hasInvalidInputs()) {\n return;\n }\n return super.removeConditionsAndOperators(startPosition, deleteCount);\n }\n getInputs(position) {\n const { eValuesFrom, eValuesTo } = this;\n if (position >= eValuesFrom.length) {\n return [null, null];\n }\n return [eValuesFrom[position], eValuesTo[position]];\n }\n hasInvalidInputs() {\n let invalidInputs = false;\n this.forEachInput((element) => invalidInputs || (invalidInputs = !element.getInputElement().validity.valid));\n return invalidInputs;\n }\n positionHasInvalidInputs(position) {\n let invalidInputs = false;\n this.forEachPositionInput(position, (element) => invalidInputs || (invalidInputs = !element.getInputElement().validity.valid));\n return invalidInputs;\n }\n canApply(_model) {\n return !this.hasInvalidInputs();\n }\n};\nfunction stringToFloat(numberParser, value) {\n if (typeof value === \"number\") {\n return value;\n }\n let filterText = _makeNull(value);\n if (filterText != null && filterText.trim() === \"\") {\n filterText = null;\n }\n if (numberParser) {\n return numberParser(filterText);\n }\n return filterText == null || filterText.trim() === \"-\" ? null : Number.parseFloat(filterText);\n}\nfunction getNormalisedValue(numberParser, input) {\n return processNumberFilterValue(stringToFloat(numberParser, input.getValue(true)));\n}\nfunction getValidityMessageKey2(fromValue, toValue, isFrom) {\n const isInvalid = fromValue != null && toValue != null && fromValue >= toValue;\n if (!isInvalid) {\n return null;\n }\n return `strict${isFrom ? \"Max\" : \"Min\"}ValueValidation`;\n}\n\n// packages/ag-grid-community/src/filter/provided/number/numberFilterModelFormatter.ts\nvar NumberFilterModelFormatter = class extends SimpleFilterModelFormatter {\n constructor(optionsFactory, filterParams) {\n super(optionsFactory, filterParams, filterParams.numberFormatter);\n this.filterTypeKeys = SCALAR_FILTER_TYPE_KEYS;\n }\n conditionToString(condition, forToolPanel, isRange, customDisplayKey, customDisplayName) {\n const { filter, filterTo, type } = condition;\n const formatValue = this.formatValue.bind(this);\n if (forToolPanel) {\n const valueForToolPanel = this.conditionForToolPanel(\n type,\n isRange,\n () => formatValue(filter),\n () => formatValue(filterTo),\n customDisplayKey,\n customDisplayName\n );\n if (valueForToolPanel != null) {\n return valueForToolPanel;\n }\n }\n if (isRange) {\n return `${formatValue(filter)}-${formatValue(filterTo)}`;\n }\n if (filter != null) {\n return formatValue(filter);\n }\n return `${type}`;\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/number/numberFilterHandler.ts\nvar NumberFilterHandler = class extends ScalarFilterHandler {\n constructor() {\n super(mapValuesFromNumberFilterModel, DEFAULT_NUMBER_FILTER_OPTIONS);\n this.filterType = \"number\";\n this.FilterModelFormatterClass = NumberFilterModelFormatter;\n }\n comparator() {\n return (left, right) => {\n if (left === right) {\n return 0;\n }\n return left < right ? 1 : -1;\n };\n }\n isValid(value) {\n return !isNaN(value);\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/number/numberFloatingFilter.ts\nvar FloatingFilterNumberInputService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.onValueChanged = () => {\n };\n this.numberInputActive = true;\n }\n setupGui(parentElement) {\n this.eNumberInput = this.createManagedBean(new AgInputNumberField());\n this.eTextInput = this.createManagedBean(new AgInputTextField());\n this.eTextInput.setDisabled(true);\n const eNumberInput = this.eNumberInput.getGui();\n const eTextInput = this.eTextInput.getGui();\n parentElement.appendChild(eNumberInput);\n parentElement.appendChild(eTextInput);\n this.setupListeners(eNumberInput, (e) => this.onValueChanged(e));\n this.setupListeners(eTextInput, (e) => this.onValueChanged(e));\n }\n setEditable(editable) {\n this.numberInputActive = editable;\n this.eNumberInput.setDisplayed(this.numberInputActive);\n this.eTextInput.setDisplayed(!this.numberInputActive);\n }\n setAutoComplete(autoComplete) {\n this.eNumberInput.setAutoComplete(autoComplete);\n this.eTextInput.setAutoComplete(autoComplete);\n }\n getValue() {\n return this.getActiveInputElement().getValue();\n }\n setValue(value, silent) {\n this.getActiveInputElement().setValue(value, silent);\n }\n getActiveInputElement() {\n return this.numberInputActive ? this.eNumberInput : this.eTextInput;\n }\n setValueChangedListener(listener) {\n this.onValueChanged = listener;\n }\n setupListeners(element, listener) {\n this.addManagedListeners(element, {\n input: listener,\n keydown: listener\n });\n }\n setParams({\n ariaLabel,\n autoComplete,\n placeholder\n }) {\n this.setAriaLabel(ariaLabel);\n if (autoComplete !== void 0) {\n this.setAutoComplete(autoComplete);\n }\n this.setPlaceholder(this.eNumberInput, placeholder);\n this.setPlaceholder(this.eTextInput, placeholder);\n }\n setPlaceholder(input, placeholder) {\n input.toggleCss(\"ag-floating-filter-search-icon\", !!placeholder);\n input.setInputPlaceholder(placeholder);\n }\n setAriaLabel(ariaLabel) {\n this.eNumberInput.setInputAriaLabel(ariaLabel);\n this.eTextInput.setInputAriaLabel(ariaLabel);\n }\n};\nvar NumberFloatingFilter = class extends TextInputFloatingFilter {\n constructor() {\n super(...arguments);\n this.FilterModelFormatterClass = NumberFilterModelFormatter;\n this.filterType = \"number\";\n this.defaultOptions = DEFAULT_NUMBER_FILTER_OPTIONS;\n }\n updateParams(params) {\n const allowedCharPattern = getAllowedCharPattern2(params.filterParams);\n if (allowedCharPattern !== this.allowedCharPattern) {\n this.recreateFloatingFilterInputService(params);\n }\n super.updateParams(params);\n }\n createFloatingFilterInputService(params) {\n this.allowedCharPattern = getAllowedCharPattern2(params.filterParams);\n if (this.allowedCharPattern) {\n return this.createManagedBean(\n new FloatingFilterTextInputService({\n config: { allowedCharPattern: this.allowedCharPattern }\n })\n );\n }\n return this.createManagedBean(new FloatingFilterNumberInputService());\n }\n convertValue(value) {\n return value ? Number(value) : null;\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/text/textFilterConstants.ts\nvar DEFAULT_TEXT_FILTER_OPTIONS = [\n \"contains\",\n \"notContains\",\n \"equals\",\n \"notEqual\",\n \"startsWith\",\n \"endsWith\",\n \"blank\",\n \"notBlank\"\n];\n\n// packages/ag-grid-community/src/filter/provided/text/textFilter.ts\nvar TextFilter = class extends SimpleFilter {\n constructor() {\n super(\"textFilter\", mapValuesFromTextFilterModel, DEFAULT_TEXT_FILTER_OPTIONS);\n this.filterType = \"text\";\n this.eValuesFrom = [];\n this.eValuesTo = [];\n this.defaultDebounceMs = 500;\n }\n createCondition(position) {\n const type = this.getConditionType(position);\n const model = {\n filterType: this.filterType,\n type\n };\n const values = this.getValues(position);\n if (values.length > 0) {\n model.filter = values[0];\n }\n if (values.length > 1) {\n model.filterTo = values[1];\n }\n return model;\n }\n areSimpleModelsEqual(aSimple, bSimple) {\n return aSimple.filter === bSimple.filter && aSimple.filterTo === bSimple.filterTo && aSimple.type === bSimple.type;\n }\n getInputs(position) {\n const { eValuesFrom, eValuesTo } = this;\n if (position >= eValuesFrom.length) {\n return [null, null];\n }\n return [eValuesFrom[position], eValuesTo[position]];\n }\n getValues(position) {\n const result = [];\n this.forEachPositionInput(position, (element, index, _elPosition, numberOfInputs) => {\n if (index < numberOfInputs) {\n result.push(_makeNull(element.getValue()));\n }\n });\n return result;\n }\n createEValue() {\n const eCondition = _createElement({ tag: \"div\", cls: \"ag-filter-body\", role: \"presentation\" });\n const { eValuesFrom, eValuesTo } = this;\n this.createFromToElement(eCondition, eValuesFrom, \"from\");\n this.createFromToElement(eCondition, eValuesTo, \"to\");\n return eCondition;\n }\n createFromToElement(eCondition, eValues, fromTo) {\n const eValue = this.createManagedBean(new AgInputTextField());\n eValue.addCss(`ag-filter-${fromTo}`);\n eValue.addCss(\"ag-filter-filter\");\n eValues.push(eValue);\n eCondition.appendChild(eValue.getGui());\n }\n removeEValues(startPosition, deleteCount) {\n const removeComps = (eGui) => this.removeComponents(eGui, startPosition, deleteCount);\n const { eValuesFrom, eValuesTo } = this;\n removeComps(eValuesFrom);\n removeComps(eValuesTo);\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/text/textFilterModelFormatter.ts\nvar TextFilterModelFormatter = class extends SimpleFilterModelFormatter {\n constructor() {\n super(...arguments);\n this.filterTypeKeys = TEXT_FILTER_TYPE_KEYS;\n }\n conditionToString(condition, forToolPanel, isRange, customDisplayKey, customDisplayName) {\n const { filter, filterTo, type } = condition;\n if (forToolPanel) {\n const getValueFunc = (value) => () => translateForFilter(this, \"filterSummaryTextQuote\", [value]);\n const valueForToolPanel = this.conditionForToolPanel(\n type,\n isRange,\n getValueFunc(filter),\n getValueFunc(filterTo),\n customDisplayKey,\n customDisplayName\n );\n if (valueForToolPanel != null) {\n return valueForToolPanel;\n }\n }\n if (isRange) {\n return `${filter}-${filterTo}`;\n }\n if (filter != null) {\n return `${filter}`;\n }\n return `${type}`;\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/text/textFilterHandler.ts\nvar defaultMatcher = ({ filterOption, value, filterText }) => {\n if (filterText == null) {\n return false;\n }\n switch (filterOption) {\n case \"contains\":\n return value.includes(filterText);\n case \"notContains\":\n return !value.includes(filterText);\n case \"equals\":\n return value === filterText;\n case \"notEqual\":\n return value != filterText;\n case \"startsWith\":\n return value.indexOf(filterText) === 0;\n case \"endsWith\": {\n const index = value.lastIndexOf(filterText);\n return index >= 0 && index === value.length - filterText.length;\n }\n default:\n return false;\n }\n};\nvar defaultFormatter = (from) => from;\nvar defaultLowercaseFormatter = (from) => from == null ? null : from.toString().toLowerCase();\nvar TextFilterHandler = class extends SimpleFilterHandler {\n constructor() {\n super(mapValuesFromTextFilterModel, DEFAULT_TEXT_FILTER_OPTIONS);\n this.filterType = \"text\";\n this.FilterModelFormatterClass = TextFilterModelFormatter;\n }\n updateParams(params) {\n super.updateParams(params);\n const filterParams = params.filterParams;\n this.matcher = filterParams.textMatcher ?? defaultMatcher;\n this.formatter = filterParams.textFormatter ?? (filterParams.caseSensitive ? defaultFormatter : defaultLowercaseFormatter);\n }\n evaluateNullValue(filterType) {\n const filterTypesAllowNulls = [\"notEqual\", \"notContains\", \"blank\"];\n return filterType ? filterTypesAllowNulls.indexOf(filterType) >= 0 : false;\n }\n evaluateNonNullValue(values, cellValue, filterModel, params) {\n const formattedValues = values.map((v) => this.formatter(v)) || [];\n const cellValueFormatted = this.formatter(cellValue);\n const {\n api,\n colDef,\n column,\n context,\n filterParams: { textFormatter }\n } = this.params;\n if (filterModel.type === \"blank\") {\n return isBlank(cellValue);\n } else if (filterModel.type === \"notBlank\") {\n return !isBlank(cellValue);\n }\n const matcherParams = {\n api,\n colDef,\n column,\n context,\n node: params.node,\n data: params.data,\n filterOption: filterModel.type,\n value: cellValueFormatted,\n textFormatter\n };\n return formattedValues.some((v) => this.matcher({ ...matcherParams, filterText: v }));\n }\n processModelToApply(model) {\n if (model && this.params.filterParams.trimInput) {\n const processCondition = (condition) => {\n const newCondition = {\n ...condition\n };\n const { filter, filterTo } = condition;\n if (filter) {\n newCondition.filter = trimInputForFilter(filter) ?? null;\n }\n if (filterTo) {\n newCondition.filterTo = trimInputForFilter(filterTo) ?? null;\n }\n return newCondition;\n };\n if (isCombinedFilterModel(model)) {\n return {\n ...model,\n conditions: model.conditions.map(processCondition)\n };\n }\n return processCondition(model);\n }\n return model;\n }\n};\n\n// packages/ag-grid-community/src/filter/provided/text/textFloatingFilter.ts\nvar TextFloatingFilter = class extends TextInputFloatingFilter {\n constructor() {\n super(...arguments);\n this.FilterModelFormatterClass = TextFilterModelFormatter;\n this.filterType = \"text\";\n this.defaultOptions = DEFAULT_TEXT_FILTER_OPTIONS;\n }\n createFloatingFilterInputService() {\n return this.createManagedBean(new FloatingFilterTextInputService());\n }\n};\n\n// packages/ag-grid-community/src/filter/quickFilterApi.ts\nfunction isQuickFilterPresent(beans) {\n return !!beans.quickFilter?.isFilterPresent();\n}\nfunction getQuickFilter(beans) {\n return beans.quickFilter?.getText();\n}\nfunction resetQuickFilter(beans) {\n beans.quickFilter?.resetCache();\n}\n\n// packages/ag-grid-community/src/filter/quickFilterService.ts\nvar QuickFilterService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"quickFilter\";\n this.quickFilter = null;\n this.quickFilterParts = null;\n }\n postConstruct() {\n const resetListener = this.resetCache.bind(this);\n const gos = this.gos;\n this.addManagedEventListeners({\n columnPivotModeChanged: resetListener,\n newColumnsLoaded: resetListener,\n columnRowGroupChanged: resetListener,\n columnVisible: () => {\n if (!gos.get(\"includeHiddenColumnsInQuickFilter\")) {\n this.resetCache();\n }\n }\n });\n this.addManagedPropertyListener(\"quickFilterText\", (e) => this.setFilter(e.currentValue));\n this.addManagedPropertyListeners(\n [\"includeHiddenColumnsInQuickFilter\", \"applyQuickFilterBeforePivotOrAgg\"],\n () => this.onColumnConfigChanged()\n );\n this.quickFilter = this.parseFilter(gos.get(\"quickFilterText\"));\n this.parser = gos.get(\"quickFilterParser\");\n this.matcher = gos.get(\"quickFilterMatcher\");\n this.setFilterParts();\n this.addManagedPropertyListeners([\"quickFilterMatcher\", \"quickFilterParser\"], () => this.setParserAndMatcher());\n }\n // if we are using autoGroupCols, then they should be included for quick filter. this covers the\n // following scenarios:\n // a) user provides 'field' into autoGroupCol of normal grid, so now because a valid col to filter leafs on\n // b) using tree data and user depends on autoGroupCol for first col, and we also want to filter on this\n // (tree data is a bit different, as parent rows can be filtered on, unlike row grouping)\n refreshCols() {\n const { autoColSvc, colModel, gos, pivotResultCols } = this.beans;\n const pivotMode = colModel.isPivotMode();\n const groupAutoCols = autoColSvc?.getColumns();\n const providedCols = colModel.getColDefCols();\n let columnsForQuickFilter = (pivotMode && !gos.get(\"applyQuickFilterBeforePivotOrAgg\") ? pivotResultCols?.getPivotResultCols()?.list : providedCols) ?? [];\n if (groupAutoCols) {\n columnsForQuickFilter = columnsForQuickFilter.concat(groupAutoCols);\n }\n this.colsToUse = gos.get(\"includeHiddenColumnsInQuickFilter\") ? columnsForQuickFilter : columnsForQuickFilter.filter((col) => col.isVisible() || col.isRowGroupActive());\n }\n isFilterPresent() {\n return this.quickFilter !== null;\n }\n doesRowPass(node) {\n const usingCache = this.gos.get(\"cacheQuickFilter\");\n if (this.matcher) {\n return this.doesRowPassMatcher(usingCache, node);\n }\n return this.quickFilterParts.every(\n (part) => usingCache ? this.doesRowPassCache(node, part) : this.doesRowPassNoCache(node, part)\n );\n }\n resetCache() {\n this.beans.rowModel.forEachNode((node) => node.quickFilterAggregateText = null);\n }\n getText() {\n return this.gos.get(\"quickFilterText\");\n }\n setFilterParts() {\n const { quickFilter, parser } = this;\n if (quickFilter) {\n this.quickFilterParts = parser ? parser(quickFilter) : quickFilter.split(\" \");\n } else {\n this.quickFilterParts = null;\n }\n }\n parseFilter(newFilter) {\n if (!_exists(newFilter)) {\n return null;\n }\n return newFilter.toUpperCase();\n }\n setFilter(newFilter) {\n if (newFilter != null && typeof newFilter !== \"string\") {\n _warn(70, { newFilter });\n return;\n }\n const parsedFilter = this.parseFilter(newFilter);\n if (this.quickFilter !== parsedFilter) {\n this.quickFilter = parsedFilter;\n this.setFilterParts();\n this.dispatchLocalEvent({ type: \"quickFilterChanged\" });\n }\n }\n setParserAndMatcher() {\n const parser = this.gos.get(\"quickFilterParser\");\n const matcher = this.gos.get(\"quickFilterMatcher\");\n const hasChanged = parser !== this.parser || matcher !== this.matcher;\n this.parser = parser;\n this.matcher = matcher;\n if (hasChanged) {\n this.setFilterParts();\n this.dispatchLocalEvent({ type: \"quickFilterChanged\" });\n }\n }\n onColumnConfigChanged() {\n this.refreshCols();\n this.resetCache();\n if (this.isFilterPresent()) {\n this.dispatchLocalEvent({ type: \"quickFilterChanged\" });\n }\n }\n doesRowPassNoCache(node, filterPart) {\n return this.colsToUse.some((column) => {\n const part = this.getTextForColumn(column, node);\n return _exists(part) && part.includes(filterPart);\n });\n }\n doesRowPassCache(node, filterPart) {\n this.checkGenerateAggText(node);\n return node.quickFilterAggregateText.includes(filterPart);\n }\n doesRowPassMatcher(usingCache, node) {\n let quickFilterAggregateText;\n if (usingCache) {\n this.checkGenerateAggText(node);\n quickFilterAggregateText = node.quickFilterAggregateText;\n } else {\n quickFilterAggregateText = this.getAggText(node);\n }\n const { quickFilterParts, matcher } = this;\n return matcher(quickFilterParts, quickFilterAggregateText);\n }\n checkGenerateAggText(node) {\n if (!node.quickFilterAggregateText) {\n node.quickFilterAggregateText = this.getAggText(node);\n }\n }\n getTextForColumn(column, node) {\n let value = this.beans.filterValueSvc.getValue(column, node);\n const colDef = column.getColDef();\n if (colDef.getQuickFilterText) {\n const params = _addGridCommonParams(this.gos, {\n value,\n node,\n data: node.data,\n column,\n colDef\n });\n value = colDef.getQuickFilterText(params);\n }\n return _exists(value) ? value.toString().toUpperCase() : null;\n }\n getAggText(node) {\n const stringParts = [];\n for (const column of this.colsToUse) {\n const part = this.getTextForColumn(column, node);\n if (_exists(part)) {\n stringParts.push(part);\n }\n }\n return stringParts.join(\"\\n\");\n }\n};\n\n// packages/ag-grid-community/src/filter/filterModule.ts\nvar ClientSideRowModelFilterModule = {\n moduleName: \"ClientSideRowModelFilter\",\n version: VERSION,\n rowModels: [\"clientSide\"],\n beans: [FilterStage]\n};\nvar FilterCoreModule = {\n moduleName: \"FilterCore\",\n version: VERSION,\n beans: [FilterManager],\n apiFunctions: {\n isAnyFilterPresent,\n onFilterChanged\n },\n css: [column_filters_default],\n dependsOn: [ClientSideRowModelFilterModule]\n};\nvar FilterValueModule = {\n moduleName: \"FilterValue\",\n version: VERSION,\n beans: [FilterValueService]\n};\nvar ColumnFilterModule = {\n moduleName: \"ColumnFilter\",\n version: VERSION,\n beans: [ColumnFilterService, FilterMenuFactory],\n dynamicBeans: { headerFilterCellCtrl: HeaderFilterCellCtrl },\n icons: {\n // open filter button - header, floating filter, menu\n filter: \"filter\",\n // filter is applied - header (legacy column menu), filter tool panel\n filterActive: \"filter\"\n },\n apiFunctions: {\n isColumnFilterPresent,\n getColumnFilterInstance,\n destroyFilter,\n setFilterModel,\n getFilterModel,\n getColumnFilterModel,\n setColumnFilterModel,\n showColumnFilter,\n hideColumnFilter,\n getColumnFilterHandler,\n doFilterAction\n },\n dependsOn: [FilterCoreModule, PopupModule, FilterValueModule, SharedMenuModule]\n};\nvar CustomFilterModule = {\n moduleName: \"CustomFilter\",\n version: VERSION,\n userComponents: { agReadOnlyFloatingFilter: ReadOnlyFloatingFilter },\n dependsOn: [ColumnFilterModule]\n};\nvar TextFilterModule = {\n moduleName: \"TextFilter\",\n version: VERSION,\n dependsOn: [ColumnFilterModule],\n userComponents: {\n agTextColumnFilter: {\n classImp: TextFilter,\n params: {\n useForm: true\n }\n },\n agTextColumnFloatingFilter: TextFloatingFilter\n },\n dynamicBeans: {\n agTextColumnFilterHandler: TextFilterHandler\n }\n};\nvar NumberFilterModule = {\n moduleName: \"NumberFilter\",\n version: VERSION,\n dependsOn: [ColumnFilterModule],\n userComponents: {\n agNumberColumnFilter: {\n classImp: NumberFilter,\n params: {\n useForm: true\n }\n },\n agNumberColumnFloatingFilter: NumberFloatingFilter\n },\n dynamicBeans: {\n agNumberColumnFilterHandler: NumberFilterHandler\n }\n};\nvar BigIntFilterModule = {\n moduleName: \"BigIntFilter\",\n version: VERSION,\n dependsOn: [ColumnFilterModule],\n userComponents: {\n agBigIntColumnFilter: {\n classImp: BigIntFilter,\n params: {\n useForm: true\n }\n },\n agBigIntColumnFloatingFilter: BigIntFloatingFilter\n },\n dynamicBeans: {\n agBigIntColumnFilterHandler: BigIntFilterHandler\n }\n};\nvar DateFilterModule = {\n moduleName: \"DateFilter\",\n version: VERSION,\n dependsOn: [ColumnFilterModule],\n userComponents: {\n agDateColumnFilter: {\n classImp: DateFilter,\n params: {\n useForm: true\n }\n },\n agDateInput: DefaultDateComponent,\n agDateColumnFloatingFilter: DateFloatingFilter\n },\n dynamicBeans: {\n agDateColumnFilterHandler: DateFilterHandler\n }\n};\nvar QuickFilterCoreModule = {\n moduleName: \"QuickFilterCore\",\n version: VERSION,\n rowModels: [\"clientSide\"],\n beans: [QuickFilterService],\n dependsOn: [FilterCoreModule, FilterValueModule]\n};\nvar QuickFilterModule = {\n moduleName: \"QuickFilter\",\n version: VERSION,\n apiFunctions: {\n isQuickFilterPresent,\n getQuickFilter,\n resetQuickFilter\n },\n dependsOn: [QuickFilterCoreModule]\n};\nvar ExternalFilterModule = {\n moduleName: \"ExternalFilter\",\n version: VERSION,\n dependsOn: [FilterCoreModule]\n};\n\n// packages/ag-grid-community/src/infiniteRowModel/infiniteBlock.ts\nvar InfiniteBlock = class extends BeanStub {\n constructor(id, parentCache, params) {\n super();\n this.id = id;\n this.parentCache = parentCache;\n this.params = params;\n this.state = \"needsLoading\";\n this.version = 0;\n this.startRow = id * params.blockSize;\n this.endRow = this.startRow + params.blockSize;\n }\n load() {\n this.state = \"loading\";\n this.loadFromDatasource();\n }\n setStateWaitingToLoad() {\n this.version++;\n this.state = \"needsLoading\";\n }\n pageLoadFailed(version) {\n const requestMostRecentAndLive = this.isRequestMostRecentAndLive(version);\n if (requestMostRecentAndLive) {\n this.state = \"failed\";\n }\n this.dispatchLocalEvent({ type: \"loadComplete\" });\n }\n pageLoaded(version, rows, lastRow) {\n this.successCommon(version, { rowData: rows, rowCount: lastRow });\n }\n isRequestMostRecentAndLive(version) {\n const thisIsMostRecentRequest = version === this.version;\n const weAreNotDestroyed = this.isAlive();\n return thisIsMostRecentRequest && weAreNotDestroyed;\n }\n successCommon(version, params) {\n this.dispatchLocalEvent({ type: \"loadComplete\" });\n const requestMostRecentAndLive = this.isRequestMostRecentAndLive(version);\n if (requestMostRecentAndLive) {\n this.state = \"loaded\";\n this.processServerResult(params);\n }\n }\n postConstruct() {\n this.rowNodes = [];\n const {\n params: { blockSize, rowHeight },\n startRow,\n beans,\n rowNodes\n } = this;\n for (let i = 0; i < blockSize; i++) {\n const rowIndex = startRow + i;\n const rowNode = new RowNode(beans);\n rowNode.setRowHeight(rowHeight);\n rowNode.uiLevel = 0;\n rowNode.setRowIndex(rowIndex);\n rowNode.setRowTop(rowHeight * rowIndex);\n rowNodes.push(rowNode);\n }\n }\n getBlockStateJson() {\n const { id, startRow, endRow, state: pageStatus } = this;\n return {\n id: \"\" + id,\n state: {\n blockNumber: id,\n startRow,\n endRow,\n pageStatus\n }\n };\n }\n setDataAndId(rowNode, data, index) {\n if (_exists(data)) {\n rowNode.setDataAndId(data, index.toString());\n } else {\n rowNode.setDataAndId(void 0, void 0);\n }\n }\n loadFromDatasource() {\n const params = this.createLoadParams();\n if (_missing(this.params.datasource.getRows)) {\n _warn(90);\n return;\n }\n window.setTimeout(() => {\n this.params.datasource.getRows(params);\n }, 0);\n }\n createLoadParams() {\n const {\n startRow,\n endRow,\n version,\n params: { sortModel, filterModel },\n gos\n } = this;\n const params = _addGridCommonParams(gos, {\n startRow,\n endRow,\n successCallback: this.pageLoaded.bind(this, version),\n failCallback: this.pageLoadFailed.bind(this, version),\n sortModel,\n filterModel\n });\n return params;\n }\n forEachNode(callback, sequence, rowCount) {\n this.rowNodes.forEach((rowNode, index) => {\n const rowIndex = this.startRow + index;\n if (rowIndex < rowCount) {\n callback(rowNode, sequence.value++);\n }\n });\n }\n getRow(rowIndex, dontTouchLastAccessed = false) {\n if (!dontTouchLastAccessed) {\n this.lastAccessed = this.params.lastAccessedSequence.value++;\n }\n const localIndex = rowIndex - this.startRow;\n return this.rowNodes[localIndex];\n }\n processServerResult(params) {\n const { rowNodes, beans } = this;\n rowNodes.forEach((rowNode, index) => {\n const data = params.rowData ? params.rowData[index] : void 0;\n if (!rowNode.id && rowNode.alreadyRendered && data) {\n rowNodes[index] = new RowNode(beans);\n rowNodes[index].setRowIndex(rowNode.rowIndex);\n rowNodes[index].setRowTop(rowNode.rowTop);\n rowNodes[index].setRowHeight(rowNode.rowHeight);\n rowNode._destroy(true);\n }\n this.setDataAndId(rowNodes[index], data, this.startRow + index);\n });\n const finalRowCount = params.rowCount != null && params.rowCount >= 0 ? params.rowCount : void 0;\n this.parentCache.pageLoaded(this, finalRowCount);\n }\n destroy() {\n const rowNodes = this.rowNodes;\n for (let i = 0, len = rowNodes.length; i < len; i++) {\n rowNodes[i]._destroy(false);\n }\n rowNodes.length = 0;\n super.destroy();\n }\n};\n\n// packages/ag-grid-community/src/infiniteRowModel/infiniteCache.ts\nvar MAX_EMPTY_BLOCKS_TO_KEEP = 2;\nvar InfiniteCache = class extends BeanStub {\n constructor(params) {\n super();\n this.params = params;\n this.lastRowIndexKnown = false;\n this.blocks = {};\n this.blockCount = 0;\n this.rowCount = params.initialRowCount;\n }\n // the rowRenderer will not pass dontCreatePage, meaning when rendering the grid,\n // it will want new pages in the cache as it asks for rows. only when we are inserting /\n // removing rows via the api is dontCreatePage set, where we move rows between the pages.\n getRow(rowIndex, dontCreatePage = false) {\n const blockId = Math.floor(rowIndex / this.params.blockSize);\n let block = this.blocks[blockId];\n if (!block) {\n if (dontCreatePage) {\n return void 0;\n }\n block = this.createBlock(blockId);\n }\n return block.getRow(rowIndex);\n }\n createBlock(blockNumber) {\n const params = this.params;\n const newBlock = this.createBean(new InfiniteBlock(blockNumber, this, params));\n this.blocks[newBlock.id] = newBlock;\n this.blockCount++;\n this.purgeBlocksIfNeeded(newBlock);\n params.rowNodeBlockLoader.addBlock(newBlock);\n return newBlock;\n }\n // we have this on infinite row model only, not server side row model,\n // because for server side, it would leave the children in inconsistent\n // state - eg if a node had children, but after the refresh it had data\n // for a different row, then the children would be with the wrong row node.\n refreshCache() {\n const nothingToRefresh = this.blockCount == 0;\n if (nothingToRefresh) {\n this.purgeCache();\n return;\n }\n for (const block of this.getBlocksInOrder()) {\n block.setStateWaitingToLoad();\n }\n this.params.rowNodeBlockLoader.checkBlockToLoad();\n }\n destroy() {\n for (const block of this.getBlocksInOrder()) {\n this.destroyBlock(block);\n }\n super.destroy();\n }\n getRowCount() {\n return this.rowCount;\n }\n isLastRowIndexKnown() {\n return this.lastRowIndexKnown;\n }\n // block calls this, when page loaded\n pageLoaded(block, lastRow) {\n if (!this.isAlive()) {\n return;\n }\n _logIfDebug(this.gos, `InfiniteCache - onPageLoaded: page = ${block.id}, lastRow = ${lastRow}`);\n this.checkRowCount(block, lastRow);\n this.onCacheUpdated();\n }\n purgeBlocksIfNeeded(blockToExclude) {\n const blocksForPurging = this.getBlocksInOrder().filter((b) => b != blockToExclude);\n const lastAccessedComparator = (a, b) => b.lastAccessed - a.lastAccessed;\n blocksForPurging.sort(lastAccessedComparator);\n const maxBlocksProvided = this.params.maxBlocksInCache > 0;\n const blocksToKeep = maxBlocksProvided ? this.params.maxBlocksInCache - 1 : null;\n const emptyBlocksToKeep = MAX_EMPTY_BLOCKS_TO_KEEP - 1;\n blocksForPurging.forEach((block, index) => {\n const purgeBecauseBlockEmpty = block.state === \"needsLoading\" && index >= emptyBlocksToKeep;\n const purgeBecauseCacheFull = maxBlocksProvided ? index >= blocksToKeep : false;\n if (purgeBecauseBlockEmpty || purgeBecauseCacheFull) {\n if (this.isBlockCurrentlyDisplayed(block)) {\n return;\n }\n if (this.isBlockFocused(block)) {\n return;\n }\n this.removeBlockFromCache(block);\n }\n });\n }\n isBlockFocused(block) {\n const focusedCell = this.beans.focusSvc.getFocusCellToUseAfterRefresh();\n if (!focusedCell) {\n return false;\n }\n if (focusedCell.rowPinned != null) {\n return false;\n }\n const { startRow, endRow } = block;\n const hasFocus = focusedCell.rowIndex >= startRow && focusedCell.rowIndex < endRow;\n return hasFocus;\n }\n isBlockCurrentlyDisplayed(block) {\n const { startRow, endRow } = block;\n return this.beans.rowRenderer.isRangeInRenderedViewport(startRow, endRow - 1);\n }\n removeBlockFromCache(blockToRemove) {\n if (!blockToRemove) {\n return;\n }\n this.destroyBlock(blockToRemove);\n }\n checkRowCount(block, lastRow) {\n if (typeof lastRow === \"number\" && lastRow >= 0) {\n this.rowCount = lastRow;\n this.lastRowIndexKnown = true;\n } else if (!this.lastRowIndexKnown) {\n const { blockSize, overflowSize } = this.params;\n const lastRowIndex = (block.id + 1) * blockSize;\n const lastRowIndexPlusOverflow = lastRowIndex + overflowSize;\n if (this.rowCount < lastRowIndexPlusOverflow) {\n this.rowCount = lastRowIndexPlusOverflow;\n }\n }\n }\n setRowCount(rowCount, lastRowIndexKnown) {\n this.rowCount = rowCount;\n if (_exists(lastRowIndexKnown)) {\n this.lastRowIndexKnown = lastRowIndexKnown;\n }\n if (!this.lastRowIndexKnown) {\n if (this.rowCount % this.params.blockSize === 0) {\n this.rowCount++;\n }\n }\n this.onCacheUpdated();\n }\n forEachNodeDeep(callback) {\n const sequence = { value: 0 };\n for (const block of this.getBlocksInOrder()) {\n block.forEachNode(callback, sequence, this.rowCount);\n }\n }\n getBlocksInOrder() {\n const blockComparator = (a, b) => a.id - b.id;\n const blocks = Object.values(this.blocks).sort(blockComparator);\n return blocks;\n }\n destroyBlock(block) {\n delete this.blocks[block.id];\n this.destroyBean(block);\n this.blockCount--;\n this.params.rowNodeBlockLoader.removeBlock(block);\n }\n // gets called 1) row count changed 2) cache purged 3) items inserted\n onCacheUpdated() {\n if (this.isAlive()) {\n this.destroyAllBlocksPastVirtualRowCount();\n this.eventSvc.dispatchEvent({\n type: \"storeUpdated\"\n });\n }\n }\n destroyAllBlocksPastVirtualRowCount() {\n const blocksToDestroy = [];\n for (const block of this.getBlocksInOrder()) {\n const startRow = block.id * this.params.blockSize;\n if (startRow >= this.rowCount) {\n blocksToDestroy.push(block);\n }\n }\n if (blocksToDestroy.length > 0) {\n for (const block of blocksToDestroy) {\n this.destroyBlock(block);\n }\n }\n }\n purgeCache() {\n for (const block of this.getBlocksInOrder()) {\n this.removeBlockFromCache(block);\n }\n this.lastRowIndexKnown = false;\n if (this.rowCount === 0) {\n this.rowCount = this.params.initialRowCount;\n }\n this.onCacheUpdated();\n }\n getRowNodesInRange(firstInRange, lastInRange) {\n const result = [];\n let lastBlockId = -1;\n let inActiveRange = false;\n const numberSequence = { value: 0 };\n let foundGapInSelection = false;\n for (const block of this.getBlocksInOrder()) {\n if (foundGapInSelection) {\n continue;\n }\n if (inActiveRange && lastBlockId + 1 !== block.id) {\n foundGapInSelection = true;\n continue;\n }\n lastBlockId = block.id;\n block.forEachNode(\n (rowNode) => {\n const hitFirstOrLast = rowNode === firstInRange || rowNode === lastInRange;\n if (inActiveRange || hitFirstOrLast) {\n result.push(rowNode);\n }\n if (hitFirstOrLast) {\n inActiveRange = !inActiveRange;\n }\n },\n numberSequence,\n this.rowCount\n );\n }\n const invalidRange = foundGapInSelection || inActiveRange;\n return invalidRange ? [] : result;\n }\n};\n\n// packages/ag-grid-community/src/infiniteRowModel/infiniteRowModel.ts\nvar InfiniteRowModel = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"rowModel\";\n /** Dummy root node */\n this.rootNode = null;\n this.hierarchical = false;\n }\n getRowBounds(index) {\n return {\n rowHeight: this.rowHeight,\n rowTop: this.rowHeight * index\n };\n }\n // we don't implement as lazy row heights is not supported in this row model\n ensureRowHeightsValid() {\n return false;\n }\n postConstruct() {\n if (this.gos.get(\"rowModelType\") !== \"infinite\") {\n return;\n }\n const beans = this.beans;\n const rootNode = new RowNode(beans);\n this.rootNode = rootNode;\n rootNode.level = -1;\n this.rowHeight = _getRowHeightAsNumber(beans);\n this.addEventListeners();\n this.addDestroyFunc(() => this.destroyCache());\n }\n start() {\n this.setDatasource(this.gos.get(\"datasource\"));\n }\n destroy() {\n this.destroyDatasource();\n super.destroy();\n this.rootNode = null;\n }\n destroyDatasource() {\n if (this.datasource) {\n this.destroyBean(this.datasource);\n this.beans.rowRenderer.datasourceChanged();\n this.datasource = null;\n }\n }\n addEventListeners() {\n this.addManagedEventListeners({\n filterChanged: this.reset.bind(this),\n sortChanged: this.reset.bind(this),\n newColumnsLoaded: this.onColumnEverything.bind(this),\n storeUpdated: this.dispatchModelUpdatedEvent.bind(this)\n });\n this.addManagedPropertyListener(\"datasource\", () => this.setDatasource(this.gos.get(\"datasource\")));\n this.addManagedPropertyListener(\"cacheBlockSize\", () => this.resetCache());\n this.addManagedPropertyListener(\"rowHeight\", () => {\n this.rowHeight = _getRowHeightAsNumber(this.beans);\n this.cacheParams.rowHeight = this.rowHeight;\n this.updateRowHeights();\n });\n }\n onColumnEverything() {\n let resetRequired;\n if (this.cacheParams) {\n resetRequired = !_jsonEquals(this.cacheParams.sortModel, this.beans.sortSvc?.getSortModel() ?? []);\n } else {\n resetRequired = true;\n }\n if (resetRequired) {\n this.reset();\n }\n }\n getType() {\n return \"infinite\";\n }\n setDatasource(datasource) {\n this.destroyDatasource();\n this.datasource = datasource;\n if (datasource) {\n this.reset();\n }\n }\n isEmpty() {\n return !this.infiniteCache;\n }\n isRowsToRender() {\n return !!this.infiniteCache;\n }\n getOverlayType() {\n const cache = this.infiniteCache;\n if (cache?.getRowCount() === 0) {\n return this.beans.filterManager?.isAnyFilterPresent() ? \"noMatchingRows\" : \"noRows\";\n }\n return null;\n }\n getNodesInRangeForSelection(firstInRange, lastInRange) {\n return this.infiniteCache?.getRowNodesInRange(firstInRange, lastInRange) ?? [];\n }\n reset() {\n if (!this.datasource) {\n return;\n }\n const getRowIdFunc = _getRowIdCallback(this.gos);\n const userGeneratingIds = getRowIdFunc != null;\n if (!userGeneratingIds) {\n this.beans.selectionSvc?.reset(\"rowDataChanged\");\n }\n this.resetCache();\n }\n dispatchModelUpdatedEvent() {\n this.eventSvc.dispatchEvent({\n type: \"modelUpdated\",\n // not sure if these should all be false - noticed if after implementing,\n // maybe they should be true?\n newPage: false,\n newPageSize: false,\n newData: false,\n keepRenderedRows: true,\n animate: false\n });\n }\n resetCache() {\n this.destroyCache();\n const beans = this.beans;\n const { filterManager, sortSvc, rowNodeBlockLoader, eventSvc, gos } = beans;\n this.cacheParams = {\n // the user provided datasource\n datasource: this.datasource,\n // sort and filter model\n filterModel: filterManager?.getFilterModel() ?? {},\n sortModel: sortSvc?.getSortModel() ?? [],\n rowNodeBlockLoader,\n // properties - this way we take a snapshot of them, so if user changes any, they will be\n // used next time we create a new cache, which is generally after a filter or sort change,\n // or a new datasource is set\n initialRowCount: gos.get(\"infiniteInitialRowCount\"),\n maxBlocksInCache: gos.get(\"maxBlocksInCache\"),\n rowHeight: _getRowHeightAsNumber(beans),\n // if user doesn't provide overflow, we use default overflow of 1, so user can scroll past\n // the current page and request first row of next page\n overflowSize: gos.get(\"cacheOverflowSize\"),\n // page size needs to be 1 or greater. having it at 1 would be silly, as you would be hitting the\n // server for one page at a time. so the default if not specified is 100.\n blockSize: gos.get(\"cacheBlockSize\"),\n // the cache could create this, however it is also used by the pages, so handy to create it\n // here as the settings are also passed to the pages\n lastAccessedSequence: { value: 0 }\n };\n this.infiniteCache = this.createBean(new InfiniteCache(this.cacheParams));\n eventSvc.dispatchEventOnce({\n type: \"rowCountReady\"\n });\n this.dispatchModelUpdatedEvent();\n }\n updateRowHeights() {\n this.forEachNode((node) => {\n node.setRowHeight(this.rowHeight);\n node.setRowTop(this.rowHeight * node.rowIndex);\n });\n this.dispatchModelUpdatedEvent();\n }\n destroyCache() {\n this.infiniteCache = this.destroyBean(this.infiniteCache);\n }\n getRow(rowIndex) {\n const infiniteCache = this.infiniteCache;\n if (!infiniteCache) {\n return void 0;\n }\n if (rowIndex >= infiniteCache.getRowCount()) {\n return void 0;\n }\n return infiniteCache.getRow(rowIndex);\n }\n getRowNode(id) {\n let result;\n this.forEachNode((rowNode) => {\n if (rowNode.id === id) {\n result = rowNode;\n }\n });\n return result;\n }\n forEachNode(callback) {\n this.infiniteCache?.forEachNodeDeep(callback);\n }\n getTopLevelRowCount() {\n return this.getRowCount();\n }\n getTopLevelRowDisplayedIndex(topLevelIndex) {\n return topLevelIndex;\n }\n getRowIndexAtPixel(pixel) {\n if (this.rowHeight !== 0) {\n const rowIndexForPixel = Math.floor(pixel / this.rowHeight);\n const lastRowIndex = this.getRowCount() - 1;\n if (rowIndexForPixel > lastRowIndex) {\n return lastRowIndex;\n }\n return rowIndexForPixel;\n }\n return 0;\n }\n getRowCount() {\n return this.infiniteCache ? this.infiniteCache.getRowCount() : 0;\n }\n isRowPresent(rowNode) {\n return !!this.getRowNode(rowNode.id);\n }\n refreshCache() {\n this.infiniteCache?.refreshCache();\n }\n purgeCache() {\n this.infiniteCache?.purgeCache();\n }\n // for iRowModel\n isLastRowIndexKnown() {\n return this.infiniteCache?.isLastRowIndexKnown() ?? false;\n }\n setRowCount(rowCount, lastRowIndexKnown) {\n this.infiniteCache?.setRowCount(rowCount, lastRowIndexKnown);\n }\n resetRowHeights() {\n }\n onRowHeightChanged() {\n }\n};\n\n// packages/ag-grid-community/src/infiniteRowModel/infiniteRowModelApi.ts\nfunction refreshInfiniteCache(beans) {\n _getInfiniteRowModel(beans)?.refreshCache();\n}\nfunction purgeInfiniteCache(beans) {\n _getInfiniteRowModel(beans)?.purgeCache();\n}\nfunction getInfiniteRowCount(beans) {\n return _getInfiniteRowModel(beans)?.getRowCount();\n}\n\n// packages/ag-grid-community/src/infiniteRowModel/rowNodeBlockLoader.ts\nvar RowNodeBlockLoader = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"rowNodeBlockLoader\";\n this.activeBlockLoadsCount = 0;\n this.blocks = [];\n this.active = true;\n }\n postConstruct() {\n this.maxConcurrentRequests = _getMaxConcurrentDatasourceRequests(this.gos);\n const blockLoadDebounceMillis = this.gos.get(\"blockLoadDebounceMillis\");\n if (blockLoadDebounceMillis && blockLoadDebounceMillis > 0) {\n this.checkBlockToLoadDebounce = _debounce(\n this,\n this.performCheckBlocksToLoad.bind(this),\n blockLoadDebounceMillis\n );\n }\n }\n addBlock(block) {\n this.blocks.push(block);\n block.addEventListener(\"loadComplete\", this.loadComplete.bind(this));\n this.checkBlockToLoad();\n }\n removeBlock(block) {\n _removeFromArray(this.blocks, block);\n }\n destroy() {\n super.destroy();\n this.active = false;\n }\n loadComplete() {\n this.activeBlockLoadsCount--;\n this.checkBlockToLoad();\n }\n checkBlockToLoad() {\n if (this.checkBlockToLoadDebounce) {\n this.checkBlockToLoadDebounce();\n } else {\n this.performCheckBlocksToLoad();\n }\n }\n performCheckBlocksToLoad() {\n if (!this.active) {\n return;\n }\n this.printCacheStatus();\n if (this.maxConcurrentRequests != null && this.activeBlockLoadsCount >= this.maxConcurrentRequests) {\n _logIfDebug(this.gos, `RowNodeBlockLoader - checkBlockToLoad: max loads exceeded`);\n return;\n }\n const loadAvailability = this.maxConcurrentRequests != null ? this.maxConcurrentRequests - this.activeBlockLoadsCount : 1;\n const blocksToLoad = this.blocks.filter((block) => block.state === \"needsLoading\").slice(0, loadAvailability);\n this.activeBlockLoadsCount += blocksToLoad.length;\n for (const block of blocksToLoad) {\n block.load();\n }\n this.printCacheStatus();\n }\n getBlockState() {\n const result = {};\n this.blocks.forEach((block) => {\n const { id, state } = block.getBlockStateJson();\n result[id] = state;\n });\n return result;\n }\n printCacheStatus() {\n _logIfDebug(\n this.gos,\n `RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`\n );\n }\n};\n\n// packages/ag-grid-community/src/infiniteRowModel/infiniteRowModelModule.ts\nvar InfiniteRowModelCoreModule = {\n moduleName: \"InfiniteRowModelCore\",\n version: VERSION,\n rowModels: [\"infinite\"],\n beans: [InfiniteRowModel, RowNodeBlockLoader]\n};\nvar InfiniteRowModelModule = {\n moduleName: \"InfiniteRowModel\",\n version: VERSION,\n apiFunctions: {\n refreshInfiniteCache,\n purgeInfiniteCache,\n getInfiniteRowCount\n },\n dependsOn: [InfiniteRowModelCoreModule, SsrmInfiniteSharedApiModule]\n};\n\n// packages/ag-grid-community/src/misc/apiEvents/apiEventService.ts\nvar ApiEventService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"apiEventSvc\";\n this.syncListeners = /* @__PURE__ */ new Map();\n this.asyncListeners = /* @__PURE__ */ new Map();\n this.syncGlobalListeners = /* @__PURE__ */ new Set();\n this.globalListenerPairs = /* @__PURE__ */ new Map();\n }\n postConstruct() {\n this.wrapSvc = this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.();\n }\n addListener(eventType, userListener) {\n const listener = this.wrapSvc?.wrap(eventType, userListener) ?? userListener;\n const async = !ALWAYS_SYNC_GLOBAL_EVENTS.has(eventType);\n const listeners = async ? this.asyncListeners : this.syncListeners;\n if (!listeners.has(eventType)) {\n listeners.set(eventType, /* @__PURE__ */ new Set());\n }\n listeners.get(eventType).add(listener);\n this.eventSvc.addListener(eventType, listener, async);\n }\n removeListener(eventType, userListener) {\n const listener = this.wrapSvc?.unwrap(eventType, userListener) ?? userListener;\n const asyncListeners = this.asyncListeners.get(eventType);\n const hasAsync = !!asyncListeners?.delete(listener);\n if (!hasAsync) {\n this.syncListeners.get(eventType)?.delete(listener);\n }\n this.eventSvc.removeListener(eventType, listener, hasAsync);\n }\n addGlobalListener(userListener) {\n const listener = this.wrapSvc?.wrapGlobal(userListener) ?? userListener;\n const syncListener = (eventType, event) => {\n if (ALWAYS_SYNC_GLOBAL_EVENTS.has(eventType)) {\n listener(eventType, event);\n }\n };\n const asyncListener = (eventType, event) => {\n if (!ALWAYS_SYNC_GLOBAL_EVENTS.has(eventType)) {\n listener(eventType, event);\n }\n };\n this.globalListenerPairs.set(userListener, { syncListener, asyncListener });\n const eventSvc = this.eventSvc;\n eventSvc.addGlobalListener(syncListener, false);\n eventSvc.addGlobalListener(asyncListener, true);\n }\n removeGlobalListener(userListener) {\n const { eventSvc, wrapSvc, globalListenerPairs } = this;\n const listener = wrapSvc?.unwrapGlobal(userListener) ?? userListener;\n const hasAsync = globalListenerPairs.has(listener);\n if (hasAsync) {\n const { syncListener, asyncListener } = globalListenerPairs.get(listener);\n eventSvc.removeGlobalListener(syncListener, false);\n eventSvc.removeGlobalListener(asyncListener, true);\n globalListenerPairs.delete(userListener);\n } else {\n this.syncGlobalListeners.delete(listener);\n eventSvc.removeGlobalListener(listener, false);\n }\n }\n destroyEventListeners(map, async) {\n map.forEach((listeners, eventType) => {\n listeners.forEach((listener) => this.eventSvc.removeListener(eventType, listener, async));\n listeners.clear();\n });\n map.clear();\n }\n destroyGlobalListeners(set, async) {\n for (const listener of set) {\n this.eventSvc.removeGlobalListener(listener, async);\n }\n set.clear();\n }\n destroy() {\n super.destroy();\n this.destroyEventListeners(this.syncListeners, false);\n this.destroyEventListeners(this.asyncListeners, true);\n this.destroyGlobalListeners(this.syncGlobalListeners, false);\n const { globalListenerPairs, eventSvc } = this;\n globalListenerPairs.forEach(({ syncListener, asyncListener }) => {\n eventSvc.removeGlobalListener(syncListener, false);\n eventSvc.removeGlobalListener(asyncListener, true);\n });\n globalListenerPairs.clear();\n }\n};\n\n// packages/ag-grid-community/src/misc/apiEvents/eventApi.ts\nfunction addEventListener(beans, eventType, listener) {\n beans.apiEventSvc?.addListener(eventType, listener);\n}\nfunction removeEventListener(beans, eventType, listener) {\n beans.apiEventSvc?.removeListener(eventType, listener);\n}\nfunction addGlobalListener(beans, listener) {\n beans.apiEventSvc?.addGlobalListener(listener);\n}\nfunction removeGlobalListener(beans, listener) {\n beans.apiEventSvc?.removeGlobalListener(listener);\n}\n\n// packages/ag-grid-community/src/misc/apiEvents/apiEventModule.ts\nvar EventApiModule = {\n moduleName: \"EventApi\",\n version: VERSION,\n apiFunctions: {\n addEventListener,\n addGlobalListener,\n removeEventListener,\n removeGlobalListener\n },\n beans: [ApiEventService]\n};\n\n// packages/ag-grid-community/src/misc/locale/localeService.ts\nvar LocaleService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"localeSvc\";\n }\n getLocaleTextFunc() {\n const gos = this.gos;\n const getLocaleText = gos.getCallback(\"getLocaleText\");\n if (getLocaleText) {\n return _getLocaleTextFromFunc(getLocaleText);\n }\n return _getLocaleTextFromMap(gos.get(\"localeText\"));\n }\n};\n\n// packages/ag-grid-community/src/misc/locale/localeModule.ts\nvar LocaleModule = {\n moduleName: \"Locale\",\n version: VERSION,\n beans: [LocaleService]\n};\n\n// packages/ag-grid-community/src/misc/state/stateApi.ts\nfunction getState(beans) {\n return beans.stateSvc?.getState() ?? {};\n}\nfunction setState(beans, state, propertiesToIgnore) {\n return beans.stateSvc?.setState(state, propertiesToIgnore);\n}\n\n// packages/ag-grid-community/src/misc/state/stateModelMigration.ts\nfunction migrateGridStateModel(state) {\n state = { ...state };\n if (!state.version) {\n state.version = \"32.1.0\";\n }\n if (state.version === \"32.1.0\") {\n state = migrateV32_1(state);\n }\n state.version = VERSION;\n return state;\n}\nfunction migrateV32_1(state) {\n state.cellSelection = jsonGet(state, \"rangeSelection\");\n return state;\n}\nfunction jsonGet(json, key) {\n if (json && typeof json === \"object\") {\n return json[key];\n }\n}\n\n// packages/ag-grid-community/src/misc/state/stateService.ts\nvar StateService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"stateSvc\";\n this.updateRowGroupExpansionStateTimer = 0;\n this.suppressEvents = true;\n this.queuedUpdateSources = /* @__PURE__ */ new Set();\n this.dispatchStateUpdateEventDebounced = _debounce(\n this,\n () => this.dispatchQueuedStateUpdateEvents(),\n 0\n );\n // If user is doing a manual expand all node by node, we don't want to process one at a time.\n // EVENT_ROW_GROUP_OPENED is already async, so no impact of making the state async here.\n this.onRowGroupOpenedDebounced = _debounce(this, () => this.updateGroupExpansionState(), 0);\n // similar to row expansion, want to debounce. However, selection is synchronous, so need to mark as stale in case `getState` is called.\n this.onRowSelectedDebounced = _debounce(\n this,\n () => {\n this.staleStateKeys.delete(\"rowSelection\");\n this.updateCachedState(\"rowSelection\", this.getRowSelectionState());\n },\n 0\n );\n this.staleStateKeys = /* @__PURE__ */ new Set();\n }\n postConstruct() {\n const { gos, ctrlsSvc, colDelayRenderSvc } = this.beans;\n this.isClientSideRowModel = _isClientSideRowModel(gos);\n const initialState = migrateGridStateModel(gos.get(\"initialState\") ?? {});\n const partialColumnState = initialState.partialColumnState;\n delete initialState.partialColumnState;\n this.cachedState = initialState;\n const suppressEventsAndDispatchInitEvent = this.suppressEventsAndDispatchInitEvent.bind(this);\n ctrlsSvc.whenReady(\n this,\n () => suppressEventsAndDispatchInitEvent(() => this.setupStateOnGridReady(initialState))\n );\n if (initialState.columnOrder || initialState.columnVisibility || initialState.columnSizing || initialState.columnPinning || initialState.columnGroup) {\n colDelayRenderSvc?.hideColumns(\"columnState\");\n }\n const [newColumnsLoadedDestroyFunc, rowCountReadyDestroyFunc, firstDataRenderedDestroyFunc] = this.addManagedEventListeners({\n newColumnsLoaded: ({ source }) => {\n if (source === \"gridInitializing\") {\n newColumnsLoadedDestroyFunc();\n suppressEventsAndDispatchInitEvent(() => {\n this.setupStateOnColumnsInitialised(initialState, !!partialColumnState);\n colDelayRenderSvc?.revealColumns(\"columnState\");\n });\n }\n },\n rowCountReady: () => {\n rowCountReadyDestroyFunc?.();\n suppressEventsAndDispatchInitEvent(() => this.setupStateOnRowCountReady(initialState));\n },\n firstDataRendered: () => {\n firstDataRenderedDestroyFunc?.();\n suppressEventsAndDispatchInitEvent(() => this.setupStateOnFirstDataRendered(initialState));\n }\n });\n }\n destroy() {\n super.destroy();\n clearTimeout(this.updateRowGroupExpansionStateTimer);\n this.queuedUpdateSources.clear();\n }\n getState() {\n if (this.staleStateKeys.size) {\n this.refreshStaleState();\n }\n return this.cachedState;\n }\n setState(providedState, propertiesToIgnore) {\n const state = migrateGridStateModel(providedState);\n delete state.partialColumnState;\n this.cachedState = state;\n this.startSuppressEvents();\n const source = \"api\";\n const ignoreSet = propertiesToIgnore ? new Set(propertiesToIgnore) : void 0;\n this.setGridReadyState(state, source, ignoreSet);\n this.setColumnsInitialisedState(state, source, !!ignoreSet, ignoreSet);\n this.setRowCountState(state, source, ignoreSet);\n setTimeout(() => {\n if (this.isAlive()) {\n this.setFirstDataRenderedState(state, source, ignoreSet);\n }\n this.stopSuppressEvents(source);\n });\n }\n setGridReadyState(state, source, ignoreSet) {\n if (source === \"api\" && !ignoreSet?.has(\"sideBar\")) {\n this.beans.sideBar?.comp?.setState(state.sideBar);\n }\n this.updateCachedState(\"sideBar\", this.getSideBarState());\n }\n setupStateOnGridReady(initialState) {\n this.setGridReadyState(initialState, \"gridInitializing\");\n const stateUpdater = () => this.updateCachedState(\"sideBar\", this.getSideBarState());\n this.addManagedEventListeners({\n toolPanelVisibleChanged: stateUpdater,\n sideBarUpdated: stateUpdater\n });\n }\n updateColumnAndGroupState() {\n this.updateColumnState([\n \"aggregation\",\n \"columnOrder\",\n \"columnPinning\",\n \"columnSizing\",\n \"columnVisibility\",\n \"pivot\",\n \"rowGroup\",\n \"sort\"\n ]);\n this.updateCachedState(\"columnGroup\", this.getColumnGroupState());\n }\n setColumnsInitialisedState(state, source, partialColumnState, ignoreSet) {\n this.setColumnState(state, source, partialColumnState, ignoreSet);\n this.setColumnGroupState(state, source, ignoreSet);\n this.updateColumnAndGroupState();\n }\n setupStateOnColumnsInitialised(initialState, partialColumnState) {\n this.setColumnsInitialisedState(initialState, \"gridInitializing\", partialColumnState);\n const onUpdate = (state) => () => this.updateColumnState([state]);\n this.addManagedEventListeners({\n columnValueChanged: onUpdate(\"aggregation\"),\n columnMoved: onUpdate(\"columnOrder\"),\n columnPinned: onUpdate(\"columnPinning\"),\n columnResized: onUpdate(\"columnSizing\"),\n columnVisible: onUpdate(\"columnVisibility\"),\n columnPivotChanged: onUpdate(\"pivot\"),\n columnPivotModeChanged: onUpdate(\"pivot\"),\n columnRowGroupChanged: onUpdate(\"rowGroup\"),\n sortChanged: onUpdate(\"sort\"),\n newColumnsLoaded: ({ source }) => {\n this.updateColumnAndGroupState();\n if (source !== \"gridInitializing\" && this.isClientSideRowModel) {\n this.onRowGroupOpenedDebounced();\n }\n },\n columnGroupOpened: () => this.updateCachedState(\"columnGroup\", this.getColumnGroupState())\n });\n }\n setRowCountState(state, source, ignoreSet) {\n const {\n filter: filterState,\n rowGroupExpansion: rowGroupExpansionState,\n ssrmRowGroupExpansion,\n rowSelection: rowSelectionState,\n pagination: paginationState,\n rowPinning\n } = state;\n const shouldSetState = (prop, propState) => !ignoreSet?.has(prop) && (propState || source === \"api\");\n if (shouldSetState(\"filter\", filterState)) {\n this.setFilterState(filterState);\n }\n if (shouldSetState(\"rowGroupExpansion\", rowGroupExpansionState) || shouldSetState(\"ssrmRowGroupExpansion\", ssrmRowGroupExpansion)) {\n this.setRowGroupExpansionState(ssrmRowGroupExpansion, rowGroupExpansionState, source);\n }\n if (shouldSetState(\"rowSelection\", rowSelectionState)) {\n this.setRowSelectionState(rowSelectionState, source);\n }\n if (shouldSetState(\"pagination\", paginationState)) {\n this.setPaginationState(paginationState, source);\n }\n if (shouldSetState(\"rowPinning\", rowPinning)) {\n this.setRowPinningState(rowPinning);\n }\n const updateCachedState = this.updateCachedState.bind(this);\n updateCachedState(\"filter\", this.getFilterState());\n this.updateGroupExpansionState();\n updateCachedState(\"rowSelection\", this.getRowSelectionState());\n updateCachedState(\"pagination\", this.getPaginationState());\n }\n setupStateOnRowCountReady(initialState) {\n this.setRowCountState(initialState, \"gridInitializing\");\n const updateCachedState = this.updateCachedState.bind(this);\n const updateRowGroupExpansionState = () => {\n this.updateRowGroupExpansionStateTimer = 0;\n this.updateGroupExpansionState();\n };\n const updateFilterState = () => updateCachedState(\"filter\", this.getFilterState());\n const { gos, colFilter, selectableFilter } = this.beans;\n this.addManagedEventListeners({\n filterChanged: updateFilterState,\n rowExpansionStateChanged: this.onRowGroupOpenedDebounced,\n expandOrCollapseAll: updateRowGroupExpansionState,\n // `groupDefaultExpanded`/`isGroupOpenByDefault` updates expansion state without an expansion event\n columnRowGroupChanged: updateRowGroupExpansionState,\n rowDataUpdated: () => {\n if (gos.get(\"groupDefaultExpanded\") !== 0 || gos.get(\"isGroupOpenByDefault\")) {\n this.updateRowGroupExpansionStateTimer || (this.updateRowGroupExpansionStateTimer = setTimeout(updateRowGroupExpansionState));\n }\n },\n selectionChanged: () => {\n this.staleStateKeys.add(\"rowSelection\");\n this.onRowSelectedDebounced();\n },\n paginationChanged: (event) => {\n if (event.newPage || event.newPageSize) {\n updateCachedState(\"pagination\", this.getPaginationState());\n }\n },\n pinnedRowsChanged: () => updateCachedState(\"rowPinning\", this.getRowPinningState())\n });\n if (colFilter) {\n this.addManagedListeners(colFilter, {\n filterStateChanged: updateFilterState\n });\n }\n if (selectableFilter) {\n this.addManagedListeners(selectableFilter, {\n selectedFilterChanged: updateFilterState\n });\n }\n }\n setFirstDataRenderedState(state, source, ignoreSet) {\n const {\n scroll: scrollState,\n cellSelection: cellSelectionState,\n focusedCell: focusedCellState,\n columnOrder: columnOrderState\n } = state;\n const shouldSetState = (prop, propState) => !ignoreSet?.has(prop) && (propState || source === \"api\");\n if (shouldSetState(\"focusedCell\", focusedCellState)) {\n this.setFocusedCellState(focusedCellState);\n }\n if (shouldSetState(\"cellSelection\", cellSelectionState)) {\n this.setCellSelectionState(cellSelectionState);\n }\n if (shouldSetState(\"scroll\", scrollState)) {\n this.setScrollState(scrollState);\n }\n this.setColumnPivotState(!!columnOrderState?.orderedColIds, source);\n const updateCachedState = this.updateCachedState.bind(this);\n updateCachedState(\"sideBar\", this.getSideBarState());\n updateCachedState(\"focusedCell\", this.getFocusedCellState());\n const cellSelection = this.getRangeSelectionState();\n updateCachedState(\"rangeSelection\", cellSelection);\n updateCachedState(\"cellSelection\", cellSelection);\n updateCachedState(\"scroll\", this.getScrollState());\n }\n setupStateOnFirstDataRendered(initialState) {\n this.setFirstDataRenderedState(initialState, \"gridInitializing\");\n const updateCachedState = this.updateCachedState.bind(this);\n const updateFocusState = () => updateCachedState(\"focusedCell\", this.getFocusedCellState());\n this.addManagedEventListeners({\n cellFocused: updateFocusState,\n cellFocusCleared: updateFocusState,\n cellSelectionChanged: (event) => {\n if (event.finished) {\n const cellSelection = this.getRangeSelectionState();\n updateCachedState(\"rangeSelection\", cellSelection);\n updateCachedState(\"cellSelection\", cellSelection);\n }\n },\n bodyScrollEnd: () => updateCachedState(\"scroll\", this.getScrollState())\n });\n }\n getColumnState() {\n const beans = this.beans;\n return convertColumnState(_getColumnState(beans), beans.colModel.isPivotMode());\n }\n setColumnState(state, source, partialColumnState, ignoreSet) {\n const {\n sort: sortState,\n rowGroup: groupState,\n aggregation: aggregationState,\n pivot: pivotState,\n columnPinning: columnPinningState,\n columnVisibility: columnVisibilityState,\n columnSizing: columnSizingState,\n columnOrder: columnOrderState\n } = state;\n let forceSetState = false;\n const shouldSetState = (prop, propState) => {\n const shouldSet = !ignoreSet?.has(prop) && !!(propState || source === \"api\");\n forceSetState || (forceSetState = shouldSet);\n return shouldSet;\n };\n const columnStateMap = {};\n const getColumnState2 = (colId) => {\n let columnState = columnStateMap[colId];\n if (columnState) {\n return columnState;\n }\n columnState = { colId };\n columnStateMap[colId] = columnState;\n return columnState;\n };\n const defaultState = {};\n const shouldSetSortState = shouldSetState(\"sort\", sortState);\n if (shouldSetSortState) {\n sortState?.sortModel.forEach(({ colId, sort, type }, sortIndex) => {\n const columnState = getColumnState2(colId);\n columnState.sort = sort;\n columnState.sortIndex = sortIndex;\n columnState.sortType = type;\n });\n }\n if (shouldSetSortState || !partialColumnState) {\n defaultState.sort = null;\n defaultState.sortIndex = null;\n }\n const shouldSetGroupState = shouldSetState(\"rowGroup\", groupState);\n if (shouldSetGroupState) {\n groupState?.groupColIds.forEach((colId, rowGroupIndex) => {\n const columnState = getColumnState2(colId);\n columnState.rowGroup = true;\n columnState.rowGroupIndex = rowGroupIndex;\n });\n }\n if (shouldSetGroupState || !partialColumnState) {\n defaultState.rowGroup = null;\n defaultState.rowGroupIndex = null;\n }\n const shouldSetAggregationState = shouldSetState(\"aggregation\", aggregationState);\n if (shouldSetAggregationState) {\n aggregationState?.aggregationModel.forEach(({ colId, aggFunc }) => {\n getColumnState2(colId).aggFunc = aggFunc;\n });\n }\n if (shouldSetAggregationState || !partialColumnState) {\n defaultState.aggFunc = null;\n }\n const shouldSetPivotState = shouldSetState(\"pivot\", pivotState);\n if (shouldSetPivotState) {\n pivotState?.pivotColIds.forEach((colId, pivotIndex) => {\n const columnState = getColumnState2(colId);\n columnState.pivot = true;\n columnState.pivotIndex = pivotIndex;\n });\n this.gos.updateGridOptions({\n options: { pivotMode: !!pivotState?.pivotMode },\n source\n });\n }\n if (shouldSetPivotState || !partialColumnState) {\n defaultState.pivot = null;\n defaultState.pivotIndex = null;\n }\n const shouldSetColumnPinningState = shouldSetState(\"columnPinning\", columnPinningState);\n if (shouldSetColumnPinningState) {\n for (const colId of columnPinningState?.leftColIds ?? []) {\n getColumnState2(colId).pinned = \"left\";\n }\n for (const colId of columnPinningState?.rightColIds ?? []) {\n getColumnState2(colId).pinned = \"right\";\n }\n }\n if (shouldSetColumnPinningState || !partialColumnState) {\n defaultState.pinned = null;\n }\n const shouldSetColumnVisibilityState = shouldSetState(\"columnVisibility\", columnVisibilityState);\n if (shouldSetColumnVisibilityState) {\n for (const colId of columnVisibilityState?.hiddenColIds ?? []) {\n getColumnState2(colId).hide = true;\n }\n }\n if (shouldSetColumnVisibilityState || !partialColumnState) {\n defaultState.hide = null;\n }\n const shouldSetColumnSizingState = shouldSetState(\"columnSizing\", columnSizingState);\n if (shouldSetColumnSizingState) {\n for (const { colId, flex, width } of columnSizingState?.columnSizingModel ?? []) {\n const columnState = getColumnState2(colId);\n columnState.flex = flex ?? null;\n columnState.width = width;\n }\n }\n if (shouldSetColumnSizingState || !partialColumnState) {\n defaultState.flex = null;\n }\n const columns = columnOrderState?.orderedColIds;\n const applyOrder = !!columns?.length && !ignoreSet?.has(\"columnOrder\");\n const columnStates = applyOrder ? columns.map((colId) => getColumnState2(colId)) : Object.values(columnStateMap);\n if (columnStates.length || forceSetState) {\n this.columnStates = columnStates;\n _applyColumnState(\n this.beans,\n {\n state: columnStates,\n applyOrder,\n defaultState\n },\n source\n );\n }\n }\n setColumnPivotState(applyOrder, source) {\n const columnStates = this.columnStates;\n this.columnStates = void 0;\n const columnGroupStates = this.columnGroupStates;\n this.columnGroupStates = void 0;\n const beans = this.beans;\n const { pivotResultCols, colGroupSvc } = beans;\n if (!pivotResultCols?.isPivotResultColsPresent()) {\n return;\n }\n if (columnStates) {\n const secondaryColumnStates = [];\n for (const columnState of columnStates) {\n if (pivotResultCols.getPivotResultCol(columnState.colId)) {\n secondaryColumnStates.push(columnState);\n }\n }\n _applyColumnState(\n beans,\n {\n state: secondaryColumnStates,\n applyOrder\n },\n source\n );\n }\n if (columnGroupStates) {\n colGroupSvc?.setColumnGroupState(columnGroupStates, source);\n }\n }\n getColumnGroupState() {\n const colGroupSvc = this.beans.colGroupSvc;\n if (!colGroupSvc) {\n return void 0;\n }\n const columnGroupState = colGroupSvc.getColumnGroupState();\n return _convertColumnGroupState(columnGroupState);\n }\n setColumnGroupState(state, source, ignoreSet) {\n const colGroupSvc = this.beans.colGroupSvc;\n if (!colGroupSvc || ignoreSet?.has(\"columnGroup\") || source !== \"api\" && !Object.prototype.hasOwnProperty.call(state, \"columnGroup\")) {\n return;\n }\n const openColumnGroups = new Set(state.columnGroup?.openColumnGroupIds);\n const existingColumnGroupState = colGroupSvc.getColumnGroupState();\n const stateItems = existingColumnGroupState.map(({ groupId }) => {\n const open = openColumnGroups.has(groupId);\n if (open) {\n openColumnGroups.delete(groupId);\n }\n return {\n groupId,\n open\n };\n });\n for (const groupId of openColumnGroups) {\n stateItems.push({\n groupId,\n open: true\n });\n }\n if (stateItems.length) {\n this.columnGroupStates = stateItems;\n }\n colGroupSvc.setColumnGroupState(stateItems, source);\n }\n getFilterState() {\n const { filterManager, selectableFilter } = this.beans;\n let filterModel = filterManager?.getFilterModel();\n if (filterModel && Object.keys(filterModel).length === 0) {\n filterModel = void 0;\n }\n const columnFilterState = filterManager?.getFilterState();\n const advancedFilterModel = filterManager?.getAdvFilterModel() ?? void 0;\n const selectableFilters = selectableFilter?.getState();\n return filterModel || advancedFilterModel || columnFilterState || selectableFilters ? { filterModel, columnFilterState, advancedFilterModel, selectableFilters } : void 0;\n }\n setFilterState(filterState) {\n const { filterManager, selectableFilter } = this.beans;\n const { filterModel, columnFilterState, advancedFilterModel, selectableFilters } = filterState ?? {\n filterModel: null,\n columnFilterState: null,\n advancedFilterModel: null\n };\n if (selectableFilters !== void 0) {\n selectableFilter?.setState(selectableFilters ?? {});\n }\n if (filterModel !== void 0 || columnFilterState !== void 0) {\n filterManager?.setFilterState(filterModel ?? null, columnFilterState ?? null, \"columnFilter\");\n }\n if (advancedFilterModel !== void 0) {\n filterManager?.setAdvFilterModel(advancedFilterModel ?? null, \"advancedFilter\");\n }\n }\n getRangeSelectionState() {\n const cellRanges = this.beans.rangeSvc?.getCellRanges().map((cellRange) => {\n const { id, type, startRow, endRow, columns, startColumn } = cellRange;\n return {\n id,\n type,\n startRow,\n endRow,\n colIds: columns.map((column) => column.getColId()),\n startColId: startColumn.getColId()\n };\n });\n return cellRanges?.length ? { cellRanges } : void 0;\n }\n setCellSelectionState(cellSelectionState) {\n const { gos, rangeSvc, colModel, visibleCols } = this.beans;\n if (!_isCellSelectionEnabled(gos) || !rangeSvc) {\n return;\n }\n const cellRanges = [];\n for (const cellRange of cellSelectionState?.cellRanges ?? []) {\n const columns = [];\n for (const colId of cellRange.colIds) {\n const column = colModel.getCol(colId);\n if (column) {\n columns.push(column);\n }\n }\n if (!columns.length) {\n continue;\n }\n let startColumn = colModel.getCol(cellRange.startColId);\n if (!startColumn) {\n const allColumns = visibleCols.allCols;\n const columnSet = new Set(columns);\n startColumn = allColumns.find((column) => columnSet.has(column));\n }\n cellRanges.push({\n ...cellRange,\n columns,\n startColumn\n });\n }\n rangeSvc.setCellRanges(cellRanges);\n }\n getScrollState() {\n if (!this.isClientSideRowModel) {\n return void 0;\n }\n const scrollFeature = this.beans.ctrlsSvc.getScrollFeature();\n const { left } = scrollFeature?.getHScrollPosition() ?? { left: 0 };\n const { top } = scrollFeature?.getVScrollPosition() ?? { top: 0 };\n return top || left ? {\n top,\n left\n } : void 0;\n }\n setScrollState(scrollState) {\n if (!this.isClientSideRowModel) {\n return;\n }\n const { top, left } = scrollState ?? { top: 0, left: 0 };\n const { frameworkOverrides, rowRenderer, animationFrameSvc, ctrlsSvc } = this.beans;\n frameworkOverrides.wrapIncoming(() => {\n ctrlsSvc.get(\"center\").setCenterViewportScrollLeft(left);\n ctrlsSvc.getScrollFeature()?.setVerticalScrollPosition(top);\n rowRenderer.redraw({ afterScroll: true });\n animationFrameSvc?.flushAllFrames();\n });\n }\n getSideBarState() {\n return this.beans.sideBar?.comp?.getState();\n }\n getFocusedCellState() {\n if (!this.isClientSideRowModel) {\n return void 0;\n }\n const focusedCell = this.beans.focusSvc.getFocusedCell();\n if (focusedCell) {\n const { column, rowIndex, rowPinned } = focusedCell;\n return {\n colId: column.getColId(),\n rowIndex,\n rowPinned\n };\n }\n return void 0;\n }\n setFocusedCellState(focusedCellState) {\n if (!this.isClientSideRowModel) {\n return;\n }\n const { focusSvc, colModel } = this.beans;\n if (!focusedCellState) {\n focusSvc.clearFocusedCell();\n return;\n }\n const { colId, rowIndex, rowPinned } = focusedCellState;\n focusSvc.setFocusedCell({\n column: colModel.getCol(colId),\n rowIndex,\n rowPinned,\n forceBrowserFocus: true,\n preventScrollOnBrowserFocus: true\n });\n }\n getPaginationState() {\n const { pagination, gos } = this.beans;\n if (!pagination) {\n return void 0;\n }\n const page = pagination.getCurrentPage();\n const pageSize = !gos.get(\"paginationAutoPageSize\") ? pagination.getPageSize() : void 0;\n if (!page && !pageSize) {\n return;\n }\n return { page, pageSize };\n }\n setPaginationState(paginationState, source) {\n const { pagination, gos } = this.beans;\n if (!pagination) {\n return;\n }\n const { pageSize, page } = paginationState ?? { page: 0, pageSize: gos.get(\"paginationPageSize\") };\n const isInit = source === \"gridInitializing\";\n if (pageSize && !gos.get(\"paginationAutoPageSize\")) {\n pagination.setPageSize(pageSize, isInit ? \"initialState\" : \"pageSizeSelector\");\n }\n if (typeof page === \"number\") {\n if (isInit) {\n pagination.setPage(page);\n } else {\n pagination.goToPage(page);\n }\n }\n }\n getRowSelectionState() {\n const selectionSvc = this.beans.selectionSvc;\n if (!selectionSvc) {\n return void 0;\n }\n const selectionState = selectionSvc.getSelectionState();\n const noSelections = !selectionState || !Array.isArray(selectionState) && (selectionState.selectAll === false || selectionState.selectAllChildren === false) && !selectionState?.toggledNodes?.length;\n return noSelections ? void 0 : selectionState;\n }\n setRowSelectionState(rowSelectionState, source) {\n this.beans.selectionSvc?.setSelectionState(rowSelectionState, source, source === \"api\");\n }\n updateGroupExpansionState() {\n const { expansionSvc, gos } = this.beans;\n const state = expansionSvc?.getExpansionState();\n const ssrmExpandAllAffectsAllRows = gos.get(\"ssrmExpandAllAffectsAllRows\");\n this.updateCachedState(\"ssrmRowGroupExpansion\", ssrmExpandAllAffectsAllRows ? state : void 0);\n this.updateCachedState(\n \"rowGroupExpansion\",\n ssrmExpandAllAffectsAllRows ? void 0 : state\n );\n }\n getRowPinningState() {\n return this.beans.pinnedRowModel?.getPinnedState();\n }\n setRowPinningState(state) {\n const pinnedRowModel = this.beans.pinnedRowModel;\n if (state) {\n pinnedRowModel?.setPinnedState(state);\n } else {\n pinnedRowModel?.reset();\n }\n }\n setRowGroupExpansionState(ssrmRowGroupExpansionState, rowGroupExpansionState, source) {\n const state = ssrmRowGroupExpansionState ?? rowGroupExpansionState ?? { expandedRowGroupIds: [], collapsedRowGroupIds: [] };\n this.beans.expansionSvc?.setExpansionState(state, source);\n }\n updateColumnState(features) {\n const newColumnState = this.getColumnState();\n let hasChanged = false;\n const cachedState = this.cachedState;\n for (const key of Object.keys(newColumnState)) {\n const value = newColumnState[key];\n if (!_jsonEquals(value, cachedState[key])) {\n hasChanged = true;\n }\n }\n this.cachedState = {\n ...cachedState,\n ...newColumnState\n };\n if (hasChanged) {\n this.dispatchStateUpdateEvent(features);\n }\n }\n updateCachedState(key, value) {\n const existingValue = this.cachedState[key];\n this.setCachedStateValue(key, value);\n if (!_jsonEquals(value, existingValue)) {\n this.dispatchStateUpdateEvent([key]);\n }\n }\n setCachedStateValue(key, value) {\n this.cachedState = {\n ...this.cachedState,\n [key]: value\n };\n }\n refreshStaleState() {\n const staleStateKeys = this.staleStateKeys;\n for (const key of staleStateKeys) {\n if (key === \"rowSelection\") {\n this.setCachedStateValue(key, this.getRowSelectionState());\n }\n }\n staleStateKeys.clear();\n }\n dispatchStateUpdateEvent(sources) {\n if (this.suppressEvents) {\n return;\n }\n for (const source of sources) {\n this.queuedUpdateSources.add(source);\n }\n this.dispatchStateUpdateEventDebounced();\n }\n dispatchQueuedStateUpdateEvents() {\n const queuedUpdateSources = this.queuedUpdateSources;\n const sources = Array.from(queuedUpdateSources);\n queuedUpdateSources.clear();\n this.eventSvc.dispatchEvent({\n type: \"stateUpdated\",\n sources,\n state: this.cachedState\n });\n }\n startSuppressEvents() {\n this.suppressEvents = true;\n this.beans.colAnimation?.setSuppressAnimation(true);\n }\n stopSuppressEvents(source) {\n setTimeout(() => {\n this.suppressEvents = false;\n this.queuedUpdateSources.clear();\n if (!this.isAlive()) {\n return;\n }\n this.beans.colAnimation?.setSuppressAnimation(false);\n this.dispatchStateUpdateEvent([source]);\n });\n }\n suppressEventsAndDispatchInitEvent(updateFunc) {\n this.startSuppressEvents();\n updateFunc();\n this.stopSuppressEvents(\"gridInitializing\");\n }\n};\n\n// packages/ag-grid-community/src/misc/state/stateModule.ts\nvar GridStateModule = {\n moduleName: \"GridState\",\n version: VERSION,\n beans: [StateService],\n apiFunctions: {\n getState,\n setState\n }\n};\n\n// packages/ag-grid-community/src/pagination/paginationApi.ts\nfunction paginationIsLastPageFound(beans) {\n return beans.rowModel.isLastRowIndexKnown();\n}\nfunction paginationGetPageSize(beans) {\n return beans.pagination?.getPageSize() ?? 100;\n}\nfunction paginationGetCurrentPage(beans) {\n return beans.pagination?.getCurrentPage() ?? 0;\n}\nfunction paginationGetTotalPages(beans) {\n return beans.pagination?.getTotalPages() ?? 1;\n}\nfunction paginationGetRowCount(beans) {\n return beans.pagination ? beans.pagination.getMasterRowCount() : beans.rowModel.getRowCount();\n}\nfunction paginationGoToNextPage(beans) {\n beans.pagination?.goToNextPage();\n}\nfunction paginationGoToPreviousPage(beans) {\n beans.pagination?.goToPreviousPage();\n}\nfunction paginationGoToFirstPage(beans) {\n beans.pagination?.goToFirstPage();\n}\nfunction paginationGoToLastPage(beans) {\n beans.pagination?.goToLastPage();\n}\nfunction paginationGoToPage(beans, page) {\n beans.pagination?.goToPage(page);\n}\n\n// packages/ag-grid-community/src/pagination/paginationAutoPageSizeService.ts\nvar PaginationAutoPageSizeService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"paginationAutoPageSizeSvc\";\n }\n postConstruct() {\n this.beans.ctrlsSvc.whenReady(this, (p) => {\n this.centerRowsCtrl = p.center;\n const listener = this.checkPageSize.bind(this);\n this.addManagedEventListeners({\n bodyHeightChanged: listener,\n scrollVisibilityChanged: listener\n });\n this.addManagedPropertyListener(\"paginationAutoPageSize\", this.onPaginationAutoSizeChanged.bind(this));\n this.checkPageSize();\n });\n }\n notActive() {\n return !this.gos.get(\"paginationAutoPageSize\") || this.centerRowsCtrl == null;\n }\n onPaginationAutoSizeChanged() {\n if (this.notActive()) {\n this.beans.pagination.unsetAutoCalculatedPageSize();\n } else {\n this.checkPageSize();\n }\n }\n checkPageSize() {\n if (this.notActive()) {\n return;\n }\n const bodyHeight = this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();\n if (bodyHeight > 0) {\n const beans = this.beans;\n const update = () => {\n const rowHeight = Math.max(_getRowHeightAsNumber(beans), 1);\n const newPageSize = Math.floor(bodyHeight / rowHeight);\n beans.pagination.setPageSize(newPageSize, \"autoCalculated\");\n };\n if (!this.isBodyRendered) {\n update();\n this.isBodyRendered = true;\n } else {\n _debounce(this, update, 50)();\n }\n } else {\n this.isBodyRendered = false;\n }\n }\n};\n\n// packages/ag-grid-community/src/utils/number.ts\nfunction _formatNumberCommas(value, getLocaleTextFunc) {\n if (typeof value !== \"number\") {\n return \"\";\n }\n const localeTextFunc = getLocaleTextFunc();\n const thousandSeparator = localeTextFunc(\"thousandSeparator\", \",\");\n const decimalSeparator = localeTextFunc(\"decimalSeparator\", \".\");\n return value.toString().replace(\".\", decimalSeparator).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, `$1${thousandSeparator}`);\n}\n\n// packages/ag-grid-community/src/pagination/pageSizeSelector/pageSizeSelectorComp.ts\nvar paginationPageSizeSelector = \"paginationPageSizeSelector\";\nvar PageSizeSelectorCompElement = { tag: \"span\", cls: \"ag-paging-page-size\" };\nvar PageSizeSelectorComp = class extends Component {\n constructor() {\n super(PageSizeSelectorCompElement);\n this.hasEmptyOption = false;\n this.handlePageSizeItemSelected = () => {\n if (!this.selectPageSizeComp) {\n return;\n }\n const newValue = this.selectPageSizeComp.getValue();\n if (!newValue) {\n return;\n }\n const paginationPageSize = Number(newValue);\n if (isNaN(paginationPageSize) || paginationPageSize < 1 || paginationPageSize === this.pagination.getPageSize()) {\n return;\n }\n this.pagination.setPageSize(paginationPageSize, \"pageSizeSelector\");\n if (this.hasEmptyOption) {\n this.toggleSelectDisplay(true);\n }\n this.selectPageSizeComp.getFocusableElement().focus();\n };\n }\n wireBeans(beans) {\n this.pagination = beans.pagination;\n }\n postConstruct() {\n this.addManagedPropertyListener(paginationPageSizeSelector, () => {\n this.onPageSizeSelectorValuesChange();\n });\n this.addManagedEventListeners({ paginationChanged: (event) => this.handlePaginationChanged(event) });\n }\n handlePaginationChanged(paginationChangedEvent) {\n if (!this.selectPageSizeComp || !paginationChangedEvent?.newPageSize) {\n return;\n }\n const paginationPageSize = this.pagination.getPageSize();\n if (this.getPageSizeSelectorValues().includes(paginationPageSize)) {\n this.selectPageSizeComp.setValue(paginationPageSize.toString());\n } else if (this.hasEmptyOption) {\n this.selectPageSizeComp.setValue(\"\");\n } else {\n this.toggleSelectDisplay(true);\n }\n }\n toggleSelectDisplay(show) {\n if (this.selectPageSizeComp && !show) {\n this.reset();\n }\n if (!show) {\n return;\n }\n this.reloadPageSizesSelector();\n if (!this.selectPageSizeComp) {\n return;\n }\n }\n reset() {\n _clearElement(this.getGui());\n if (!this.selectPageSizeComp) {\n return;\n }\n this.selectPageSizeComp = this.destroyBean(this.selectPageSizeComp);\n }\n onPageSizeSelectorValuesChange() {\n if (!this.selectPageSizeComp) {\n return;\n }\n if (this.shouldShowPageSizeSelector()) {\n this.reloadPageSizesSelector();\n }\n }\n shouldShowPageSizeSelector() {\n return this.gos.get(\"pagination\") && !this.gos.get(\"suppressPaginationPanel\") && !this.gos.get(\"paginationAutoPageSize\") && this.gos.get(paginationPageSizeSelector) !== false;\n }\n reloadPageSizesSelector() {\n const pageSizeOptions = this.getPageSizeSelectorValues();\n const paginationPageSizeOption = this.pagination.getPageSize();\n const shouldAddAndSelectEmptyOption = !paginationPageSizeOption || !pageSizeOptions.includes(paginationPageSizeOption);\n if (shouldAddAndSelectEmptyOption) {\n const pageSizeSet = this.gos.exists(\"paginationPageSize\");\n const pageSizesSet = this.gos.get(paginationPageSizeSelector) !== true;\n _warn(94, { pageSizeSet, pageSizesSet, pageSizeOptions, paginationPageSizeOption });\n if (!pageSizesSet) {\n _warn(95, { paginationPageSizeOption, paginationPageSizeSelector });\n }\n pageSizeOptions.unshift(\"\");\n }\n const value = String(shouldAddAndSelectEmptyOption ? \"\" : paginationPageSizeOption);\n if (this.selectPageSizeComp) {\n if (!_areEqual(this.pageSizeOptions, pageSizeOptions)) {\n this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(pageSizeOptions));\n this.pageSizeOptions = pageSizeOptions;\n }\n this.selectPageSizeComp.setValue(value, true);\n } else {\n this.createPageSizeSelectorComp(pageSizeOptions, value);\n }\n this.hasEmptyOption = shouldAddAndSelectEmptyOption;\n }\n createPageSizeSelectOptions(pageSizeOptions) {\n return pageSizeOptions.map((value) => ({\n value: String(value)\n }));\n }\n createPageSizeSelectorComp(pageSizeOptions, value) {\n const localeTextFunc = this.getLocaleTextFunc();\n const localisedLabel = localeTextFunc(\"pageSizeSelectorLabel\", \"Page Size:\");\n const localisedAriaLabel = localeTextFunc(\"ariaPageSizeSelectorLabel\", \"Page Size\");\n this.selectPageSizeComp = this.createManagedBean(new AgSelect()).addOptions(this.createPageSizeSelectOptions(pageSizeOptions)).setValue(value).setAriaLabel(localisedAriaLabel).setLabel(localisedLabel).onValueChange(() => this.handlePageSizeItemSelected());\n this.appendChild(this.selectPageSizeComp);\n }\n getPageSizeSelectorValues() {\n const defaultValues = [20, 50, 100];\n const paginationPageSizeSelectorValues = this.gos.get(paginationPageSizeSelector);\n if (!Array.isArray(paginationPageSizeSelectorValues) || !paginationPageSizeSelectorValues?.length) {\n return defaultValues;\n }\n return [...paginationPageSizeSelectorValues].sort((a, b) => a - b);\n }\n destroy() {\n this.toggleSelectDisplay(false);\n super.destroy();\n }\n};\nvar PageSizeSelectorSelector = {\n selector: \"AG-PAGE-SIZE-SELECTOR\",\n component: PageSizeSelectorComp\n};\n\n// packages/ag-grid-community/src/pagination/paginationComp.css\nvar paginationComp_default = \".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;flex-wrap:wrap-reverse;gap:calc(var(--ag-spacing)*4);justify-content:flex-end;min-height:var(--ag-pagination-panel-height);padding:calc(var(--ag-spacing)*.5) var(--ag-cell-horizontal-padding);row-gap:calc(var(--ag-spacing)*.5);@container (width < 600px){justify-content:center}}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel,.ag-paging-row-summary-panel{margin:calc(var(--ag-spacing)*.5)}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}.ag-paging-description{line-height:0}\";\n\n// packages/ag-grid-community/src/pagination/paginationComp.ts\nvar PaginationComp = class extends TabGuardComp {\n constructor() {\n super();\n this.btFirst = RefPlaceholder;\n this.btPrevious = RefPlaceholder;\n this.btNext = RefPlaceholder;\n this.btLast = RefPlaceholder;\n this.lbRecordCount = RefPlaceholder;\n this.lbFirstRowOnPage = RefPlaceholder;\n this.lbLastRowOnPage = RefPlaceholder;\n this.lbCurrent = RefPlaceholder;\n this.lbTotal = RefPlaceholder;\n this.pageSizeComp = RefPlaceholder;\n this.previousAndFirstButtonsDisabled = false;\n this.nextButtonDisabled = false;\n this.lastButtonDisabled = false;\n this.areListenersSetup = false;\n this.allowFocusInnerElement = false;\n this.registerCSS(paginationComp_default);\n }\n wireBeans(beans) {\n this.rowModel = beans.rowModel;\n this.pagination = beans.pagination;\n this.ariaAnnounce = beans.ariaAnnounce;\n }\n postConstruct() {\n const isRtl = this.gos.get(\"enableRtl\");\n this.setTemplate(this.getTemplate(), [PageSizeSelectorSelector]);\n const { btFirst, btPrevious, btNext, btLast } = this;\n this.activateTabIndex([btFirst, btPrevious, btNext, btLast]);\n btFirst.insertAdjacentElement(\"afterbegin\", _createIconNoSpan(isRtl ? \"last\" : \"first\", this.beans));\n btPrevious.insertAdjacentElement(\"afterbegin\", _createIconNoSpan(isRtl ? \"next\" : \"previous\", this.beans));\n btNext.insertAdjacentElement(\"afterbegin\", _createIconNoSpan(isRtl ? \"previous\" : \"next\", this.beans));\n btLast.insertAdjacentElement(\"afterbegin\", _createIconNoSpan(isRtl ? \"first\" : \"last\", this.beans));\n this.addManagedPropertyListener(\"pagination\", this.onPaginationChanged.bind(this));\n this.addManagedPropertyListener(\"suppressPaginationPanel\", this.onPaginationChanged.bind(this));\n this.addManagedPropertyListeners(\n [\"paginationPageSizeSelector\", \"paginationAutoPageSize\", \"suppressPaginationPanel\"],\n () => this.onPageSizeRelatedOptionsChange()\n );\n this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector());\n this.initialiseTabGuard({\n // prevent tab guard default logic\n onTabKeyDown: () => {\n },\n focusInnerElement: (fromBottom) => {\n if (this.allowFocusInnerElement) {\n return this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(fromBottom);\n } else {\n return _focusGridInnerElement(this.beans, fromBottom);\n }\n },\n forceFocusOutWhenTabGuardsAreEmpty: true\n });\n this.onPaginationChanged();\n }\n setAllowFocus(allowFocus) {\n this.allowFocusInnerElement = allowFocus;\n }\n getFocusableContainerName() {\n return \"pagination\";\n }\n onPaginationChanged() {\n const isPaging = this.gos.get(\"pagination\");\n const paginationPanelEnabled = isPaging && !this.gos.get(\"suppressPaginationPanel\");\n this.setDisplayed(paginationPanelEnabled);\n if (!paginationPanelEnabled) {\n return;\n }\n this.setupListeners();\n this.enableOrDisableButtons();\n this.updateLabels();\n this.onPageSizeRelatedOptionsChange();\n }\n onPageSizeRelatedOptionsChange() {\n this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector());\n }\n setupListeners() {\n if (!this.areListenersSetup) {\n this.addManagedEventListeners({ paginationChanged: this.onPaginationChanged.bind(this) });\n for (const item of [\n { el: this.btFirst, fn: this.onBtFirst.bind(this) },\n { el: this.btPrevious, fn: this.onBtPrevious.bind(this) },\n { el: this.btNext, fn: this.onBtNext.bind(this) },\n { el: this.btLast, fn: this.onBtLast.bind(this) }\n ]) {\n const { el, fn } = item;\n this.addManagedListeners(el, {\n click: fn,\n keydown: (e) => {\n if (e.key === KeyCode.ENTER || e.key === KeyCode.SPACE) {\n e.preventDefault();\n fn();\n }\n }\n });\n }\n _addFocusableContainerListener(this.beans, this, this.getGui());\n this.areListenersSetup = true;\n }\n }\n onBtFirst() {\n if (!this.previousAndFirstButtonsDisabled) {\n this.pagination.goToFirstPage();\n }\n }\n formatNumber(value) {\n const userFunc = this.gos.getCallback(\"paginationNumberFormatter\");\n if (userFunc) {\n const params = { value };\n return userFunc(params);\n }\n return _formatNumberCommas(value, this.getLocaleTextFunc.bind(this));\n }\n getTemplate() {\n const localeTextFunc = this.getLocaleTextFunc();\n const idPrefix = `ag-${this.getCompId()}`;\n return {\n tag: \"div\",\n cls: \"ag-paging-panel ag-unselectable\",\n attrs: { id: `${idPrefix}` },\n children: [\n {\n tag: \"ag-page-size-selector\",\n ref: \"pageSizeComp\"\n },\n {\n tag: \"span\",\n cls: \"ag-paging-row-summary-panel\",\n children: [\n {\n tag: \"span\",\n ref: \"lbFirstRowOnPage\",\n cls: \"ag-paging-row-summary-panel-number\",\n attrs: { id: `${idPrefix}-first-row` }\n },\n { tag: \"span\", attrs: { id: `${idPrefix}-to` }, children: localeTextFunc(\"to\", \"to\") },\n {\n tag: \"span\",\n ref: \"lbLastRowOnPage\",\n cls: \"ag-paging-row-summary-panel-number\",\n attrs: { id: `${idPrefix}-last-row` }\n },\n { tag: \"span\", attrs: { id: `${idPrefix}-of` }, children: localeTextFunc(\"of\", \"of\") },\n {\n tag: \"span\",\n ref: \"lbRecordCount\",\n cls: \"ag-paging-row-summary-panel-number\",\n attrs: { id: `${idPrefix}-row-count` }\n }\n ]\n },\n {\n tag: \"span\",\n cls: \"ag-paging-page-summary-panel\",\n role: \"presentation\",\n children: [\n {\n tag: \"div\",\n ref: \"btFirst\",\n cls: \"ag-button ag-paging-button\",\n role: \"button\",\n attrs: { \"aria-label\": localeTextFunc(\"firstPage\", \"First Page\") }\n },\n {\n tag: \"div\",\n ref: \"btPrevious\",\n cls: \"ag-button ag-paging-button\",\n role: \"button\",\n attrs: { \"aria-label\": localeTextFunc(\"previousPage\", \"Previous Page\") }\n },\n {\n tag: \"span\",\n cls: \"ag-paging-description\",\n children: [\n {\n tag: \"span\",\n attrs: {\n id: `${idPrefix}-start-page`\n },\n children: localeTextFunc(\"page\", \"Page\")\n },\n {\n tag: \"span\",\n ref: \"lbCurrent\",\n cls: \"ag-paging-number\",\n attrs: { id: `${idPrefix}-start-page-number` }\n },\n {\n tag: \"span\",\n attrs: {\n id: `${idPrefix}-of-page`\n },\n children: localeTextFunc(\"of\", \"of\")\n },\n {\n tag: \"span\",\n ref: \"lbTotal\",\n cls: \"ag-paging-number\",\n attrs: { id: `${idPrefix}-of-page-number` }\n }\n ]\n },\n {\n tag: \"div\",\n ref: \"btNext\",\n cls: \"ag-button ag-paging-button\",\n role: \"button\",\n attrs: { \"aria-label\": localeTextFunc(\"nextPage\", \"Next Page\") }\n },\n {\n tag: \"div\",\n ref: \"btLast\",\n cls: \"ag-button ag-paging-button\",\n role: \"button\",\n attrs: { \"aria-label\": localeTextFunc(\"lastPage\", \"Last Page\") }\n }\n ]\n }\n ]\n };\n }\n onBtNext() {\n if (!this.nextButtonDisabled) {\n this.pagination.goToNextPage();\n }\n }\n onBtPrevious() {\n if (!this.previousAndFirstButtonsDisabled) {\n this.pagination.goToPreviousPage();\n }\n }\n onBtLast() {\n if (!this.lastButtonDisabled) {\n this.pagination.goToLastPage();\n }\n }\n enableOrDisableButtons() {\n const currentPage = this.pagination.getCurrentPage();\n const maxRowFound = this.rowModel.isLastRowIndexKnown();\n const totalPages = this.pagination.getTotalPages();\n this.previousAndFirstButtonsDisabled = currentPage === 0;\n this.toggleButtonDisabled(this.btFirst, this.previousAndFirstButtonsDisabled);\n this.toggleButtonDisabled(this.btPrevious, this.previousAndFirstButtonsDisabled);\n const zeroPagesToDisplay = this.isZeroPagesToDisplay();\n const onLastPage = currentPage === totalPages - 1;\n this.nextButtonDisabled = onLastPage || zeroPagesToDisplay;\n this.lastButtonDisabled = !maxRowFound || zeroPagesToDisplay || currentPage === totalPages - 1;\n this.toggleButtonDisabled(this.btNext, this.nextButtonDisabled);\n this.toggleButtonDisabled(this.btLast, this.lastButtonDisabled);\n }\n toggleButtonDisabled(button, disabled) {\n _setAriaDisabled(button, disabled);\n button.classList.toggle(\"ag-disabled\", disabled);\n }\n isZeroPagesToDisplay() {\n const maxRowFound = this.rowModel.isLastRowIndexKnown();\n const totalPages = this.pagination.getTotalPages();\n return maxRowFound && totalPages === 0;\n }\n updateLabels() {\n const lastPageFound = this.rowModel.isLastRowIndexKnown();\n const totalPages = this.pagination.getTotalPages();\n const masterRowCount = this.pagination.getMasterRowCount();\n const rowCount = lastPageFound ? masterRowCount : null;\n const currentPage = this.pagination.getCurrentPage();\n const pageSize = this.pagination.getPageSize();\n let startRow;\n let endRow;\n if (this.isZeroPagesToDisplay()) {\n startRow = endRow = 0;\n } else {\n startRow = pageSize * currentPage + 1;\n endRow = startRow + pageSize - 1;\n if (lastPageFound && endRow > rowCount) {\n endRow = rowCount;\n }\n }\n const theoreticalEndRow = startRow + pageSize - 1;\n const isLoadingPageSize = !lastPageFound && masterRowCount < theoreticalEndRow;\n const lbFirstRowOnPage = this.formatNumber(startRow);\n this.lbFirstRowOnPage.textContent = lbFirstRowOnPage;\n let lbLastRowOnPage;\n const localeTextFunc = this.getLocaleTextFunc();\n if (isLoadingPageSize) {\n lbLastRowOnPage = localeTextFunc(\"pageLastRowUnknown\", \"?\");\n } else {\n lbLastRowOnPage = this.formatNumber(endRow);\n }\n this.lbLastRowOnPage.textContent = lbLastRowOnPage;\n const pagesExist = totalPages > 0;\n const toDisplay = pagesExist ? currentPage + 1 : 0;\n const lbCurrent = this.formatNumber(toDisplay);\n this.lbCurrent.textContent = lbCurrent;\n let lbTotal;\n let lbRecordCount;\n if (lastPageFound) {\n lbTotal = this.formatNumber(totalPages);\n lbRecordCount = this.formatNumber(rowCount);\n } else {\n const moreText = localeTextFunc(\"more\", \"more\");\n lbTotal = moreText;\n lbRecordCount = moreText;\n }\n this.lbTotal.textContent = lbTotal;\n this.lbRecordCount.textContent = lbRecordCount;\n this.announceAriaStatus(lbFirstRowOnPage, lbLastRowOnPage, lbRecordCount, lbCurrent, lbTotal);\n }\n announceAriaStatus(lbFirstRowOnPage, lbLastRowOnPage, lbRecordCount, lbCurrent, lbTotal) {\n const localeTextFunc = this.getLocaleTextFunc();\n const strPage = localeTextFunc(\"page\", \"Page\");\n const strTo = localeTextFunc(\"to\", \"to\");\n const strOf = localeTextFunc(\"of\", \"of\");\n const ariaRowStatus = `${lbFirstRowOnPage} ${strTo} ${lbLastRowOnPage} ${strOf} ${lbRecordCount}`;\n const ariaPageStatus = `${strPage} ${lbCurrent} ${strOf} ${lbTotal}`;\n if (ariaRowStatus !== this.ariaRowStatus) {\n this.ariaRowStatus = ariaRowStatus;\n this.ariaAnnounce?.announceValue(ariaRowStatus, \"paginationRow\");\n }\n if (ariaPageStatus !== this.ariaPageStatus) {\n this.ariaPageStatus = ariaPageStatus;\n this.ariaAnnounce?.announceValue(ariaPageStatus, \"paginationPage\");\n }\n }\n};\nvar PaginationSelector = {\n selector: \"AG-PAGINATION\",\n component: PaginationComp\n};\n\n// packages/ag-grid-community/src/pagination/paginationService.ts\nvar DEFAULT_PAGE_SIZE = 100;\nvar PaginationService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"pagination\";\n this.currentPage = 0;\n this.topDisplayedRowIndex = 0;\n this.bottomDisplayedRowIndex = 0;\n this.masterRowCount = 0;\n }\n postConstruct() {\n const gos = this.gos;\n this.active = gos.get(\"pagination\");\n this.pageSizeFromGridOptions = gos.get(\"paginationPageSize\");\n this.paginateChildRows = this.isPaginateChildRows();\n this.addManagedPropertyListener(\"pagination\", this.onPaginationGridOptionChanged.bind(this));\n this.addManagedPropertyListener(\"paginationPageSize\", this.onPageSizeGridOptionChanged.bind(this));\n }\n getPaginationSelector() {\n return PaginationSelector;\n }\n isPaginateChildRows() {\n const gos = this.gos;\n const shouldPaginate = gos.get(\"groupHideParentOfSingleChild\") || // following two properties deprecated v32.3.0\n gos.get(\"groupRemoveSingleChildren\") || gos.get(\"groupRemoveLowestSingleChildren\");\n if (shouldPaginate) {\n return true;\n }\n return gos.get(\"paginateChildRows\");\n }\n onPaginationGridOptionChanged() {\n this.active = this.gos.get(\"pagination\");\n this.calculatePages();\n this.dispatchPaginationChangedEvent({ keepRenderedRows: true });\n }\n onPageSizeGridOptionChanged() {\n this.setPageSize(this.gos.get(\"paginationPageSize\"), \"gridOptions\");\n }\n goToPage(page) {\n const currentPage = this.currentPage;\n if (!this.active || currentPage === page || typeof currentPage !== \"number\") {\n return;\n }\n const { editSvc } = this.beans;\n if (editSvc?.isEditing()) {\n if (editSvc.isBatchEditing()) {\n editSvc.cleanupEditors();\n } else {\n editSvc.stopEditing(void 0, { source: \"api\" });\n }\n }\n this.currentPage = page;\n this.calculatePages();\n this.dispatchPaginationChangedEvent({ newPage: true });\n }\n goToPageWithIndex(index) {\n if (!this.active) {\n return;\n }\n let adjustedIndex = index;\n if (!this.paginateChildRows) {\n adjustedIndex = this.beans.rowModel.getTopLevelIndexFromDisplayedIndex?.(index) ?? index;\n }\n this.goToPage(Math.floor(adjustedIndex / this.pageSize));\n }\n isRowInPage(rowIndex) {\n if (!this.active) {\n return true;\n }\n return rowIndex >= this.topDisplayedRowIndex && rowIndex <= this.bottomDisplayedRowIndex;\n }\n getCurrentPage() {\n return this.currentPage;\n }\n goToNextPage() {\n this.goToPage(this.currentPage + 1);\n }\n goToPreviousPage() {\n this.goToPage(this.currentPage - 1);\n }\n goToFirstPage() {\n this.goToPage(0);\n }\n goToLastPage() {\n const rowCount = this.beans.rowModel.getRowCount();\n const lastPage = Math.floor(rowCount / this.pageSize);\n this.goToPage(lastPage);\n }\n getPageSize() {\n return this.pageSize;\n }\n getTotalPages() {\n return this.totalPages;\n }\n /** This is only for state setting before data has been loaded */\n setPage(page) {\n this.currentPage = page;\n }\n get pageSize() {\n if (_exists(this.pageSizeAutoCalculated) && this.gos.get(\"paginationAutoPageSize\")) {\n return this.pageSizeAutoCalculated;\n }\n if (_exists(this.pageSizeFromPageSizeSelector)) {\n return this.pageSizeFromPageSizeSelector;\n }\n if (_exists(this.pageSizeFromInitialState)) {\n return this.pageSizeFromInitialState;\n }\n if (_exists(this.pageSizeFromGridOptions)) {\n return this.pageSizeFromGridOptions;\n }\n return DEFAULT_PAGE_SIZE;\n }\n calculatePages() {\n if (this.active) {\n if (this.paginateChildRows) {\n this.calculatePagesAllRows();\n } else {\n this.calculatePagesMasterRowsOnly();\n }\n } else {\n this.calculatedPagesNotActive();\n }\n this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex, this.bottomDisplayedRowIndex);\n }\n unsetAutoCalculatedPageSize() {\n if (this.pageSizeAutoCalculated === void 0) {\n return;\n }\n const oldPageSize = this.pageSizeAutoCalculated;\n this.pageSizeAutoCalculated = void 0;\n if (this.pageSize === oldPageSize) {\n return;\n }\n this.calculatePages();\n this.dispatchPaginationChangedEvent({ newPageSize: true });\n }\n setPageSize(size, source) {\n const currentSize = this.pageSize;\n switch (source) {\n case \"autoCalculated\":\n this.pageSizeAutoCalculated = size;\n break;\n case \"pageSizeSelector\":\n this.pageSizeFromPageSizeSelector = size;\n if (this.currentPage !== 0) {\n this.goToFirstPage();\n }\n break;\n case \"initialState\":\n this.pageSizeFromInitialState = size;\n break;\n case \"gridOptions\":\n this.pageSizeFromGridOptions = size;\n this.pageSizeFromInitialState = void 0;\n this.pageSizeFromPageSizeSelector = void 0;\n if (this.currentPage !== 0) {\n this.goToFirstPage();\n }\n break;\n }\n if (currentSize !== this.pageSize) {\n this.calculatePages();\n this.dispatchPaginationChangedEvent({ newPageSize: true, keepRenderedRows: true });\n }\n }\n setZeroRows() {\n this.masterRowCount = 0;\n this.topDisplayedRowIndex = 0;\n this.bottomDisplayedRowIndex = -1;\n this.currentPage = 0;\n this.totalPages = 0;\n }\n adjustCurrentPageIfInvalid() {\n const totalPages = this.totalPages;\n if (this.currentPage >= totalPages) {\n this.currentPage = totalPages - 1;\n }\n const currentPage = this.currentPage;\n if (!isFinite(currentPage) || isNaN(currentPage) || currentPage < 0) {\n this.currentPage = 0;\n }\n }\n calculatePagesMasterRowsOnly() {\n const rowModel = this.beans.rowModel;\n const masterRowCount = rowModel.getTopLevelRowCount();\n this.masterRowCount = masterRowCount;\n if (masterRowCount <= 0) {\n this.setZeroRows();\n return;\n }\n const pageSize = this.pageSize;\n const masterLastRowIndex = masterRowCount - 1;\n this.totalPages = Math.floor(masterLastRowIndex / pageSize) + 1;\n this.adjustCurrentPageIfInvalid();\n const currentPage = this.currentPage;\n const masterPageStartIndex = pageSize * currentPage;\n let masterPageEndIndex = pageSize * (currentPage + 1) - 1;\n if (masterPageEndIndex > masterLastRowIndex) {\n masterPageEndIndex = masterLastRowIndex;\n }\n this.topDisplayedRowIndex = rowModel.getTopLevelRowDisplayedIndex(masterPageStartIndex);\n if (masterPageEndIndex === masterLastRowIndex) {\n this.bottomDisplayedRowIndex = rowModel.getRowCount() - 1;\n } else {\n const firstIndexNotToShow = rowModel.getTopLevelRowDisplayedIndex(masterPageEndIndex + 1);\n this.bottomDisplayedRowIndex = firstIndexNotToShow - 1;\n }\n }\n getMasterRowCount() {\n return this.masterRowCount;\n }\n calculatePagesAllRows() {\n const masterRowCount = this.beans.rowModel.getRowCount();\n this.masterRowCount = masterRowCount;\n if (masterRowCount === 0) {\n this.setZeroRows();\n return;\n }\n const { pageSize, currentPage } = this;\n const maxRowIndex = masterRowCount - 1;\n this.totalPages = Math.floor(maxRowIndex / pageSize) + 1;\n this.adjustCurrentPageIfInvalid();\n this.topDisplayedRowIndex = pageSize * currentPage;\n this.bottomDisplayedRowIndex = pageSize * (currentPage + 1) - 1;\n if (this.bottomDisplayedRowIndex > maxRowIndex) {\n this.bottomDisplayedRowIndex = maxRowIndex;\n }\n }\n calculatedPagesNotActive() {\n this.setPageSize(void 0, \"autoCalculated\");\n this.totalPages = 1;\n this.currentPage = 0;\n this.topDisplayedRowIndex = 0;\n this.bottomDisplayedRowIndex = this.beans.rowModel.getRowCount() - 1;\n }\n dispatchPaginationChangedEvent(params) {\n const { keepRenderedRows = false, newPage = false, newPageSize = false } = params;\n this.eventSvc.dispatchEvent({\n type: \"paginationChanged\",\n animate: false,\n newData: false,\n newPage,\n newPageSize,\n keepRenderedRows\n });\n }\n};\n\n// packages/ag-grid-community/src/pagination/paginationModule.ts\nvar PaginationModule = {\n moduleName: \"Pagination\",\n version: VERSION,\n beans: [PaginationService, PaginationAutoPageSizeService],\n icons: {\n // \"go to first\" button in pagination controls\n first: \"first\",\n // \"go to previous\" button in pagination controls\n previous: \"previous\",\n // \"go to next\" button in pagination controls\n next: \"next\",\n // \"go to last\" button in pagination controls\n last: \"last\"\n },\n apiFunctions: {\n paginationIsLastPageFound,\n paginationGetPageSize,\n paginationGetCurrentPage,\n paginationGetTotalPages,\n paginationGetRowCount,\n paginationGoToNextPage,\n paginationGoToPreviousPage,\n paginationGoToFirstPage,\n paginationGoToLastPage,\n paginationGoToPage\n },\n dependsOn: [PopupModule]\n};\n\n// packages/ag-grid-community/src/pinnedRowModel/manualPinnedRow.css\nvar manualPinnedRow_default = \".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}\";\n\n// packages/ag-grid-community/src/pinnedRowModel/pinnedRowApi.ts\nfunction getPinnedTopRowCount(beans) {\n return beans.pinnedRowModel?.getPinnedTopRowCount() ?? 0;\n}\nfunction getPinnedBottomRowCount(beans) {\n return beans.pinnedRowModel?.getPinnedBottomRowCount() ?? 0;\n}\nfunction getPinnedTopRow(beans, index) {\n return beans.pinnedRowModel?.getPinnedTopRow(index);\n}\nfunction getPinnedBottomRow(beans, index) {\n return beans.pinnedRowModel?.getPinnedBottomRow(index);\n}\nfunction forEachPinnedRow(beans, floating, callback) {\n return beans.pinnedRowModel?.forEachPinnedRow(floating, callback);\n}\n\n// packages/ag-grid-community/src/pinnedRowModel/pinnedRowModule.ts\nvar PinnedRowModule = {\n moduleName: \"PinnedRow\",\n version: VERSION,\n beans: [PinnedRowModel],\n css: [manualPinnedRow_default],\n apiFunctions: {\n getPinnedTopRowCount,\n getPinnedBottomRowCount,\n getPinnedTopRow,\n getPinnedBottomRow,\n forEachPinnedRow\n },\n icons: {\n rowPin: \"pin\",\n rowPinTop: \"pinned-top\",\n rowPinBottom: \"pinned-bottom\",\n rowUnpin: \"un-pin\"\n }\n};\n\n// packages/ag-grid-community/src/rendering/cellRenderers/animateShowChangeCellRenderer.ts\nvar ARROW_UP = \"\\u2191\";\nvar ARROW_DOWN = \"\\u2193\";\nvar AnimateShowChangeCellRendererElement = {\n tag: \"span\",\n children: [\n { tag: \"span\", ref: \"eDelta\", cls: \"ag-value-change-delta\" },\n { tag: \"span\", ref: \"eValue\", cls: \"ag-value-change-value\" }\n ]\n};\nvar AnimateShowChangeCellRenderer = class extends Component {\n constructor() {\n super(AnimateShowChangeCellRendererElement);\n this.eValue = RefPlaceholder;\n this.eDelta = RefPlaceholder;\n this.refreshCount = 0;\n }\n init(params) {\n this.refresh(params, true);\n }\n showDelta(params, delta) {\n const absDelta = Math.abs(delta);\n const valueFormatted = params.formatValue(absDelta);\n const valueToUse = _exists(valueFormatted) ? valueFormatted : absDelta;\n const deltaUp = delta >= 0;\n const eDelta = this.eDelta;\n if (deltaUp) {\n eDelta.textContent = ARROW_UP + valueToUse;\n } else {\n eDelta.textContent = ARROW_DOWN + valueToUse;\n }\n eDelta.classList.toggle(\"ag-value-change-delta-up\", deltaUp);\n eDelta.classList.toggle(\"ag-value-change-delta-down\", !deltaUp);\n }\n setTimerToRemoveDelta() {\n this.refreshCount++;\n const refreshCountCopy = this.refreshCount;\n this.beans.frameworkOverrides.wrapIncoming(() => {\n window.setTimeout(() => {\n if (refreshCountCopy === this.refreshCount) {\n this.hideDeltaValue();\n }\n }, 2e3);\n });\n }\n hideDeltaValue() {\n this.eValue.classList.remove(\"ag-value-change-value-highlight\");\n _clearElement(this.eDelta);\n }\n refresh(params, isInitialRender = false) {\n const { value, valueFormatted } = params;\n const { eValue, lastValue, beans } = this;\n if (value === lastValue) {\n return false;\n }\n if (_exists(valueFormatted)) {\n eValue.textContent = valueFormatted;\n } else if (_exists(value)) {\n eValue.textContent = value;\n } else {\n _clearElement(eValue);\n }\n if (beans.filterManager?.isSuppressFlashingCellsBecauseFiltering()) {\n return false;\n }\n const numericValue = value && typeof value === \"object\" && \"toNumber\" in value ? value.toNumber() : value;\n const numericLastValue = lastValue && typeof lastValue === \"object\" && \"toNumber\" in lastValue ? lastValue.toNumber() : lastValue;\n if (numericValue === numericLastValue) {\n return false;\n }\n if (typeof numericValue === \"number\" && typeof numericLastValue === \"number\") {\n const delta = numericValue - numericLastValue;\n this.showDelta(params, delta);\n }\n if (lastValue) {\n eValue.classList.add(\"ag-value-change-value-highlight\");\n }\n if (!isInitialRender) {\n this.setTimerToRemoveDelta();\n }\n this.lastValue = value;\n return true;\n }\n};\n\n// packages/ag-grid-community/src/rendering/cellRenderers/animateSlideCellRenderer.css\nvar animateSlideCellRenderer_default = \".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}\";\n\n// packages/ag-grid-community/src/rendering/cellRenderers/animateSlideCellRenderer.ts\nvar AnimateSlideCellRendererElement = {\n tag: \"span\",\n children: [{ tag: \"span\", ref: \"eCurrent\", cls: \"ag-value-slide-current\" }]\n};\nvar AnimateSlideCellRenderer = class extends Component {\n constructor() {\n super(AnimateSlideCellRendererElement);\n this.eCurrent = RefPlaceholder;\n this.refreshCount = 0;\n this.registerCSS(animateSlideCellRenderer_default);\n }\n init(params) {\n this.refresh(params, true);\n }\n addSlideAnimation() {\n this.refreshCount++;\n const refreshCountCopy = this.refreshCount;\n this.ePrevious?.remove();\n const { beans, eCurrent } = this;\n const prevElement = _createElement({ tag: \"span\", cls: \"ag-value-slide-previous ag-value-slide-out\" });\n this.ePrevious = prevElement;\n prevElement.textContent = eCurrent.textContent;\n this.getGui().insertBefore(prevElement, eCurrent);\n beans.frameworkOverrides.wrapIncoming(() => {\n window.setTimeout(() => {\n if (refreshCountCopy !== this.refreshCount) {\n return;\n }\n this.ePrevious.classList.add(\"ag-value-slide-out-end\");\n }, 50);\n window.setTimeout(() => {\n if (refreshCountCopy !== this.refreshCount) {\n return;\n }\n this.ePrevious?.remove();\n this.ePrevious = null;\n }, 3e3);\n });\n }\n refresh(params, isInitialRender = false) {\n let value = params.value;\n if (_missing(value)) {\n value = \"\";\n }\n if (value === this.lastValue) {\n return false;\n }\n if (this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering()) {\n return false;\n }\n if (!isInitialRender) {\n this.addSlideAnimation();\n }\n this.lastValue = value;\n const eCurrent = this.eCurrent;\n if (_exists(params.valueFormatted)) {\n eCurrent.textContent = params.valueFormatted;\n } else if (_exists(params.value)) {\n eCurrent.textContent = value;\n } else {\n _clearElement(eCurrent);\n }\n return true;\n }\n};\n\n// packages/ag-grid-community/src/rendering/cell/cellFlashService.ts\nvar CellFlashService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"cellFlashSvc\";\n this.nextAnimationTime = null;\n this.nextAnimationCycle = null;\n this.animations = {\n highlight: /* @__PURE__ */ new Map(),\n \"data-changed\": /* @__PURE__ */ new Map()\n };\n }\n animateCell(cellCtrl, cssName, flashDuration = this.beans.gos.get(\"cellFlashDuration\"), fadeDuration = this.beans.gos.get(\"cellFadeDuration\")) {\n const animations = this.animations[cssName];\n animations.delete(cellCtrl);\n const time = Date.now();\n const flashEndTime = time + flashDuration;\n const fadeEndTime = time + flashDuration + fadeDuration;\n const animState = {\n phase: \"flash\",\n flashEndTime,\n fadeEndTime\n };\n animations.set(cellCtrl, animState);\n const cssBase = `ag-cell-${cssName}`;\n const cssAnimation = `${cssBase}-animation`;\n const {\n comp,\n eGui: { style }\n } = cellCtrl;\n comp.toggleCss(cssBase, true);\n comp.toggleCss(cssAnimation, false);\n style.removeProperty(\"transition\");\n style.removeProperty(\"transition-delay\");\n if (this.nextAnimationTime && flashEndTime + 15 < this.nextAnimationTime) {\n clearTimeout(this.nextAnimationCycle);\n this.nextAnimationCycle = null;\n this.nextAnimationTime = null;\n }\n if (!this.nextAnimationCycle) {\n this.beans.frameworkOverrides.wrapIncoming(() => {\n this.nextAnimationCycle = setTimeout(this.advanceAnimations.bind(this), flashDuration);\n });\n this.nextAnimationTime = flashEndTime;\n }\n }\n advanceAnimations() {\n const time = Date.now();\n let nextAnimationTime = null;\n for (const cssName of Object.keys(this.animations)) {\n const animations = this.animations[cssName];\n const cssBase = `ag-cell-${cssName}`;\n const cssAnimation = `${cssBase}-animation`;\n for (const [cell, animState] of animations) {\n if (!cell.isAlive() || !cell.comp) {\n animations.delete(cell);\n continue;\n }\n const { phase, flashEndTime, fadeEndTime } = animState;\n const nextActionableTime = phase === \"flash\" ? flashEndTime : fadeEndTime;\n const requiresAction = time + 15 >= nextActionableTime;\n if (!requiresAction) {\n nextAnimationTime = Math.min(nextActionableTime, nextAnimationTime ?? Infinity);\n continue;\n }\n const {\n comp,\n eGui: { style }\n } = cell;\n switch (phase) {\n case \"flash\":\n comp.toggleCss(cssBase, false);\n comp.toggleCss(cssAnimation, true);\n style.transition = `background-color ${fadeEndTime - flashEndTime}ms`;\n style.transitionDelay = `${flashEndTime - time}ms`;\n nextAnimationTime = Math.min(fadeEndTime, nextAnimationTime ?? Infinity);\n animState.phase = \"fade\";\n break;\n case \"fade\":\n comp.toggleCss(cssBase, false);\n comp.toggleCss(cssAnimation, false);\n style.removeProperty(\"transition\");\n style.removeProperty(\"transition-delay\");\n animations.delete(cell);\n break;\n }\n }\n }\n if (nextAnimationTime == null) {\n this.nextAnimationTime = null;\n this.nextAnimationCycle = null;\n } else if (nextAnimationTime) {\n this.nextAnimationCycle = setTimeout(this.advanceAnimations.bind(this), nextAnimationTime - time);\n this.nextAnimationTime = nextAnimationTime;\n }\n }\n onFlashCells(cellCtrl, event) {\n if (!cellCtrl.comp) {\n return;\n }\n const cellId = _createCellId(cellCtrl.cellPosition);\n const shouldFlash = event.cells[cellId];\n if (shouldFlash) {\n this.animateCell(cellCtrl, \"highlight\");\n }\n }\n flashCell(cellCtrl, delays) {\n this.animateCell(cellCtrl, \"data-changed\", delays?.flashDuration, delays?.fadeDuration);\n }\n destroy() {\n for (const cssName of Object.keys(this.animations)) {\n const animations = this.animations[cssName];\n animations.clear();\n }\n }\n};\n\n// packages/ag-grid-community/src/rendering/cell/highlightChangesApi.ts\nfunction flashCells(beans, params = {}) {\n const { cellFlashSvc } = beans;\n if (!cellFlashSvc) {\n return;\n }\n beans.frameworkOverrides.wrapIncoming(() => {\n for (const cellCtrl of beans.rowRenderer.getCellCtrls(params.rowNodes, params.columns)) {\n cellFlashSvc.flashCell(cellCtrl, params);\n }\n });\n}\n\n// packages/ag-grid-community/src/rendering/cell/highlightChangesModule.ts\nvar HighlightChangesModule = {\n moduleName: \"HighlightChanges\",\n version: VERSION,\n beans: [CellFlashService],\n userComponents: {\n agAnimateShowChangeCellRenderer: AnimateShowChangeCellRenderer,\n agAnimateSlideCellRenderer: AnimateSlideCellRenderer\n },\n apiFunctions: {\n flashCells\n }\n};\n\n// packages/ag-grid-community/src/rendering/renderApi.ts\nfunction setGridAriaProperty(beans, property, value) {\n if (!property) {\n return;\n }\n const eGrid = beans.ctrlsSvc.getGridBodyCtrl().eGridBody;\n const ariaProperty = `aria-${property}`;\n if (value === null) {\n eGrid.removeAttribute(ariaProperty);\n } else {\n eGrid.setAttribute(ariaProperty, value);\n }\n}\nfunction refreshCells(beans, params = {}) {\n beans.frameworkOverrides.wrapIncoming(() => beans.rowRenderer.refreshCells(params));\n}\nfunction refreshHeader(beans) {\n beans.frameworkOverrides.wrapIncoming(() => {\n for (const c of beans.ctrlsSvc.getHeaderRowContainerCtrls()) {\n c.refresh();\n }\n });\n}\nfunction isAnimationFrameQueueEmpty(beans) {\n return beans.animationFrameSvc?.isQueueEmpty() ?? true;\n}\nfunction flushAllAnimationFrames(beans) {\n beans.animationFrameSvc?.flushAllFrames();\n}\nfunction getSizesForCurrentTheme(beans) {\n return {\n rowHeight: _getRowHeightAsNumber(beans),\n headerHeight: getHeaderHeight(beans)\n };\n}\nfunction getCellRendererInstances(beans, params = {}) {\n const cellRenderers = [];\n for (const cellCtrl of beans.rowRenderer.getCellCtrls(params.rowNodes, params.columns)) {\n const cellRenderer = cellCtrl.getCellRenderer();\n if (cellRenderer != null) {\n cellRenderers.push(_unwrapUserComp(cellRenderer));\n }\n }\n if (params.columns?.length) {\n return cellRenderers;\n }\n const fullWidthRenderers = [];\n const rowIdMap = mapRowNodes(params.rowNodes);\n for (const rowCtrl of beans.rowRenderer.getAllRowCtrls()) {\n if (rowIdMap && !isRowInMap(rowCtrl.rowNode, rowIdMap)) {\n continue;\n }\n if (!rowCtrl.isFullWidth()) {\n continue;\n }\n const renderers = rowCtrl.getFullWidthCellRenderers();\n for (let i = 0; i < renderers.length; i++) {\n const renderer = renderers[i];\n if (renderer != null) {\n fullWidthRenderers.push(_unwrapUserComp(renderer));\n }\n }\n }\n return [...fullWidthRenderers, ...cellRenderers];\n}\n\n// packages/ag-grid-community/src/rendering/renderModule.ts\nvar RenderApiModule = {\n moduleName: \"RenderApi\",\n version: VERSION,\n apiFunctions: {\n setGridAriaProperty,\n refreshCells,\n refreshHeader,\n isAnimationFrameQueueEmpty,\n flushAllAnimationFrames,\n getSizesForCurrentTheme,\n getCellRendererInstances\n }\n};\n\n// packages/ag-grid-community/src/rendering/row/rowAutoHeightService.ts\nvar RowAutoHeightService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"rowAutoHeight\";\n this.wasEverActive = false;\n this._debouncedCalculateRowHeights = _debounce(this, this.calculateRowHeights.bind(this), 1);\n }\n /**\n * If row height has been active, request a refresh of the row heights.\n */\n requestCheckAutoHeight() {\n if (!this.wasEverActive) {\n return;\n }\n this._debouncedCalculateRowHeights();\n }\n calculateRowHeights() {\n const { visibleCols, rowModel, rowSpanSvc, pinnedRowModel } = this.beans;\n const displayedAutoHeightCols = visibleCols.autoHeightCols;\n let anyNodeChanged = false;\n const updateDisplayedRowHeights = (row) => {\n const autoHeights = row.__autoHeights;\n let newRowHeight = _getRowHeightForNode(this.beans, row).height;\n for (const col of displayedAutoHeightCols) {\n let cellHeight = autoHeights?.[col.getColId()];\n const spannedCell = rowSpanSvc?.getCellSpan(col, row);\n if (spannedCell) {\n if (spannedCell.getLastNode() !== row) {\n continue;\n }\n cellHeight = rowSpanSvc?.getCellSpan(col, row)?.getLastNodeAutoHeight();\n if (!cellHeight) {\n return;\n }\n }\n if (cellHeight == null) {\n if (this.colSpanSkipCell(col, row)) {\n continue;\n }\n return;\n }\n newRowHeight = Math.max(cellHeight, newRowHeight);\n }\n if (newRowHeight !== row.rowHeight) {\n row.setRowHeight(newRowHeight);\n anyNodeChanged = true;\n }\n };\n pinnedRowModel?.forEachPinnedRow?.(\"top\", updateDisplayedRowHeights);\n pinnedRowModel?.forEachPinnedRow?.(\"bottom\", updateDisplayedRowHeights);\n rowModel.forEachDisplayedNode?.(updateDisplayedRowHeights);\n if (anyNodeChanged) {\n rowModel.onRowHeightChanged?.();\n }\n }\n /**\n * Set the cell height into the row node, and request a refresh of the row heights if there's been a change.\n * @param rowNode the node to set the auto height on\n * @param cellHeight the height to set, undefined if the cell has just been destroyed\n * @param column the column of the cell\n */\n setRowAutoHeight(rowNode, cellHeight, column) {\n rowNode.__autoHeights ?? (rowNode.__autoHeights = {});\n if (cellHeight == void 0) {\n delete rowNode.__autoHeights[column.getId()];\n return;\n }\n const previousCellHeight = rowNode.__autoHeights[column.getId()];\n rowNode.__autoHeights[column.getId()] = cellHeight;\n if (previousCellHeight !== cellHeight) {\n this.requestCheckAutoHeight();\n }\n }\n /**\n * If using col span, then cells which have been spanned over do not need an auto height value\n * @param col the column of the cell\n * @param node the node of the cell\n * @returns whether the row needs auto height value for that column\n */\n colSpanSkipCell(col, node) {\n const { colModel, colViewport, visibleCols } = this.beans;\n if (!colModel.colSpanActive) {\n return false;\n }\n let activeColsForRow = [];\n switch (col.getPinned()) {\n case \"left\":\n activeColsForRow = visibleCols.getLeftColsForRow(node);\n break;\n case \"right\":\n activeColsForRow = visibleCols.getRightColsForRow(node);\n break;\n case null:\n activeColsForRow = colViewport.getColsWithinViewport(node);\n break;\n }\n return !activeColsForRow.includes(col);\n }\n /**\n * If required, sets up observers to continuously measure changes in the cell height.\n * @param cellCtrl the cellCtrl of the cell\n * @param eCellWrapper the HTMLElement to track the height of\n * @param compBean the component bean to add the destroy/cleanup function to\n * @returns whether or not auto height has been set up on this cell\n */\n setupCellAutoHeight(cellCtrl, eCellWrapper, compBean) {\n if (!cellCtrl.column.isAutoHeight() || !eCellWrapper) {\n return false;\n }\n this.wasEverActive = true;\n const eParentCell = eCellWrapper.parentElement;\n const { rowNode, column } = cellCtrl;\n const beans = this.beans;\n const measureHeight = (timesCalled) => {\n if (this.beans.editSvc?.isEditing(cellCtrl)) {\n return;\n }\n if (!cellCtrl.isAlive() || !compBean.isAlive()) {\n return;\n }\n const { paddingTop, paddingBottom, borderBottomWidth, borderTopWidth } = _getElementSize(eParentCell);\n const extraHeight = paddingTop + paddingBottom + borderBottomWidth + borderTopWidth;\n const wrapperHeight = eCellWrapper.offsetHeight;\n const autoHeight = wrapperHeight + extraHeight;\n if (timesCalled < 5) {\n const doc = _getDocument(beans);\n const notYetInDom = !doc?.contains(eCellWrapper);\n const possiblyNoContentYet = autoHeight == 0;\n if (notYetInDom || possiblyNoContentYet) {\n window.setTimeout(() => measureHeight(timesCalled + 1), 0);\n return;\n }\n }\n this.setRowAutoHeight(rowNode, autoHeight, column);\n };\n const listener = () => measureHeight(0);\n listener();\n const destroyResizeObserver = _observeResize(beans, eCellWrapper, listener);\n compBean.addDestroyFunc(() => {\n destroyResizeObserver();\n this.setRowAutoHeight(rowNode, void 0, column);\n });\n return true;\n }\n setAutoHeightActive(cols) {\n this.active = cols.list.some((col) => col.isVisible() && col.isAutoHeight());\n }\n /**\n * Determines if the row auto height service has cells to grow.\n * @returns true if all of the rendered rows are at least as tall as their rendered cells.\n */\n areRowsMeasured() {\n if (!this.active) {\n return true;\n }\n const rowCtrls = this.beans.rowRenderer.getAllRowCtrls();\n let renderedAutoHeightCols = null;\n for (const { rowNode } of rowCtrls) {\n if (!renderedAutoHeightCols || this.beans.colModel.colSpanActive) {\n const renderedCols = this.beans.colViewport.getColsWithinViewport(rowNode);\n renderedAutoHeightCols = renderedCols.filter((col) => col.isAutoHeight());\n }\n if (renderedAutoHeightCols.length === 0) {\n continue;\n }\n if (!rowNode.__autoHeights) {\n return false;\n }\n for (const col of renderedAutoHeightCols) {\n const cellHeight = rowNode.__autoHeights[col.getColId()];\n if (!cellHeight || rowNode.rowHeight < cellHeight) {\n return false;\n }\n }\n }\n return true;\n }\n};\n\n// packages/ag-grid-community/src/rendering/row/rowAutoHeightModule.ts\nvar RowAutoHeightModule = {\n moduleName: \"RowAutoHeight\",\n version: VERSION,\n beans: [RowAutoHeightService]\n};\n\n// packages/ag-grid-community/src/rendering/spanning/rowSpanCache.ts\nvar CellSpan = class {\n constructor(col, firstNode) {\n this.col = col;\n this.firstNode = firstNode;\n // used for distinguishing between types\n this.cellSpan = true;\n this.spannedNodes = /* @__PURE__ */ new Set();\n this.addSpannedNode(firstNode);\n }\n /**\n * Reset the span leaving only the head.\n * Head is used as a comparison as this is the row used to render this cell\n * Even if the row data changes, the cell will properly reflect the correct value.\n */\n reset() {\n this.spannedNodes.clear();\n this.addSpannedNode(this.firstNode);\n }\n addSpannedNode(node) {\n this.spannedNodes.add(node);\n this.lastNode = node;\n }\n getLastNode() {\n return this.lastNode;\n }\n getCellHeight() {\n return this.lastNode.rowTop + this.lastNode.rowHeight - this.firstNode.rowTop - 1;\n }\n doesSpanContain(cellPosition) {\n if (cellPosition.column !== this.col) {\n return false;\n }\n if (cellPosition.rowPinned != this.firstNode.rowPinned) {\n return false;\n }\n return this.firstNode.rowIndex <= cellPosition.rowIndex && cellPosition.rowIndex <= this.lastNode.rowIndex;\n }\n /**\n * Gets the auto height value for last node in the spanned cell.\n * The first node is used to store the auto height for the cell, but the additional height for this cell\n * needs applied to the last row in the span.\n */\n getLastNodeAutoHeight() {\n const autoHeight = this.firstNode.__autoHeights?.[this.col.getColId()];\n if (autoHeight == null) {\n return void 0;\n }\n let allButLastHeights = 0;\n for (const node of this.spannedNodes) {\n if (node === this.lastNode) {\n continue;\n }\n allButLastHeights += node.rowHeight;\n }\n return autoHeight - allButLastHeights;\n }\n};\nvar RowSpanCache = class extends BeanStub {\n constructor(column) {\n super();\n this.column = column;\n }\n buildCache(pinned) {\n const {\n column,\n beans: { gos, pinnedRowModel, rowModel, valueSvc, pagination }\n } = this;\n const { colDef } = column;\n const oldMap = this.getNodeMap(pinned);\n const newMap = /* @__PURE__ */ new Map();\n const isFullWidthCellFunc = gos.getCallback(\"isFullWidthRow\");\n const equalsFnc = colDef.equals;\n const customCompare = colDef.spanRows;\n const isCustomCompare = typeof customCompare === \"function\";\n let lastNode = null;\n let spanData = null;\n let lastValue;\n const setNewHead = (node, value) => {\n lastNode = node;\n spanData = null;\n lastValue = value;\n };\n const checkNodeForCache = (node) => {\n const doesNodeSupportSpanning = !node.isExpandable() && !node.group && !node.detail && (isFullWidthCellFunc ? !isFullWidthCellFunc({ rowNode: node }) : true);\n if (node.rowIndex == null || !doesNodeSupportSpanning) {\n setNewHead(null, null);\n return;\n }\n if (lastNode == null || node.level !== lastNode.level || // no span across groups\n node.footer || spanData && node.rowIndex - 1 !== spanData?.getLastNode().rowIndex) {\n setNewHead(node, valueSvc.getValue(column, node, \"data\"));\n return;\n }\n const value = valueSvc.getValue(column, node, \"data\");\n if (isCustomCompare) {\n const params = _addGridCommonParams(gos, {\n valueA: lastValue,\n nodeA: lastNode,\n valueB: value,\n nodeB: node,\n column,\n colDef\n });\n if (!customCompare(params)) {\n setNewHead(node, value);\n return;\n }\n } else if (equalsFnc ? !equalsFnc(lastValue, value) : lastValue !== value) {\n setNewHead(node, value);\n return;\n }\n if (!spanData) {\n const oldSpan = oldMap?.get(lastNode);\n if (oldSpan?.firstNode === lastNode) {\n oldSpan.reset();\n spanData = oldSpan;\n } else {\n spanData = new CellSpan(column, lastNode);\n }\n newMap.set(lastNode, spanData);\n }\n spanData.addSpannedNode(node);\n newMap.set(node, spanData);\n };\n switch (pinned) {\n case \"center\":\n rowModel.forEachDisplayedNode?.((node) => {\n const isNodeInPage = !pagination || pagination.isRowInPage(node.rowIndex);\n if (!isNodeInPage) {\n return;\n }\n checkNodeForCache(node);\n });\n this.centerValueNodeMap = newMap;\n break;\n case \"top\":\n pinnedRowModel?.forEachPinnedRow(\"top\", checkNodeForCache);\n this.topValueNodeMap = newMap;\n break;\n case \"bottom\":\n pinnedRowModel?.forEachPinnedRow(\"bottom\", checkNodeForCache);\n this.bottomValueNodeMap = newMap;\n break;\n }\n }\n isCellSpanning(node) {\n return !!this.getCellSpan(node);\n }\n getCellSpan(node) {\n return this.getNodeMap(node.rowPinned).get(node);\n }\n getNodeMap(container) {\n switch (container) {\n case \"top\":\n return this.topValueNodeMap;\n case \"bottom\":\n return this.bottomValueNodeMap;\n default:\n return this.centerValueNodeMap;\n }\n }\n};\n\n// packages/ag-grid-community/src/rendering/spanning/rowSpanService.ts\nvar RowSpanService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"rowSpanSvc\";\n this.spanningColumns = /* @__PURE__ */ new Map();\n // debounced to allow spannedRowRenderer to run first, removing any old spanned rows\n this.debouncePinnedEvent = _debounce(this, this.dispatchCellsUpdatedEvent.bind(this, true), 0);\n this.debounceModelEvent = _debounce(this, this.dispatchCellsUpdatedEvent.bind(this, false), 0);\n this.pinnedTimeout = null;\n this.modelTimeout = null;\n }\n postConstruct() {\n const onRowDataUpdated = this.onRowDataUpdated.bind(this);\n const buildPinnedCaches = this.buildPinnedCaches.bind(this);\n this.addManagedEventListeners({\n paginationChanged: this.buildModelCaches.bind(this),\n pinnedRowDataChanged: buildPinnedCaches,\n pinnedRowsChanged: buildPinnedCaches,\n rowNodeDataChanged: onRowDataUpdated,\n cellValueChanged: onRowDataUpdated\n });\n }\n /**\n * When a new column is created with spanning (or spanning changes for a column)\n * @param column column that is now spanning\n */\n register(column) {\n const { gos } = this.beans;\n if (!gos.get(\"enableCellSpan\")) {\n return;\n }\n if (this.spanningColumns.has(column)) {\n return;\n }\n const cache = this.createManagedBean(new RowSpanCache(column));\n this.spanningColumns.set(column, cache);\n cache.buildCache(\"top\");\n cache.buildCache(\"bottom\");\n cache.buildCache(\"center\");\n this.debouncePinnedEvent();\n this.debounceModelEvent();\n }\n dispatchCellsUpdatedEvent(pinned) {\n this.dispatchLocalEvent({ type: \"spannedCellsUpdated\", pinned });\n }\n /**\n * When a new column is destroyed with spanning (or spanning changes for a column)\n * @param column column that is now spanning\n */\n deregister(column) {\n this.spanningColumns.delete(column);\n }\n // called when data changes, as this could be a hot path it's debounced\n // it uses timeouts instead of debounce so that it can be cancelled by `modelUpdated`\n // which is expected to run immediately (to exec before the rowRenderer)\n onRowDataUpdated({ node }) {\n const { spannedRowRenderer } = this.beans;\n if (node.rowPinned) {\n if (this.pinnedTimeout != null) {\n return;\n }\n this.pinnedTimeout = window.setTimeout(() => {\n this.pinnedTimeout = null;\n this.buildPinnedCaches();\n spannedRowRenderer?.createCtrls(\"top\");\n spannedRowRenderer?.createCtrls(\"bottom\");\n }, 0);\n return;\n }\n if (this.modelTimeout != null) {\n return;\n }\n this.modelTimeout = window.setTimeout(() => {\n this.modelTimeout = null;\n this.buildModelCaches();\n spannedRowRenderer?.createCtrls(\"center\");\n }, 0);\n }\n buildModelCaches() {\n if (this.modelTimeout != null) {\n clearTimeout(this.modelTimeout);\n }\n this.spanningColumns.forEach((cache) => cache.buildCache(\"center\"));\n this.debounceModelEvent();\n }\n buildPinnedCaches() {\n if (this.pinnedTimeout != null) {\n clearTimeout(this.pinnedTimeout);\n }\n this.spanningColumns.forEach((cache) => {\n cache.buildCache(\"top\");\n cache.buildCache(\"bottom\");\n });\n this.debouncePinnedEvent();\n }\n isCellSpanning(col, rowNode) {\n const cache = this.spanningColumns.get(col);\n if (!cache) {\n return false;\n }\n return cache.isCellSpanning(rowNode);\n }\n getCellSpanByPosition(position) {\n const { pinnedRowModel, rowModel } = this.beans;\n const col = position.column;\n const index = position.rowIndex;\n const cache = this.spanningColumns.get(col);\n if (!cache) {\n return void 0;\n }\n let node;\n switch (position.rowPinned) {\n case \"top\":\n node = pinnedRowModel?.getPinnedTopRow(index);\n break;\n case \"bottom\":\n node = pinnedRowModel?.getPinnedBottomRow(index);\n break;\n default:\n node = rowModel.getRow(index);\n }\n if (!node) {\n return void 0;\n }\n return cache.getCellSpan(node);\n }\n getCellStart(position) {\n const span = this.getCellSpanByPosition(position);\n if (!span) {\n return position;\n }\n return { ...position, rowIndex: span.firstNode.rowIndex };\n }\n getCellEnd(position) {\n const span = this.getCellSpanByPosition(position);\n if (!span) {\n return position;\n }\n return { ...position, rowIndex: span.getLastNode().rowIndex };\n }\n /**\n * Look-up a spanned cell given a col and node as position indicators\n *\n * @param col a column to lookup a span at this position\n * @param rowNode a node that may be spanned at this position\n * @returns the CellSpan object if one exists\n */\n getCellSpan(col, rowNode) {\n const cache = this.spanningColumns.get(col);\n if (!cache) {\n return void 0;\n }\n return cache.getCellSpan(rowNode);\n }\n forEachSpannedColumn(rowNode, callback) {\n for (const [col, cache] of this.spanningColumns) {\n if (cache.isCellSpanning(rowNode)) {\n const spanningNode = cache.getCellSpan(rowNode);\n callback(col, spanningNode);\n }\n }\n }\n destroy() {\n super.destroy();\n this.spanningColumns.clear();\n }\n};\n\n// packages/ag-grid-community/src/rendering/spanning/spannedCellCtrl.ts\nvar SpannedCellCtrl = class extends CellCtrl {\n constructor(cellSpan, rowCtrl, beans) {\n super(cellSpan.col, cellSpan.firstNode, beans, rowCtrl);\n this.cellSpan = cellSpan;\n this.SPANNED_CELL_CSS_CLASS = \"ag-spanned-cell\";\n }\n setComp(comp, eCell, eWrapper, eCellWrapper, printLayout, startEditing, compBean) {\n this.eWrapper = eWrapper;\n super.setComp(comp, eCell, eWrapper, eCellWrapper, printLayout, startEditing, compBean);\n this.setAriaRowSpan();\n }\n isCellSpanning() {\n return true;\n }\n getCellSpan() {\n return this.cellSpan;\n }\n /**\n * When cell is spanning, ensure row index is also available on the cell\n */\n refreshAriaRowIndex() {\n const { eGui, rowNode } = this;\n if (!eGui || rowNode.rowIndex == null) {\n return;\n }\n _setAriaRowIndex(eGui, rowNode.rowIndex);\n }\n /**\n * When cell is spanning, ensure row index is also available on the cell\n */\n setAriaRowSpan() {\n _setAriaRowSpan(this.eGui, this.cellSpan.spannedNodes.size);\n }\n // not ideal, for tabbing need to force the focused position\n setFocusedCellPosition(cellPos) {\n this.focusedCellPosition = cellPos;\n }\n getFocusedCellPosition() {\n return this.focusedCellPosition ?? this.cellPosition;\n }\n checkCellFocused() {\n const focusedCell = this.beans.focusSvc.getFocusedCell();\n return !!focusedCell && this.cellSpan.doesSpanContain(focusedCell);\n }\n applyStaticCssClasses() {\n super.applyStaticCssClasses();\n this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS, true);\n }\n onCellFocused(event) {\n const { beans } = this;\n if (_isCellFocusSuppressed(beans)) {\n this.focusedCellPosition = void 0;\n return;\n }\n const cellFocused = this.isCellFocused();\n if (!cellFocused) {\n this.focusedCellPosition = void 0;\n }\n if (event && cellFocused) {\n this.focusedCellPosition = {\n rowIndex: event.rowIndex,\n rowPinned: event.rowPinned,\n column: event.column\n // fix\n };\n }\n super.onCellFocused(event);\n }\n getRootElement() {\n return this.eWrapper;\n }\n};\n\n// packages/ag-grid-community/src/rendering/spanning/spannedRowCtrl.ts\nvar SpannedRowCtrl = class extends RowCtrl {\n getInitialRowClasses(_rowContainerType) {\n return [\"ag-spanned-row\"];\n }\n getNewCellCtrl(col) {\n const cellSpan = this.beans.rowSpanSvc?.getCellSpan(col, this.rowNode);\n if (!cellSpan) {\n return;\n }\n const firstRowOfSpan = cellSpan.firstNode !== this.rowNode;\n if (firstRowOfSpan) {\n return;\n }\n return new SpannedCellCtrl(cellSpan, this, this.beans);\n }\n isCorrectCtrlForSpan(cell) {\n const cellSpan = this.beans.rowSpanSvc?.getCellSpan(cell.column, this.rowNode);\n if (!cellSpan) {\n return false;\n }\n const firstRowOfSpan = cellSpan.firstNode !== this.rowNode;\n if (firstRowOfSpan) {\n return false;\n }\n return cell.getCellSpan() === cellSpan;\n }\n /**\n * Below overrides are explicitly disabling styling and other unwanted behaviours for spannedRowCtrl\n */\n onRowHeightChanged() {\n }\n refreshFirstAndLastRowStyles() {\n }\n addHoverFunctionality() {\n }\n resetHoveredStatus() {\n }\n};\n\n// packages/ag-grid-community/src/rendering/spanning/spannedRowRenderer.ts\nvar SpannedRowRenderer = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"spannedRowRenderer\";\n this.topCtrls = /* @__PURE__ */ new Map();\n this.bottomCtrls = /* @__PURE__ */ new Map();\n this.centerCtrls = /* @__PURE__ */ new Map();\n }\n postConstruct() {\n this.addManagedEventListeners({\n displayedRowsChanged: this.createAllCtrls.bind(this)\n });\n }\n createAllCtrls() {\n this.createCtrls(\"top\");\n this.createCtrls(\"bottom\");\n this.createCtrls(\"center\");\n }\n /**\n * When displayed rows or cols change, the spanned cell ctrls need to update\n */\n createCtrls(ctrlsKey) {\n const { rowSpanSvc } = this.beans;\n const previousCtrls = this.getCtrlsMap(ctrlsKey);\n const previousCtrlsSize = previousCtrls.size;\n const rowCtrls = this.getAllRelevantRowControls(ctrlsKey);\n const newRowCtrls = /* @__PURE__ */ new Map();\n let hasNewSpans = false;\n for (const ctrl of rowCtrls) {\n if (!ctrl.isAlive()) {\n continue;\n }\n rowSpanSvc?.forEachSpannedColumn(ctrl.rowNode, (col, cellSpan) => {\n if (newRowCtrls.has(cellSpan.firstNode)) {\n return;\n }\n const existingCtrl = previousCtrls.get(cellSpan.firstNode);\n if (existingCtrl) {\n newRowCtrls.set(cellSpan.firstNode, existingCtrl);\n previousCtrls.delete(cellSpan.firstNode);\n return;\n }\n hasNewSpans = true;\n const newCtrl = new SpannedRowCtrl(cellSpan.firstNode, this.beans, false, false, false);\n newRowCtrls.set(cellSpan.firstNode, newCtrl);\n });\n }\n this.setCtrlsMap(ctrlsKey, newRowCtrls);\n const sameCount = newRowCtrls.size === previousCtrlsSize;\n if (!hasNewSpans && sameCount) {\n return;\n }\n for (const oldCtrl of previousCtrls.values()) {\n oldCtrl.destroyFirstPass(true);\n oldCtrl.destroySecondPass();\n }\n this.dispatchLocalEvent({\n type: `spannedRowsUpdated`,\n ctrlsKey\n });\n }\n // cannot use getAllRowCtrls as it returns this services row ctrls.\n getAllRelevantRowControls(ctrlsKey) {\n const { rowRenderer } = this.beans;\n switch (ctrlsKey) {\n case \"top\":\n return rowRenderer.topRowCtrls;\n case \"bottom\":\n return rowRenderer.bottomRowCtrls;\n case \"center\":\n return rowRenderer.allRowCtrls;\n }\n }\n getCellByPosition(cellPosition) {\n const { rowSpanSvc } = this.beans;\n const cellSpan = rowSpanSvc?.getCellSpanByPosition(cellPosition);\n if (!cellSpan) {\n return void 0;\n }\n const ctrl = this.getCtrlsMap(cellPosition.rowPinned).get(cellSpan.firstNode);\n if (!ctrl) {\n return void 0;\n }\n return ctrl.getAllCellCtrls().find((cellCtrl) => cellCtrl.column === cellPosition.column);\n }\n getCtrls(container) {\n return [...this.getCtrlsMap(container).values()];\n }\n destroyRowCtrls(container) {\n for (const ctrl of this.getCtrlsMap(container).values()) {\n ctrl.destroyFirstPass(true);\n ctrl.destroySecondPass();\n }\n this.setCtrlsMap(container, /* @__PURE__ */ new Map());\n }\n getCtrlsMap(container) {\n switch (container) {\n case \"top\":\n return this.topCtrls;\n case \"bottom\":\n return this.bottomCtrls;\n default:\n return this.centerCtrls;\n }\n }\n setCtrlsMap(container, map) {\n switch (container) {\n case \"top\":\n this.topCtrls = map;\n break;\n case \"bottom\":\n this.bottomCtrls = map;\n break;\n default:\n this.centerCtrls = map;\n break;\n }\n }\n destroy() {\n super.destroy();\n this.destroyRowCtrls(\"top\");\n this.destroyRowCtrls(\"bottom\");\n this.destroyRowCtrls(\"center\");\n }\n};\n\n// packages/ag-grid-community/src/rendering/spanning/cellSpanModule.ts\nvar CellSpanModule = {\n moduleName: \"CellSpan\",\n version: VERSION,\n beans: [RowSpanService, SpannedRowRenderer]\n};\n\n// packages/ag-grid-community/src/columns/selectionColService.ts\nvar SelectionColService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"selectionColSvc\";\n }\n postConstruct() {\n this.addManagedPropertyListener(\"rowSelection\", (event) => {\n this.onSelectionOptionsChanged(\n event.currentValue,\n event.previousValue,\n _convertColumnEventSourceType(event.source)\n );\n });\n this.addManagedPropertyListener(\"selectionColumnDef\", this.updateColumns.bind(this));\n }\n addColumns(cols) {\n const selectionCols = this.columns;\n if (selectionCols == null) {\n return;\n }\n cols.list = selectionCols.list.concat(cols.list);\n cols.tree = selectionCols.tree.concat(cols.tree);\n _updateColsMap(cols);\n }\n createColumns(cols, updateOrders) {\n const destroyCollection = () => {\n _destroyColumnTree(this.beans, this.columns?.tree);\n this.columns = null;\n };\n const newTreeDepth = cols.treeDepth;\n const oldTreeDepth = this.columns?.treeDepth ?? -1;\n const treeDepthSame = oldTreeDepth == newTreeDepth;\n const list = this.generateSelectionCols();\n const areSame = _areColIdsEqual(list, this.columns?.list ?? []);\n if (areSame && treeDepthSame) {\n return;\n }\n destroyCollection();\n const { colGroupSvc } = this.beans;\n const treeDepth = colGroupSvc?.findDepth(cols.tree) ?? 0;\n const tree = colGroupSvc?.balanceTreeForAutoCols(list, treeDepth) ?? [];\n this.columns = {\n list,\n tree,\n treeDepth,\n map: {}\n };\n const putSelectionColsFirstInList = (cols2) => {\n if (!cols2) {\n return null;\n }\n const colsFiltered = cols2.filter((col) => !isColumnSelectionCol(col));\n return [...list, ...colsFiltered];\n };\n updateOrders(putSelectionColsFirstInList);\n }\n updateColumns(event) {\n const source = _convertColumnEventSourceType(event.source);\n const { beans } = this;\n for (const col of this.columns?.list ?? []) {\n const colDef = this.createSelectionColDef(event.currentValue);\n col.setColDef(colDef, null, source);\n _applyColumnState(beans, { state: [_getColumnStateFromColDef(colDef, col.colId)] }, source);\n }\n }\n getColumn(key) {\n return this.columns?.list.find((col) => _columnsMatch(col, key)) ?? null;\n }\n getColumns() {\n return this.columns?.list ?? null;\n }\n isSelectionColumnEnabled() {\n const { gos, beans } = this;\n const rowSelection = gos.get(\"rowSelection\");\n if (typeof rowSelection !== \"object\" || !_isRowSelection(gos)) {\n return false;\n }\n const hasAutoCols = (beans.autoColSvc?.getColumns()?.length ?? 0) > 0;\n if (rowSelection.checkboxLocation === \"autoGroupColumn\" && hasAutoCols) {\n return false;\n }\n const checkboxes = !!_getCheckboxes(rowSelection);\n const headerCheckbox = _getHeaderCheckbox(rowSelection);\n return checkboxes || headerCheckbox;\n }\n createSelectionColDef(def) {\n const { gos } = this;\n const selectionColumnDef = def ?? gos.get(\"selectionColumnDef\");\n const enableRTL = gos.get(\"enableRtl\");\n const { rowSpan: _, spanRows: __, ...filteredSelColDef } = selectionColumnDef ?? {};\n return {\n // overridable properties\n width: 50,\n resizable: false,\n suppressHeaderMenuButton: true,\n sortable: false,\n suppressMovable: true,\n lockPosition: enableRTL ? \"right\" : \"left\",\n comparator(valueA, valueB, nodeA, nodeB) {\n const aSelected = nodeA.isSelected();\n const bSelected = nodeB.isSelected();\n return aSelected === bSelected ? 0 : aSelected ? 1 : -1;\n },\n editable: false,\n suppressFillHandle: true,\n suppressAutoSize: true,\n pinned: null,\n // overrides\n ...filteredSelColDef,\n // non-overridable properties\n colId: SELECTION_COLUMN_ID,\n chartDataType: \"excluded\"\n };\n }\n generateSelectionCols() {\n if (!this.isSelectionColumnEnabled()) {\n return [];\n }\n const colDef = this.createSelectionColDef();\n const colId = colDef.colId;\n this.gos.validateColDef(colDef, colId, true);\n const col = new AgColumn(colDef, null, colId, false);\n this.createBean(col);\n return [col];\n }\n onSelectionOptionsChanged(current, prev, source) {\n const prevCheckbox = prev && typeof prev !== \"string\" ? _getCheckboxes(prev) : void 0;\n const currCheckbox = current && typeof current !== \"string\" ? _getCheckboxes(current) : void 0;\n const checkboxHasChanged = prevCheckbox !== currCheckbox;\n const prevHeaderCheckbox = prev && typeof prev !== \"string\" ? _getHeaderCheckbox(prev) : void 0;\n const currHeaderCheckbox = current && typeof current !== \"string\" ? _getHeaderCheckbox(current) : void 0;\n const headerCheckboxHasChanged = prevHeaderCheckbox !== currHeaderCheckbox;\n const currLocation = _getCheckboxLocation(current);\n const prevLocation = _getCheckboxLocation(prev);\n const locationChanged = currLocation !== prevLocation;\n if (checkboxHasChanged || headerCheckboxHasChanged || locationChanged) {\n this.beans.colModel.refreshAll(source);\n }\n }\n destroy() {\n _destroyColumnTree(this.beans, this.columns?.tree);\n super.destroy();\n }\n /**\n * Refreshes visibility of the selection column based on which columns are currently visible.\n * Called by the VisibleColsService with the columns that are currently visible in left/center/right\n * containers. This method *MUTATES* those arrays directly.\n *\n * The selection column should be visible if all of the following are true\n * - The selection column is not disabled\n * - The number of visible columns excluding the selection column and row numbers column is greater than 0\n * @param leftCols Visible columns in the left-pinned container\n * @param centerCols Visible columns in the center viewport\n * @param rightCols Visible columns in the right-pinned container\n */\n refreshVisibility(leftCols, centerCols, rightCols) {\n if (!this.columns?.list.length) {\n return;\n }\n const numVisibleCols = leftCols.length + centerCols.length + rightCols.length;\n if (numVisibleCols === 0) {\n return;\n }\n const column = this.columns.list[0];\n if (!column.isVisible()) {\n return;\n }\n const hideSelectionCol = () => {\n let cols;\n switch (column.pinned) {\n case \"left\":\n case true:\n cols = leftCols;\n break;\n case \"right\":\n cols = rightCols;\n break;\n default:\n cols = centerCols;\n }\n if (cols) {\n _removeFromArray(cols, column);\n }\n };\n const rowNumbersCol = this.beans.rowNumbersSvc?.getColumn(ROW_NUMBERS_COLUMN_ID);\n const expectedNumCols = rowNumbersCol ? 2 : 1;\n if (expectedNumCols === numVisibleCols) {\n hideSelectionCol();\n }\n }\n};\n\n// packages/ag-grid-community/src/selection/rowSelection.css\nvar rowSelection_default = ':where(.ag-selection-checkbox) .ag-checkbox-input-wrapper:before{content:\"\";cursor:pointer;inset:-8px;position:absolute}';\n\n// packages/ag-grid-community/src/selection/rowSelectionApi.ts\nfunction setNodesSelected(beans, params) {\n const allNodesValid = params.nodes.every((node) => {\n if (node.rowPinned && !_isManualPinnedRow(node)) {\n _warn(59);\n return false;\n }\n if (node.id === void 0) {\n _warn(60);\n return false;\n }\n return true;\n });\n if (!allNodesValid) {\n return;\n }\n const { nodes, source, newValue } = params;\n beans.selectionSvc?.setNodesSelected({ nodes, source: source ?? \"api\", newValue });\n}\nfunction selectAll(beans, selectAll2, source = \"apiSelectAll\") {\n beans.selectionSvc?.selectAllRowNodes({ source, selectAll: selectAll2 });\n}\nfunction deselectAll(beans, selectAll2, source = \"apiSelectAll\") {\n beans.selectionSvc?.deselectAllRowNodes({ source, selectAll: selectAll2 });\n}\nfunction selectAllFiltered(beans, source = \"apiSelectAllFiltered\") {\n beans.selectionSvc?.selectAllRowNodes({ source, selectAll: \"filtered\" });\n}\nfunction deselectAllFiltered(beans, source = \"apiSelectAllFiltered\") {\n beans.selectionSvc?.deselectAllRowNodes({ source, selectAll: \"filtered\" });\n}\nfunction selectAllOnCurrentPage(beans, source = \"apiSelectAllCurrentPage\") {\n beans.selectionSvc?.selectAllRowNodes({ source, selectAll: \"currentPage\" });\n}\nfunction deselectAllOnCurrentPage(beans, source = \"apiSelectAllCurrentPage\") {\n beans.selectionSvc?.deselectAllRowNodes({ source, selectAll: \"currentPage\" });\n}\nfunction getSelectedNodes(beans) {\n return beans.selectionSvc?.getSelectedNodes() ?? [];\n}\nfunction getSelectedRows(beans) {\n return beans.selectionSvc?.getSelectedRows() ?? [];\n}\n\n// packages/ag-grid-community/src/selection/checkboxSelectionComponent.ts\nvar CheckboxSelectionComponentElement = {\n tag: \"div\",\n cls: \"ag-selection-checkbox\",\n role: \"presentation\",\n children: [\n {\n tag: \"ag-checkbox\",\n ref: \"eCheckbox\",\n role: \"presentation\"\n }\n ]\n};\nvar CheckboxSelectionComponent = class extends Component {\n constructor() {\n super(CheckboxSelectionComponentElement, [AgCheckboxSelector]);\n this.eCheckbox = RefPlaceholder;\n }\n postConstruct() {\n this.eCheckbox.setPassive(true);\n }\n onDataChanged() {\n this.onSelectionChanged();\n }\n onSelectableChanged() {\n this.showOrHideSelect();\n }\n onSelectionChanged() {\n const translate = this.getLocaleTextFunc();\n const { rowNode, eCheckbox } = this;\n const state = rowNode.isSelected();\n const stateName = _getAriaCheckboxStateName(translate, state);\n const [ariaKey, ariaLabel] = rowNode.selectable ? [\"ariaRowToggleSelection\", \"Press Space to toggle row selection\"] : [\"ariaRowSelectionDisabled\", \"Row Selection is disabled for this row\"];\n const translatedLabel = translate(ariaKey, ariaLabel);\n eCheckbox.setValue(state, true);\n eCheckbox.setInputAriaLabel(`${translatedLabel} (${stateName})`);\n }\n init(params) {\n this.rowNode = params.rowNode;\n this.column = params.column;\n this.overrides = params.overrides;\n this.onSelectionChanged();\n this.addManagedListeners(this.eCheckbox.getWrapperElement(), {\n // we don't want double click on this icon to open a group\n dblclick: _stopPropagationForAgGrid,\n click: (event) => {\n _stopPropagationForAgGrid(event);\n if (this.eCheckbox.isDisabled()) {\n return;\n }\n this.beans.selectionSvc?.handleSelectionEvent(event, this.rowNode, \"checkboxSelected\");\n }\n });\n this.addManagedListeners(this.rowNode, {\n rowSelected: this.onSelectionChanged.bind(this),\n dataChanged: this.onDataChanged.bind(this),\n selectableChanged: this.onSelectableChanged.bind(this)\n });\n this.addManagedPropertyListener(\"rowSelection\", ({ currentValue, previousValue }) => {\n const curr = typeof currentValue === \"object\" ? _getHideDisabledCheckboxes(currentValue) : void 0;\n const prev = typeof previousValue === \"object\" ? _getHideDisabledCheckboxes(previousValue) : void 0;\n if (curr !== prev) {\n this.onSelectableChanged();\n }\n });\n const isRowSelectableFunc = _getIsRowSelectable(this.gos);\n const checkboxVisibleIsDynamic = isRowSelectableFunc || typeof this.getIsVisible() === \"function\";\n if (checkboxVisibleIsDynamic) {\n const showOrHideSelectListener = this.showOrHideSelect.bind(this);\n this.addManagedEventListeners({ displayedColumnsChanged: showOrHideSelectListener });\n this.addManagedListeners(this.rowNode, {\n dataChanged: showOrHideSelectListener,\n cellChanged: showOrHideSelectListener\n });\n this.showOrHideSelect();\n }\n this.eCheckbox.getInputElement().setAttribute(\"tabindex\", \"-1\");\n }\n showOrHideSelect() {\n const { column, rowNode, overrides, gos } = this;\n const selectable = rowNode.selectable;\n const isVisible = this.getIsVisible();\n let checkboxes = void 0;\n if (typeof isVisible === \"function\") {\n const extraParams = overrides?.callbackParams;\n if (!column) {\n checkboxes = isVisible({ ...extraParams, node: rowNode, data: rowNode.data });\n } else {\n const params = column.createColumnFunctionCallbackParams(rowNode);\n checkboxes = isVisible({ ...extraParams, ...params });\n }\n } else {\n checkboxes = isVisible ?? false;\n }\n const disabled = selectable && !checkboxes || !selectable && checkboxes;\n const visible = selectable || checkboxes;\n const so = gos.get(\"rowSelection\");\n const showDisabledCheckboxes = so && typeof so !== \"string\" ? !_getHideDisabledCheckboxes(so) : !!column?.getColDef().showDisabledCheckboxes;\n this.setVisible(visible && (disabled ? showDisabledCheckboxes : true));\n this.setDisplayed(visible && (disabled ? showDisabledCheckboxes : true));\n if (visible) {\n this.eCheckbox.setDisabled(disabled);\n }\n if (overrides?.removeHidden) {\n this.setDisplayed(visible);\n }\n }\n getIsVisible() {\n const overrides = this.overrides;\n if (overrides) {\n return overrides.isVisible;\n }\n const so = this.gos.get(\"rowSelection\");\n if (so && typeof so !== \"string\") {\n return _getCheckboxes(so);\n }\n return this.column?.getColDef()?.checkboxSelection;\n }\n};\n\n// packages/ag-grid-community/src/selection/rowRangeSelectionContext.ts\nvar RowRangeSelectionContext = class {\n constructor(rowModel, pinnedRowModel) {\n this.rowModel = rowModel;\n this.pinnedRowModel = pinnedRowModel;\n /** Whether the user is currently selecting all nodes either via the header checkbox or API */\n this.selectAll = false;\n this.rootId = null;\n /**\n * Note that the \"end\" `RowNode` may come before or after the \"root\" `RowNode` in the\n * actual grid.\n */\n this.endId = null;\n this.cachedRange = [];\n }\n reset() {\n this.rootId = null;\n this.endId = null;\n this.cachedRange.length = 0;\n }\n setRoot(node) {\n this.rootId = node.id;\n this.endId = null;\n this.cachedRange.length = 0;\n }\n setEndRange(end) {\n this.endId = end.id;\n this.cachedRange.length = 0;\n }\n getRange() {\n if (this.cachedRange.length === 0) {\n const root = this.getRoot();\n const end = this.getEnd();\n if (root == null || end == null) {\n return this.cachedRange;\n }\n this.cachedRange = this.getNodesInRange(root, end) ?? [];\n }\n return this.cachedRange;\n }\n isInRange(node) {\n if (this.rootId === null) {\n return false;\n }\n return this.getRange().some((nodeInRange) => nodeInRange.id === node.id);\n }\n getRoot(fallback) {\n if (this.rootId) {\n return this.getRowNode(this.rootId);\n }\n if (fallback) {\n this.setRoot(fallback);\n return fallback;\n }\n }\n getEnd() {\n if (this.endId) {\n return this.getRowNode(this.endId);\n }\n }\n getRowNode(id) {\n let node;\n const { rowModel, pinnedRowModel } = this;\n node ?? (node = rowModel.getRowNode(id));\n if (pinnedRowModel?.isManual()) {\n node ?? (node = pinnedRowModel.getPinnedRowById(id, \"top\"));\n node ?? (node = pinnedRowModel.getPinnedRowById(id, \"bottom\"));\n }\n return node;\n }\n /**\n * Truncates the range to the given node (assumed to be within the current range).\n * Returns nodes that remain in the current range and those that should be removed\n *\n * @param node - Node at which to truncate the range\n * @returns Object of nodes to either keep or discard (i.e. deselect) from the range\n */\n truncate(node) {\n const range = this.getRange();\n if (range.length === 0) {\n return { keep: [], discard: [] };\n }\n const discardAfter = range[0].id === this.rootId;\n const idx = range.findIndex((rowNode) => rowNode.id === node.id);\n if (idx > -1) {\n const above = range.slice(0, idx);\n const below = range.slice(idx + 1);\n this.setEndRange(node);\n return discardAfter ? { keep: above, discard: below } : { keep: below, discard: above };\n } else {\n return { keep: range, discard: [] };\n }\n }\n /**\n * Extends the range to the given node. Returns nodes that remain in the current range\n * and those that should be removed.\n *\n * @param node - Node marking the new end of the range\n * @returns Object of nodes to either keep or discard (i.e. deselect) from the range\n */\n extend(node, groupSelectsChildren = false) {\n const root = this.getRoot();\n if (root == null) {\n const keep = this.getRange().slice();\n if (groupSelectsChildren) {\n node.depthFirstSearch((node2) => !node2.group && keep.push(node2));\n }\n keep.push(node);\n this.setRoot(node);\n return { keep, discard: [] };\n }\n const newRange = this.getNodesInRange(root, node);\n if (!newRange) {\n this.setRoot(node);\n return { keep: [node], discard: [] };\n }\n if (newRange.find((newRangeNode) => newRangeNode.id === this.endId)) {\n this.setEndRange(node);\n return { keep: this.getRange(), discard: [] };\n } else {\n const discard = this.getRange().slice();\n this.setEndRange(node);\n return { keep: this.getRange(), discard };\n }\n }\n getNodesInRange(start, end) {\n const { pinnedRowModel, rowModel } = this;\n if (!pinnedRowModel?.isManual()) {\n return rowModel.getNodesInRangeForSelection(start, end);\n }\n if (start.rowPinned === \"top\" && !end.rowPinned) {\n const pinnedRange = _getNodesInRangeForSelection(pinnedRowModel, \"top\", start, void 0);\n return pinnedRange.concat(rowModel.getNodesInRangeForSelection(rowModel.getRow(0), end) ?? []);\n }\n if (start.rowPinned === \"bottom\" && !end.rowPinned) {\n const pinnedRange = _getNodesInRangeForSelection(pinnedRowModel, \"bottom\", void 0, start);\n const count = rowModel.getRowCount();\n const lastMain = rowModel.getRow(count - 1);\n return (rowModel.getNodesInRangeForSelection(end, lastMain) ?? []).concat(pinnedRange);\n }\n if (!start.rowPinned && !end.rowPinned) {\n return rowModel.getNodesInRangeForSelection(start, end);\n }\n if (start.rowPinned === \"top\" && end.rowPinned === \"top\") {\n return _getNodesInRangeForSelection(pinnedRowModel, \"top\", start, end);\n }\n if (start.rowPinned === \"bottom\" && end.rowPinned === \"top\") {\n const top = _getNodesInRangeForSelection(pinnedRowModel, \"top\", end, void 0);\n const bottom = _getNodesInRangeForSelection(pinnedRowModel, \"bottom\", void 0, start);\n const first = rowModel.getRow(0);\n const last = rowModel.getRow(rowModel.getRowCount() - 1);\n return top.concat(rowModel.getNodesInRangeForSelection(first, last) ?? []).concat(bottom);\n }\n if (!start.rowPinned && end.rowPinned === \"top\") {\n const pinned = _getNodesInRangeForSelection(pinnedRowModel, \"top\", end, void 0);\n return pinned.concat(rowModel.getNodesInRangeForSelection(rowModel.getRow(0), start) ?? []);\n }\n if (start.rowPinned === \"top\" && end.rowPinned === \"bottom\") {\n const top = _getNodesInRangeForSelection(pinnedRowModel, \"top\", start, void 0);\n const bottom = _getNodesInRangeForSelection(pinnedRowModel, \"bottom\", void 0, end);\n const first = rowModel.getRow(0);\n const last = rowModel.getRow(rowModel.getRowCount() - 1);\n return top.concat(rowModel.getNodesInRangeForSelection(first, last) ?? []).concat(bottom);\n }\n if (start.rowPinned === \"bottom\" && end.rowPinned === \"bottom\") {\n return _getNodesInRangeForSelection(pinnedRowModel, \"bottom\", start, end);\n }\n if (!start.rowPinned && end.rowPinned === \"bottom\") {\n const pinned = _getNodesInRangeForSelection(pinnedRowModel, \"bottom\", void 0, end);\n const last = rowModel.getRow(rowModel.getRowCount());\n return (rowModel.getNodesInRangeForSelection(start, last) ?? []).concat(pinned);\n }\n return null;\n }\n};\n\n// packages/ag-grid-community/src/selection/selectAllFeature.ts\nvar SelectAllFeature = class extends BeanStub {\n constructor(column) {\n super();\n this.column = column;\n this.cbSelectAllVisible = false;\n this.processingEventFromCheckbox = false;\n }\n onSpaceKeyDown(e) {\n const checkbox = this.cbSelectAll;\n if (checkbox.isDisplayed() && !checkbox.getGui().contains(_getActiveDomElement(this.beans))) {\n e.preventDefault();\n checkbox.setValue(!checkbox.getValue());\n }\n }\n getCheckboxGui() {\n return this.cbSelectAll.getGui();\n }\n setComp(ctrl) {\n this.headerCellCtrl = ctrl;\n const cbSelectAll = this.createManagedBean(new AgCheckbox());\n this.cbSelectAll = cbSelectAll;\n cbSelectAll.addCss(\"ag-header-select-all\");\n _setAriaRole(cbSelectAll.getGui(), \"presentation\");\n this.showOrHideSelectAll();\n const updateStateOfCheckbox = this.updateStateOfCheckbox.bind(this);\n this.addManagedEventListeners({\n newColumnsLoaded: () => this.showOrHideSelectAll(),\n displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this),\n selectionChanged: updateStateOfCheckbox,\n paginationChanged: updateStateOfCheckbox,\n modelUpdated: updateStateOfCheckbox\n });\n this.addManagedPropertyListener(\"rowSelection\", ({ currentValue, previousValue }) => {\n const getSelectAll = (rowSelection) => typeof rowSelection === \"string\" || !rowSelection || rowSelection.mode === \"singleRow\" ? void 0 : rowSelection.selectAll;\n if (getSelectAll(currentValue) !== getSelectAll(previousValue)) {\n this.showOrHideSelectAll();\n }\n this.updateStateOfCheckbox();\n });\n this.addManagedListeners(cbSelectAll, { fieldValueChanged: this.onCbSelectAll.bind(this) });\n cbSelectAll.getInputElement().setAttribute(\"tabindex\", \"-1\");\n this.refreshSelectAllLabel();\n }\n onDisplayedColumnsChanged(e) {\n if (!this.isAlive()) {\n return;\n }\n this.showOrHideSelectAll(e.source === \"uiColumnMoved\");\n }\n showOrHideSelectAll(fromColumnMoved = false) {\n const cbSelectAllVisible = this.isCheckboxSelection();\n this.cbSelectAllVisible = cbSelectAllVisible;\n this.cbSelectAll.setDisplayed(cbSelectAllVisible);\n if (cbSelectAllVisible) {\n this.checkRightRowModelType(\"selectAllCheckbox\");\n this.checkSelectionType(\"selectAllCheckbox\");\n this.updateStateOfCheckbox();\n }\n this.refreshSelectAllLabel(fromColumnMoved);\n }\n updateStateOfCheckbox() {\n if (!this.cbSelectAllVisible || this.processingEventFromCheckbox) {\n return;\n }\n this.processingEventFromCheckbox = true;\n const selectAllMode = this.getSelectAllMode();\n const selectionSvc = this.beans.selectionSvc;\n const cbSelectAll = this.cbSelectAll;\n const allSelected = selectionSvc.getSelectAllState(selectAllMode);\n cbSelectAll.setValue(allSelected);\n const hasNodesToSelect = selectionSvc.hasNodesToSelect(selectAllMode);\n cbSelectAll.setDisabled(!hasNodesToSelect);\n this.refreshSelectAllLabel();\n this.processingEventFromCheckbox = false;\n }\n refreshSelectAllLabel(fromColumnMoved = false) {\n const translate = this.getLocaleTextFunc();\n const { headerCellCtrl, cbSelectAll, cbSelectAllVisible } = this;\n const checked = cbSelectAll.getValue();\n const ariaStatus = _getAriaCheckboxStateName(translate, checked);\n const ariaLabel = translate(\"ariaRowSelectAll\", \"Press Space to toggle all rows selection\");\n headerCellCtrl.setAriaDescriptionProperty(\n \"selectAll\",\n cbSelectAllVisible ? `${ariaLabel} (${ariaStatus})` : null\n );\n cbSelectAll.setInputAriaLabel(translate(\"ariaHeaderSelection\", \"Column with Header Selection\"));\n if (!fromColumnMoved) {\n headerCellCtrl.announceAriaDescription();\n }\n }\n checkSelectionType(feature) {\n const isMultiSelect = _isMultiRowSelection(this.gos);\n if (!isMultiSelect) {\n _warn(128, { feature });\n return false;\n }\n return true;\n }\n checkRightRowModelType(feature) {\n const { gos, rowModel } = this.beans;\n const rowModelMatches = _isClientSideRowModel(gos) || _isServerSideRowModel(gos);\n if (!rowModelMatches) {\n _warn(129, { feature, rowModel: rowModel.getType() });\n return false;\n }\n return true;\n }\n onCbSelectAll() {\n if (this.processingEventFromCheckbox) {\n return;\n }\n if (!this.cbSelectAllVisible) {\n return;\n }\n const value = this.cbSelectAll.getValue();\n const selectAll2 = this.getSelectAllMode();\n let source = \"uiSelectAll\";\n if (selectAll2 === \"currentPage\") {\n source = \"uiSelectAllCurrentPage\";\n } else if (selectAll2 === \"filtered\") {\n source = \"uiSelectAllFiltered\";\n }\n const params = { source, selectAll: selectAll2 };\n const selectionSvc = this.beans.selectionSvc;\n if (value) {\n selectionSvc.selectAllRowNodes(params);\n } else {\n selectionSvc.deselectAllRowNodes(params);\n }\n }\n /**\n * Checkbox is enabled when either the `headerCheckbox` option is enabled in the new selection API\n * or `headerCheckboxSelection` is enabled in the legacy API.\n */\n isCheckboxSelection() {\n const { column, gos, beans } = this;\n const rowSelection = gos.get(\"rowSelection\");\n const newHeaderCheckbox = typeof rowSelection === \"object\";\n const featureName = newHeaderCheckbox ? \"headerCheckbox\" : \"headerCheckboxSelection\";\n return isCheckboxSelection(beans, column) && this.checkRightRowModelType(featureName) && this.checkSelectionType(featureName);\n }\n getSelectAllMode() {\n const selectAll2 = _getSelectAll(this.gos, false);\n if (selectAll2) {\n return selectAll2;\n }\n const { headerCheckboxSelectionCurrentPageOnly, headerCheckboxSelectionFilteredOnly } = this.column.getColDef();\n if (headerCheckboxSelectionCurrentPageOnly) {\n return \"currentPage\";\n }\n if (headerCheckboxSelectionFilteredOnly) {\n return \"filtered\";\n }\n return \"all\";\n }\n destroy() {\n super.destroy();\n this.cbSelectAll = void 0;\n this.headerCellCtrl = void 0;\n }\n};\nfunction isCheckboxSelection({ gos, selectionColSvc }, column) {\n const rowSelection = gos.get(\"rowSelection\");\n const colDef = column.getColDef();\n const { headerCheckboxSelection } = colDef;\n let result = false;\n const newHeaderCheckbox = typeof rowSelection === \"object\";\n if (newHeaderCheckbox) {\n const isSelectionCol = isColumnSelectionCol(column);\n const isAutoCol = isColumnGroupAutoCol(column);\n const location = _getCheckboxLocation(rowSelection);\n if (location === \"autoGroupColumn\" && isAutoCol || isSelectionCol && selectionColSvc?.isSelectionColumnEnabled()) {\n result = _getHeaderCheckbox(rowSelection);\n }\n } else if (typeof headerCheckboxSelection === \"function\") {\n result = headerCheckboxSelection(_addGridCommonParams(gos, { column, colDef }));\n } else {\n result = !!headerCheckboxSelection;\n }\n return result;\n}\n\n// packages/ag-grid-community/src/selection/baseSelectionService.ts\nvar BaseSelectionService = class extends BeanStub {\n postConstruct() {\n const { gos, beans } = this;\n this.selectionCtx = new RowRangeSelectionContext(beans.rowModel, beans.pinnedRowModel);\n this.addManagedPropertyListeners([\"isRowSelectable\", \"rowSelection\"], () => {\n const callback = _getIsRowSelectable(gos);\n if (callback !== this.isRowSelectable) {\n this.isRowSelectable = callback;\n this.updateSelectable();\n }\n });\n this.isRowSelectable = _getIsRowSelectable(gos);\n this.addManagedEventListeners({\n cellValueChanged: (e) => this.updateRowSelectable(e.node),\n rowNodeDataChanged: (e) => this.updateRowSelectable(e.node)\n });\n }\n destroy() {\n super.destroy();\n this.selectionCtx.reset();\n }\n createCheckboxSelectionComponent() {\n return new CheckboxSelectionComponent();\n }\n createSelectAllFeature(column) {\n if (isCheckboxSelection(this.beans, column)) {\n return new SelectAllFeature(column);\n }\n }\n isMultiSelect() {\n return _isMultiRowSelection(this.gos);\n }\n onRowCtrlSelected(rowCtrl, hasFocusFunc, gui) {\n const selected = !!rowCtrl.rowNode.isSelected();\n rowCtrl.forEachGui(gui, (gui2) => {\n gui2.rowComp.toggleCss(\"ag-row-selected\", selected);\n const element = gui2.element;\n _setAriaSelected(element, selected);\n const hasFocus = element.contains(_getActiveDomElement(this.beans));\n if (hasFocus) {\n hasFocusFunc(gui2);\n }\n });\n }\n announceAriaRowSelection(rowNode) {\n if (this.isRowSelectionBlocked(rowNode)) {\n return;\n }\n const selected = rowNode.isSelected();\n const isEditing2 = this.beans.editSvc?.isEditing({ rowNode });\n if (!rowNode.selectable || isEditing2) {\n return;\n }\n const translate = this.getLocaleTextFunc();\n const label = translate(\n selected ? \"ariaRowDeselect\" : \"ariaRowSelect\",\n `Press SPACE to ${selected ? \"deselect\" : \"select\"} this row`\n );\n this.beans.ariaAnnounce?.announceValue(label, \"rowSelection\");\n }\n isRowSelectionBlocked(rowNode) {\n return !rowNode.selectable || rowNode.rowPinned && !_isManualPinnedRow(rowNode) || !_isRowSelection(this.gos);\n }\n updateRowSelectable(rowNode, suppressSelectionUpdate) {\n const selectable = rowNode.rowPinned && rowNode.pinnedSibling ? (\n // If row node is pinned sibling, copy selectable status over from sibling row node\n rowNode.pinnedSibling.selectable\n ) : (\n // otherwise calculate selectable state directly\n this.isRowSelectable?.(rowNode) ?? true\n );\n this.setRowSelectable(rowNode, selectable, suppressSelectionUpdate);\n return selectable;\n }\n setRowSelectable(rowNode, newVal, suppressSelectionUpdate) {\n if (rowNode.selectable !== newVal) {\n rowNode.selectable = newVal;\n rowNode.dispatchRowEvent(\"selectableChanged\");\n if (suppressSelectionUpdate) {\n return;\n }\n const isGroupSelectsChildren = _getGroupSelectsDescendants(this.gos);\n if (isGroupSelectsChildren) {\n const selected = this.calculateSelectedFromChildren(rowNode);\n this.setNodesSelected({ nodes: [rowNode], newValue: selected ?? false, source: \"selectableChanged\" });\n return;\n }\n if (rowNode.isSelected() && !rowNode.selectable) {\n this.setNodesSelected({ nodes: [rowNode], newValue: false, source: \"selectableChanged\" });\n }\n }\n }\n calculateSelectedFromChildren(rowNode) {\n let atLeastOneSelected = false;\n let atLeastOneDeSelected = false;\n if (!rowNode.childrenAfterGroup?.length) {\n return rowNode.selectable ? rowNode.__selected : null;\n }\n for (let i = 0; i < rowNode.childrenAfterGroup.length; i++) {\n const child = rowNode.childrenAfterGroup[i];\n let childState = child.isSelected();\n if (!child.selectable) {\n const selectable = this.calculateSelectedFromChildren(child);\n if (selectable === null) {\n continue;\n }\n childState = selectable;\n }\n switch (childState) {\n case true:\n atLeastOneSelected = true;\n break;\n case false:\n atLeastOneDeSelected = true;\n break;\n default:\n return void 0;\n }\n }\n if (atLeastOneSelected && atLeastOneDeSelected) {\n return void 0;\n }\n if (atLeastOneSelected) {\n return true;\n }\n if (atLeastOneDeSelected) {\n return false;\n }\n if (!rowNode.selectable) {\n return null;\n }\n return rowNode.__selected;\n }\n selectRowNode(rowNode, newValue, e, source = \"api\") {\n if (newValue && rowNode.destroyed) {\n return false;\n }\n const selectionNotAllowed = !rowNode.selectable && newValue;\n const selectionNotChanged = rowNode.__selected === newValue;\n if (selectionNotAllowed || selectionNotChanged) {\n return false;\n }\n rowNode.__selected = newValue;\n rowNode.dispatchRowEvent(\"rowSelected\");\n const sibling = rowNode.sibling;\n if (sibling && sibling.footer && sibling.__localEventService) {\n sibling.dispatchRowEvent(\"rowSelected\");\n }\n const pinnedSibling = rowNode.pinnedSibling;\n if (pinnedSibling?.rowPinned && pinnedSibling.__localEventService) {\n pinnedSibling.dispatchRowEvent(\"rowSelected\");\n }\n this.eventSvc.dispatchEvent({\n ..._createGlobalRowEvent(rowNode, this.gos, \"rowSelected\"),\n event: e || null,\n source\n });\n return true;\n }\n isCellCheckboxSelection(column, rowNode) {\n const so = this.gos.get(\"rowSelection\");\n if (so && typeof so !== \"string\") {\n const checkbox = isColumnSelectionCol(column) && _getCheckboxes(so);\n return column.isColumnFunc(rowNode, checkbox);\n } else {\n return column.isColumnFunc(rowNode, column.colDef.checkboxSelection);\n }\n }\n inferNodeSelections(node, shiftKey, metaKey, source) {\n const { gos, selectionCtx } = this;\n const currentSelection = node.isSelected();\n const groupSelectsDescendants = _getGroupSelectsDescendants(gos);\n const enableClickSelection = _getEnableSelection(gos);\n const enableDeselection = _getEnableDeselection(gos);\n const isMultiSelect = this.isMultiSelect();\n const isRowClicked = source === \"rowClicked\";\n if (isRowClicked && !(enableClickSelection || enableDeselection)) {\n return null;\n }\n if (shiftKey && metaKey && isMultiSelect) {\n const root = selectionCtx.getRoot();\n if (!root) {\n return null;\n } else if (!root.isSelected()) {\n const partition = selectionCtx.extend(node, groupSelectsDescendants);\n return {\n select: [],\n deselect: partition.keep,\n reset: false\n };\n } else {\n const partition = selectionCtx.isInRange(node) ? selectionCtx.truncate(node) : selectionCtx.extend(node, groupSelectsDescendants);\n return {\n deselect: partition.discard,\n select: partition.keep,\n reset: false\n };\n }\n } else if (shiftKey && isMultiSelect) {\n const fallback = selectionCtx.selectAll ? this.beans.rowModel.getRow(0) : void 0;\n const root = selectionCtx.getRoot(fallback);\n const partition = selectionCtx.isInRange(node) ? selectionCtx.truncate(node) : selectionCtx.extend(node, groupSelectsDescendants);\n return {\n select: partition.keep,\n deselect: partition.discard,\n reset: selectionCtx.selectAll || !!(root && !root.isSelected())\n };\n } else if (metaKey) {\n if (isRowClicked) {\n const newValue = !currentSelection;\n const selectingWhenDisabled = newValue && !enableClickSelection;\n const deselectingWhenDisabled = !newValue && !enableDeselection;\n if (selectingWhenDisabled || deselectingWhenDisabled) {\n return null;\n }\n selectionCtx.setRoot(node);\n return {\n node,\n newValue,\n clearSelection: false\n };\n }\n selectionCtx.setRoot(node);\n return {\n node,\n newValue: !currentSelection,\n clearSelection: !isMultiSelect\n };\n } else {\n selectionCtx.setRoot(node);\n const enableSelectionWithoutKeys = _getEnableSelectionWithoutKeys(gos);\n const groupSelectsFiltered = _getGroupSelection(gos) === \"filteredDescendants\";\n const shouldClear = isRowClicked && (!enableSelectionWithoutKeys || !enableClickSelection);\n if (groupSelectsFiltered && currentSelection === void 0 && _isClientSideRowModel(gos)) {\n return {\n node,\n newValue: false,\n checkFilteredNodes: true,\n clearSelection: !isMultiSelect || shouldClear\n };\n }\n if (isRowClicked) {\n const newValue = currentSelection ? !enableSelectionWithoutKeys : enableClickSelection;\n const selectingWhenDisabled = newValue && !enableClickSelection;\n const deselectingWhenDisabled = !newValue && !enableDeselection;\n const wouldStateBeUnchanged = newValue === currentSelection && !shouldClear;\n if (wouldStateBeUnchanged || selectingWhenDisabled || deselectingWhenDisabled) {\n return null;\n }\n return {\n node,\n newValue,\n clearSelection: !isMultiSelect || shouldClear,\n keepDescendants: node.group && groupSelectsDescendants\n };\n }\n return {\n node,\n newValue: !currentSelection,\n clearSelection: !isMultiSelect || shouldClear\n };\n }\n }\n};\n\n// packages/ag-grid-community/src/selection/selectionService.ts\nvar SelectionService = class extends BaseSelectionService {\n constructor() {\n super(...arguments);\n this.beanName = \"selectionSvc\";\n this.selectedNodes = /* @__PURE__ */ new Map();\n /** Only used to track detail grid selection state when master/detail is enabled */\n this.detailSelection = /* @__PURE__ */ new Map();\n this.masterSelectsDetail = false;\n }\n postConstruct() {\n super.postConstruct();\n const { gos } = this;\n this.mode = _getRowSelectionMode(gos);\n this.groupSelectsDescendants = _getGroupSelectsDescendants(gos);\n this.groupSelectsFiltered = _getGroupSelection(gos) === \"filteredDescendants\";\n this.masterSelectsDetail = _getMasterSelects(gos) === \"detail\";\n this.addManagedPropertyListeners([\"groupSelectsChildren\", \"groupSelectsFiltered\", \"rowSelection\"], () => {\n const groupSelectsDescendants = _getGroupSelectsDescendants(gos);\n const selectionMode = _getRowSelectionMode(gos);\n const groupSelectsFiltered = _getGroupSelection(gos) === \"filteredDescendants\";\n this.masterSelectsDetail = _getMasterSelects(gos) === \"detail\";\n if (groupSelectsDescendants !== this.groupSelectsDescendants || groupSelectsFiltered !== this.groupSelectsFiltered || selectionMode !== this.mode) {\n this.deselectAllRowNodes({ source: \"api\" });\n this.groupSelectsDescendants = groupSelectsDescendants;\n this.groupSelectsFiltered = groupSelectsFiltered;\n this.mode = selectionMode;\n }\n });\n this.addManagedEventListeners({ rowSelected: this.onRowSelected.bind(this) });\n }\n destroy() {\n super.destroy();\n this.resetNodes();\n }\n handleSelectionEvent(event, rowNode, source) {\n if (this.isRowSelectionBlocked(rowNode)) {\n return 0;\n }\n const selection = this.inferNodeSelections(rowNode, event.shiftKey, event.metaKey || event.ctrlKey, source);\n if (selection == null) {\n return 0;\n }\n this.selectionCtx.selectAll = false;\n if (\"select\" in selection) {\n if (selection.reset) {\n this.resetNodes();\n } else {\n this.selectRange(selection.deselect, false, source);\n }\n return this.selectRange(selection.select, true, source);\n } else {\n const newValue = selection.checkFilteredNodes ? recursiveCanNodesBeSelected(selection.node) : selection.newValue;\n return this.setNodesSelected({\n nodes: [selection.node],\n newValue,\n clearSelection: selection.clearSelection,\n keepDescendants: selection.keepDescendants,\n event,\n source\n });\n }\n }\n setNodesSelected({\n newValue,\n clearSelection,\n suppressFinishActions,\n nodes,\n event,\n source,\n keepDescendants = false\n }) {\n if (nodes.length === 0) {\n return 0;\n }\n const { gos } = this;\n if (!_isRowSelection(gos) && newValue) {\n _warn(132);\n return 0;\n }\n if (nodes.length > 1 && !this.isMultiSelect()) {\n _warn(130);\n return 0;\n }\n let updatedCount = 0;\n for (let i = 0; i < nodes.length; i++) {\n const rowNode = nodes[i];\n const node = rowNode.primaryRow;\n if (node.rowPinned && !_isManualPinnedRow(node)) {\n _warn(59);\n continue;\n }\n if (node.id === void 0) {\n _warn(60);\n continue;\n }\n if (newValue && rowNode.destroyed) {\n continue;\n }\n const skipThisNode = this.groupSelectsFiltered && node.group && !gos.get(\"treeData\");\n if (!skipThisNode) {\n const thisNodeWasSelected = this.selectRowNode(node, newValue, event, source);\n if (thisNodeWasSelected) {\n this.detailSelection.delete(node.id);\n updatedCount++;\n }\n }\n if (this.groupSelectsDescendants && node.childrenAfterGroup?.length) {\n updatedCount += this.selectChildren(node, newValue, source);\n }\n }\n if (!suppressFinishActions) {\n if (nodes.length === 1 && source === \"api\") {\n this.selectionCtx.setRoot(nodes[0].primaryRow);\n }\n const clearOtherNodes = newValue && (clearSelection || !this.isMultiSelect());\n if (clearOtherNodes) {\n updatedCount += this.clearOtherNodes(nodes[0].primaryRow, keepDescendants, source);\n }\n if (updatedCount > 0) {\n this.updateGroupsFromChildrenSelections(source);\n this.dispatchSelectionChanged(source);\n }\n }\n return updatedCount;\n }\n // not to be mixed up with 'cell range selection' where you drag the mouse, this is row range selection, by\n // holding down 'shift'.\n selectRange(nodesToSelect, value, source) {\n let updatedCount = 0;\n nodesToSelect.forEach((node) => {\n const rowNode = node.primaryRow;\n if (rowNode.group && this.groupSelectsDescendants) {\n return;\n }\n const nodeWasSelected = this.selectRowNode(rowNode, value, void 0, source);\n if (nodeWasSelected) {\n updatedCount++;\n }\n });\n if (updatedCount > 0) {\n this.updateGroupsFromChildrenSelections(source);\n this.dispatchSelectionChanged(source);\n }\n return updatedCount;\n }\n selectChildren(node, newValue, source) {\n const children = this.groupSelectsFiltered ? node.childrenAfterAggFilter : node.childrenAfterGroup;\n if (!children) {\n return 0;\n }\n return this.setNodesSelected({\n newValue,\n clearSelection: false,\n suppressFinishActions: true,\n source,\n nodes: children\n });\n }\n getSelectedNodes() {\n return Array.from(this.selectedNodes.values());\n }\n getSelectedRows() {\n const selectedRows = [];\n this.selectedNodes.forEach((rowNode) => rowNode.data && selectedRows.push(rowNode.data));\n return selectedRows;\n }\n getSelectionCount() {\n return this.selectedNodes.size;\n }\n /**\n * This method is used by the CSRM to remove groups which are being disposed of,\n * events do not need fired in this case\n */\n filterFromSelection(predicate) {\n const newSelectedNodes = /* @__PURE__ */ new Map();\n this.selectedNodes.forEach((rowNode, key) => {\n if (predicate(rowNode)) {\n newSelectedNodes.set(key, rowNode);\n }\n });\n this.selectedNodes = newSelectedNodes;\n }\n updateGroupsFromChildrenSelections(source, changedPath) {\n if (!this.groupSelectsDescendants) {\n return false;\n }\n const { gos, rowModel } = this.beans;\n if (!_isClientSideRowModel(gos, rowModel)) {\n return false;\n }\n const rootNode = rowModel.rootNode;\n if (!rootNode) {\n return false;\n }\n let selectionChanged = false;\n const nodeCallback = (rowNode) => {\n if (rowNode !== rootNode) {\n const selected = this.calculateSelectedFromChildren(rowNode);\n selectionChanged = this.selectRowNode(rowNode, selected === null ? false : selected, void 0, source) || selectionChanged;\n }\n };\n _forEachChangedGroupDepthFirst(rootNode, this.beans.rowModel.hierarchical, changedPath, nodeCallback);\n return selectionChanged;\n }\n clearOtherNodes(rowNodeToKeepSelected, keepDescendants, source) {\n const groupsToRefresh = /* @__PURE__ */ new Map();\n let updatedCount = 0;\n this.selectedNodes.forEach((otherRowNode) => {\n const isNodeToKeep = otherRowNode.id == rowNodeToKeepSelected.id;\n const shouldClearDescendant = keepDescendants ? !isDescendantOf(rowNodeToKeepSelected, otherRowNode) : true;\n if (shouldClearDescendant && !isNodeToKeep) {\n const rowNode = this.selectedNodes.get(otherRowNode.id);\n updatedCount += this.setNodesSelected({\n nodes: [rowNode],\n newValue: false,\n clearSelection: false,\n suppressFinishActions: true,\n source\n });\n if (this.groupSelectsDescendants && otherRowNode.parent) {\n groupsToRefresh.set(otherRowNode.parent.id, otherRowNode.parent);\n }\n }\n });\n groupsToRefresh.forEach((group) => {\n const selected = this.calculateSelectedFromChildren(group);\n this.selectRowNode(group, selected === null ? false : selected, void 0, source);\n });\n return updatedCount;\n }\n onRowSelected(event) {\n const rowNode = event.node;\n if (this.groupSelectsDescendants && rowNode.group) {\n return;\n }\n if (rowNode.isSelected()) {\n this.selectedNodes.set(rowNode.id, rowNode);\n } else {\n this.selectedNodes.delete(rowNode.id);\n }\n }\n syncInRowNode(rowNode, oldNode) {\n this.syncInOldRowNode(rowNode, oldNode);\n this.syncInNewRowNode(rowNode);\n }\n createDaemonNode(rowNode) {\n if (!rowNode.id) {\n return void 0;\n }\n const oldNode = new RowNode(this.beans);\n oldNode.id = rowNode.id;\n oldNode.data = rowNode.data;\n oldNode.__selected = rowNode.__selected;\n oldNode.level = rowNode.level;\n return oldNode;\n }\n // if the id has changed for the node, then this means the rowNode\n // is getting used for a different data item, which breaks\n // our selectedNodes, as the node now is mapped by the old id\n // which is inconsistent. so to keep the old node as selected,\n // we swap in the clone (with the old id and old data). this means\n // the oldNode is effectively a daemon we keep a reference to,\n // so if client calls api.getSelectedNodes(), it gets the daemon\n // in the result. when the client un-selects, the reference to the\n // daemon is removed. the daemon, because it's an oldNode, is not\n // used by the grid for rendering, it's a copy of what the node used\n // to be like before the id was changed.\n syncInOldRowNode(rowNode, oldNode) {\n if (oldNode && rowNode.id !== oldNode.id) {\n const oldNodeSelected = this.selectedNodes.get(oldNode.id) == rowNode;\n if (oldNodeSelected) {\n this.selectedNodes.set(oldNode.id, oldNode);\n }\n }\n }\n syncInNewRowNode(rowNode) {\n if (this.selectedNodes.has(rowNode.id)) {\n rowNode.__selected = true;\n this.selectedNodes.set(rowNode.id, rowNode);\n } else {\n rowNode.__selected = false;\n }\n }\n reset(source) {\n const selectionCount = this.getSelectionCount();\n this.resetNodes();\n if (selectionCount) {\n this.dispatchSelectionChanged(source);\n }\n }\n resetNodes() {\n this.selectedNodes.forEach((node) => {\n this.selectRowNode(node, false);\n });\n this.selectedNodes.clear();\n }\n // returns a list of all nodes at 'best cost' - a feature to be used\n // with groups / trees. if a group has all it's children selected,\n // then the group appears in the result, but not the children.\n // Designed for use with 'children' as the group selection type,\n // where groups don't actually appear in the selection normally.\n getBestCostNodeSelection() {\n const { gos, rowModel } = this.beans;\n if (!_isClientSideRowModel(gos, rowModel)) {\n return;\n }\n const topLevelNodes = rowModel.getTopLevelNodes();\n if (topLevelNodes === null) {\n return;\n }\n const result = [];\n function traverse(nodes) {\n for (let i = 0, l = nodes.length; i < l; i++) {\n const node = nodes[i];\n if (node.isSelected()) {\n result.push(node);\n } else if (node.group && node.childrenAfterGroup) {\n traverse(node.childrenAfterGroup);\n }\n }\n }\n traverse(topLevelNodes);\n return result;\n }\n isEmpty() {\n return this.getSelectionCount() === 0;\n }\n deselectAllRowNodes({ source, selectAll: selectAll2 }) {\n const rowModelClientSide = _isClientSideRowModel(this.gos);\n let updatedNodes = false;\n const callback = (rowNode) => {\n const updated = this.selectRowNode(rowNode.primaryRow, false, void 0, source);\n updatedNodes || (updatedNodes = updated);\n };\n if (selectAll2 === \"currentPage\" || selectAll2 === \"filtered\") {\n if (!rowModelClientSide) {\n _error(102);\n return;\n }\n this.getNodesToSelect(selectAll2).forEach(callback);\n } else {\n this.selectedNodes.forEach(callback);\n this.reset(source);\n }\n this.selectionCtx.selectAll = false;\n if (rowModelClientSide && this.groupSelectsDescendants) {\n const updated = this.updateGroupsFromChildrenSelections(source);\n updatedNodes || (updatedNodes = updated);\n }\n if (updatedNodes) {\n this.dispatchSelectionChanged(source);\n }\n }\n getSelectedCounts(selectAll2) {\n let selectedCount = 0;\n let notSelectedCount = 0;\n this.getNodesToSelect(selectAll2).forEach((node) => {\n if (this.groupSelectsDescendants && node.group) {\n return;\n }\n if (node.isSelected()) {\n selectedCount++;\n } else if (node.selectable) {\n notSelectedCount++;\n }\n });\n return { selectedCount, notSelectedCount };\n }\n getSelectAllState(selectAll2) {\n const { selectedCount, notSelectedCount } = this.getSelectedCounts(selectAll2);\n return _calculateSelectAllState(selectedCount, notSelectedCount) ?? null;\n }\n hasNodesToSelect(selectAll2) {\n return this.getNodesToSelect(selectAll2).filter((node) => node.selectable).length > 0;\n }\n /**\n * @param selectAll See `MultiRowSelectionOptions.selectAll`\n * @returns all nodes including unselectable nodes which are the target of this selection attempt\n */\n getNodesToSelect(selectAll2) {\n if (!this.canSelectAll()) {\n return [];\n }\n const nodes = [];\n const addToResult = (node) => nodes.push(node);\n if (selectAll2 === \"currentPage\") {\n this.forEachNodeOnPage((node) => {\n if (!node.group) {\n addToResult(node);\n return;\n }\n if (!node.footer && !node.expanded) {\n const recursivelyAddChildren = (child) => {\n addToResult(child);\n const children = child.childrenAfterFilter;\n if (children) {\n for (let i = 0, len = children.length; i < len; ++i) {\n recursivelyAddChildren(children[i]);\n }\n }\n };\n recursivelyAddChildren(node);\n return;\n }\n if (!this.groupSelectsDescendants) {\n addToResult(node);\n }\n });\n return nodes;\n }\n const clientSideRowModel = this.beans.rowModel;\n if (selectAll2 === \"filtered\") {\n clientSideRowModel.forEachNodeAfterFilter(addToResult);\n return nodes;\n }\n clientSideRowModel.forEachNode(addToResult);\n return nodes;\n }\n forEachNodeOnPage(callback) {\n const { pageBounds, rowModel } = this.beans;\n const firstRow = pageBounds.getFirstRow();\n const lastRow = pageBounds.getLastRow();\n for (let i = firstRow; i <= lastRow; i++) {\n const node = rowModel.getRow(i);\n if (node) {\n callback(node);\n }\n }\n }\n selectAllRowNodes(params) {\n const { gos, selectionCtx } = this;\n if (!_isRowSelection(gos)) {\n _warn(132);\n return;\n }\n if (_isUsingNewRowSelectionAPI(gos) && !_isMultiRowSelection(gos)) {\n _warn(130);\n return;\n }\n if (!this.canSelectAll()) {\n return;\n }\n const { source, selectAll: selectAll2 } = params;\n let updatedNodes = false;\n this.getNodesToSelect(selectAll2).forEach((rowNode) => {\n const updated = this.selectRowNode(rowNode.primaryRow, true, void 0, source);\n updatedNodes || (updatedNodes = updated);\n });\n selectionCtx.selectAll = true;\n if (_isClientSideRowModel(gos) && this.groupSelectsDescendants) {\n const updated = this.updateGroupsFromChildrenSelections(source);\n updatedNodes || (updatedNodes = updated);\n }\n if (updatedNodes) {\n this.dispatchSelectionChanged(source);\n }\n }\n getSelectionState() {\n return this.isEmpty() ? null : Array.from(this.selectedNodes.keys());\n }\n setSelectionState(state, source, clearSelection) {\n if (!state) {\n state = [];\n }\n if (!Array.isArray(state)) {\n _error(103);\n return;\n }\n const rowIds = new Set(state);\n const nodes = [];\n this.beans.rowModel.forEachNode((node) => {\n if (rowIds.has(node.id)) {\n nodes.push(node);\n }\n });\n if (clearSelection) {\n this.resetNodes();\n }\n this.setNodesSelected({\n newValue: true,\n nodes,\n source\n });\n }\n canSelectAll() {\n return _isClientSideRowModel(this.beans.gos);\n }\n /**\n * Updates the selectable state for a node by invoking isRowSelectable callback.\n * If the node is not selectable, it will be deselected.\n *\n * Callers:\n * - property isRowSelectable changed\n * - after grouping / treeData via `updateSelectableAfterGrouping`\n */\n updateSelectable(changedPath) {\n const { gos, rowModel } = this.beans;\n if (!_isRowSelection(gos)) {\n return;\n }\n const source = \"selectableChanged\";\n const isCSRMGroupSelectsDescendants = _isClientSideRowModel(gos) && this.groupSelectsDescendants;\n const nodesToDeselect = [];\n if (isCSRMGroupSelectsDescendants) {\n const rootNode = rowModel.rootNode;\n if (rootNode) {\n _forEachChangedGroupDepthFirst(rootNode, rowModel.hierarchical, changedPath, (node) => {\n let childSelectable = false;\n for (const child of node.childrenAfterGroup) {\n childSelectable || (childSelectable = child.selectable);\n if (!child.group && !this.updateRowSelectable(child, true) && child.isSelected()) {\n nodesToDeselect.push(child);\n }\n }\n this.setRowSelectable(node, childSelectable, true);\n });\n }\n } else {\n rowModel.forEachNode((node) => {\n if (!this.updateRowSelectable(node, true) && node.isSelected()) {\n nodesToDeselect.push(node);\n }\n });\n }\n if (nodesToDeselect.length) {\n this.setNodesSelected({\n nodes: nodesToDeselect,\n newValue: false,\n source\n });\n }\n if (!changedPath && isCSRMGroupSelectsDescendants) {\n this.updateGroupsFromChildrenSelections?.(source);\n }\n }\n // only called by CSRM\n updateSelectableAfterGrouping(changedPath) {\n this.updateSelectable(changedPath);\n if (this.groupSelectsDescendants) {\n const selectionChanged = this.updateGroupsFromChildrenSelections?.(\"rowGroupChanged\", changedPath);\n if (selectionChanged) {\n this.dispatchSelectionChanged(\"rowGroupChanged\");\n }\n }\n }\n refreshMasterNodeState(node, e) {\n if (!this.masterSelectsDetail) {\n return;\n }\n const detailApi = node.detailNode?.detailGridInfo?.api;\n if (!detailApi) {\n return;\n }\n const isSelectAll = _isAllSelected(detailApi);\n const current = node.isSelected();\n if (current !== isSelectAll) {\n const selectionChanged = this.selectRowNode(node, isSelectAll, e, \"masterDetail\");\n if (selectionChanged) {\n this.dispatchSelectionChanged(\"masterDetail\");\n }\n }\n if (!isSelectAll) {\n this.detailSelection.set(node.id, new Set(detailApi.getSelectedNodes().map((n) => n.id)));\n }\n }\n setDetailSelectionState(masterNode, detailGridOptions, detailApi) {\n if (!this.masterSelectsDetail) {\n return;\n }\n if (!_isMultiRowSelection(detailGridOptions)) {\n _warn(269);\n return;\n }\n switch (masterNode.isSelected()) {\n case true: {\n detailApi.selectAll();\n break;\n }\n case false: {\n detailApi.deselectAll();\n break;\n }\n case void 0: {\n const selectedIds = this.detailSelection.get(masterNode.id);\n if (selectedIds) {\n const nodes = [];\n for (const id of selectedIds) {\n const n = detailApi.getRowNode(id);\n if (n) {\n nodes.push(n);\n }\n }\n detailApi.setNodesSelected({ nodes, newValue: true, source: \"masterDetail\" });\n }\n break;\n }\n default:\n break;\n }\n }\n dispatchSelectionChanged(source) {\n this.eventSvc.dispatchEvent({\n type: \"selectionChanged\",\n source,\n selectedNodes: this.getSelectedNodes(),\n serverSideState: null\n });\n }\n};\nfunction _isAllSelected(api) {\n let selectedCount = 0;\n let notSelectedCount = 0;\n api.forEachNode((node) => {\n if (node.isSelected()) {\n selectedCount++;\n } else if (node.selectable) {\n notSelectedCount++;\n }\n });\n return _calculateSelectAllState(selectedCount, notSelectedCount);\n}\nfunction _calculateSelectAllState(selected, notSelected) {\n if (selected === 0 && notSelected === 0) {\n return false;\n }\n if (selected > 0 && notSelected > 0) {\n return;\n }\n return selected > 0;\n}\nfunction isDescendantOf(root, child) {\n let parent = child.parent;\n while (parent) {\n if (parent === root) {\n return true;\n }\n parent = parent.parent;\n }\n return false;\n}\nfunction recursiveCanNodesBeSelected(root) {\n const rootCanBeSelected = root.isSelected() === false;\n const childrenCanBeSelected = root.childrenAfterFilter?.some(recursiveCanNodesBeSelected) ?? false;\n return rootCanBeSelected || childrenCanBeSelected;\n}\n\n// packages/ag-grid-community/src/selection/rowSelectionModule.ts\nvar SharedRowSelectionModule = {\n moduleName: \"SharedRowSelection\",\n version: VERSION,\n beans: [SelectionColService],\n css: [rowSelection_default],\n apiFunctions: {\n setNodesSelected,\n selectAll,\n deselectAll,\n selectAllFiltered,\n deselectAllFiltered,\n selectAllOnCurrentPage,\n deselectAllOnCurrentPage,\n getSelectedNodes,\n getSelectedRows\n }\n};\nvar RowSelectionModule = {\n moduleName: \"RowSelection\",\n version: VERSION,\n rowModels: [\"clientSide\", \"infinite\", \"viewport\"],\n beans: [SelectionService],\n dependsOn: [SharedRowSelectionModule]\n};\n\n// packages/ag-grid-community/src/styling/cellCustomStyleFeature.ts\nvar CellCustomStyleFeature = class extends BeanStub {\n constructor(cellCtrl, beans) {\n super();\n this.cellCtrl = cellCtrl;\n this.staticClasses = [];\n this.beans = beans;\n this.column = cellCtrl.column;\n }\n setComp(comp) {\n this.cellComp = comp;\n this.applyUserStyles();\n this.applyCellClassRules();\n this.applyClassesFromColDef();\n }\n applyCellClassRules() {\n const { column, cellComp } = this;\n const colDef = column.colDef;\n const cellClassRules = colDef.cellClassRules;\n const cellClassParams = this.getCellClassParams(column, colDef);\n processClassRules(\n this.beans.expressionSvc,\n // if current was previous, skip\n cellClassRules === this.cellClassRules ? void 0 : this.cellClassRules,\n cellClassRules,\n cellClassParams,\n (className) => cellComp.toggleCss(className, true),\n (className) => cellComp.toggleCss(className, false)\n );\n this.cellClassRules = cellClassRules;\n }\n applyUserStyles() {\n const column = this.column;\n const colDef = column.colDef;\n const cellStyle = colDef.cellStyle;\n if (!cellStyle) {\n return;\n }\n let styles;\n if (typeof cellStyle === \"function\") {\n const cellStyleParams = this.getCellClassParams(column, colDef);\n styles = cellStyle(cellStyleParams);\n } else {\n styles = cellStyle;\n }\n if (styles) {\n this.cellComp.setUserStyles(styles);\n }\n }\n applyClassesFromColDef() {\n const { column, cellComp } = this;\n const colDef = column.colDef;\n const cellClassParams = this.getCellClassParams(column, colDef);\n for (const className of this.staticClasses) {\n cellComp.toggleCss(className, false);\n }\n const newStaticClasses = this.beans.cellStyles.getStaticCellClasses(colDef, cellClassParams);\n this.staticClasses = newStaticClasses;\n for (const className of newStaticClasses) {\n cellComp.toggleCss(className, true);\n }\n }\n getCellClassParams(column, colDef) {\n const { value, rowNode } = this.cellCtrl;\n return _addGridCommonParams(this.beans.gos, {\n value,\n data: rowNode.data,\n node: rowNode,\n colDef,\n column,\n rowIndex: rowNode.rowIndex\n });\n }\n};\n\n// packages/ag-grid-community/src/styling/cellStyleService.ts\nvar CellStyleService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"cellStyles\";\n }\n processAllCellClasses(colDef, params, onApplicableClass, onNotApplicableClass) {\n processClassRules(\n this.beans.expressionSvc,\n void 0,\n colDef.cellClassRules,\n params,\n onApplicableClass,\n onNotApplicableClass\n );\n this.processStaticCellClasses(colDef, params, onApplicableClass);\n }\n getStaticCellClasses(colDef, params) {\n const { cellClass } = colDef;\n if (!cellClass) {\n return [];\n }\n let classOrClasses;\n if (typeof cellClass === \"function\") {\n const cellClassFunc = cellClass;\n classOrClasses = cellClassFunc(params);\n } else {\n classOrClasses = cellClass;\n }\n if (typeof classOrClasses === \"string\") {\n classOrClasses = [classOrClasses];\n }\n return classOrClasses || [];\n }\n createCellCustomStyleFeature(ctrl) {\n return new CellCustomStyleFeature(ctrl, this.beans);\n }\n processStaticCellClasses(colDef, params, onApplicableClass) {\n const classOrClasses = this.getStaticCellClasses(colDef, params);\n classOrClasses.forEach((cssClassItem) => {\n onApplicableClass(cssClassItem);\n });\n }\n};\n\n// packages/ag-grid-community/src/styling/stylingModule.ts\nvar CellStyleModule = {\n moduleName: \"CellStyle\",\n version: VERSION,\n beans: [CellStyleService]\n};\nvar RowStyleModule = {\n moduleName: \"RowStyle\",\n version: VERSION,\n beans: [RowStyleService]\n};\n\n// packages/ag-grid-community/src/gridOptionsInitial.ts\nvar INITIAL_GRID_OPTION_KEYS = {\n enableBrowserTooltips: true,\n tooltipTrigger: true,\n tooltipMouseTrack: true,\n tooltipShowMode: true,\n tooltipInteraction: true,\n defaultColGroupDef: true,\n suppressAutoSize: true,\n skipHeaderOnAutoSize: true,\n autoSizeStrategy: true,\n components: true,\n stopEditingWhenCellsLoseFocus: true,\n undoRedoCellEditing: true,\n undoRedoCellEditingLimit: true,\n excelStyles: true,\n cacheQuickFilter: true,\n customChartThemes: true,\n chartThemeOverrides: true,\n chartToolPanelsDef: true,\n loadingCellRendererSelector: true,\n localeText: true,\n keepDetailRows: true,\n keepDetailRowsCount: true,\n detailRowHeight: true,\n detailRowAutoHeight: true,\n tabIndex: true,\n valueCache: true,\n valueCacheNeverExpires: true,\n enableCellExpressions: true,\n suppressTouch: true,\n suppressBrowserResizeObserver: true,\n suppressPropertyNamesCheck: true,\n debug: true,\n dragAndDropImageComponent: true,\n overlayComponent: true,\n suppressOverlays: true,\n loadingOverlayComponent: true,\n suppressLoadingOverlay: true,\n noRowsOverlayComponent: true,\n paginationPageSizeSelector: true,\n paginateChildRows: true,\n pivotPanelShow: true,\n pivotSuppressAutoColumn: true,\n suppressExpandablePivotGroups: true,\n aggFuncs: true,\n allowShowChangeAfterFilter: true,\n ensureDomOrder: true,\n enableRtl: true,\n suppressColumnVirtualisation: true,\n suppressMaxRenderedRowRestriction: true,\n suppressRowVirtualisation: true,\n rowDragText: true,\n groupLockGroupColumns: true,\n suppressGroupRowsSticky: true,\n rowModelType: true,\n cacheOverflowSize: true,\n infiniteInitialRowCount: true,\n serverSideInitialRowCount: true,\n maxBlocksInCache: true,\n maxConcurrentDatasourceRequests: true,\n blockLoadDebounceMillis: true,\n serverSideOnlyRefreshFilteredGroups: true,\n serverSidePivotResultFieldSeparator: true,\n viewportRowModelPageSize: true,\n viewportRowModelBufferSize: true,\n debounceVerticalScrollbar: true,\n suppressAnimationFrame: true,\n suppressPreventDefaultOnMouseWheel: true,\n scrollbarWidth: true,\n icons: true,\n suppressRowTransform: true,\n gridId: true,\n enableGroupEdit: true,\n initialState: true,\n processUnpinnedColumns: true,\n createChartContainer: true,\n getLocaleText: true,\n getRowId: true,\n reactiveCustomComponents: true,\n renderingMode: true,\n columnMenu: true,\n suppressSetFilterByDefault: true,\n getDataPath: true,\n enableCellSpan: true,\n enableFilterHandlers: true,\n filterHandlers: true\n};\n\n// packages/ag-grid-community/src/validation/apiFunctionValidator.ts\nvar clientSide = \"clientSide\";\nvar serverSide = \"serverSide\";\nvar infinite = \"infinite\";\nvar functionRowModels = {\n onGroupExpandedOrCollapsed: [clientSide],\n refreshClientSideRowModel: [clientSide],\n isRowDataEmpty: [clientSide],\n forEachLeafNode: [clientSide],\n forEachNodeAfterFilter: [clientSide],\n forEachNodeAfterFilterAndSort: [clientSide],\n resetRowHeights: [clientSide, serverSide],\n applyTransaction: [clientSide],\n applyTransactionAsync: [clientSide],\n flushAsyncTransactions: [clientSide],\n getBestCostNodeSelection: [clientSide],\n getServerSideSelectionState: [serverSide],\n setServerSideSelectionState: [serverSide],\n applyServerSideTransaction: [serverSide],\n applyServerSideTransactionAsync: [serverSide],\n applyServerSideRowData: [serverSide],\n retryServerSideLoads: [serverSide],\n flushServerSideAsyncTransactions: [serverSide],\n refreshServerSide: [serverSide],\n getServerSideGroupLevelState: [serverSide],\n refreshInfiniteCache: [infinite],\n purgeInfiniteCache: [infinite],\n getInfiniteRowCount: [infinite],\n isLastRowIndexKnown: [infinite, serverSide],\n expandAll: [clientSide, serverSide],\n collapseAll: [clientSide, serverSide],\n onRowHeightChanged: [clientSide, serverSide],\n setRowCount: [infinite, serverSide],\n getCacheBlockState: [infinite, serverSide]\n};\nvar deprecatedFunctions = {\n showLoadingOverlay: {\n version: \"v32\",\n message: '`showLoadingOverlay` is deprecated. Use the grid option \"loading\"=true instead or setGridOption(\"loading\", true).'\n },\n clearRangeSelection: {\n version: \"v32.2\",\n message: \"Use `clearCellSelection` instead.\"\n },\n getInfiniteRowCount: {\n version: \"v32.2\",\n old: \"getInfiniteRowCount()\",\n new: \"getDisplayedRowCount()\"\n },\n selectAllFiltered: {\n version: \"v33\",\n old: \"selectAllFiltered()\",\n new: 'selectAll(\"filtered\")'\n },\n deselectAllFiltered: {\n version: \"v33\",\n old: \"deselectAllFiltered()\",\n new: 'deselectAll(\"filtered\")'\n },\n selectAllOnCurrentPage: {\n version: \"v33\",\n old: \"selectAllOnCurrentPage()\",\n new: 'selectAll(\"currentPage\")'\n },\n deselectAllOnCurrentPage: {\n version: \"v33\",\n old: \"deselectAllOnCurrentPage()\",\n new: 'deselectAll(\"currentPage\")'\n }\n};\nfunction validateApiFunction(functionName, apiFunction, beans) {\n const deprecation = deprecatedFunctions[functionName];\n if (deprecation) {\n const { version, new: replacement, old, message } = deprecation;\n const apiMethod = old ?? functionName;\n return (...args) => {\n const replacementMessage = replacement ? `Please use ${replacement} instead. ` : \"\";\n _warnOnce(`Since ${version} api.${apiMethod} is deprecated. ${replacementMessage}${message ?? \"\"}`);\n return apiFunction.apply(apiFunction, args);\n };\n }\n const rowModels = functionRowModels[functionName];\n if (rowModels) {\n return (...args) => {\n const rowModel = beans.rowModel.getType();\n if (!rowModels.includes(rowModel)) {\n _errorOnce(\n `api.${functionName} can only be called when gridOptions.rowModelType is ${rowModels.join(\" or \")}`\n );\n return void 0;\n }\n return apiFunction.apply(apiFunction, args);\n };\n }\n return apiFunction;\n}\n\n// packages/ag-grid-community/src/validation/rules/dynamicBeanValidations.ts\nvar DYNAMIC_BEAN_MODULES = {\n detailCellRendererCtrl: \"SharedMasterDetail\",\n dndSourceComp: \"DragAndDrop\",\n fillHandle: \"CellSelection\",\n groupCellRendererCtrl: \"GroupCellRenderer\",\n headerFilterCellCtrl: \"ColumnFilter\",\n headerGroupCellCtrl: \"ColumnGroup\",\n rangeHandle: \"CellSelection\",\n tooltipFeature: \"Tooltip\",\n highlightTooltipFeature: \"Tooltip\",\n tooltipStateManager: \"Tooltip\",\n groupStrategy: \"RowGrouping\",\n treeGroupStrategy: \"TreeData\",\n rowNumberRowResizer: \"RowNumbers\",\n singleCell: \"EditCore\",\n fullRow: \"EditCore\",\n agSetColumnFilterHandler: \"SetFilter\",\n agMultiColumnFilterHandler: \"MultiFilter\",\n agGroupColumnFilterHandler: \"GroupFilter\",\n agNumberColumnFilterHandler: \"NumberFilter\",\n agBigIntColumnFilterHandler: \"BigIntFilter\",\n agDateColumnFilterHandler: \"DateFilter\",\n agTextColumnFilterHandler: \"TextFilter\"\n};\n\n// packages/ag-grid-community/src/validation/rules/iconValidations.ts\nvar ICON_VALUES = {\n expanded: 1,\n contracted: 1,\n \"tree-closed\": 1,\n \"tree-open\": 1,\n \"tree-indeterminate\": 1,\n pin: 1,\n \"eye-slash\": 1,\n arrows: 1,\n left: 1,\n right: 1,\n group: 1,\n aggregation: 1,\n pivot: 1,\n \"not-allowed\": 1,\n chart: 1,\n cross: 1,\n cancel: 1,\n tick: 1,\n first: 1,\n previous: 1,\n next: 1,\n last: 1,\n linked: 1,\n unlinked: 1,\n \"color-picker\": 1,\n loading: 1,\n menu: 1,\n \"menu-alt\": 1,\n filter: 1,\n \"filter-add\": 1,\n columns: 1,\n maximize: 1,\n minimize: 1,\n copy: 1,\n cut: 1,\n paste: 1,\n grip: 1,\n save: 1,\n csv: 1,\n excel: 1,\n \"small-down\": 1,\n \"small-left\": 1,\n \"small-right\": 1,\n \"small-up\": 1,\n asc: 1,\n desc: 1,\n aasc: 1,\n adesc: 1,\n none: 1,\n up: 1,\n down: 1,\n plus: 1,\n minus: 1,\n settings: 1,\n \"checkbox-checked\": 1,\n \"checkbox-indeterminate\": 1,\n \"checkbox-unchecked\": 1,\n \"radio-button-on\": 1,\n \"radio-button-off\": 1,\n eye: 1,\n \"column-arrow\": 1,\n \"un-pin\": 1,\n \"pinned-top\": 1,\n \"pinned-bottom\": 1,\n \"chevron-up\": 1,\n \"chevron-down\": 1,\n \"chevron-left\": 1,\n \"chevron-right\": 1,\n edit: 1\n};\nvar ICON_MODULES = {\n chart: \"MenuCore\",\n cancel: \"EnterpriseCore\",\n first: \"Pagination\",\n previous: \"Pagination\",\n next: \"Pagination\",\n last: \"Pagination\",\n linked: \"IntegratedCharts\",\n loadingMenuItems: \"MenuCore\",\n unlinked: \"IntegratedCharts\",\n menu: \"ColumnHeaderComp\",\n legacyMenu: \"ColumnMenu\",\n filter: \"ColumnFilter\",\n filterActive: \"ColumnFilter\",\n filterAdd: \"NewFiltersToolPanel\",\n filterCardCollapse: \"NewFiltersToolPanel\",\n filterCardExpand: \"NewFiltersToolPanel\",\n filterCardEditing: \"NewFiltersToolPanel\",\n filterTab: \"ColumnMenu\",\n filtersToolPanel: \"FiltersToolPanel\",\n columns: [\"MenuCore\"],\n columnsToolPanel: [\"ColumnsToolPanel\"],\n maximize: \"EnterpriseCore\",\n minimize: \"EnterpriseCore\",\n save: \"MenuCore\",\n columnGroupOpened: \"ColumnGroupHeaderComp\",\n columnGroupClosed: \"ColumnGroupHeaderComp\",\n accordionOpen: \"EnterpriseCore\",\n accordionClosed: \"EnterpriseCore\",\n accordionIndeterminate: \"EnterpriseCore\",\n columnSelectClosed: [\"ColumnsToolPanel\", \"ColumnMenu\"],\n columnSelectOpen: [\"ColumnsToolPanel\", \"ColumnMenu\"],\n columnSelectIndeterminate: [\"ColumnsToolPanel\", \"ColumnMenu\"],\n columnMovePin: \"SharedDragAndDrop\",\n columnMoveHide: \"SharedDragAndDrop\",\n columnMoveMove: \"SharedDragAndDrop\",\n columnMoveLeft: \"SharedDragAndDrop\",\n columnMoveRight: \"SharedDragAndDrop\",\n columnMoveGroup: \"SharedDragAndDrop\",\n columnMoveValue: \"SharedDragAndDrop\",\n columnMovePivot: \"SharedDragAndDrop\",\n dropNotAllowed: \"SharedDragAndDrop\",\n ensureColumnVisible: [\"ColumnsToolPanel\", \"ColumnMenu\"],\n groupContracted: \"GroupCellRenderer\",\n groupExpanded: \"GroupCellRenderer\",\n setFilterGroupClosed: \"SetFilter\",\n setFilterGroupOpen: \"SetFilter\",\n setFilterGroupIndeterminate: \"SetFilter\",\n setFilterLoading: \"SetFilter\",\n close: \"EnterpriseCore\",\n check: \"MenuItem\",\n colorPicker: \"CommunityCore\",\n groupLoading: \"LoadingCellRenderer\",\n overlayLoading: \"Overlay\",\n overlayExporting: \"Overlay\",\n menuAlt: \"ColumnHeaderComp\",\n menuPin: \"MenuCore\",\n menuValue: \"MenuCore\",\n menuAddRowGroup: [\"MenuCore\", \"ColumnsToolPanel\"],\n menuRemoveRowGroup: [\"MenuCore\", \"ColumnsToolPanel\"],\n clipboardCopy: \"MenuCore\",\n clipboardCut: \"MenuCore\",\n clipboardPaste: \"MenuCore\",\n pivotPanel: [\"ColumnsToolPanel\", \"RowGroupingPanel\"],\n rowGroupPanel: [\"ColumnsToolPanel\", \"RowGroupingPanel\"],\n valuePanel: \"ColumnsToolPanel\",\n columnDrag: \"EnterpriseCore\",\n rowDrag: [\"RowDrag\", \"DragAndDrop\"],\n csvExport: \"MenuCore\",\n excelExport: \"MenuCore\",\n smallDown: \"CommunityCore\",\n selectOpen: \"CommunityCore\",\n richSelectOpen: \"RichSelect\",\n richSelectRemove: \"RichSelect\",\n richSelectLoading: \"RichSelect\",\n smallLeft: \"CommunityCore\",\n smallRight: \"CommunityCore\",\n subMenuOpen: \"MenuItem\",\n subMenuOpenRtl: \"MenuItem\",\n panelDelimiter: \"RowGroupingPanel\",\n panelDelimiterRtl: \"RowGroupingPanel\",\n smallUp: \"CommunityCore\",\n sortAscending: [\"MenuCore\", \"Sort\"],\n sortDescending: [\"MenuCore\", \"Sort\"],\n sortAbsoluteAscending: [\"MenuCore\", \"Sort\"],\n sortAbsoluteDescending: [\"MenuCore\", \"Sort\"],\n sortUnSort: [\"MenuCore\", \"Sort\"],\n advancedFilterBuilder: \"AdvancedFilter\",\n advancedFilterBuilderDrag: \"AdvancedFilter\",\n advancedFilterBuilderInvalid: \"AdvancedFilter\",\n advancedFilterBuilderMoveUp: \"AdvancedFilter\",\n advancedFilterBuilderMoveDown: \"AdvancedFilter\",\n advancedFilterBuilderAdd: \"AdvancedFilter\",\n advancedFilterBuilderRemove: \"AdvancedFilter\",\n advancedFilterBuilderSelectOpen: \"AdvancedFilter\",\n chartsMenu: \"IntegratedCharts\",\n chartsMenuEdit: \"IntegratedCharts\",\n chartsMenuAdvancedSettings: \"IntegratedCharts\",\n chartsMenuAdd: \"IntegratedCharts\",\n chartsColorPicker: \"IntegratedCharts\",\n chartsThemePrevious: \"IntegratedCharts\",\n chartsThemeNext: \"IntegratedCharts\",\n chartsDownload: \"IntegratedCharts\",\n checkboxChecked: \"CommunityCore\",\n checkboxIndeterminate: \"CommunityCore\",\n checkboxUnchecked: \"CommunityCore\",\n radioButtonOn: \"CommunityCore\",\n radioButtonOff: \"CommunityCore\",\n rowPin: \"PinnedRow\",\n rowUnpin: \"PinnedRow\",\n rowPinBottom: \"PinnedRow\",\n rowPinTop: \"PinnedRow\"\n};\nvar DEPRECATED_ICONS_V33 = /* @__PURE__ */ new Set([\n \"colorPicker\",\n \"smallUp\",\n \"checkboxChecked\",\n \"checkboxIndeterminate\",\n \"checkboxUnchecked\",\n \"radioButtonOn\",\n \"radioButtonOff\",\n \"smallDown\",\n \"smallLeft\",\n \"smallRight\"\n]);\n\n// packages/ag-grid-community/src/validation/validationService.ts\nvar ValidationService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"validation\";\n }\n wireBeans(beans) {\n this.gridOptions = beans.gridOptions;\n provideValidationServiceLogger(getError);\n }\n warnOnInitialPropertyUpdate(source, key) {\n if (source === \"api\" && INITIAL_GRID_OPTION_KEYS[key]) {\n _warn(22, { key });\n }\n }\n processGridOptions(options) {\n this.processOptions(options, GRID_OPTIONS_VALIDATORS());\n }\n validateApiFunction(functionName, apiFunction) {\n return validateApiFunction(functionName, apiFunction, this.beans);\n }\n missingUserComponent(propertyName, componentName, agGridDefaults, jsComps) {\n const moduleForComponent = USER_COMP_MODULES[componentName];\n if (moduleForComponent) {\n this.gos.assertModuleRegistered(\n moduleForComponent,\n `AG Grid '${propertyName}' component: ${componentName}`\n );\n } else {\n _warn(101, {\n propertyName,\n componentName,\n agGridDefaults,\n jsComps\n });\n }\n }\n missingDynamicBean(beanName) {\n const moduleName = DYNAMIC_BEAN_MODULES[beanName];\n return moduleName ? _errMsg(200, {\n ...this.gos.getModuleErrorParams(),\n moduleName,\n reasonOrId: beanName\n }) : void 0;\n }\n checkRowEvents(eventType) {\n if (DEPRECATED_ROW_NODE_EVENTS.has(eventType)) {\n _warn(10, { eventType });\n }\n }\n validateIcon(iconName) {\n if (DEPRECATED_ICONS_V33.has(iconName)) {\n _warn(43, { iconName });\n }\n if (ICON_VALUES[iconName]) {\n return;\n }\n const moduleName = ICON_MODULES[iconName];\n if (moduleName) {\n _error(200, {\n reasonOrId: `icon '${iconName}'`,\n moduleName,\n gridScoped: _areModulesGridScoped(),\n gridId: this.beans.context.getId(),\n rowModelType: this.gos.get(\"rowModelType\"),\n additionalText: \"Alternatively, use the CSS icon name directly.\"\n });\n return;\n }\n _warn(134, { iconName });\n }\n isProvidedUserComp(compName) {\n return !!USER_COMP_MODULES[compName];\n }\n /** Should only be called via the GridOptionsService */\n validateColDef(colDef) {\n this.processOptions(colDef, COL_DEF_VALIDATORS());\n }\n processOptions(options, validator) {\n const { validations, deprecations, allProperties, propertyExceptions, objectName, docsUrl } = validator;\n if (allProperties && this.gridOptions.suppressPropertyNamesCheck !== true) {\n this.checkProperties(\n options,\n [...propertyExceptions ?? [], ...Object.keys(deprecations)],\n allProperties,\n objectName,\n docsUrl\n );\n }\n const warnings = /* @__PURE__ */ new Set();\n const optionKeys = Object.keys(options);\n optionKeys.forEach((key) => {\n const deprecation = deprecations[key];\n if (deprecation) {\n const { message, version } = deprecation;\n warnings.add(`As of v${version}, ${String(key)} is deprecated. ${message ?? \"\"}`);\n }\n const value = options[key];\n if (value == null || value === false) {\n return;\n }\n const rules = validations[key];\n if (!rules) {\n return;\n }\n const { dependencies, validate, supportedRowModels, expectedType } = rules;\n if (expectedType) {\n const actualType = typeof value;\n if (actualType !== expectedType) {\n warnings.add(\n `${String(key)} should be of type '${expectedType}' but received '${actualType}' (${value}).`\n );\n return;\n }\n }\n if (supportedRowModels) {\n const rowModel = this.gridOptions.rowModelType ?? \"clientSide\";\n if (!supportedRowModels.includes(rowModel)) {\n warnings.add(\n `${String(key)} is not supported with the '${rowModel}' row model. It is only valid with: ${supportedRowModels.join(\", \")}.`\n );\n return;\n }\n }\n if (dependencies) {\n const warning = this.checkForRequiredDependencies(key, dependencies, options);\n if (warning) {\n warnings.add(warning);\n return;\n }\n }\n if (validate) {\n const warning = validate(options, this.gridOptions, this.beans);\n if (warning) {\n warnings.add(warning);\n return;\n }\n }\n });\n if (warnings.size > 0) {\n for (const warning of warnings) {\n _warnOnce(warning);\n }\n }\n }\n checkForRequiredDependencies(key, validator, options) {\n const optionEntries = Object.entries(validator);\n const failedOptions = optionEntries.filter(([key2, value]) => {\n const gridOptionValue = options[key2];\n return !value.required.includes(gridOptionValue);\n });\n if (failedOptions.length === 0) {\n return null;\n }\n return failedOptions.map(\n ([failedKey, possibleOptions]) => `'${String(key)}' requires '${failedKey}' to be one of [${possibleOptions.required.map((o) => {\n if (o === null) {\n return \"null\";\n } else if (o === void 0) {\n return \"undefined\";\n }\n return o;\n }).join(\", \")}]. ${possibleOptions.reason ?? \"\"}`\n ).join(\"\\n \");\n }\n checkProperties(object, exceptions, validProperties, containerName, docsUrl) {\n const VUE_FRAMEWORK_PROPS = [\"__ob__\", \"__v_skip\", \"__metadata__\"];\n const invalidProperties = _fuzzyCheckStrings(\n Object.getOwnPropertyNames(object),\n [...VUE_FRAMEWORK_PROPS, ...exceptions, ...validProperties],\n validProperties\n );\n const invalidPropertiesKeys = Object.keys(invalidProperties);\n for (const key of invalidPropertiesKeys) {\n const value = invalidProperties[key];\n let message = `invalid ${containerName} property '${key}' did you mean any of these: ${value.slice(0, 8).join(\", \")}.`;\n if (validProperties.includes(\"context\")) {\n message += `\nIf you are trying to annotate ${containerName} with application data, use the '${containerName}.context' property instead.`;\n }\n _warnOnce(message);\n }\n if (invalidPropertiesKeys.length > 0 && docsUrl) {\n const url = this.beans.frameworkOverrides.getDocLink(docsUrl);\n _warnOnce(`to see all the valid ${containerName} properties please check: ${url}`);\n }\n }\n};\nfunction _fuzzyCheckStrings(inputValues, validValues, allSuggestions) {\n const fuzzyMatches = {};\n const invalidInputs = inputValues.filter(\n (inputValue) => !validValues.some((validValue) => validValue === inputValue)\n );\n if (invalidInputs.length > 0) {\n for (const invalidInput of invalidInputs) {\n fuzzyMatches[invalidInput] = _fuzzySuggestions({ inputValue: invalidInput, allSuggestions }).values;\n }\n }\n return fuzzyMatches;\n}\nvar DEPRECATED_ROW_NODE_EVENTS = /* @__PURE__ */ new Set([\n \"firstChildChanged\",\n \"lastChildChanged\",\n \"childIndexChanged\"\n]);\n\n// packages/ag-grid-community/src/validation/validationModule.ts\nvar ValidationModule = {\n moduleName: \"Validation\",\n version: VERSION,\n beans: [ValidationService]\n};\n\n// packages/ag-grid-community/src/allCommunityModule.ts\nvar AllCommunityModule = {\n moduleName: \"AllCommunity\",\n version: VERSION,\n dependsOn: [\n ClientSideRowModelModule,\n CsvExportModule,\n InfiniteRowModelModule,\n ValidationModule,\n TextEditorModule,\n NumberEditorModule,\n DateEditorModule,\n CheckboxEditorModule,\n SelectEditorModule,\n LargeTextEditorModule,\n CustomEditorModule,\n UndoRedoEditModule,\n TextFilterModule,\n NumberFilterModule,\n BigIntFilterModule,\n DateFilterModule,\n CustomFilterModule,\n QuickFilterModule,\n ExternalFilterModule,\n GridStateModule,\n AlignedGridsModule,\n PaginationModule,\n ColumnApiModule,\n RowApiModule,\n ScrollApiModule,\n RenderApiModule,\n ColumnAutoSizeModule,\n RowDragModule,\n PinnedRowModule,\n RowSelectionModule,\n ValueCacheModule,\n CellStyleModule,\n ColumnHoverModule,\n RowStyleModule,\n EventApiModule,\n CellApiModule,\n HighlightChangesModule,\n TooltipModule,\n LocaleModule,\n RowAutoHeightModule,\n DragAndDropModule,\n ClientSideRowModelApiModule,\n CellSpanModule\n ]\n};\n\n// packages/ag-grid-community/src/testing/testIdUtils.ts\nfunction formatTestId(name, attributes = {}) {\n const params = Object.keys(attributes).map((k) => {\n const v = attributes[k];\n return v != null ? `${k}=${v}` : null;\n }).filter(Boolean).join(\";\");\n return [name, params].filter((s) => s.length > 0).join(\":\");\n}\nvar agTestIdFor = {\n grid(gridId) {\n return formatTestId(\"ag-grid-root\", { gridId });\n },\n /** Headers */\n headerGroupCell(colId) {\n return formatTestId(\"ag-header-group-cell\", { colId });\n },\n headerCell(colId) {\n return formatTestId(\"ag-header-cell\", { colId });\n },\n headerCheckbox(colId) {\n return formatTestId(\"ag-header-selection-checkbox\", { colId });\n },\n headerFilterButton(colId) {\n return formatTestId(\"ag-header-cell-filter-button\", { colId });\n },\n floatingFilter(colId) {\n return formatTestId(\"ag-floating-filter\", { colId });\n },\n floatingFilterButton(colId) {\n return formatTestId(\"ag-floating-filter-button\", { colId });\n },\n headerCellMenuButton(colId) {\n return formatTestId(\"ag-header-cell-menu-button\", { colId });\n },\n headerResizeHandle(colId) {\n return formatTestId(\"ag-header-cell-resize\", { colId });\n },\n /** Column Filters */\n filterInstancePickerDisplay(spec) {\n return formatTestId(`ag-${spec.source}-picker-display`, prepFilterSpec(spec));\n },\n numberFilterInstanceInput(spec) {\n return formatTestId(`ag-${spec.source}-number-input`, prepFilterSpec(spec));\n },\n textFilterInstanceInput(spec) {\n return formatTestId(`ag-${spec.source}-text-input`, prepFilterSpec(spec));\n },\n dateFilterInstanceInput(spec) {\n return formatTestId(`ag-${spec.source}-date-input`, prepFilterSpec(spec));\n },\n setFilterInstanceMiniFilterInput(spec) {\n return formatTestId(\n `ag-${spec.source}-set-filter-mini-filter-input`,\n spec.source === \"filter-toolpanel\" ? { label: spec.colLabel } : { colId: spec.colId }\n );\n },\n setFilterInstanceItem(spec, itemLabel) {\n return formatTestId(\n `ag-${spec.source}-set-filter-item`,\n spec.source === \"filter-toolpanel\" ? { colLabel: spec.colLabel, itemLabel } : { colId: spec.colId, itemLabel }\n );\n },\n setFilterApplyPanelButton(spec, buttonLabel) {\n return formatTestId(\n `ag-${spec.source}-set-filter-apply-panel-button`,\n spec.source === \"filter-toolpanel\" ? { colLabel: spec.colLabel, buttonLabel } : { colId: spec.colId, buttonLabel }\n );\n },\n filterConditionRadioButton(spec, buttonLabel) {\n return formatTestId(\n `ag-${spec.source}-filter-condition-radio-button`,\n spec.source === \"filter-toolpanel\" ? { colLabel: spec.colLabel, buttonLabel } : { colId: spec.colId, buttonLabel }\n );\n },\n /** Advanced Filter */\n advancedFilterInput() {\n return formatTestId(\"ag-advanced-filter-input\");\n },\n advancedFilterButton(label) {\n return formatTestId(\"ag-advanced-filter-button\", { label });\n },\n advancedFilterBuilderButton() {\n return formatTestId(\"ag-advanced-filter-builder-button\");\n },\n advancedFilterPanelMaximiseButton() {\n return formatTestId(\"ag-advanced-filter-builder-panel-maximise\");\n },\n advancedFilterPanelCloseButton() {\n return formatTestId(\"ag-advanced-filter-builder-panel-close\");\n },\n advancedFilterPill(label) {\n return formatTestId(\"ag-advanced-filter-builder-pill\", { label });\n },\n advancedFilterBuilderAddItemButton() {\n return formatTestId(\"ag-advanced-filter-builder-add-item-button\");\n },\n /** Rows */\n rowNode(rowId) {\n return formatTestId(\"ag-row\", { [\"row-id\"]: rowId });\n },\n /** Cells */\n cell(rowId, colId) {\n return formatTestId(\"ag-cell\", { [\"row-id\"]: rowId, colId });\n },\n autoGroupCell(rowId) {\n return agTestIdFor.cell(rowId, GROUP_AUTO_COLUMN_ID);\n },\n checkbox(rowId, colId) {\n return formatTestId(\"ag-selection-checkbox\", { [\"row-id\"]: rowId, colId });\n },\n selectionColumnCheckbox(rowId) {\n return agTestIdFor.checkbox(rowId, SELECTION_COLUMN_ID);\n },\n autoGroupColumnCheckbox(rowId) {\n return agTestIdFor.checkbox(rowId, GROUP_AUTO_COLUMN_ID);\n },\n dragHandle(rowId, colId) {\n return formatTestId(\"ag-drag-handle\", { [\"row-id\"]: rowId, colId });\n },\n groupContracted(rowId, colId) {\n return formatTestId(\"ag-group-contracted\", { [\"row-id\"]: rowId, colId });\n },\n groupExpanded(rowId, colId) {\n return formatTestId(\"ag-group-expanded\", { [\"row-id\"]: rowId, colId });\n },\n autoGroupContracted(rowId) {\n return agTestIdFor.groupContracted(rowId, GROUP_AUTO_COLUMN_ID);\n },\n autoGroupExpanded(rowId) {\n return agTestIdFor.groupExpanded(rowId, GROUP_AUTO_COLUMN_ID);\n },\n rowNumber(rowId) {\n return agTestIdFor.cell(rowId, ROW_NUMBERS_COLUMN_ID);\n },\n /** Menu */\n menu() {\n return formatTestId(\"ag-menu\");\n },\n menuOption(option) {\n return formatTestId(\"ag-menu-option\", { [\"option\"]: option });\n },\n /** SideBar */\n sideBar() {\n return formatTestId(\"ag-side-bar\");\n },\n sideBarButton(label) {\n return formatTestId(\"ag-side-button\", { label });\n },\n /** Column Tool Panel */\n columnToolPanel() {\n return formatTestId(\"ag-column-panel\");\n },\n pivotModeSelect() {\n return formatTestId(\"ag-pivot-mode-select\");\n },\n columnPanelSelectHeaderCheckbox() {\n return formatTestId(\"ag-column-panel-select-header-checkbox\");\n },\n columnPanelSelectHeaderFilter() {\n return formatTestId(\"ag-column-panel-select-header-filter\");\n },\n columnSelectListItemGroupClosedIcon(label) {\n return formatTestId(\"ag-column-select-list-item-group-closed-icon\", { label });\n },\n columnSelectListItemCheckbox(label) {\n return formatTestId(\"ag-column-select-list-item-checkbox\", { label });\n },\n columnSelectListItemDragHandle(label) {\n return formatTestId(\"ag-column-select-list-item-drag-handle\", { label });\n },\n columnDropCellDragHandle(source, area, label) {\n return formatTestId(\"ag-column-drop-cell-drag-handle\", { source, area, label });\n },\n columnDropCellCancelButton(source, area, label) {\n return formatTestId(\"ag-column-drop-cell-cancel\", { source, area, label });\n },\n columnDropArea(source, name) {\n return formatTestId(\"ag-column-drop-area\", { source, name });\n },\n /** Filter Tool Panel (New) */\n filterToolPanel() {\n return formatTestId(\"ag-filter-panel\");\n },\n filterToolPanelAddFilterButton() {\n return formatTestId(\"ag-filter-panel-add-filter-button\");\n },\n filterToolPanelFilterTypeSelector(colLabel) {\n return formatTestId(\"ag-filter-panel-filter-type-selector\", { colLabel });\n },\n /** Filter Tool Panel (Old) */\n filterToolPanelSearchInput() {\n return formatTestId(\"ag-filter-toolpanel-search-input\");\n },\n filterToolPanelGroup(title) {\n return formatTestId(\"ag-filter-toolpanel-group\", { title });\n },\n filterToolPanelGroupCollapsedIcon(title) {\n return formatTestId(\"ag-filter-toolpanel-group-collapsed-icon\", { title });\n },\n /** Status Bar */\n statusBarTotalAndFilteredRowCount() {\n return formatTestId(\"ag-status-bar-total-and-filtered-row-count\");\n },\n statusBarTotalRowCount() {\n return formatTestId(\"ag-status-bar-total-row-count\");\n },\n statusBarFilteredRowCount() {\n return formatTestId(\"ag-status-bar-filtered-row-count\");\n },\n statusBarSelectedRowCount() {\n return formatTestId(\"ag-status-bar-selected-row-count\");\n },\n statusBarAggregations() {\n return formatTestId(\"ag-status-bar-aggregations\");\n },\n /** Pagination */\n paginationPanelSizePickerDisplay(value) {\n return formatTestId(\"ag-pagination-page-size-picker-field-display\", { value });\n },\n paginationPanelFirstRowOnPage(value) {\n return formatTestId(\"ag-paging-row-summary-panel-first-row-on-page\", { value });\n },\n paginationPanelLastRowOnPage(value) {\n return formatTestId(\"ag-paging-row-summary-panel-last-row-on-page\", { value });\n },\n paginationPanelRecordCount(value) {\n return formatTestId(\"ag-paging-row-summary-panel-record-count\", { value });\n },\n paginationSummaryPanelButton(label) {\n return formatTestId(\"ag-paging-page-summary-panel-btn\", { label });\n },\n paginationSummaryPanelCurrentPage(value) {\n return formatTestId(\"ag-paging-page-summary-panel-current-page\", { value });\n },\n paginationSummaryPanelTotalPage(value) {\n return formatTestId(\"ag-paging-page-summary-panel-total-page\", { value });\n },\n /** Fill Handle */\n fillHandle() {\n return formatTestId(\"ag-fill-handle\");\n },\n /** Column Chooser */\n columnChooserCloseButton() {\n return formatTestId(\"ag-column-chooser-close-button\");\n },\n columnChooserSearchBarCheckbox() {\n return formatTestId(\"ag-column-chooser-header-checkbox\");\n },\n columnChooserSearchBarFilter() {\n return formatTestId(\"ag-column-chooser-searchbar-filter\");\n },\n columnChooserListItemGroupClosedIcon(label) {\n return formatTestId(\"ag-column-chooser-list-item-group-closed-icon\", { label });\n },\n columnChooserListItemCheckbox(label) {\n return formatTestId(\"ag-column-chooser-list-item-checkbox\", { label });\n },\n columnChooserListItemDragHandle(label) {\n return formatTestId(\"ag-column-chooser-list-item-drag-handle\", { label });\n },\n /** Overlay */\n overlay() {\n return formatTestId(\"ag-overlay\");\n }\n};\nvar wrapAgTestIdFor = (fn) => {\n const locators = {};\n const keys = Object.keys(agTestIdFor);\n for (const k of keys) {\n locators[k] = (...args) => {\n return fn(agTestIdFor[k](...args));\n };\n }\n return locators;\n};\nfunction mapKeys(obj, keys) {\n const result = {};\n for (const k of Object.keys(obj)) {\n if (keys[k] !== null) {\n result[keys[k] ?? k] = obj[k];\n }\n }\n return result;\n}\nfunction applySpecDefaults(obj) {\n return obj.source !== \"floating-filter\" ? { index: 0, ...obj } : obj;\n}\nfunction prepFilterSpec(obj) {\n return mapKeys(applySpecDefaults(obj), { colLabel: \"label\" });\n}\n\n// packages/ag-grid-community/src/testing/testIdService.ts\nvar TEST_ID_ATTR = \"data-testid\";\nfunction setTestId(element, testId) {\n element?.setAttribute(TEST_ID_ATTR, testId);\n}\nfunction setTestIdAttribute(attr) {\n TEST_ID_ATTR = attr;\n}\nvar TestIdService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"testIdSvc\";\n }\n postConstruct() {\n const delayedDebounce = _debounce(this, () => this.setupAllTestIds(), 500);\n const setup = _debounce(\n this,\n () => {\n this.setupAllTestIds();\n delayedDebounce();\n },\n 0\n );\n this.addManagedEventListeners({\n firstDataRendered: setup,\n displayedRowsChanged: setup,\n displayedColumnsChanged: setup,\n displayedColumnsWidthChanged: setup,\n virtualColumnsChanged: setup,\n columnMenuVisibleChanged: setup,\n contextMenuVisibleChanged: setup,\n advancedFilterBuilderVisibleChanged: setup,\n fieldPickerValueSelected: setup,\n modelUpdated: setup,\n sideBarUpdated: setup,\n pinnedHeightChanged: setup,\n gridReady: setup,\n overlayExclusiveChanged: setup,\n rowGroupOpened: setup,\n scrollVisibilityChanged: setup,\n gridSizeChanged: setup,\n filterOpened: setup,\n filterChanged: setup,\n cellSelectionChanged: setup\n });\n }\n setupAllTestIds() {\n const root = _getRootNode(this.beans);\n const gridId = getGridId(this.beans);\n const gridWrapper = root.querySelector(`[grid-id=\"${gridId}\"]`);\n setTestId(gridWrapper, agTestIdFor.grid(gridId));\n root.querySelectorAll(\".ag-header-group-cell\").forEach((groupCell) => {\n setTestId(groupCell, agTestIdFor.headerGroupCell(groupCell.getAttribute(\"col-id\")));\n });\n root.querySelectorAll(\".ag-header-cell\").forEach((cell) => {\n const colId = cell.getAttribute(\"col-id\");\n const isFloatingFilter = cell.classList.contains(\"ag-floating-filter\");\n const headerCellId = isFloatingFilter ? agTestIdFor.floatingFilter(colId) : agTestIdFor.headerCell(colId);\n setTestId(cell, headerCellId);\n setTestId(cell.querySelector(\".ag-header-cell-filter-button\"), agTestIdFor.headerFilterButton(colId));\n setTestId(cell.querySelector(\".ag-header-cell-menu-button\"), agTestIdFor.headerCellMenuButton(colId));\n setTestId(cell.querySelector(\".ag-header-cell-resize\"), agTestIdFor.headerResizeHandle(colId));\n setTestId(cell.querySelector(\".ag-checkbox input[type=checkbox]\"), agTestIdFor.headerCheckbox(colId));\n setTestId(cell.querySelector(\".ag-floating-filter-button button\"), agTestIdFor.floatingFilterButton(colId));\n this.setupFilterInstance(cell.querySelector(\".ag-floating-filter-body\"), {\n source: \"floating-filter\",\n colId\n });\n });\n const filterMenu = root.querySelector(\".ag-filter-menu\");\n this.setupFilterInstance(filterMenu, { source: \"column-filter\" });\n setTestId(root.querySelector(\".ag-advanced-filter input[type=text]\"), agTestIdFor.advancedFilterInput());\n root.querySelectorAll(\".ag-advanced-filter-buttons button\").forEach((button) => {\n setTestId(button, agTestIdFor.advancedFilterButton(button.textContent));\n });\n setTestId(\n root.querySelector(\"button.ag-advanced-filter-builder-button\"),\n agTestIdFor.advancedFilterBuilderButton()\n );\n root.querySelectorAll('.ag-panel[aria-label=\"Advanced Filter\"] .ag-panel-title-bar-button').forEach(\n (button, i) => {\n setTestId(\n button,\n i === 0 ? agTestIdFor.advancedFilterPanelMaximiseButton() : agTestIdFor.advancedFilterPanelCloseButton()\n );\n }\n );\n root.querySelectorAll('.ag-panel[aria-lable=\"Advanced Filter\"] .ag-advanced-filter-builder-pill').forEach(\n (pill) => {\n setTestId(\n pill,\n agTestIdFor.advancedFilterPill(pill.querySelector(\".ag-picker-field-display\")?.textContent)\n );\n }\n );\n setTestId(\n root.querySelector('.ag-panel[aria-label=\"Advanced Filter\"] .ag-advanced-filter-builder-item-button'),\n agTestIdFor.advancedFilterBuilderAddItemButton()\n );\n root.querySelectorAll(\".ag-row\").forEach((row) => {\n const rowId = row.getAttribute(\"row-id\");\n setTestId(row, agTestIdFor.rowNode(rowId));\n row.querySelectorAll(\".ag-cell\").forEach((cell) => {\n const colId = cell.getAttribute(\"col-id\");\n setTestId(cell, agTestIdFor.cell(rowId, colId));\n setTestId(\n cell.querySelector(\".ag-selection-checkbox input[type=checkbox]\"),\n agTestIdFor.checkbox(rowId, colId)\n );\n setTestId(cell.querySelector(\".ag-drag-handle\"), agTestIdFor.dragHandle(rowId, colId));\n setTestId(cell.querySelector(\".ag-group-contracted\"), agTestIdFor.groupContracted(rowId, colId));\n setTestId(cell.querySelector(\".ag-group-expanded\"), agTestIdFor.groupExpanded(rowId, colId));\n });\n });\n root.querySelectorAll(\".ag-menu-list\").forEach((menu) => {\n setTestId(menu, agTestIdFor.menu());\n menu.querySelectorAll(\".ag-menu-option\").forEach((option) => {\n setTestId(option, agTestIdFor.menuOption(option.querySelector(\".ag-menu-option-text\")?.textContent));\n });\n });\n root.querySelectorAll(\".ag-side-bar\").forEach((sideBar) => {\n setTestId(sideBar, agTestIdFor.sideBar());\n sideBar.querySelectorAll(\".ag-side-button button\").forEach((button) => {\n setTestId(\n button,\n agTestIdFor.sideBarButton(button.querySelector(\".ag-side-button-label\")?.textContent)\n );\n });\n sideBar.querySelectorAll(\".ag-column-panel\").forEach((panel) => {\n setTestId(panel, agTestIdFor.columnToolPanel());\n setTestId(\n panel.querySelector(\".ag-pivot-mode-select input[type=checkbox]\"),\n agTestIdFor.pivotModeSelect()\n );\n setTestId(\n panel.querySelector(\".ag-column-select-header-checkbox input[type=checkbox]\"),\n agTestIdFor.columnPanelSelectHeaderCheckbox()\n );\n setTestId(\n panel.querySelector(\".ag-column-select-header-filter-wrapper input[type=text]\"),\n agTestIdFor.columnPanelSelectHeaderFilter()\n );\n panel.querySelectorAll(\".ag-column-select-list\").forEach((list) => {\n list.querySelectorAll(\".ag-column-select-virtual-list-item\").forEach((item) => {\n const label = item.getAttribute(\"aria-label\");\n setTestId(\n item.querySelector(\".ag-column-group-closed-icon\"),\n agTestIdFor.columnSelectListItemGroupClosedIcon(label)\n );\n setTestId(\n item.querySelector(\".ag-column-select-checkbox input[type=checkbox]\"),\n agTestIdFor.columnSelectListItemCheckbox(label)\n );\n setTestId(\n item.querySelector(\".ag-drag-handle\"),\n agTestIdFor.columnSelectListItemDragHandle(label)\n );\n });\n });\n this.setupColumnDropArea(panel, \"toolbar\");\n });\n sideBar.querySelectorAll(\".ag-filter-panel\").forEach((panel) => {\n setTestId(panel, agTestIdFor.filterToolPanel());\n setTestId(\n panel.querySelector(\"button.ag-filter-add-button\"),\n agTestIdFor.filterToolPanelAddFilterButton()\n );\n panel.querySelectorAll(\".ag-filter-card\").forEach((filterCard) => {\n const colLabel = filterCard.querySelector(\".ag-filter-card-title\")?.textContent;\n const typeSelector = filterCard.querySelector(\".ag-filter-type-select\");\n setTestId(typeSelector, agTestIdFor.filterToolPanelFilterTypeSelector(colLabel));\n filterCard.querySelectorAll(\".ag-filter\").forEach(\n (filter) => this.setupFilterInstance(filter, { source: \"filter-toolpanel\", colLabel })\n );\n });\n });\n sideBar.querySelectorAll(\".ag-filter-toolpanel\").forEach((panel) => {\n setTestId(\n panel.querySelector(\".ag-filter-toolpanel-search-input input[type=text]\"),\n agTestIdFor.filterToolPanelSearchInput()\n );\n panel.querySelectorAll(\".ag-filter-toolpanel-group\").forEach((group) => {\n const title = group.querySelector(\".ag-filter-toolpanel-group-title\")?.textContent;\n setTestId(group, agTestIdFor.filterToolPanelGroup(title));\n setTestId(\n group.querySelector(\".ag-filter-toolpanel-group-title-bar-icon .ag-icon-tree-closed\"),\n agTestIdFor.filterToolPanelGroupCollapsedIcon(title)\n );\n const filterRoot = group.querySelector(\".ag-filter-toolpanel-instance-filter\");\n if (filterRoot) {\n this.setupFilterInstance(filterRoot, { source: \"filter-toolpanel\", colLabel: title });\n }\n });\n });\n });\n setTestId(\n root.querySelector(\".ag-status-bar .ag-status-panel-total-and-filtered-row-count\"),\n agTestIdFor.statusBarTotalAndFilteredRowCount()\n );\n setTestId(\n root.querySelector(\".ag-status-bar .ag-status-panel-total-row-count\"),\n agTestIdFor.statusBarTotalRowCount()\n );\n setTestId(\n root.querySelector(\".ag-status-bar .ag-status-panel-filtered-row-count\"),\n agTestIdFor.statusBarFilteredRowCount()\n );\n setTestId(\n root.querySelector(\".ag-status-bar .ag-status-panel-selected-row-count\"),\n agTestIdFor.statusBarSelectedRowCount()\n );\n setTestId(\n root.querySelector(\".ag-status-bar .ag-status-panel-filtered-row-count\"),\n agTestIdFor.statusBarAggregations()\n );\n root.querySelectorAll(\".ag-paging-panel\").forEach((pagingPanel) => {\n setTestId(\n pagingPanel.querySelector(\".ag-paging-page-size .ag-picker-field-display\"),\n agTestIdFor.paginationPanelSizePickerDisplay(\n pagingPanel.querySelector(\".ag-paging-page-size .ag-picker-field-display\")?.textContent\n )\n );\n pagingPanel.querySelectorAll(\".ag-paging-row-summary-panel-number\").forEach((panelNumber) => {\n const dataRef = panelNumber.getAttribute(\"data-ref\");\n switch (dataRef) {\n case \"lbFirstRowOnPage\":\n setTestId(panelNumber, agTestIdFor.paginationPanelFirstRowOnPage(panelNumber.textContent));\n break;\n case \"lbLastRowOnPage\":\n setTestId(panelNumber, agTestIdFor.paginationPanelLastRowOnPage(panelNumber.textContent));\n break;\n case \"lbRecordCount\":\n setTestId(panelNumber, agTestIdFor.paginationPanelRecordCount(panelNumber.textContent));\n break;\n }\n });\n pagingPanel.querySelectorAll(\".ag-paging-page-summary-panel .ag-button\").forEach((pagingButton) => {\n setTestId(\n pagingButton,\n agTestIdFor.paginationSummaryPanelButton(pagingButton.getAttribute(\"aria-label\")?.toLowerCase())\n );\n });\n pagingPanel.querySelectorAll(\".ag-paging-page-summary-panel .ag-paging-number\").forEach((pagingNumber) => {\n const dataRef = pagingNumber.getAttribute(\"data-ref\");\n switch (dataRef) {\n case \"lbCurrent\":\n setTestId(\n pagingNumber,\n agTestIdFor.paginationSummaryPanelCurrentPage(pagingNumber.textContent)\n );\n break;\n case \"lbTotal\":\n setTestId(pagingNumber, agTestIdFor.paginationSummaryPanelTotalPage(pagingNumber.textContent));\n break;\n }\n });\n });\n setTestId(root.querySelector(\".ag-fill-handle\"), agTestIdFor.fillHandle());\n root.querySelectorAll('.ag-panel[aria-label=\"Choose Columns\"]').forEach((panel) => {\n setTestId(panel.querySelector(\".ag-panel-title-bar-button-icon\"), agTestIdFor.columnChooserCloseButton());\n setTestId(\n panel.querySelector('.ag-column-select-header-checkbox input[type=\"checkbox\"]'),\n agTestIdFor.columnChooserSearchBarCheckbox()\n );\n setTestId(\n panel.querySelector('.ag-column-select-header-filter-wrapper input[type=\"text\"]'),\n agTestIdFor.columnChooserSearchBarFilter()\n );\n panel.querySelectorAll(\".ag-column-select-list\").forEach((list) => {\n list.querySelectorAll(\".ag-column-select-virtual-list-item\").forEach((item) => {\n const label = item.getAttribute(\"aria-label\");\n setTestId(\n item.querySelector(\".ag-column-group-closed-icon\"),\n agTestIdFor.columnChooserListItemGroupClosedIcon(label)\n );\n setTestId(\n item.querySelector(\".ag-column-select-checkbox input[type=checkbox]\"),\n agTestIdFor.columnChooserListItemCheckbox(label)\n );\n setTestId(\n item.querySelector(\".ag-drag-handle\"),\n agTestIdFor.columnChooserListItemDragHandle(label)\n );\n });\n });\n });\n setTestId(root.querySelector(\".ag-overlay-wrapper\"), agTestIdFor.overlay());\n const rowGroupPanelWrapper = root.querySelector(\".ag-column-drop-wrapper\");\n if (rowGroupPanelWrapper) {\n this.setupColumnDropArea(rowGroupPanelWrapper, \"panel\");\n }\n }\n setupFilterInstance(filterRoot, spec) {\n if (!filterRoot) {\n return;\n }\n filterRoot.querySelectorAll(\".ag-filter-select .ag-picker-field-display\").forEach((fieldDisplay) => {\n setTestId(fieldDisplay, agTestIdFor.filterInstancePickerDisplay(spec));\n });\n const filterClass = spec.source === \"floating-filter\" ? \".ag-floating-filter-body\" : \".ag-filter-body\";\n filterRoot.querySelectorAll(`${filterClass} .ag-input-field:not(.ag-hidden) input[type=\"number\"]`).forEach((numberInput, i, array) => {\n const setIndex = array.length > 1;\n const filterSpec = setIndex ? { ...spec, index: i } : spec;\n setTestId(numberInput, agTestIdFor.numberFilterInstanceInput(filterSpec));\n });\n filterRoot.querySelectorAll(`${filterClass} .ag-input-field:not(.ag-hidden) input[type=\"text\"]`).forEach((textInput, i, array) => {\n const setIndex = array.length > 1;\n const filterSpec = setIndex ? { ...spec, index: i } : spec;\n setTestId(textInput, agTestIdFor.textFilterInstanceInput(filterSpec));\n });\n filterRoot.querySelectorAll(`${filterClass} .ag-input-field:not(.ag-hidden) input[type=\"date\"]`).forEach((dateInput, i, array) => {\n const setIndex = array.length > 1;\n const filterSpec = setIndex ? { ...spec, index: i } : spec;\n setTestId(dateInput, agTestIdFor.dateFilterInstanceInput(filterSpec));\n });\n const setMiniFilterInput = filterRoot.querySelector('.ag-mini-filter input[type=\"text\"]');\n setTestId(setMiniFilterInput, agTestIdFor.setFilterInstanceMiniFilterInput(spec));\n filterRoot.querySelectorAll(\".ag-set-filter-list .ag-set-filter-item\").forEach((item) => {\n const label = item.querySelector(\".ag-checkbox-label\")?.textContent;\n const checkbox = item.querySelector('input[type=\"checkbox\"]');\n setTestId(checkbox, agTestIdFor.setFilterInstanceItem(spec, label));\n });\n filterRoot.querySelectorAll(\".ag-filter-apply-panel button\").forEach((button) => {\n setTestId(button, agTestIdFor.setFilterApplyPanelButton(spec, button.textContent));\n });\n filterRoot.querySelectorAll(\".ag-filter-condition .ag-radio-button\").forEach((radioButton) => {\n const label = radioButton.querySelector(\".ag-radio-button-label\")?.textContent;\n setTestId(\n radioButton.querySelector(\"input[type=radio]\"),\n agTestIdFor.filterConditionRadioButton(spec, label)\n );\n });\n }\n setupColumnDropArea(root, source) {\n root.querySelectorAll(\".ag-column-drop\").forEach((columnDrop) => {\n const dropAreaName = columnDrop.querySelector(\".ag-column-drop-list\")?.getAttribute(\"aria-label\");\n setTestId(columnDrop, agTestIdFor.columnDropArea(source, dropAreaName));\n columnDrop.querySelectorAll(\".ag-column-drop-cell\").forEach((columnDropCell) => {\n const label = columnDropCell.querySelector(\".ag-column-drop-cell-text\")?.textContent;\n setTestId(\n columnDropCell.querySelector(\".ag-drag-handle\"),\n agTestIdFor.columnDropCellDragHandle(source, dropAreaName, label)\n );\n setTestId(\n columnDropCell.querySelector(\".ag-column-drop-cell-button .ag-icon-cancel\"),\n agTestIdFor.columnDropCellCancelButton(source, dropAreaName, label)\n );\n });\n });\n }\n};\n\n// packages/ag-grid-community/src/testing/testingModule.ts\nvar TestingModule = {\n moduleName: \"Testing\",\n version: VERSION,\n beans: [TestIdService]\n};\nfunction setupAgTestIds({ testIdAttribute } = {}) {\n if (testIdAttribute) {\n setTestIdAttribute(testIdAttribute);\n }\n ModuleRegistry.registerModules([TestingModule]);\n}\n\n// packages/ag-grid-community/src/columns/baseColsService.ts\nvar BaseColsService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.dispatchColumnChangedEvent = dispatchColumnChangedEvent;\n this.columns = [];\n this.columnIndexMap = {};\n this.updateIndexMap = () => {\n this.columnIndexMap = {};\n this.columns.forEach((col, index) => this.columnIndexMap[col.getId()] = index);\n };\n }\n wireBeans(beans) {\n this.colModel = beans.colModel;\n this.aggFuncSvc = beans.aggFuncSvc;\n this.visibleCols = beans.visibleCols;\n this.groupHierarchCols = beans.groupHierarchyColSvc;\n }\n sortColumns(compareFn) {\n const { groupHierarchCols } = this;\n this.columns.sort((a, b) => groupHierarchCols?.compareVirtualColumns(a, b) ?? compareFn(a, b));\n this.updateIndexMap();\n }\n setColumns(colKeys, source) {\n this.setColList(colKeys, this.columns, this.eventName, true, true, this.columnProcessors.set, source);\n }\n addColumns(colKeys, source) {\n this.updateColList(colKeys, this.columns, true, true, this.columnProcessors.add, this.eventName, source);\n }\n removeColumns(colKeys, source) {\n this.updateColList(colKeys, this.columns, false, true, this.columnProcessors.remove, this.eventName, source);\n }\n getColumnIndex(colId) {\n return this.columnIndexMap[colId];\n }\n setColList(colKeys = [], masterList, eventName, detectOrderChange, autoGroupsNeedBuilding, columnCallback, source) {\n const gridColumns = this.colModel.getCols();\n if (!gridColumns || gridColumns.length === 0) {\n return;\n }\n const changes = /* @__PURE__ */ new Map();\n masterList.forEach((col, idx) => changes.set(col, idx));\n masterList.length = 0;\n for (const key of colKeys) {\n const column = this.colModel.getColDefCol(key);\n if (column) {\n masterList.push(column);\n }\n }\n masterList.forEach((col, idx) => {\n const oldIndex = changes.get(col);\n if (oldIndex === void 0) {\n changes.set(col, 0);\n return;\n }\n if (detectOrderChange && oldIndex !== idx) {\n return;\n }\n changes.delete(col);\n });\n this.updateIndexMap();\n const primaryCols = this.colModel.getColDefCols();\n for (const column of primaryCols ?? []) {\n const added = masterList.indexOf(column) >= 0;\n columnCallback(column, added, source);\n }\n if (autoGroupsNeedBuilding) {\n this.colModel.refreshCols(false, source);\n }\n this.visibleCols.refresh(source);\n this.dispatchColumnChangedEvent(this.eventSvc, eventName, [...changes.keys()], source);\n }\n updateColList(keys = [], masterList, actionIsAdd, autoGroupsNeedBuilding, columnCallback, eventType, source) {\n if (!keys || keys.length === 0) {\n return;\n }\n let atLeastOne = false;\n const updatedCols = /* @__PURE__ */ new Set();\n for (const key of keys) {\n if (!key) {\n continue;\n }\n const columnToAdd = this.colModel.getColDefCol(key);\n if (!columnToAdd) {\n continue;\n }\n updatedCols.add(columnToAdd);\n if (actionIsAdd) {\n if (masterList.indexOf(columnToAdd) >= 0) {\n continue;\n }\n masterList.push(columnToAdd);\n } else {\n const currentIndex = masterList.indexOf(columnToAdd);\n if (currentIndex < 0) {\n continue;\n }\n for (let i = currentIndex + 1; i < masterList.length; i++) {\n updatedCols.add(masterList[i]);\n }\n _removeFromArray(masterList, columnToAdd);\n }\n columnCallback(columnToAdd, actionIsAdd, source);\n atLeastOne = true;\n }\n if (!atLeastOne) {\n return;\n }\n this.updateIndexMap();\n if (autoGroupsNeedBuilding) {\n this.colModel.refreshCols(false, source);\n }\n this.visibleCols.refresh(source);\n const eventColumns = Array.from(updatedCols);\n this.eventSvc.dispatchEvent({\n type: eventType,\n columns: eventColumns,\n column: eventColumns.length === 1 ? eventColumns[0] : null,\n source\n });\n }\n extractCols(source, oldProvidedCols = []) {\n const previousCols = this.columns;\n const colsWithIndex = [];\n const colsWithValue = [];\n const { setFlagFunc, getIndexFunc, getInitialIndexFunc, getValueFunc, getInitialValueFunc } = this.columnExtractors;\n const primaryCols = this.colModel.getColDefCols();\n for (const col of primaryCols ?? []) {\n const colIsNew = !oldProvidedCols.includes(col);\n const colDef = col.getColDef();\n const value = getValueFunc(colDef);\n const initialValue = getInitialValueFunc(colDef);\n const index = getIndexFunc(colDef);\n const initialIndex = getInitialIndexFunc(colDef);\n let include;\n const valuePresent = value !== void 0;\n const indexPresent = index !== void 0;\n const initialValuePresent = initialValue !== void 0;\n const initialIndexPresent = initialIndex !== void 0;\n if (valuePresent) {\n include = value;\n } else if (indexPresent) {\n if (index === null) {\n include = false;\n } else {\n include = index >= 0;\n }\n } else if (colIsNew) {\n if (initialValuePresent) {\n include = initialValue;\n } else if (initialIndexPresent) {\n include = initialIndex != null && initialIndex >= 0;\n } else {\n include = false;\n }\n } else {\n include = previousCols.indexOf(col) >= 0;\n }\n if (include) {\n const useIndex = colIsNew ? index != null || initialIndex != null : index != null;\n if (useIndex) {\n colsWithIndex.push(col);\n } else {\n colsWithValue.push(col);\n }\n }\n }\n const getIndexForCol = (col) => {\n const colDef = col.getColDef();\n return getIndexFunc(colDef) ?? getInitialIndexFunc(colDef);\n };\n colsWithIndex.sort((colA, colB) => getIndexForCol(colA) - getIndexForCol(colB));\n const res = [];\n const groupHierarchCols = this.groupHierarchCols;\n const addCol = (col) => {\n if (groupHierarchCols) {\n groupHierarchCols.expandColumnInto(res, col);\n } else {\n res.push(col);\n }\n };\n colsWithIndex.forEach(addCol);\n for (const col of previousCols) {\n if (colsWithValue.indexOf(col) >= 0) {\n addCol(col);\n }\n }\n for (const col of colsWithValue) {\n if (res.indexOf(col) < 0) {\n addCol(col);\n }\n }\n for (const col of previousCols) {\n if (res.indexOf(col) < 0) {\n setFlagFunc(col, false, source);\n }\n }\n for (const col of res) {\n if (previousCols.indexOf(col) < 0) {\n setFlagFunc(col, true, source);\n }\n }\n this.columns = res;\n this.updateIndexMap();\n return this.columns;\n }\n restoreColumnOrder(columnStateAccumulator, incomingColumnState) {\n const colList = this.columns;\n const primaryCols = this.colModel.getColDefCols();\n if (!colList.length || !primaryCols) {\n return columnStateAccumulator;\n }\n const updatedColIdArray = Object.keys(incomingColumnState);\n const updatedColIds = new Set(updatedColIdArray);\n const newColIds = new Set(updatedColIdArray);\n const allColIds = new Set(\n colList.map((column) => {\n const colId = column.getColId();\n newColIds.delete(colId);\n return colId;\n }).concat(updatedColIdArray)\n );\n const colIdsInOriginalOrder = [];\n const originalOrderMap = {};\n let orderIndex = 0;\n for (let i = 0; i < primaryCols.length; i++) {\n const colId = primaryCols[i].getColId();\n if (allColIds.has(colId)) {\n colIdsInOriginalOrder.push(colId);\n originalOrderMap[colId] = orderIndex++;\n }\n }\n let index = 1e3;\n let hasAddedNewCols = false;\n let lastIndex = 0;\n const enableProp = this.columnOrdering.enableProp;\n const initialEnableProp = this.columnOrdering.initialEnableProp;\n const indexProp = this.columnOrdering.indexProp;\n const initialIndexProp = this.columnOrdering.initialIndexProp;\n const processPrecedingNewCols = (colId) => {\n const originalOrderIndex = originalOrderMap[colId];\n for (let i = lastIndex; i < originalOrderIndex; i++) {\n const newColId = colIdsInOriginalOrder[i];\n if (newColIds.has(newColId)) {\n incomingColumnState[newColId][indexProp] = index++;\n newColIds.delete(newColId);\n }\n }\n lastIndex = originalOrderIndex;\n };\n for (const column of colList) {\n const colId = column.getColId();\n if (updatedColIds.has(colId)) {\n processPrecedingNewCols(colId);\n incomingColumnState[colId][indexProp] = index++;\n } else {\n const colDef = column.getColDef();\n const missingIndex = colDef[indexProp] === null || colDef[indexProp] === void 0 && colDef[initialIndexProp] == null;\n if (missingIndex) {\n if (!hasAddedNewCols) {\n const propEnabled = colDef[enableProp] || colDef[enableProp] === void 0 && colDef[initialEnableProp];\n if (propEnabled) {\n processPrecedingNewCols(colId);\n } else {\n for (const newColId of newColIds) {\n incomingColumnState[newColId][indexProp] = index + originalOrderMap[newColId];\n }\n index += colIdsInOriginalOrder.length;\n hasAddedNewCols = true;\n }\n }\n if (!columnStateAccumulator[colId]) {\n columnStateAccumulator[colId] = { colId };\n }\n columnStateAccumulator[colId][indexProp] = index++;\n }\n }\n }\n return columnStateAccumulator;\n }\n};\n\n// packages/ag-grid-community/src/components/framework/frameworkComponentWrapper.ts\nvar BaseComponentWrapper = class {\n wrap(OriginalConstructor, mandatoryMethods, optionalMethods, componentType) {\n const wrapper = this.createWrapper(OriginalConstructor, componentType);\n for (const methodName of mandatoryMethods ?? []) {\n this.createMethod(wrapper, methodName, true);\n }\n for (const methodName of optionalMethods ?? []) {\n this.createMethod(wrapper, methodName, false);\n }\n return wrapper;\n }\n createMethod(wrapper, methodName, mandatory) {\n wrapper.addMethod(methodName, this.createMethodProxy(wrapper, methodName, mandatory));\n }\n createMethodProxy(wrapper, methodName, mandatory) {\n return function() {\n if (wrapper.hasMethod(methodName)) {\n return wrapper.callMethod(methodName, arguments);\n }\n if (mandatory) {\n _warn(49, { methodName });\n }\n return null;\n };\n }\n};\n\n// packages/ag-grid-community/src/widgets/tabGuard.ts\nvar TabGuardCtrl = class extends AgTabGuardCtrl {\n constructor(params) {\n super(params, STOP_PROPAGATION_CALLBACKS);\n }\n};\nvar TabGuardFeature = class extends AgTabGuardFeature {\n constructor(comp) {\n super(comp, STOP_PROPAGATION_CALLBACKS);\n }\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agContentEditableField.css\nvar agContentEditableField_default = \".ag-content-editable-field{align-items:center;display:flex}.ag-content-editable-field-input{background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);cursor:text;display:block;flex:1 1 auto;line-height:normal;outline:none;overflow:auto;overflow-y:hidden;padding:0 var(--ag-input-padding-start);white-space:nowrap;-ms-overflow-style:none!important;scrollbar-width:none!important}.ag-content-editable-field-input::-webkit-scrollbar{display:none!important}.ag-wrapper.ag-content-editable-field-input{line-height:var(--ag-internal-content-line-height)}.ag-content-editable-field-input:where(:focus,:focus-within){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color)}:where(.ag-content-editable-field.ag-disabled .ag-content-editable-field-input){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}.ag-content-editable-field-input:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}\";\n\n// packages/ag-grid-community/src/agStack/widgets/agContentEditableField.ts\nvar AgContentEditableFieldElement = {\n tag: \"div\",\n cls: \"ag-content-editable-field\",\n role: \"presentation\",\n children: [\n { tag: \"div\", ref: \"eLabel\" },\n {\n tag: \"div\",\n ref: \"eWrapper\",\n cls: \"ag-wrapper ag-content-editable-field-input\",\n attrs: {\n contenteditable: \"plaintext-only\"\n }\n }\n ]\n};\nvar AgContentEditableField = class extends AgAbstractField {\n constructor(config) {\n super(config, AgContentEditableFieldElement, [], config?.className);\n this.eLabel = RefPlaceholder;\n this.eWrapper = RefPlaceholder;\n this.renderValueToElement = config?.renderValueToElement ?? true;\n this.registerCSS(agContentEditableField_default);\n }\n postConstruct() {\n super.postConstruct();\n this.setupEditable();\n this.setupAria();\n this.addManagedElementListeners(this.eWrapper, {\n input: () => this.syncValueFromDom(),\n blur: () => this.syncValueFromDom(true)\n });\n if (this.renderValueToElement && this.value != null) {\n this.refreshDisplayedValue(this.value);\n }\n }\n setupAria() {\n const ariaEl = this.getAriaElement();\n _setAriaRole(ariaEl, this.config.ariaRole ?? \"textbox\");\n ariaEl.setAttribute(\"tabindex\", this.gos.get(\"tabIndex\").toString());\n }\n setupEditable() {\n const editable = this.config.contentEditable ?? \"plaintext-only\";\n if (editable === false) {\n this.eWrapper.removeAttribute(\"contenteditable\");\n } else if (editable === true) {\n this.eWrapper.setAttribute(\"contenteditable\", \"true\");\n } else {\n this.eWrapper.setAttribute(\"contenteditable\", editable);\n }\n }\n setValue(value, silent) {\n const res = super.setValue(value, silent);\n if (this.renderValueToElement && !silent) {\n this.refreshDisplayedValue(value);\n }\n return res;\n }\n setRenderValueToElement(render) {\n this.renderValueToElement = render;\n }\n setDisplayedValue(value) {\n this.refreshDisplayedValue(value ?? \"\");\n }\n getContentElement() {\n return this.eWrapper;\n }\n refreshDisplayedValue(value) {\n this.eWrapper.textContent = value ?? \"\";\n }\n syncValueFromDom(silent) {\n super.setValue(this.eWrapper.textContent ?? \"\", silent);\n }\n getFocusableElement() {\n return this.eWrapper;\n }\n};\nvar AgContentEditableFieldSelector = {\n selector: \"AG-CONTENT-EDITABLE-FIELD\",\n component: AgContentEditableField\n};\n\n// packages/ag-grid-community/src/agStack/widgets/agToggleButton.css\nvar agToggleButton_default = '.ag-toggle-button{flex:none;min-width:unset;width:unset}.ag-toggle-button-input-wrapper{background-color:var(--ag-toggle-button-off-background-color);border-radius:calc(var(--ag-toggle-button-height)*.5);flex:none;height:var(--ag-toggle-button-height);max-width:var(--ag-toggle-button-width);min-width:var(--ag-toggle-button-width);position:relative;transition:background-color .1s;:where(.ag-toggle-button-input){-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-toggle-button-height);margin:0;max-width:var(--ag-toggle-button-width);min-width:var(--ag-toggle-button-width);opacity:0}&.ag-checked{background-color:var(--ag-toggle-button-on-background-color)}&.ag-disabled{opacity:.5}}.ag-toggle-button-input-wrapper:before{background-color:var(--ag-toggle-button-switch-background-color);border-radius:100%;content:\"\";display:block;height:calc(var(--ag-toggle-button-height) - var(--ag-toggle-button-switch-inset)*2);left:var(--ag-toggle-button-switch-inset);pointer-events:none;position:absolute;top:var(--ag-toggle-button-switch-inset);transition:left .1s;width:calc(var(--ag-toggle-button-height) - var(--ag-toggle-button-switch-inset)*2)}.ag-toggle-button-input-wrapper.ag-checked:before{left:calc(100% - var(--ag-toggle-button-height) + var(--ag-toggle-button-switch-inset))}.ag-toggle-button-input-wrapper:focus-within{box-shadow:var(--ag-focus-shadow)}';\n\n// packages/ag-grid-community/src/agStack/widgets/agToggleButton.ts\nvar AgToggleButton = class extends AgCheckbox {\n constructor(config) {\n super(config, \"ag-toggle-button\");\n this.registerCSS(agToggleButton_default);\n }\n setValue(value, silent) {\n super.setValue(value, silent);\n this.toggleCss(\"ag-selected\", this.getValue());\n return this;\n }\n};\nvar AgToggleButtonSelector = {\n selector: \"AG-TOGGLE-BUTTON\",\n component: AgToggleButton\n};\nexport {\n ALWAYS_SYNC_GLOBAL_EVENTS,\n AgAbstractCellEditor,\n AgAbstractInputField,\n AgAbstractLabel,\n AgCheckbox,\n AgCheckboxSelector,\n AgColumn,\n AgColumnGroup,\n AgContentEditableField,\n AgContentEditableFieldSelector,\n AgFilterButtonSelector,\n AgInputDateField,\n AgInputNumberField,\n AgInputNumberFieldSelector,\n AgInputTextArea,\n AgInputTextField,\n AgInputTextFieldSelector,\n AgPickerField,\n AgPopupComponent,\n AgPromise,\n AgProvidedColumnGroup,\n AgRadioButton,\n AgRadioButtonSelector,\n AgSelect,\n AgSelectSelector,\n AgToggleButton,\n AgToggleButtonSelector,\n AlignedGridsModule,\n AllCommunityModule,\n AutoScrollService,\n BaseColsService,\n BaseComponentWrapper,\n BaseCreator,\n BaseGridSerializingSession,\n BaseSelectionService,\n BeanStub,\n BigIntFilterModule,\n CellApiModule,\n CellRangeType,\n CellSpanModule,\n CellStyleModule,\n CheckboxEditorModule,\n ClientSideRowModelApiModule,\n ClientSideRowModelModule,\n ColumnApiModule,\n ColumnAutoSizeModule,\n ColumnHoverModule,\n ColumnKeyCreator,\n Component,\n CssClassManager,\n CsvExportModule,\n CustomEditorModule,\n CustomFilterModule,\n DateEditorModule,\n DateFilterModule,\n Direction,\n DragAndDropModule,\n DragSourceType,\n EventApiModule,\n ExternalFilterModule,\n FakeHScrollComp,\n FakeVScrollComp,\n FilterButtonComp,\n FilterComp,\n FilterWrapperComp,\n GROUP_AUTO_COLUMN_ID,\n GROUP_HIERARCHY_COLUMN_ID_PREFIX,\n GridBodyCtrl,\n GridCoreCreator,\n GridCtrl,\n GridHeaderCtrl,\n GridStateModule,\n GroupInstanceIdCreator,\n HeaderRowContainerCtrl,\n HighlightChangesModule,\n InfiniteRowModelModule,\n KeyCode,\n LargeTextEditorModule,\n LocalEventService,\n LocaleModule,\n LocaleService,\n ManagedFocusFeature,\n ModuleRegistry,\n NumberEditorModule,\n NumberFilterModule,\n PaginationModule,\n PinnedRowModel,\n PinnedRowModule,\n PositionableFeature,\n ProvidedFilter,\n QuickFilterModule,\n ROW_NUMBERS_COLUMN_ID,\n RefPlaceholder,\n RenderApiModule,\n RowApiModule,\n RowAutoHeightModule,\n RowContainerCtrl,\n RowDragModule,\n RowNode,\n RowSelectionModule,\n RowStyleModule,\n SELECTION_COLUMN_ID,\n STRUCTURED_SCHEMA_FEATURES,\n ScrollApiModule,\n SelectEditorModule,\n ServerSideTransactionResultStatus,\n TabGuardClassNames,\n TabGuardComp,\n TabGuardCtrl,\n TabGuardFeature,\n TextEditorModule,\n TextFilterModule,\n TooltipModule,\n TouchListener,\n UndoRedoEditModule,\n ValidationModule,\n ValueCacheModule,\n VanillaFrameworkOverrides,\n AgBeanStub as _AgBeanStub,\n AgComponentStub as _AgComponentStub,\n AgContext as _AgContext,\n AgPositionableFeature as _AgPositionableFeature,\n AgTabGuardComp as _AgTabGuardComp,\n AgTabGuardFeature as _AgTabGuardFeature,\n AgTooltipComponent as _AgTooltipComponent,\n AgTooltipFeature as _AgTooltipFeature,\n _BOOLEAN_MIXED_GRID_OPTIONS,\n BaseDragAndDropService as _BaseDragAndDropService,\n BaseDragService as _BaseDragService,\n BaseEnvironment as _BaseEnvironment,\n BaseEventService as _BaseEventService,\n BasePopupService as _BasePopupService,\n BaseRegistry as _BaseRegistry,\n BaseTooltipStateManager as _BaseTooltipStateManager,\n ChangedRowNodes as _ChangedRowNodes,\n ColumnFilterModule as _ColumnFilterModule,\n ColumnGroupModule as _ColumnGroupModule,\n ColumnMoveModule as _ColumnMoveModule,\n CsrmSsrmSharedApiModule as _CsrmSsrmSharedApiModule,\n DragModule as _DragModule,\n EditCoreModule as _EditCoreModule,\n EmptyBean as _EmptyBean,\n FOCUS_MANAGED_CLASS as _FOCUS_MANAGED_CLASS,\n FilterCoreModule as _FilterCoreModule,\n FilterValueModule as _FilterValueModule,\n _GET_ALL_EVENTS,\n _GET_ALL_GRID_OPTIONS,\n _GET_SHALLOW_GRID_OPTIONS,\n HeaderComp as _HeaderComp,\n HorizontalResizeModule as _HorizontalResizeModule,\n KeyboardNavigationModule as _KeyboardNavigationModule,\n MONTHS as _MONTHS,\n _PUBLIC_EVENTS,\n _PUBLIC_EVENT_HANDLERS_MAP,\n PopupModule as _PopupModule,\n ROW_ID_PREFIX_BOTTOM_PINNED as _ROW_ID_PREFIX_BOTTOM_PINNED,\n ROW_ID_PREFIX_ROW_GROUP as _ROW_ID_PREFIX_ROW_GROUP,\n ROW_ID_PREFIX_TOP_PINNED as _ROW_ID_PREFIX_TOP_PINNED,\n RowModelSharedApiModule as _RowModelSharedApiModule,\n STOP_PROPAGATION_CALLBACKS as _STOP_PROPAGATION_CALLBACKS,\n SharedDragAndDropModule as _SharedDragAndDropModule,\n SharedExportModule as _SharedExportModule,\n SharedMenuModule as _SharedMenuModule,\n SharedRowSelectionModule as _SharedRowSelectionModule,\n SortModule as _SortModule,\n SsrmInfiniteSharedApiModule as _SsrmInfiniteSharedApiModule,\n _addAdditionalCss,\n _addColumnDefaultAndTypes,\n _addFocusableContainerListener,\n _addGridCommonParams,\n _addOrRemoveAttribute,\n _anchorElementToMouseMoveEvent,\n _applyColumnState,\n _areCellsEqual,\n _areColIdsEqual,\n _areEqual,\n _areSortDefsEqual,\n _asThemeImpl,\n _attemptToRestoreCellFocus,\n _batchCall,\n _camelCaseToHumanText,\n _canSkipShowingRowGroup,\n _clearElement,\n _columnsMatch,\n _combineAttributesAndGridOptions,\n _consoleError,\n _convertColumnEventSourceType,\n coreDefaults as _coreThemeDefaults,\n _createAgElement,\n _createCellId,\n _createColumnTree,\n _createColumnTreeWithIds,\n _createElement,\n _createGlobalRowEvent,\n _createIcon,\n _createIconNoSpan,\n _createRowNodeSibling,\n createSharedTheme as _createSharedTheme,\n _csrmFirstLeaf,\n _csrmReorderAllLeafs,\n _debounce,\n _defaultComparator,\n _destroyColumnTree,\n _doOnce,\n _downloadFile,\n _errMsg,\n _error,\n _escapeString,\n _exists,\n _findEnterpriseCoreModule,\n _findFocusableElements,\n _findNextFocusableElement,\n _findTabbableParent,\n _flatten,\n _focusGridInnerElement,\n _focusInto,\n _focusNextGridCoreContainer,\n _forEachChangedGroupDepthFirst,\n _formatNumberCommas,\n _fuzzySuggestions,\n _getAbsoluteHeight,\n _getAbsoluteRowIndex,\n _getAbsoluteWidth,\n _getActiveDomElement,\n _getAriaPosInSet,\n _getCallbackForEvent,\n _getCellByPosition,\n _getCellCtrlForEventTarget,\n _getCellPositionForEvent,\n _getCellRendererDetails,\n _getCheckboxLocation,\n _getCheckboxes,\n _getClientSideRowModel,\n _getColumnState,\n _getColumnStateFromColDef,\n _getColumnsFromTree,\n _getDateParts,\n _getDefaultFloatingFilterType,\n _getDefaultSimpleFilter,\n _getDisplaySortForColumn,\n _getDocument,\n _getEditorRendererDetails,\n _getEnableColumnSelection,\n _getFillHandle,\n _getFilterDetails,\n _getFilterModel,\n _getFilterParamsForDataType,\n _getFirstRow,\n _getFloatingFilterCompDetails,\n getFloatingFiltersHeight as _getFloatingFiltersHeight,\n _getGlobalGridOption,\n _getGrandTotalRow,\n _getGridOption,\n _getGridRegisteredModules,\n _getGroupAggFiltering,\n _getGroupSelection,\n _getGroupSelectsDescendants,\n _getGroupTotalRowCallback,\n _getHeaderCheckbox,\n _getHeaderClassesFromColDef,\n getHeaderRowCount as _getHeaderRowCount,\n _getInnerCellRendererDetails,\n _getInnerHeight,\n _getInnerWidth,\n _getIsRowSelectable,\n _getLastRow,\n _getLocaleTextFromFunc,\n _getLocaleTextFromMap,\n _getLocaleTextFunc,\n _getMaxConcurrentDatasourceRequests,\n _getNormalisedMousePosition,\n _getPageBody,\n getParamType as _getParamType,\n _getRootNode,\n _getRowAbove,\n _getRowBelow,\n _getRowContainerClass,\n _getRowContainerOptions,\n _getRowCtrlForEventTarget,\n _getRowHeightAsNumber,\n _getRowHeightForNode,\n _getRowIdCallback,\n _getRowNode,\n _getRowSelectionMode,\n _getRowSpanContainerClass,\n _getRowViewportClass,\n _getServerSideRowModel,\n _getShouldDisplayTooltip,\n _getSortDefFromColDef,\n _getSortDefFromInput,\n _getSuppressMultiRanges,\n _getToolPanelClassesFromColDef,\n _getViewportRowModel,\n _getWindow,\n _interpretAsRightClick,\n _isAnimateRows,\n _isBrowserFirefox,\n _isBrowserSafari,\n _isCellSelectionEnabled,\n _isClientSideRowModel,\n _isColumnMenuAnchoringEnabled,\n _isColumnsSortingCoupledToGroup,\n _isComponent,\n _isDomLayout,\n _isElementInEventPath,\n _isElementOverflowingCallback,\n _isEventFromPrintableCharacter,\n _isExpressionString,\n _isFocusableFormField,\n _isFullWidthGroupRow,\n _isGetRowHeightFunction,\n _isGroupHideColumnsUntilExpanded,\n _isGroupMultiAutoColumn,\n _isGroupRowsSticky,\n _isGroupUseEntireRow,\n _isIOSUserAgent,\n _isKeyboardMode,\n _isLegacyMenuEnabled,\n _isMultiRowSelection,\n _isNodeOrElement,\n _isNothingFocused,\n _isPromise,\n _isRowBefore,\n _isRowNumbers,\n _isRowSelection,\n _isSameRow,\n _isServerSideRowModel,\n _isSetFilterByDefault,\n _isShowTooltipWhenTruncated,\n _isSortDirectionValid,\n _isSortTypeValid,\n _isStopPropagationForAgGrid,\n _isUseApplyButton,\n _isUsingNewCellSelectionAPI,\n _isUsingNewRowSelectionAPI,\n _isVisible,\n _jsonEquals,\n _last,\n _loadTemplate,\n _logPreInitWarn,\n _makeNull,\n _mergeDeep,\n _missing,\n _normalizeSortDirection,\n _normalizeSortType,\n _observeResize,\n paramToVariableName as _paramToVariableName,\n paramValueToCss as _paramValueToCss,\n _parseBigIntOrNull,\n _parseDateTimeFromString,\n _placeCaretAtEnd,\n _preInitErrMsg,\n _prevOrNextDisplayedRow,\n _processOnChange,\n _radioCssClass,\n _refreshFilterUi,\n _refreshHandlerAndUi,\n _registerModule,\n _removeAllFromArray,\n _removeAriaExpanded,\n _removeAriaSort,\n _removeFromArray,\n _removeFromParent,\n _requestAnimationFrame,\n _resetColumnState,\n _selectAllCells,\n _serialiseDate,\n _setAriaActiveDescendant,\n _setAriaChecked,\n _setAriaColCount,\n _setAriaColIndex,\n _setAriaColSpan,\n _setAriaControls,\n _setAriaControlsAndLabel,\n _setAriaDescribedBy,\n _setAriaDisabled,\n _setAriaExpanded,\n _setAriaHasPopup,\n _setAriaHidden,\n _setAriaInvalid,\n _setAriaLabel,\n _setAriaLabelledBy,\n _setAriaLevel,\n _setAriaOrientation,\n _setAriaPosInSet,\n _setAriaRole,\n _setAriaRowCount,\n _setAriaRowIndex,\n _setAriaSelected,\n _setAriaSetSize,\n _setAriaSort,\n _setColMenuVisible,\n _setDisabled,\n _setDisplayed,\n _setFixedWidth,\n _setScrollLeft,\n _setUmd,\n _setVisible,\n sharedDefaults as _sharedThemeDefaults,\n _shouldUpdateColVisibilityAfterGroup,\n _skipFocusableContainerListenerForAgGrid,\n _stopPropagationForAgGrid,\n _suppressCellMouseEvent,\n themeAlpineParams as _themeAlpineParams,\n themeBalhamParams as _themeBalhamParams,\n themeMaterialParams as _themeMaterialParams,\n themeQuartzParams as _themeQuartzParams,\n _toString,\n _toStringOrNull,\n _translate,\n translateForFilter as _translateForFilter,\n _unwrapUserComp,\n _updateColsMap,\n _updateColumnState,\n _updateFilterModel,\n _waitUntil,\n _warn,\n _warnOnce,\n agTestIdFor,\n buttonStyleAlpine,\n buttonStyleBalham,\n buttonStyleBase,\n buttonStyleQuartz,\n checkboxStyleDefault,\n colorSchemeDark,\n colorSchemeDarkBlue,\n colorSchemeDarkWarm,\n colorSchemeLight,\n colorSchemeLightCold,\n colorSchemeLightWarm,\n colorSchemeVariable,\n columnDropStyleBordered,\n columnDropStylePlain,\n convertColumnGroupState,\n convertColumnState,\n createGrid,\n createPart,\n createTheme,\n getGridApi,\n getGridElement,\n iconOverrides,\n iconSetAlpine,\n iconSetBalham,\n iconSetMaterial,\n iconSetQuartz,\n iconSetQuartzBold,\n iconSetQuartzLight,\n iconSetQuartzRegular,\n inputStyleBase,\n inputStyleBordered,\n inputStyleUnderlined,\n isColumn,\n isColumnGroup,\n isColumnGroupAutoCol,\n isColumnSelectionCol,\n isCombinedFilterModel,\n isProvidedColumnGroup,\n isRowNumberCol,\n isSpecialCol,\n onRowHeightChanged,\n provideGlobalGridOptions,\n resetRowHeights,\n setupAgTestIds,\n styleMaterial,\n tabStyleAlpine,\n tabStyleBase,\n tabStyleMaterial,\n tabStyleQuartz,\n tabStyleRolodex,\n themeAlpine,\n themeBalham,\n themeMaterial,\n themeQuartz,\n wrapAgTestIdFor\n};\n","// packages/ag-grid-react/src/agGridReact.tsx\nimport React21, { Component } from \"react\";\n\n// packages/ag-grid-react/src/reactUi/agGridReactUi.tsx\nimport React20, {\n forwardRef as forwardRef3,\n useCallback as useCallback15,\n useContext as useContext16,\n useEffect as useEffect11,\n useImperativeHandle as useImperativeHandle3,\n useMemo as useMemo13,\n useRef as useRef17,\n useState as useState16\n} from \"react\";\nimport {\n BaseComponentWrapper,\n GridCoreCreator,\n VanillaFrameworkOverrides,\n _combineAttributesAndGridOptions,\n _findEnterpriseCoreModule,\n _getGridOption,\n _getGridRegisteredModules,\n _isClientSideRowModel,\n _isServerSideRowModel,\n _observeResize as _observeResize2,\n _processOnChange,\n _warn as _warn2\n} from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/reactUi/cellRenderer/groupCellRenderer.tsx\nimport React3, {\n forwardRef,\n useCallback,\n useContext,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState\n} from \"react\";\nimport { _toString } from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/reactUi/beansContext.tsx\nimport React from \"react\";\nvar BeansContext = React.createContext({});\nvar RenderModeContext = React.createContext(\"default\");\n\n// packages/ag-grid-react/src/reactUi/jsComp.tsx\nvar showJsComp = (compDetails, context, eParent, ref) => {\n const doNothing = !compDetails || compDetails.componentFromFramework || context.isDestroyed();\n if (doNothing) {\n return;\n }\n const promise = compDetails.newAgStackInstance();\n let comp;\n let compGui;\n let destroyed = false;\n promise.then((c) => {\n if (destroyed) {\n context.destroyBean(c);\n return;\n }\n comp = c;\n compGui = comp.getGui();\n eParent.appendChild(compGui);\n setRef(ref, comp);\n });\n return () => {\n destroyed = true;\n if (!comp) {\n return;\n }\n compGui?.remove();\n context.destroyBean(comp);\n if (ref) {\n setRef(ref, void 0);\n }\n };\n};\nvar setRef = (ref, value) => {\n if (!ref) {\n return;\n }\n if (ref instanceof Function) {\n const refCallback = ref;\n refCallback(value);\n } else {\n const refObj = ref;\n refObj.current = value;\n }\n};\n\n// packages/ag-grid-react/src/reactUi/utils.tsx\nimport React2 from \"react\";\nimport ReactDOM from \"react-dom\";\nvar classesList = (...list) => {\n const filtered = list.filter((s) => s != null && s !== \"\");\n return filtered.join(\" \");\n};\nvar CssClasses = class _CssClasses {\n constructor(...initialClasses) {\n this.classesMap = {};\n for (const className of initialClasses) {\n this.classesMap[className] = true;\n }\n }\n setClass(className, on) {\n const nothingHasChanged = !!this.classesMap[className] == on;\n if (nothingHasChanged) {\n return this;\n }\n const res = new _CssClasses();\n res.classesMap = { ...this.classesMap };\n res.classesMap[className] = on;\n return res;\n }\n toString() {\n const res = Object.keys(this.classesMap).filter((key) => this.classesMap[key]).join(\" \");\n return res;\n }\n};\nvar isComponentStateless = (Component2) => {\n const hasSymbol = () => typeof Symbol === \"function\" && Symbol.for;\n const getMemoType = () => hasSymbol() ? Symbol.for(\"react.memo\") : 60115;\n return typeof Component2 === \"function\" && !(Component2.prototype && Component2.prototype.isReactComponent) || typeof Component2 === \"object\" && Component2.$$typeof === getMemoType();\n};\nvar reactVersion = React2.version?.split(\".\")[0];\nvar isReactVersion17Minus = reactVersion === \"16\" || reactVersion === \"17\";\nfunction isReact19() {\n return reactVersion === \"19\";\n}\nvar disableFlushSync = false;\nfunction runWithoutFlushSync(func) {\n if (!disableFlushSync) {\n setTimeout(() => disableFlushSync = false, 0);\n }\n disableFlushSync = true;\n return func();\n}\nvar agFlushSync = (useFlushSync, fn) => {\n if (!isReactVersion17Minus && useFlushSync && !disableFlushSync) {\n ReactDOM.flushSync(fn);\n } else {\n fn();\n }\n};\nvar agStartTransition = (fn) => {\n if (!isReactVersion17Minus) {\n React2.startTransition(fn);\n } else {\n fn();\n }\n};\nfunction agUseSyncExternalStore(subscribe, getSnapshot, defaultSnapshot) {\n if (React2.useSyncExternalStore) {\n return React2.useSyncExternalStore(subscribe, getSnapshot);\n } else {\n return defaultSnapshot;\n }\n}\nfunction getNextValueIfDifferent(prev, next, maintainOrder) {\n if (next == null || prev == null) {\n return next;\n }\n if (prev === next || next.length === 0 && prev.length === 0) {\n return prev;\n }\n if (maintainOrder || prev.length === 0 && next.length > 0 || prev.length > 0 && next.length === 0) {\n return next;\n }\n const oldValues = [];\n const newValues = [];\n const prevMap = /* @__PURE__ */ new Map();\n const nextMap = /* @__PURE__ */ new Map();\n for (let i = 0; i < next.length; i++) {\n const c = next[i];\n nextMap.set(c.instanceId, c);\n }\n for (let i = 0; i < prev.length; i++) {\n const c = prev[i];\n prevMap.set(c.instanceId, c);\n if (nextMap.has(c.instanceId)) {\n oldValues.push(c);\n }\n }\n for (let i = 0; i < next.length; i++) {\n const c = next[i];\n const instanceId = c.instanceId;\n if (!prevMap.has(instanceId)) {\n newValues.push(c);\n }\n }\n if (oldValues.length === prev.length && newValues.length === 0) {\n return prev;\n }\n if (oldValues.length === 0 && newValues.length === next.length) {\n return next;\n }\n if (oldValues.length === 0) {\n return newValues;\n }\n if (newValues.length === 0) {\n return oldValues;\n }\n return [...oldValues, ...newValues];\n}\n\n// packages/ag-grid-react/src/reactUi/cellRenderer/groupCellRenderer.tsx\nvar GroupCellRenderer = forwardRef((props, ref) => {\n const { registry, context } = useContext(BeansContext);\n const eGui = useRef(null);\n const eValueRef = useRef(null);\n const eCheckboxRef = useRef(null);\n const eExpandedRef = useRef(null);\n const eContractedRef = useRef(null);\n const ctrlRef = useRef();\n const [innerCompDetails, setInnerCompDetails] = useState();\n const [childCount, setChildCount] = useState();\n const [value, setValue] = useState();\n const [cssClasses, setCssClasses] = useState(() => new CssClasses());\n const [expandedCssClasses, setExpandedCssClasses] = useState(() => new CssClasses(\"ag-hidden\"));\n const [contractedCssClasses, setContractedCssClasses] = useState(() => new CssClasses(\"ag-hidden\"));\n const [checkboxCssClasses, setCheckboxCssClasses] = useState(() => new CssClasses(\"ag-invisible\"));\n useImperativeHandle(ref, () => {\n return {\n // force new instance when grid tries to refresh\n refresh() {\n return false;\n }\n };\n });\n useLayoutEffect(() => {\n return showJsComp(innerCompDetails, context, eValueRef.current);\n }, [innerCompDetails]);\n const setRef2 = useCallback((eRef) => {\n eGui.current = eRef;\n if (!eRef || context.isDestroyed()) {\n ctrlRef.current = context.destroyBean(ctrlRef.current);\n return;\n }\n const compProxy = {\n setInnerRenderer: (details, valueToDisplay) => {\n setInnerCompDetails(details);\n setValue(valueToDisplay);\n },\n setChildCount: (count) => setChildCount(count),\n toggleCss: (name, on) => setCssClasses((prev) => prev.setClass(name, on)),\n setContractedDisplayed: (displayed) => setContractedCssClasses((prev) => prev.setClass(\"ag-hidden\", !displayed)),\n setExpandedDisplayed: (displayed) => setExpandedCssClasses((prev) => prev.setClass(\"ag-hidden\", !displayed)),\n setCheckboxVisible: (visible) => setCheckboxCssClasses((prev) => prev.setClass(\"ag-invisible\", !visible)),\n setCheckboxSpacing: (add) => setCheckboxCssClasses((prev) => prev.setClass(\"ag-group-checkbox-spacing\", add))\n };\n const groupCellRendererCtrl = registry.createDynamicBean(\"groupCellRendererCtrl\", true);\n if (groupCellRendererCtrl) {\n ctrlRef.current = context.createBean(groupCellRendererCtrl);\n ctrlRef.current.init(\n compProxy,\n eRef,\n eCheckboxRef.current,\n eExpandedRef.current,\n eContractedRef.current,\n GroupCellRenderer,\n props\n );\n }\n }, []);\n const className = useMemo(() => `ag-cell-wrapper ${cssClasses.toString()}`, [cssClasses]);\n const expandedClassName = useMemo(() => `ag-group-expanded ${expandedCssClasses.toString()}`, [expandedCssClasses]);\n const contractedClassName = useMemo(\n () => `ag-group-contracted ${contractedCssClasses.toString()}`,\n [contractedCssClasses]\n );\n const checkboxClassName = useMemo(() => `ag-group-checkbox ${checkboxCssClasses.toString()}`, [checkboxCssClasses]);\n const useFwRenderer = innerCompDetails?.componentFromFramework;\n const FwRenderer = useFwRenderer ? innerCompDetails.componentClass : void 0;\n const useValue = innerCompDetails == null && value != null;\n const escapedValue = _toString(value);\n return /* @__PURE__ */ React3.createElement(\n \"span\",\n {\n className,\n ref: setRef2,\n ...!props.colDef ? { role: ctrlRef.current?.getCellAriaRole() } : {}\n },\n /* @__PURE__ */ React3.createElement(\"span\", { className: expandedClassName, ref: eExpandedRef }),\n /* @__PURE__ */ React3.createElement(\"span\", { className: contractedClassName, ref: eContractedRef }),\n /* @__PURE__ */ React3.createElement(\"span\", { className: checkboxClassName, ref: eCheckboxRef }),\n /* @__PURE__ */ React3.createElement(\"span\", { className: \"ag-group-value\", ref: eValueRef }, useValue ? escapedValue : useFwRenderer ? /* @__PURE__ */ React3.createElement(FwRenderer, { ...innerCompDetails.params }) : null),\n /* @__PURE__ */ React3.createElement(\"span\", { className: \"ag-group-child-count\" }, childCount)\n );\n});\nvar groupCellRenderer_default = GroupCellRenderer;\n\n// packages/ag-grid-react/src/shared/customComp/customComponentWrapper.ts\nimport { AgPromise as AgPromise2 } from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/reactUi/customComp/customWrapperComp.tsx\nimport React4, { memo, useEffect, useState as useState2 } from \"react\";\n\n// packages/ag-grid-react/src/shared/customComp/customContext.ts\nimport { createContext } from \"react\";\nvar CustomContext = createContext({\n setMethods: () => {\n }\n});\n\n// packages/ag-grid-react/src/reactUi/customComp/customWrapperComp.tsx\nvar CustomWrapperComp = (params) => {\n const { initialProps, addUpdateCallback, CustomComponentClass, setMethods } = params;\n const [{ key, ...props }, setProps] = useState2(initialProps);\n useEffect(() => {\n addUpdateCallback((newProps) => setProps(newProps));\n }, []);\n return /* @__PURE__ */ React4.createElement(CustomContext.Provider, { value: { setMethods } }, /* @__PURE__ */ React4.createElement(CustomComponentClass, { key, ...props }));\n};\nvar customWrapperComp_default = memo(CustomWrapperComp);\n\n// packages/ag-grid-react/src/shared/reactComponent.ts\nimport { createElement } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { AgPromise } from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/shared/keyGenerator.ts\nvar counter = 0;\nfunction generateNewKey() {\n return `agPortalKey_${++counter}`;\n}\n\n// packages/ag-grid-react/src/shared/reactComponent.ts\nvar ReactComponent = class {\n constructor(reactComponent, portalManager, componentType, suppressFallbackMethods) {\n this.portal = null;\n this.oldPortal = null;\n this.reactComponent = reactComponent;\n this.portalManager = portalManager;\n this.componentType = componentType;\n this.suppressFallbackMethods = !!suppressFallbackMethods;\n this.statelessComponent = this.isStateless(this.reactComponent);\n this.key = generateNewKey();\n this.portalKey = generateNewKey();\n this.instanceCreated = this.isStatelessComponent() ? AgPromise.resolve(false) : new AgPromise((resolve) => {\n this.resolveInstanceCreated = resolve;\n });\n }\n getGui() {\n return this.eParentElement;\n }\n /** `getGui()` returns the parent element. This returns the actual root element. */\n getRootElement() {\n const firstChild = this.eParentElement.firstChild;\n return firstChild;\n }\n destroy() {\n if (this.componentInstance && typeof this.componentInstance.destroy == \"function\") {\n this.componentInstance.destroy();\n }\n const portal = this.portal;\n if (portal) {\n this.portalManager.destroyPortal(portal);\n }\n }\n createParentElement(params) {\n const componentWrappingElement = this.portalManager.getComponentWrappingElement();\n const eParentElement = document.createElement(componentWrappingElement || \"div\");\n eParentElement.classList.add(\"ag-react-container\");\n params.reactContainer = eParentElement;\n return eParentElement;\n }\n statelessComponentRendered() {\n return this.eParentElement.childElementCount > 0 || this.eParentElement.childNodes.length > 0;\n }\n getFrameworkComponentInstance() {\n return this.componentInstance;\n }\n isStatelessComponent() {\n return this.statelessComponent;\n }\n getReactComponentName() {\n return this.reactComponent.name;\n }\n getMemoType() {\n return this.hasSymbol() ? Symbol.for(\"react.memo\") : 60115;\n }\n hasSymbol() {\n return typeof Symbol === \"function\" && Symbol.for;\n }\n isStateless(Component2) {\n return typeof Component2 === \"function\" && !(Component2.prototype && Component2.prototype.isReactComponent) || typeof Component2 === \"object\" && Component2.$$typeof === this.getMemoType();\n }\n hasMethod(name) {\n const frameworkComponentInstance = this.getFrameworkComponentInstance();\n return !!frameworkComponentInstance && frameworkComponentInstance[name] != null || this.fallbackMethodAvailable(name);\n }\n callMethod(name, args) {\n const frameworkComponentInstance = this.getFrameworkComponentInstance();\n if (this.isStatelessComponent()) {\n return this.fallbackMethod(name, !!args && args[0] ? args[0] : {});\n } else if (!frameworkComponentInstance) {\n setTimeout(() => this.callMethod(name, args));\n return;\n }\n const method = frameworkComponentInstance[name];\n if (method) {\n return method.apply(frameworkComponentInstance, args);\n }\n if (this.fallbackMethodAvailable(name)) {\n return this.fallbackMethod(name, !!args && args[0] ? args[0] : {});\n }\n }\n addMethod(name, callback) {\n this[name] = callback;\n }\n init(params) {\n this.eParentElement = this.createParentElement(params);\n this.createOrUpdatePortal(params);\n return new AgPromise((resolve) => this.createReactComponent(resolve));\n }\n createOrUpdatePortal(params) {\n if (!this.isStatelessComponent()) {\n this.ref = (element) => {\n this.componentInstance = element;\n this.resolveInstanceCreated?.(true);\n this.resolveInstanceCreated = void 0;\n };\n params.ref = this.ref;\n }\n this.reactElement = this.createElement(this.reactComponent, { ...params, key: this.key });\n this.portal = createPortal(\n this.reactElement,\n this.eParentElement,\n this.portalKey\n // fixed deltaRowModeRefreshCompRenderer\n );\n }\n createElement(reactComponent, props) {\n return createElement(reactComponent, props);\n }\n createReactComponent(resolve) {\n this.portalManager.mountReactPortal(this.portal, this, resolve);\n }\n rendered() {\n return this.isStatelessComponent() && this.statelessComponentRendered() || !!(!this.isStatelessComponent() && this.getFrameworkComponentInstance());\n }\n /*\n * fallback methods - these will be invoked if a corresponding instance method is not present\n * for example if refresh is called and is not available on the component instance, then refreshComponent on this\n * class will be invoked instead\n *\n * Currently only refresh is supported\n */\n refreshComponent(args) {\n this.oldPortal = this.portal;\n this.createOrUpdatePortal(args);\n this.portalManager.updateReactPortal(this.oldPortal, this.portal);\n }\n fallbackMethod(name, params) {\n const method = this[`${name}Component`];\n if (!this.suppressFallbackMethods && !!method) {\n return method.bind(this)(params);\n }\n }\n fallbackMethodAvailable(name) {\n if (this.suppressFallbackMethods) {\n return false;\n }\n const method = this[`${name}Component`];\n return !!method;\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/customComponentWrapper.ts\nfunction addOptionalMethods(optionalMethodNames, providedMethods, component) {\n for (const methodName of optionalMethodNames) {\n const providedMethod = providedMethods[methodName];\n if (providedMethod) {\n component[methodName] = providedMethod;\n }\n }\n}\nvar CustomComponentWrapper = class extends ReactComponent {\n constructor() {\n super(...arguments);\n this.awaitUpdateCallback = new AgPromise2((resolve) => {\n this.resolveUpdateCallback = resolve;\n });\n this.wrapperComponent = customWrapperComp_default;\n }\n init(params) {\n this.sourceParams = params;\n return super.init(this.getProps());\n }\n addMethod() {\n }\n getInstance() {\n return this.instanceCreated.then(() => this.componentInstance);\n }\n getFrameworkComponentInstance() {\n return this;\n }\n createElement(reactComponent, props) {\n return super.createElement(this.wrapperComponent, {\n initialProps: props,\n CustomComponentClass: reactComponent,\n setMethods: (methods) => this.setMethods(methods),\n addUpdateCallback: (callback) => {\n this.updateCallback = () => {\n callback(this.getProps());\n return new AgPromise2((resolve) => {\n setTimeout(() => {\n resolve();\n });\n });\n };\n this.resolveUpdateCallback();\n }\n });\n }\n setMethods(methods) {\n this.providedMethods = methods;\n addOptionalMethods(this.getOptionalMethods(), this.providedMethods, this);\n }\n getOptionalMethods() {\n return [];\n }\n getProps() {\n return {\n ...this.sourceParams,\n key: this.key,\n ref: this.ref\n };\n }\n refreshProps() {\n if (this.updateCallback) {\n return this.updateCallback();\n }\n return new AgPromise2(\n (resolve) => this.awaitUpdateCallback.then(() => {\n this.updateCallback().then(() => resolve());\n })\n );\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/cellRendererComponentWrapper.ts\nvar CellRendererComponentWrapper = class extends CustomComponentWrapper {\n refresh(params) {\n this.sourceParams = params;\n this.refreshProps();\n return true;\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/customOverlayComponentWrapper.ts\nvar CustomOverlayComponentWrapper = class extends CustomComponentWrapper {\n refresh(params) {\n this.sourceParams = params;\n this.refreshProps();\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/dateComponentWrapper.ts\nvar DateComponentWrapper = class extends CustomComponentWrapper {\n constructor() {\n super(...arguments);\n this.date = null;\n this.onDateChange = (date) => this.updateDate(date);\n }\n getDate() {\n return this.date;\n }\n setDate(date) {\n this.date = date;\n this.refreshProps();\n }\n refresh(params) {\n this.sourceParams = params;\n this.refreshProps();\n }\n getOptionalMethods() {\n return [\"afterGuiAttached\", \"setInputPlaceholder\", \"setInputAriaLabel\", \"setDisabled\"];\n }\n updateDate(date) {\n this.setDate(date);\n this.sourceParams.onDateChanged();\n }\n getProps() {\n const props = super.getProps();\n props.date = this.date;\n props.onDateChange = this.onDateChange;\n delete props.onDateChanged;\n return props;\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/dragAndDropImageComponentWrapper.ts\nvar DragAndDropImageComponentWrapper = class extends CustomComponentWrapper {\n constructor() {\n super(...arguments);\n this.label = \"\";\n this.icon = null;\n this.shake = false;\n }\n setIcon(iconName, shake) {\n this.icon = iconName;\n this.shake = shake;\n this.refreshProps();\n }\n setLabel(label) {\n this.label = label;\n this.refreshProps();\n }\n getProps() {\n const props = super.getProps();\n const { label, icon, shake } = this;\n props.label = label;\n props.icon = icon;\n props.shake = shake;\n return props;\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/filterComponentWrapper.ts\nimport { AgPromise as AgPromise3 } from \"ag-grid-community\";\nvar FilterComponentWrapper = class extends CustomComponentWrapper {\n constructor() {\n super(...arguments);\n this.model = null;\n this.onModelChange = (model) => this.updateModel(model);\n this.onUiChange = () => this.sourceParams.filterModifiedCallback();\n this.expectingNewMethods = true;\n this.hasBeenActive = false;\n this.awaitSetMethodsCallback = new AgPromise3((resolve) => {\n this.resolveSetMethodsCallback = resolve;\n });\n }\n isFilterActive() {\n return this.model != null;\n }\n doesFilterPass(params) {\n return this.providedMethods.doesFilterPass(params);\n }\n getModel() {\n return this.model;\n }\n setModel(model) {\n this.expectingNewMethods = true;\n this.model = model;\n this.hasBeenActive || (this.hasBeenActive = this.isFilterActive());\n return this.refreshProps();\n }\n refresh(newParams) {\n this.sourceParams = newParams;\n this.refreshProps();\n return true;\n }\n afterGuiAttached(params) {\n const providedMethods = this.providedMethods;\n if (!providedMethods) {\n this.awaitSetMethodsCallback.then(() => this.providedMethods?.afterGuiAttached?.(params));\n } else {\n providedMethods.afterGuiAttached?.(params);\n }\n }\n getOptionalMethods() {\n return [\"afterGuiDetached\", \"onNewRowsLoaded\", \"getModelAsString\", \"onAnyFilterChanged\"];\n }\n setMethods(methods) {\n if (this.expectingNewMethods === false && this.hasBeenActive && this.providedMethods?.doesFilterPass !== methods?.doesFilterPass) {\n setTimeout(() => {\n this.sourceParams.filterChangedCallback();\n });\n }\n this.expectingNewMethods = false;\n super.setMethods(methods);\n this.resolveSetMethodsCallback();\n this.resolveFilterPassCallback?.();\n this.resolveFilterPassCallback = void 0;\n }\n updateModel(model) {\n this.resolveFilterPassCallback?.();\n const awaitFilterPassCallback = new AgPromise3((resolve) => {\n this.resolveFilterPassCallback = resolve;\n });\n this.setModel(model).then(() => {\n awaitFilterPassCallback.then(() => {\n this.sourceParams.filterChangedCallback();\n });\n });\n }\n getProps() {\n const props = super.getProps();\n props.model = this.model;\n props.onModelChange = this.onModelChange;\n props.onUiChange = this.onUiChange;\n delete props.filterChangedCallback;\n return props;\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/filterDisplayComponentWrapper.ts\nimport { AgPromise as AgPromise4 } from \"ag-grid-community\";\nvar FilterDisplayComponentWrapper = class extends CustomComponentWrapper {\n constructor() {\n super(...arguments);\n this.awaitSetMethodsCallback = new AgPromise4((resolve) => {\n this.resolveSetMethodsCallback = resolve;\n });\n }\n refresh(newParams) {\n this.sourceParams = newParams;\n this.refreshProps();\n return true;\n }\n afterGuiAttached(params) {\n const providedMethods = this.providedMethods;\n if (!providedMethods) {\n this.awaitSetMethodsCallback.then(() => this.providedMethods?.afterGuiAttached?.(params));\n } else {\n providedMethods.afterGuiAttached?.(params);\n }\n }\n getOptionalMethods() {\n return [\"afterGuiDetached\", \"onNewRowsLoaded\", \"onAnyFilterChanged\"];\n }\n setMethods(methods) {\n super.setMethods(methods);\n this.resolveSetMethodsCallback();\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/floatingFilterComponentProxy.ts\nimport { AgPromise as AgPromise5 } from \"ag-grid-community\";\nfunction updateFloatingFilterParent(params, model) {\n params.parentFilterInstance((instance) => {\n (instance.setModel(model) || AgPromise5.resolve()).then(() => {\n params.filterParams.filterChangedCallback();\n });\n });\n}\nvar FloatingFilterComponentProxy = class {\n constructor(floatingFilterParams, refreshProps) {\n this.floatingFilterParams = floatingFilterParams;\n this.refreshProps = refreshProps;\n this.model = null;\n this.onModelChange = (model) => this.updateModel(model);\n }\n getProps() {\n return {\n ...this.floatingFilterParams,\n model: this.model,\n onModelChange: this.onModelChange\n };\n }\n onParentModelChanged(parentModel) {\n this.model = parentModel;\n this.refreshProps();\n }\n refresh(params) {\n this.floatingFilterParams = params;\n this.refreshProps();\n }\n setMethods(methods) {\n addOptionalMethods(this.getOptionalMethods(), methods, this);\n }\n getOptionalMethods() {\n return [\"afterGuiAttached\"];\n }\n updateModel(model) {\n this.model = model;\n this.refreshProps();\n updateFloatingFilterParent(this.floatingFilterParams, model);\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/floatingFilterComponentWrapper.ts\nvar FloatingFilterComponentWrapper = class extends CustomComponentWrapper {\n constructor() {\n super(...arguments);\n this.model = null;\n this.onModelChange = (model) => this.updateModel(model);\n }\n onParentModelChanged(parentModel) {\n this.model = parentModel;\n this.refreshProps();\n }\n refresh(newParams) {\n this.sourceParams = newParams;\n this.refreshProps();\n }\n getOptionalMethods() {\n return [\"afterGuiAttached\"];\n }\n updateModel(model) {\n this.model = model;\n this.refreshProps();\n updateFloatingFilterParent(this.sourceParams, model);\n }\n getProps() {\n const props = super.getProps();\n props.model = this.model;\n props.onModelChange = this.onModelChange;\n return props;\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/floatingFilterDisplayComponentWrapper.ts\nvar FloatingFilterDisplayComponentWrapper = class extends CustomComponentWrapper {\n refresh(newParams) {\n this.sourceParams = newParams;\n this.refreshProps();\n }\n getOptionalMethods() {\n return [\"afterGuiAttached\"];\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/innerHeaderComponentWrapper.ts\nvar InnerHeaderComponentWrapper = class extends CustomComponentWrapper {\n refresh(params) {\n this.sourceParams = params;\n this.refreshProps();\n return true;\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/menuItemComponentWrapper.ts\nvar MenuItemComponentWrapper = class extends CustomComponentWrapper {\n constructor() {\n super(...arguments);\n this.active = false;\n this.expanded = false;\n this.onActiveChange = (active) => this.updateActive(active);\n }\n setActive(active) {\n this.awaitSetActive(active);\n }\n setExpanded(expanded) {\n this.expanded = expanded;\n this.refreshProps();\n }\n getOptionalMethods() {\n return [\"select\", \"configureDefaults\"];\n }\n awaitSetActive(active) {\n this.active = active;\n return this.refreshProps();\n }\n updateActive(active) {\n const result = this.awaitSetActive(active);\n if (active) {\n result.then(() => this.sourceParams.onItemActivated());\n }\n }\n getProps() {\n const props = super.getProps();\n props.active = this.active;\n props.expanded = this.expanded;\n props.onActiveChange = this.onActiveChange;\n delete props.onItemActivated;\n return props;\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/statusPanelComponentWrapper.ts\nvar StatusPanelComponentWrapper = class extends CustomComponentWrapper {\n refresh(params) {\n this.sourceParams = params;\n this.refreshProps();\n return true;\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/toolPanelComponentWrapper.ts\nvar ToolPanelComponentWrapper = class extends CustomComponentWrapper {\n constructor() {\n super(...arguments);\n this.onStateChange = (state) => this.updateState(state);\n }\n refresh(params) {\n this.sourceParams = params;\n this.refreshProps();\n return true;\n }\n getState() {\n return this.state;\n }\n updateState(state) {\n this.state = state;\n this.refreshProps();\n this.sourceParams.onStateUpdated();\n }\n getProps() {\n const props = super.getProps();\n props.state = this.state;\n props.onStateChange = this.onStateChange;\n return props;\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/util.ts\nimport { AgPromise as AgPromise6, _warn } from \"ag-grid-community\";\nfunction getInstance(wrapperComponent, callback) {\n const promise = wrapperComponent?.getInstance?.() ?? AgPromise6.resolve(void 0);\n promise.then((comp) => callback(comp));\n}\nfunction warnReactiveCustomComponents() {\n _warn(231);\n}\n\n// packages/ag-grid-react/src/shared/portalManager.ts\nvar MAX_COMPONENT_CREATION_TIME_IN_MS = 1e3;\nvar PortalManager = class {\n constructor(refresher, wrappingElement, maxComponentCreationTimeMs) {\n this.destroyed = false;\n this.portals = [];\n this.hasPendingPortalUpdate = false;\n this.wrappingElement = wrappingElement ? wrappingElement : \"div\";\n this.refresher = refresher;\n this.maxComponentCreationTimeMs = maxComponentCreationTimeMs ? maxComponentCreationTimeMs : MAX_COMPONENT_CREATION_TIME_IN_MS;\n }\n getPortals() {\n return this.portals;\n }\n destroy() {\n this.destroyed = true;\n }\n destroyPortal(portal) {\n this.portals = this.portals.filter((curPortal) => curPortal !== portal);\n this.batchUpdate();\n }\n getComponentWrappingElement() {\n return this.wrappingElement;\n }\n mountReactPortal(portal, reactComponent, resolve) {\n this.portals = [...this.portals, portal];\n this.waitForInstance(reactComponent, resolve);\n this.batchUpdate();\n }\n updateReactPortal(oldPortal, newPortal) {\n this.portals[this.portals.indexOf(oldPortal)] = newPortal;\n this.batchUpdate();\n }\n batchUpdate() {\n if (this.hasPendingPortalUpdate) {\n return;\n }\n setTimeout(() => {\n if (!this.destroyed) {\n this.refresher();\n this.hasPendingPortalUpdate = false;\n }\n });\n this.hasPendingPortalUpdate = true;\n }\n waitForInstance(reactComponent, resolve, startTime = Date.now()) {\n if (this.destroyed) {\n resolve(null);\n return;\n }\n if (reactComponent.rendered()) {\n resolve(reactComponent);\n } else {\n if (Date.now() - startTime >= this.maxComponentCreationTimeMs && !this.hasPendingPortalUpdate) {\n agFlushSync(true, () => this.refresher());\n if (reactComponent.rendered()) {\n resolve(reactComponent);\n }\n return;\n }\n window.setTimeout(() => {\n this.waitForInstance(reactComponent, resolve, startTime);\n });\n }\n }\n};\n\n// packages/ag-grid-react/src/reactUi/agGridProvider.tsx\nimport React5, { useContext as useContext2, useRef as useRef2 } from \"react\";\nimport { _areEqual } from \"ag-grid-community\";\nvar ModulesContext = React5.createContext([]);\nvar LicenseContext = React5.createContext(void 0);\nfunction AgGridProvider({ modules, licenseKey, children }) {\n const parentModules = useContext2(ModulesContext);\n const parentLicenseKey = useContext2(LicenseContext);\n const modulesRef = useRef2(modules);\n const parentModulesRef = useRef2(parentModules);\n const mergedModules = useRef2([...parentModules, ...modules]);\n const parentModulesChanged = !_areEqual(parentModulesRef.current, parentModules);\n if (parentModulesChanged) {\n parentModulesRef.current = parentModules;\n }\n const modulesChanged = !_areEqual(modulesRef.current, modules);\n if (modulesChanged) {\n modulesRef.current = modules;\n }\n if (parentModulesChanged || modulesChanged) {\n mergedModules.current = [...parentModulesRef.current, ...modulesRef.current];\n }\n const effectiveLicenseKey = licenseKey ?? parentLicenseKey;\n return /* @__PURE__ */ React5.createElement(ModulesContext.Provider, { value: mergedModules.current }, /* @__PURE__ */ React5.createElement(LicenseContext.Provider, { value: effectiveLicenseKey }, children));\n}\n\n// packages/ag-grid-react/src/reactUi/gridComp.tsx\nimport React19, { memo as memo14, useCallback as useCallback14, useEffect as useEffect9, useMemo as useMemo12, useRef as useRef16, useState as useState15 } from \"react\";\nimport { GridCtrl } from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/reactUi/gridBodyComp.tsx\nimport React17, { memo as memo12, useCallback as useCallback12, useContext as useContext14, useMemo as useMemo11, useRef as useRef14, useState as useState14 } from \"react\";\nimport {\n CssClassManager as CssClassManager4,\n FakeHScrollComp,\n FakeVScrollComp,\n GridBodyCtrl,\n _observeResize,\n _setAriaColCount,\n _setAriaRowCount\n} from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/reactUi/header/gridHeaderComp.tsx\nimport React11, { memo as memo7, useCallback as useCallback7, useContext as useContext8, useMemo as useMemo6, useRef as useRef8, useState as useState8 } from \"react\";\nimport { GridHeaderCtrl } from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/reactUi/header/headerRowContainerComp.tsx\nimport React10, { memo as memo6, useCallback as useCallback6, useContext as useContext7, useRef as useRef7, useState as useState7 } from \"react\";\nimport { HeaderRowContainerCtrl } from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/reactUi/header/headerRowComp.tsx\nimport React9, { memo as memo5, useCallback as useCallback5, useContext as useContext6, useMemo as useMemo5, useRef as useRef6, useState as useState6 } from \"react\";\nimport { _EmptyBean as _EmptyBean4 } from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/reactUi/header/headerCellComp.tsx\nimport React6, { memo as memo2, useCallback as useCallback2, useContext as useContext3, useEffect as useEffect2, useLayoutEffect as useLayoutEffect2, useMemo as useMemo2, useRef as useRef3, useState as useState3 } from \"react\";\nimport { CssClassManager, _EmptyBean, _removeAriaSort, _setAriaSort } from \"ag-grid-community\";\nvar HeaderCellComp = ({ ctrl }) => {\n const isAlive = ctrl.isAlive();\n const { context } = useContext3(BeansContext);\n const [userCompDetails, setUserCompDetails] = useState3();\n const [userStyles, setUserStyles] = useState3();\n const compBean = useRef3();\n const eGui = useRef3(null);\n const eResize = useRef3(null);\n const eHeaderCompWrapper = useRef3(null);\n const userCompRef = useRef3();\n const cssManager = useRef3();\n if (isAlive && !cssManager.current) {\n cssManager.current = new CssClassManager(() => eGui.current);\n }\n const setRef2 = useCallback2((eRef) => {\n eGui.current = eRef;\n if (!eRef || !ctrl.isAlive() || context.isDestroyed()) {\n compBean.current = context.destroyBean(compBean.current);\n return;\n }\n compBean.current = context.createBean(new _EmptyBean());\n const refreshSelectAllGui = () => {\n const selectAllGui = ctrl.getSelectAllGui();\n if (selectAllGui) {\n eResize.current?.insertAdjacentElement(\"afterend\", selectAllGui);\n compBean.current.addDestroyFunc(() => selectAllGui.remove());\n }\n };\n const compProxy = {\n setWidth: (width) => {\n if (eGui.current) {\n eGui.current.style.width = width;\n }\n },\n toggleCss: (name, on) => cssManager.current.toggleCss(name, on),\n setUserStyles: (styles) => setUserStyles(styles),\n setAriaSort: (sort) => {\n if (eGui.current) {\n if (sort) {\n _setAriaSort(eGui.current, sort);\n } else {\n _removeAriaSort(eGui.current);\n }\n }\n },\n setUserCompDetails: (compDetails) => setUserCompDetails(compDetails),\n getUserCompInstance: () => userCompRef.current || void 0,\n refreshSelectAllGui,\n removeSelectAllGui: () => ctrl.getSelectAllGui()?.remove()\n };\n ctrl.setComp(compProxy, eRef, eResize.current, eHeaderCompWrapper.current, compBean.current);\n refreshSelectAllGui();\n }, []);\n useLayoutEffect2(\n () => showJsComp(userCompDetails, context, eHeaderCompWrapper.current, userCompRef),\n [userCompDetails]\n );\n useEffect2(() => {\n ctrl.setDragSource(eGui.current);\n }, [userCompDetails]);\n const userCompStateless = useMemo2(() => {\n const res = userCompDetails?.componentFromFramework && isComponentStateless(userCompDetails.componentClass);\n return !!res;\n }, [userCompDetails]);\n const reactUserComp = userCompDetails?.componentFromFramework;\n const UserCompClass = userCompDetails?.componentClass;\n return /* @__PURE__ */ React6.createElement(\"div\", { ref: setRef2, style: userStyles, className: \"ag-header-cell\", role: \"columnheader\" }, /* @__PURE__ */ React6.createElement(\"div\", { ref: eResize, className: \"ag-header-cell-resize\", role: \"presentation\" }), /* @__PURE__ */ React6.createElement(\"div\", { ref: eHeaderCompWrapper, className: \"ag-header-cell-comp-wrapper\", role: \"presentation\" }, reactUserComp ? userCompStateless ? /* @__PURE__ */ React6.createElement(UserCompClass, { ...userCompDetails.params }) : /* @__PURE__ */ React6.createElement(UserCompClass, { ...userCompDetails.params, ref: userCompRef }) : null));\n};\nvar headerCellComp_default = memo2(HeaderCellComp);\n\n// packages/ag-grid-react/src/reactUi/header/headerFilterCellComp.tsx\nimport React7, { memo as memo3, useCallback as useCallback3, useContext as useContext4, useEffect as useEffect3, useLayoutEffect as useLayoutEffect3, useMemo as useMemo3, useRef as useRef4, useState as useState4 } from \"react\";\nimport { AgPromise as AgPromise7, _EmptyBean as _EmptyBean2 } from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/shared/customComp/floatingFilterDisplayComponentProxy.ts\nvar FloatingFilterDisplayComponentProxy = class {\n constructor(floatingFilterParams, refreshProps) {\n this.floatingFilterParams = floatingFilterParams;\n this.refreshProps = refreshProps;\n }\n getProps() {\n return this.floatingFilterParams;\n }\n refresh(params) {\n this.floatingFilterParams = params;\n this.refreshProps();\n }\n setMethods(methods) {\n addOptionalMethods(this.getOptionalMethods(), methods, this);\n }\n getOptionalMethods() {\n return [\"afterGuiAttached\"];\n }\n};\n\n// packages/ag-grid-react/src/reactUi/header/headerFilterCellComp.tsx\nvar HeaderFilterCellComp = ({ ctrl }) => {\n const { context, gos } = useContext4(BeansContext);\n const [userStyles, setUserStyles] = useState4();\n const [cssClasses, setCssClasses] = useState4(\n () => new CssClasses(\"ag-header-cell\", \"ag-floating-filter\")\n );\n const [cssBodyClasses, setBodyCssClasses] = useState4(() => new CssClasses());\n const [cssButtonWrapperClasses, setButtonWrapperCssClasses] = useState4(\n () => new CssClasses(\"ag-floating-filter-button\", \"ag-hidden\")\n );\n const [buttonWrapperAriaHidden, setButtonWrapperAriaHidden] = useState4(\"false\");\n const [userCompDetails, setUserCompDetails] = useState4();\n const [, setRenderKey] = useState4(1);\n const compBean = useRef4();\n const eGui = useRef4(null);\n const eFloatingFilterBody = useRef4(null);\n const eButtonWrapper = useRef4(null);\n const eButtonShowMainFilter = useRef4(null);\n const userCompResolve = useRef4();\n const userCompPromise = useRef4();\n const userCompRef = (value) => {\n if (value == null) {\n return;\n }\n userCompResolve.current?.(value);\n };\n const setRef2 = useCallback3((eRef) => {\n eGui.current = eRef;\n if (!eRef || !ctrl.isAlive() || context.isDestroyed()) {\n compBean.current = context.destroyBean(compBean.current);\n return;\n }\n compBean.current = context.createBean(new _EmptyBean2());\n userCompPromise.current = new AgPromise7((resolve) => {\n userCompResolve.current = resolve;\n });\n const compProxy = {\n toggleCss: (name, on) => setCssClasses((prev) => prev.setClass(name, on)),\n setUserStyles: (styles) => setUserStyles(styles),\n addOrRemoveBodyCssClass: (name, on) => setBodyCssClasses((prev) => prev.setClass(name, on)),\n setButtonWrapperDisplayed: (displayed) => {\n setButtonWrapperCssClasses((prev) => prev.setClass(\"ag-hidden\", !displayed));\n setButtonWrapperAriaHidden(!displayed ? \"true\" : \"false\");\n },\n setWidth: (width) => {\n if (eGui.current) {\n eGui.current.style.width = width;\n }\n },\n setCompDetails: (compDetails) => setUserCompDetails(compDetails),\n getFloatingFilterComp: () => userCompPromise.current ? userCompPromise.current : null,\n setMenuIcon: (eIcon) => eButtonShowMainFilter.current?.appendChild(eIcon)\n };\n ctrl.setComp(compProxy, eRef, eButtonShowMainFilter.current, eFloatingFilterBody.current, compBean.current);\n }, []);\n useLayoutEffect3(\n () => showJsComp(userCompDetails, context, eFloatingFilterBody.current, userCompRef),\n [userCompDetails]\n );\n const className = useMemo3(() => cssClasses.toString(), [cssClasses]);\n const bodyClassName = useMemo3(() => cssBodyClasses.toString(), [cssBodyClasses]);\n const buttonWrapperClassName = useMemo3(() => cssButtonWrapperClasses.toString(), [cssButtonWrapperClasses]);\n const userCompStateless = useMemo3(() => {\n const res = userCompDetails && userCompDetails.componentFromFramework && isComponentStateless(userCompDetails.componentClass);\n return !!res;\n }, [userCompDetails]);\n const reactiveCustomComponents = useMemo3(() => gos.get(\"reactiveCustomComponents\"), []);\n const enableFilterHandlers = useMemo3(() => gos.get(\"enableFilterHandlers\"), []);\n const [floatingFilterCompProxy, setFloatingFilterCompProxy] = useState4();\n useEffect3(() => {\n if (userCompDetails?.componentFromFramework) {\n if (reactiveCustomComponents) {\n const ProxyClass = enableFilterHandlers ? FloatingFilterDisplayComponentProxy : FloatingFilterComponentProxy;\n const compProxy = new ProxyClass(userCompDetails.params, () => setRenderKey((prev) => prev + 1));\n userCompRef(compProxy);\n setFloatingFilterCompProxy(compProxy);\n } else {\n warnReactiveCustomComponents();\n }\n }\n }, [userCompDetails]);\n const floatingFilterProps = floatingFilterCompProxy?.getProps();\n const reactUserComp = userCompDetails?.componentFromFramework;\n const UserCompClass = userCompDetails?.componentClass;\n return /* @__PURE__ */ React7.createElement(\"div\", { ref: setRef2, style: userStyles, className, role: \"gridcell\" }, /* @__PURE__ */ React7.createElement(\"div\", { ref: eFloatingFilterBody, className: bodyClassName, role: \"presentation\" }, reactUserComp ? reactiveCustomComponents ? floatingFilterProps && /* @__PURE__ */ React7.createElement(\n CustomContext.Provider,\n {\n value: {\n setMethods: (methods) => floatingFilterCompProxy.setMethods(methods)\n }\n },\n /* @__PURE__ */ React7.createElement(UserCompClass, { ...floatingFilterProps })\n ) : /* @__PURE__ */ React7.createElement(UserCompClass, { ...userCompDetails.params, ref: userCompStateless ? () => {\n } : userCompRef }) : null), /* @__PURE__ */ React7.createElement(\n \"div\",\n {\n ref: eButtonWrapper,\n \"aria-hidden\": buttonWrapperAriaHidden,\n className: buttonWrapperClassName,\n role: \"presentation\"\n },\n /* @__PURE__ */ React7.createElement(\n \"button\",\n {\n ref: eButtonShowMainFilter,\n type: \"button\",\n className: \"ag-button ag-floating-filter-button-button\",\n tabIndex: -1\n }\n )\n ));\n};\nvar headerFilterCellComp_default = memo3(HeaderFilterCellComp);\n\n// packages/ag-grid-react/src/reactUi/header/headerGroupCellComp.tsx\nimport React8, { memo as memo4, useCallback as useCallback4, useContext as useContext5, useEffect as useEffect4, useLayoutEffect as useLayoutEffect4, useMemo as useMemo4, useRef as useRef5, useState as useState5 } from \"react\";\nimport { _EmptyBean as _EmptyBean3 } from \"ag-grid-community\";\nvar HeaderGroupCellComp = ({ ctrl }) => {\n const { context } = useContext5(BeansContext);\n const [userStyles, setUserStyles] = useState5();\n const [cssClasses, setCssClasses] = useState5(() => new CssClasses());\n const [cssResizableClasses, setResizableCssClasses] = useState5(() => new CssClasses());\n const [resizableAriaHidden, setResizableAriaHidden] = useState5(\"false\");\n const [ariaExpanded, setAriaExpanded] = useState5();\n const [userCompDetails, setUserCompDetails] = useState5();\n const compBean = useRef5();\n const eGui = useRef5(null);\n const eResize = useRef5(null);\n const eHeaderCompWrapper = useRef5(null);\n const userCompRef = useRef5();\n const setRef2 = useCallback4((eRef) => {\n eGui.current = eRef;\n if (!eRef || !ctrl.isAlive() || context.isDestroyed()) {\n compBean.current = context.destroyBean(compBean.current);\n return;\n }\n compBean.current = context.createBean(new _EmptyBean3());\n const compProxy = {\n setWidth: (width) => {\n if (eGui.current) {\n eGui.current.style.width = width;\n }\n },\n toggleCss: (name, on) => setCssClasses((prev) => prev.setClass(name, on)),\n setUserStyles: (styles) => setUserStyles(styles),\n setHeaderWrapperHidden: (hidden) => {\n const headerCompWrapper = eHeaderCompWrapper.current;\n if (!headerCompWrapper) {\n return;\n }\n if (hidden) {\n headerCompWrapper.style.setProperty(\"display\", \"none\");\n } else {\n headerCompWrapper.style.removeProperty(\"display\");\n }\n },\n setHeaderWrapperMaxHeight: (value) => {\n const headerCompWrapper = eHeaderCompWrapper.current;\n if (!headerCompWrapper) {\n return;\n }\n if (value != null) {\n headerCompWrapper.style.setProperty(\"max-height\", `${value}px`);\n } else {\n headerCompWrapper.style.removeProperty(\"max-height\");\n }\n headerCompWrapper.classList.toggle(\"ag-header-cell-comp-wrapper-limited-height\", value != null);\n },\n setUserCompDetails: (compDetails) => setUserCompDetails(compDetails),\n setResizableDisplayed: (displayed) => {\n setResizableCssClasses((prev) => prev.setClass(\"ag-hidden\", !displayed));\n setResizableAriaHidden(!displayed ? \"true\" : \"false\");\n },\n setAriaExpanded: (expanded) => setAriaExpanded(expanded),\n getUserCompInstance: () => userCompRef.current || void 0\n };\n ctrl.setComp(compProxy, eRef, eResize.current, eHeaderCompWrapper.current, compBean.current);\n }, []);\n useLayoutEffect4(() => showJsComp(userCompDetails, context, eHeaderCompWrapper.current), [userCompDetails]);\n useEffect4(() => {\n if (eGui.current) {\n ctrl.setDragSource(eGui.current);\n }\n }, [userCompDetails]);\n const userCompStateless = useMemo4(() => {\n const res = userCompDetails?.componentFromFramework && isComponentStateless(userCompDetails.componentClass);\n return !!res;\n }, [userCompDetails]);\n const className = useMemo4(() => \"ag-header-group-cell \" + cssClasses.toString(), [cssClasses]);\n const resizableClassName = useMemo4(\n () => \"ag-header-cell-resize \" + cssResizableClasses.toString(),\n [cssResizableClasses]\n );\n const reactUserComp = userCompDetails?.componentFromFramework;\n const UserCompClass = userCompDetails?.componentClass;\n return /* @__PURE__ */ React8.createElement(\"div\", { ref: setRef2, style: userStyles, className, role: \"columnheader\", \"aria-expanded\": ariaExpanded }, /* @__PURE__ */ React8.createElement(\"div\", { ref: eHeaderCompWrapper, className: \"ag-header-cell-comp-wrapper\", role: \"presentation\" }, reactUserComp ? userCompStateless ? /* @__PURE__ */ React8.createElement(UserCompClass, { ...userCompDetails.params }) : /* @__PURE__ */ React8.createElement(UserCompClass, { ...userCompDetails.params, ref: userCompRef }) : null), /* @__PURE__ */ React8.createElement(\"div\", { ref: eResize, \"aria-hidden\": resizableAriaHidden, className: resizableClassName }));\n};\nvar headerGroupCellComp_default = memo4(HeaderGroupCellComp);\n\n// packages/ag-grid-react/src/reactUi/header/headerRowComp.tsx\nvar HeaderRowComp = ({ ctrl }) => {\n const { gos, context } = useContext6(BeansContext);\n const { topOffset, rowHeight } = useMemo5(() => ctrl.getTopAndHeight(), []);\n const tabIndex = useMemo5(() => gos.get(\"tabIndex\"), []);\n const [ariaRowIndex, setAriaRowIndex] = useState6(() => ctrl.getAriaRowIndex());\n const className = ctrl.headerRowClass;\n const [height, setHeight] = useState6(() => rowHeight + \"px\");\n const [top, setTop] = useState6(() => topOffset + \"px\");\n const cellCtrlsRef = useRef6(null);\n const [cellCtrls, setCellCtrls] = useState6(() => ctrl.getUpdatedHeaderCtrls());\n const compBean = useRef6();\n const eGui = useRef6(null);\n const setRef2 = useCallback5((eRef) => {\n eGui.current = eRef;\n if (!eRef || !ctrl.isAlive() || context.isDestroyed()) {\n compBean.current = context.destroyBean(compBean.current);\n return;\n }\n compBean.current = context.createBean(new _EmptyBean4());\n const compProxy = {\n setHeight: (height2) => setHeight(height2),\n setTop: (top2) => setTop(top2),\n setHeaderCtrls: (ctrls, forceOrder, afterScroll) => {\n const prevCellCtrls = cellCtrlsRef.current;\n const nextCells = getNextValueIfDifferent(prevCellCtrls, ctrls, forceOrder);\n if (nextCells !== prevCellCtrls) {\n cellCtrlsRef.current = nextCells;\n agFlushSync(afterScroll, () => setCellCtrls(nextCells));\n }\n },\n setWidth: (width) => {\n if (eGui.current) {\n eGui.current.style.width = width;\n }\n },\n setRowIndex: (rowIndex) => {\n setAriaRowIndex(rowIndex);\n }\n };\n ctrl.setComp(compProxy, compBean.current, false);\n }, []);\n const style = useMemo5(\n () => ({\n height,\n top\n }),\n [height, top]\n );\n const createCellJsx = useCallback5((cellCtrl) => {\n switch (ctrl.type) {\n case \"group\":\n return /* @__PURE__ */ React9.createElement(headerGroupCellComp_default, { ctrl: cellCtrl, key: cellCtrl.instanceId });\n case \"filter\":\n return /* @__PURE__ */ React9.createElement(headerFilterCellComp_default, { ctrl: cellCtrl, key: cellCtrl.instanceId });\n default:\n return /* @__PURE__ */ React9.createElement(headerCellComp_default, { ctrl: cellCtrl, key: cellCtrl.instanceId });\n }\n }, []);\n return /* @__PURE__ */ React9.createElement(\n \"div\",\n {\n ref: setRef2,\n className,\n role: \"row\",\n style,\n tabIndex,\n \"aria-rowindex\": ariaRowIndex\n },\n cellCtrls.map(createCellJsx)\n );\n};\nvar headerRowComp_default = memo5(HeaderRowComp);\n\n// packages/ag-grid-react/src/reactUi/header/headerRowContainerComp.tsx\nvar HeaderRowContainerComp = ({ pinned }) => {\n const [displayed, setDisplayed] = useState7(true);\n const [headerRowCtrls, setHeaderRowCtrls] = useState7([]);\n const { context } = useContext7(BeansContext);\n const eGui = useRef7(null);\n const eCenterContainer = useRef7(null);\n const headerRowCtrlRef = useRef7();\n const pinnedLeft = pinned === \"left\";\n const pinnedRight = pinned === \"right\";\n const centre = !pinnedLeft && !pinnedRight;\n const setRef2 = useCallback6((eRef) => {\n eGui.current = eRef;\n if (!eRef || context.isDestroyed()) {\n headerRowCtrlRef.current = context.destroyBean(headerRowCtrlRef.current);\n return;\n }\n headerRowCtrlRef.current = context.createBean(new HeaderRowContainerCtrl(pinned));\n const compProxy = {\n setDisplayed,\n setCtrls: (ctrls) => setHeaderRowCtrls(ctrls),\n // centre only\n setCenterWidth: (width) => {\n if (eCenterContainer.current) {\n eCenterContainer.current.style.width = width;\n }\n },\n setViewportScrollLeft: (left) => {\n if (eGui.current) {\n eGui.current.scrollLeft = left;\n }\n },\n // pinned only\n setPinnedContainerWidth: (width) => {\n if (eGui.current) {\n eGui.current.style.width = width;\n eGui.current.style.minWidth = width;\n eGui.current.style.maxWidth = width;\n }\n }\n };\n headerRowCtrlRef.current.setComp(compProxy, eGui.current);\n }, []);\n const className = !displayed ? \"ag-hidden\" : \"\";\n const insertRowsJsx = () => headerRowCtrls.map((ctrl) => /* @__PURE__ */ React10.createElement(headerRowComp_default, { ctrl, key: ctrl.instanceId }));\n return pinnedLeft ? /* @__PURE__ */ React10.createElement(\"div\", { ref: setRef2, className: \"ag-pinned-left-header \" + className, \"aria-hidden\": !displayed, role: \"rowgroup\" }, insertRowsJsx()) : pinnedRight ? /* @__PURE__ */ React10.createElement(\"div\", { ref: setRef2, className: \"ag-pinned-right-header \" + className, \"aria-hidden\": !displayed, role: \"rowgroup\" }, insertRowsJsx()) : centre ? /* @__PURE__ */ React10.createElement(\"div\", { ref: setRef2, className: \"ag-header-viewport \" + className, role: \"rowgroup\", tabIndex: -1 }, /* @__PURE__ */ React10.createElement(\"div\", { ref: eCenterContainer, className: \"ag-header-container\", role: \"presentation\" }, insertRowsJsx())) : null;\n};\nvar headerRowContainerComp_default = memo6(HeaderRowContainerComp);\n\n// packages/ag-grid-react/src/reactUi/header/gridHeaderComp.tsx\nvar GridHeaderComp = () => {\n const [cssClasses, setCssClasses] = useState8(() => new CssClasses());\n const [height, setHeight] = useState8();\n const { context } = useContext8(BeansContext);\n const eGui = useRef8(null);\n const gridCtrlRef = useRef8();\n const setRef2 = useCallback7((eRef) => {\n eGui.current = eRef;\n if (!eRef || context.isDestroyed()) {\n gridCtrlRef.current = context.destroyBean(gridCtrlRef.current);\n return;\n }\n gridCtrlRef.current = context.createBean(new GridHeaderCtrl());\n const compProxy = {\n toggleCss: (name, on) => setCssClasses((prev) => prev.setClass(name, on)),\n setHeightAndMinHeight: (height2) => setHeight(height2)\n };\n gridCtrlRef.current.setComp(compProxy, eRef, eRef);\n }, []);\n const className = useMemo6(() => {\n const res = cssClasses.toString();\n return \"ag-header \" + res;\n }, [cssClasses]);\n const style = useMemo6(\n () => ({\n height,\n minHeight: height\n }),\n [height]\n );\n return /* @__PURE__ */ React11.createElement(\"div\", { ref: setRef2, className, style, role: \"presentation\" }, /* @__PURE__ */ React11.createElement(headerRowContainerComp_default, { pinned: \"left\" }), /* @__PURE__ */ React11.createElement(headerRowContainerComp_default, { pinned: null }), /* @__PURE__ */ React11.createElement(headerRowContainerComp_default, { pinned: \"right\" }));\n};\nvar gridHeaderComp_default = memo7(GridHeaderComp);\n\n// packages/ag-grid-react/src/reactUi/reactComment.tsx\nimport { useEffect as useEffect5 } from \"react\";\nvar useReactCommentEffect = (comment, eForCommentRef) => {\n useEffect5(() => {\n const eForComment = eForCommentRef.current;\n if (eForComment) {\n const eParent = eForComment.parentElement;\n if (eParent) {\n const eComment = document.createComment(comment);\n eParent.insertBefore(eComment, eForComment);\n return () => {\n eComment.remove();\n };\n }\n }\n }, [comment]);\n};\nvar reactComment_default = useReactCommentEffect;\n\n// packages/ag-grid-react/src/reactUi/rows/rowContainerComp.tsx\nimport React16, { memo as memo11, useCallback as useCallback11, useContext as useContext13, useMemo as useMemo10, useRef as useRef13, useState as useState13 } from \"react\";\nimport {\n RowContainerCtrl,\n _getRowContainerClass,\n _getRowContainerOptions,\n _getRowSpanContainerClass,\n _getRowViewportClass\n} from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/reactUi/rows/rowComp.tsx\nimport React15, { memo as memo10, useCallback as useCallback10, useContext as useContext12, useEffect as useEffect8, useLayoutEffect as useLayoutEffect7, useMemo as useMemo9, useRef as useRef12, useState as useState12 } from \"react\";\nimport { CssClassManager as CssClassManager3, _EmptyBean as _EmptyBean6 } from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/reactUi/cells/cellComp.tsx\nimport React14, { Suspense, memo as memo9, useCallback as useCallback9, useContext as useContext11, useLayoutEffect as useLayoutEffect6, useMemo as useMemo8, useRef as useRef11, useState as useState11 } from \"react\";\nimport { CssClassManager as CssClassManager2, _EmptyBean as _EmptyBean5, _removeFromParent } from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/shared/customComp/cellEditorComponentProxy.ts\nimport { AgPromise as AgPromise8 } from \"ag-grid-community\";\nvar CellEditorComponentProxy = class {\n constructor(cellEditorParams, refreshProps) {\n this.cellEditorParams = cellEditorParams;\n this.refreshProps = refreshProps;\n this.instanceCreated = new AgPromise8((resolve) => {\n this.resolveInstanceCreated = resolve;\n });\n this.onValueChange = (value) => this.updateValue(value);\n this.value = cellEditorParams.value;\n }\n getProps() {\n return {\n ...this.cellEditorParams,\n initialValue: this.cellEditorParams.value,\n value: this.value,\n onValueChange: this.onValueChange\n };\n }\n getValue() {\n return this.value;\n }\n refresh(params) {\n this.cellEditorParams = params;\n this.refreshProps();\n }\n setMethods(methods) {\n addOptionalMethods(this.getOptionalMethods(), methods, this);\n }\n getInstance() {\n return this.instanceCreated.then(() => this.componentInstance);\n }\n setRef(componentInstance) {\n this.componentInstance = componentInstance;\n this.resolveInstanceCreated?.();\n this.resolveInstanceCreated = void 0;\n }\n getOptionalMethods() {\n return [\n \"isCancelBeforeStart\",\n \"isCancelAfterEnd\",\n \"focusIn\",\n \"focusOut\",\n \"afterGuiAttached\",\n \"getValidationErrors\",\n \"getValidationElement\"\n ];\n }\n updateValue(value) {\n this.value = value;\n this.refreshProps();\n }\n};\n\n// packages/ag-grid-react/src/reactUi/cells/cellEditorComp.tsx\nimport React12 from \"react\";\n\n// packages/ag-grid-react/src/reactUi/cells/popupEditorComp.tsx\nimport { memo as memo8, useContext as useContext9, useLayoutEffect as useLayoutEffect5, useState as useState10 } from \"react\";\nimport { createPortal as createPortal2 } from \"react-dom\";\nimport { _getActiveDomElement } from \"ag-grid-community\";\n\n// packages/ag-grid-react/src/reactUi/useEffectOnce.tsx\nimport { useEffect as useEffect6, useRef as useRef9, useState as useState9 } from \"react\";\nvar useEffectOnce = (effect) => {\n const effectFn = useRef9(effect);\n const destroyFn = useRef9();\n const effectCalled = useRef9(false);\n const rendered = useRef9(false);\n const [, setVal] = useState9(0);\n if (effectCalled.current) {\n rendered.current = true;\n }\n useEffect6(() => {\n if (!effectCalled.current) {\n destroyFn.current = effectFn.current();\n effectCalled.current = true;\n }\n setVal((val) => val + 1);\n return () => {\n if (!rendered.current) {\n return;\n }\n destroyFn.current?.();\n };\n }, []);\n};\n\n// packages/ag-grid-react/src/reactUi/cells/popupEditorComp.tsx\nvar PopupEditorComp = (props) => {\n const [popupEditorWrapper, setPopupEditorWrapper] = useState10();\n const beans = useContext9(BeansContext);\n const { context, popupSvc, gos, editSvc } = beans;\n const { editDetails, cellCtrl, eParentCell } = props;\n useEffectOnce(() => {\n const { compDetails } = editDetails;\n const useModelPopup = gos.get(\"stopEditingWhenCellsLoseFocus\");\n let hideEditorPopup = void 0;\n let wrapper;\n if (!context.isDestroyed()) {\n wrapper = context.createBean(editSvc.createPopupEditorWrapper(compDetails.params));\n const ePopupGui = wrapper.getGui();\n if (props.jsChildComp) {\n const eChildGui = props.jsChildComp.getGui();\n if (eChildGui) {\n ePopupGui.appendChild(eChildGui);\n }\n }\n const { column, rowNode } = cellCtrl;\n const positionParams = {\n column,\n rowNode,\n type: \"popupCellEditor\",\n eventSource: eParentCell,\n ePopup: ePopupGui,\n position: editDetails.popupPosition,\n keepWithinBounds: true\n };\n const positionCallback = popupSvc?.positionPopupByComponent.bind(popupSvc, positionParams);\n const addPopupRes = popupSvc?.addPopup({\n modal: useModelPopup,\n eChild: ePopupGui,\n closeOnEsc: true,\n closedCallback: (e) => {\n cellCtrl.onPopupEditorClosed(e);\n },\n anchorToElement: eParentCell,\n positionCallback,\n ariaOwns: eParentCell\n });\n hideEditorPopup = addPopupRes ? addPopupRes.hideFunc : void 0;\n setPopupEditorWrapper(wrapper);\n props.jsChildComp?.afterGuiAttached?.();\n }\n return () => {\n hideEditorPopup?.();\n context.destroyBean(wrapper);\n };\n });\n useLayoutEffect5(() => {\n return () => {\n if (cellCtrl.isCellFocused() && popupEditorWrapper?.getGui().contains(_getActiveDomElement(beans))) {\n eParentCell.focus({ preventScroll: true });\n }\n };\n }, [popupEditorWrapper]);\n return popupEditorWrapper && props.wrappedContent ? createPortal2(props.wrappedContent, popupEditorWrapper.getGui()) : null;\n};\nvar popupEditorComp_default = memo8(PopupEditorComp);\n\n// packages/ag-grid-react/src/reactUi/cells/cellEditorComp.tsx\nvar jsxEditorProxy = (editDetails, CellEditorClass, setRef2) => {\n const { compProxy } = editDetails;\n setRef2(compProxy);\n const props = compProxy.getProps();\n const isStateless = isComponentStateless(CellEditorClass);\n return /* @__PURE__ */ React12.createElement(\n CustomContext.Provider,\n {\n value: {\n setMethods: (methods) => compProxy.setMethods(methods)\n }\n },\n isStateless ? /* @__PURE__ */ React12.createElement(CellEditorClass, { ...props }) : /* @__PURE__ */ React12.createElement(CellEditorClass, { ...props, ref: (ref) => compProxy.setRef(ref) })\n );\n};\nvar jsxEditor = (editDetails, CellEditorClass, setRef2) => {\n const newFormat = editDetails.compProxy;\n return newFormat ? jsxEditorProxy(editDetails, CellEditorClass, setRef2) : /* @__PURE__ */ React12.createElement(CellEditorClass, { ...editDetails.compDetails.params, ref: setRef2 });\n};\nvar jsxEditValue = (editDetails, setCellEditorRef, eGui, cellCtrl, jsEditorComp) => {\n const compDetails = editDetails.compDetails;\n const CellEditorClass = compDetails.componentClass;\n const reactInlineEditor = compDetails.componentFromFramework && !editDetails.popup;\n const reactPopupEditor = compDetails.componentFromFramework && editDetails.popup;\n const jsPopupEditor = !compDetails.componentFromFramework && editDetails.popup;\n return reactInlineEditor ? jsxEditor(editDetails, CellEditorClass, setCellEditorRef) : reactPopupEditor ? /* @__PURE__ */ React12.createElement(\n popupEditorComp_default,\n {\n editDetails,\n cellCtrl,\n eParentCell: eGui,\n wrappedContent: jsxEditor(editDetails, CellEditorClass, setCellEditorRef)\n }\n ) : jsPopupEditor && jsEditorComp ? /* @__PURE__ */ React12.createElement(popupEditorComp_default, { editDetails, cellCtrl, eParentCell: eGui, jsChildComp: jsEditorComp }) : null;\n};\n\n// packages/ag-grid-react/src/reactUi/cells/showJsRenderer.tsx\nimport { useCallback as useCallback8, useContext as useContext10, useEffect as useEffect7 } from \"react\";\nvar useJsCellRenderer = (showDetails, showTools, eCellValue, cellValueVersion, jsCellRendererRef, eGui, suppressInlineEditRenderer = false) => {\n const { context } = useContext10(BeansContext);\n const destroyCellRenderer = useCallback8(() => {\n const comp = jsCellRendererRef.current;\n if (!comp) {\n return;\n }\n const compGui = comp.getGui();\n if (compGui && compGui.parentElement) {\n compGui.remove();\n }\n context.destroyBean(comp);\n jsCellRendererRef.current = void 0;\n }, []);\n useEffect7(() => {\n const showValue = showDetails != null && !suppressInlineEditRenderer;\n const jsCompDetails = showDetails?.compDetails && !showDetails.compDetails.componentFromFramework;\n const waitingForToolsSetup = showTools && eCellValue == null;\n const showComp = showValue && jsCompDetails && !waitingForToolsSetup;\n if (!showComp) {\n destroyCellRenderer();\n return;\n }\n const compDetails = showDetails.compDetails;\n if (jsCellRendererRef.current) {\n const comp = jsCellRendererRef.current;\n const attemptRefresh = comp.refresh != null && showDetails.force == false;\n const refreshResult = attemptRefresh ? comp.refresh(compDetails.params) : false;\n const refreshWorked = refreshResult === true || refreshResult === void 0;\n if (refreshWorked) {\n return;\n }\n destroyCellRenderer();\n }\n const promise = compDetails.newAgStackInstance();\n promise.then((comp) => {\n if (!comp) {\n return;\n }\n const compGui = comp.getGui();\n if (!compGui) {\n return;\n }\n const parent = showTools ? eCellValue : eGui.current;\n parent.appendChild(compGui);\n jsCellRendererRef.current = comp;\n });\n }, [showDetails, showTools, cellValueVersion, suppressInlineEditRenderer]);\n useEffect7(() => {\n return destroyCellRenderer;\n }, []);\n};\nvar showJsRenderer_default = useJsCellRenderer;\n\n// packages/ag-grid-react/src/reactUi/cells/skeletonCellComp.tsx\nimport React13, { useMemo as useMemo7, useRef as useRef10 } from \"react\";\nvar SkeletonCellRenderer = ({\n cellCtrl,\n parent\n}) => {\n const jsCellRendererRef = useRef10();\n const renderDetails = useMemo7(() => {\n const { loadingComp } = cellCtrl.getDeferLoadingCellRenderer();\n return loadingComp ? {\n value: void 0,\n compDetails: loadingComp,\n force: false\n } : void 0;\n }, [cellCtrl]);\n showJsRenderer_default(renderDetails, false, void 0, 1, jsCellRendererRef, parent);\n if (renderDetails?.compDetails?.componentFromFramework) {\n const CellRendererClass = renderDetails.compDetails.componentClass;\n return /* @__PURE__ */ React13.createElement(CellRendererClass, { ...renderDetails.compDetails.params });\n }\n return /* @__PURE__ */ React13.createElement(React13.Fragment, null);\n};\n\n// packages/ag-grid-react/src/reactUi/cells/cellComp.tsx\nvar CellComp = ({\n cellCtrl,\n printLayout,\n editingCell\n}) => {\n const beans = useContext11(BeansContext);\n const { context } = beans;\n const {\n column: { colIdSanitised },\n instanceId\n } = cellCtrl;\n const compBean = useRef11();\n const [renderDetails, setRenderDetails] = useState11(\n () => cellCtrl.isCellRenderer() ? void 0 : { compDetails: void 0, value: cellCtrl.getValueToDisplay(), force: false }\n );\n const [editDetails, setEditDetails] = useState11();\n const [renderKey, setRenderKey] = useState11(1);\n const [userStyles, setUserStyles] = useState11();\n const [includeSelection, setIncludeSelection] = useState11(false);\n const [includeRowDrag, setIncludeRowDrag] = useState11(false);\n const [includeDndSource, setIncludeDndSource] = useState11(false);\n const rowResizerElement = useRef11(null);\n const [jsEditorComp, setJsEditorComp] = useState11();\n const forceWrapper = useMemo8(() => cellCtrl.isForceWrapper(), [cellCtrl]);\n const cellAriaRole = useMemo8(() => cellCtrl.getCellAriaRole(), [cellCtrl]);\n const eGui = useRef11(null);\n const eWrapper = useRef11(null);\n const cellRendererRef = useRef11(null);\n const jsCellRendererRef = useRef11();\n const cellEditorRef = useRef11();\n const eCellWrapper = useRef11();\n const cellWrapperDestroyFuncs = useRef11([]);\n const rowDragCompRef = useRef11();\n const eCellValue = useRef11();\n const [cellValueVersion, setCellValueVersion] = useState11(0);\n const setCellValueRef = useCallback9((ref) => {\n eCellValue.current = ref;\n setCellValueVersion((v) => v + 1);\n }, []);\n const showTools = renderDetails != null && (includeSelection || includeDndSource || includeRowDrag) && (editDetails == null || !!editDetails.popup);\n const showCellWrapper = forceWrapper || showTools;\n const cellValueClass = useMemo8(() => {\n return cellCtrl.getCellValueClass();\n }, [cellCtrl]);\n const setCellEditorRef = useCallback9(\n (cellEditor) => {\n cellEditorRef.current = cellEditor;\n if (cellEditor) {\n const editingCancelledByUserComp = cellEditor.isCancelBeforeStart && cellEditor.isCancelBeforeStart();\n setTimeout(() => {\n if (editingCancelledByUserComp) {\n cellCtrl.stopEditing(true);\n cellCtrl.focusCell(true);\n } else {\n cellCtrl.cellEditorAttached();\n cellCtrl.enableEditorTooltipFeature(cellEditor);\n }\n });\n }\n },\n [cellCtrl]\n );\n const cssManager = useRef11();\n if (!cssManager.current) {\n cssManager.current = new CssClassManager2(() => eGui.current);\n }\n const suppressJsRenderer = !!editDetails && !editDetails.popup;\n showJsRenderer_default(\n renderDetails,\n showCellWrapper,\n eCellValue.current,\n cellValueVersion,\n jsCellRendererRef,\n eGui,\n suppressJsRenderer\n );\n const lastRenderDetails = useRef11();\n useLayoutEffect6(() => {\n const oldDetails = lastRenderDetails.current;\n const newDetails = renderDetails;\n lastRenderDetails.current = renderDetails;\n if (oldDetails == null || oldDetails.compDetails == null || newDetails == null || newDetails.compDetails == null) {\n return;\n }\n rowDragCompRef.current?.refreshVisibility();\n const oldCompDetails = oldDetails.compDetails;\n const newCompDetails = newDetails.compDetails;\n if (oldCompDetails.componentClass != newCompDetails.componentClass) {\n return;\n }\n if (cellRendererRef.current?.refresh == null) {\n return;\n }\n const result = cellRendererRef.current.refresh(newCompDetails.params);\n if (result != true) {\n setRenderKey((prev) => prev + 1);\n }\n }, [renderDetails]);\n useLayoutEffect6(() => {\n const doingJsEditor = editDetails && !editDetails.compDetails.componentFromFramework;\n if (!doingJsEditor || context.isDestroyed()) {\n return;\n }\n const compDetails = editDetails.compDetails;\n const isPopup = editDetails.popup === true;\n const cellEditorPromise = compDetails.newAgStackInstance();\n cellEditorPromise.then((cellEditor) => {\n if (!cellEditor) {\n return;\n }\n const compGui = cellEditor.getGui();\n setCellEditorRef(cellEditor);\n if (!isPopup) {\n const parentEl = (forceWrapper ? eCellWrapper : eGui).current;\n parentEl?.appendChild(compGui);\n cellEditor.afterGuiAttached?.();\n }\n setJsEditorComp(cellEditor);\n });\n return () => {\n cellEditorPromise.then((cellEditor) => {\n const compGui = cellEditor.getGui();\n cellCtrl.disableEditorTooltipFeature();\n context.destroyBean(cellEditor);\n setCellEditorRef(void 0);\n setJsEditorComp(void 0);\n compGui?.remove();\n });\n };\n }, [editDetails]);\n const setCellWrapperRef = useCallback9(\n (eRef) => {\n eCellWrapper.current = eRef;\n if (!eRef || context.isDestroyed() || !cellCtrl.isAlive()) {\n const callbacks = cellWrapperDestroyFuncs.current;\n cellWrapperDestroyFuncs.current = [];\n for (const cb of callbacks) {\n cb();\n }\n return;\n }\n let rowDragComp;\n const addComp = (comp) => {\n if (comp) {\n eRef.insertAdjacentElement(\"afterbegin\", comp.getGui());\n cellWrapperDestroyFuncs.current.push(() => {\n _removeFromParent(comp.getGui());\n context.destroyBean(comp);\n if (rowDragCompRef.current === rowDragComp) {\n rowDragCompRef.current = void 0;\n }\n });\n }\n };\n if (includeSelection) {\n addComp(cellCtrl.createSelectionCheckbox());\n }\n if (includeDndSource) {\n addComp(cellCtrl.createDndSource());\n }\n if (includeRowDrag) {\n rowDragComp = cellCtrl.createRowDragComp();\n rowDragCompRef.current = rowDragComp;\n if (rowDragComp) {\n addComp(rowDragComp);\n rowDragComp.refreshVisibility();\n }\n }\n },\n [cellCtrl, context, includeDndSource, includeRowDrag, includeSelection]\n );\n const init = useCallback9(() => {\n const spanReady = !cellCtrl.isCellSpanning() || eWrapper.current;\n const eRef = eGui.current;\n if (!eRef || !spanReady || !cellCtrl || !cellCtrl.isAlive() || context.isDestroyed()) {\n compBean.current = context.destroyBean(compBean.current);\n return;\n }\n compBean.current = context.createBean(new _EmptyBean5());\n const compProxy = {\n toggleCss: (name, on) => cssManager.current.toggleCss(name, on),\n setUserStyles: (styles) => setUserStyles(styles),\n getFocusableElement: () => eGui.current,\n setIncludeSelection: (include) => setIncludeSelection(include),\n setIncludeRowDrag: (include) => setIncludeRowDrag(include),\n setIncludeDndSource: (include) => setIncludeDndSource(include),\n setRowResizerElement: (element) => {\n if (rowResizerElement.current) {\n _removeFromParent(rowResizerElement.current);\n }\n rowResizerElement.current = element;\n if (element && eGui.current) {\n eGui.current.appendChild(element);\n }\n },\n getCellEditor: () => cellEditorRef.current ?? null,\n getCellRenderer: () => cellRendererRef.current ?? jsCellRendererRef.current,\n getParentOfValue: () => eCellValue.current ?? eCellWrapper.current ?? eGui.current,\n setRenderDetails: (compDetails, value, force) => {\n const setDetails = () => {\n setRenderDetails((prev) => {\n if (prev?.compDetails !== compDetails || prev?.value !== value || prev?.force !== force) {\n return {\n value,\n compDetails,\n force\n };\n } else {\n return prev;\n }\n });\n };\n if (compDetails?.params?.deferRender && !cellCtrl.rowNode.group) {\n const { loadingComp, onReady } = cellCtrl.getDeferLoadingCellRenderer();\n if (loadingComp) {\n setRenderDetails({\n value: void 0,\n compDetails: loadingComp,\n force: false\n });\n onReady.then(() => agStartTransition(setDetails));\n return;\n }\n }\n setDetails();\n },\n setEditDetails: (compDetails, popup, popupPosition, reactiveCustomComponents) => {\n if (compDetails) {\n let compProxy2 = void 0;\n if (compDetails.componentFromFramework) {\n if (reactiveCustomComponents) {\n compProxy2 = new CellEditorComponentProxy(\n compDetails.params,\n () => setRenderKey((prev) => prev + 1)\n );\n } else {\n warnReactiveCustomComponents();\n }\n }\n setEditDetails({\n compDetails,\n popup,\n popupPosition,\n compProxy: compProxy2\n });\n if (!popup) {\n setRenderDetails(void 0);\n }\n } else {\n const recoverFocus = cellCtrl.hasBrowserFocus();\n if (recoverFocus) {\n compProxy.getFocusableElement().focus({ preventScroll: true });\n }\n cellEditorRef.current = void 0;\n setEditDetails(void 0);\n }\n },\n refreshEditStyles: (editing, isPopup) => {\n if (!eGui.current) {\n return;\n }\n const { current } = cssManager;\n current.toggleCss(\"ag-cell-value\", !showCellWrapper);\n current.toggleCss(\"ag-cell-inline-editing\", !!editing && !isPopup);\n current.toggleCss(\"ag-cell-popup-editing\", !!editing && !!isPopup);\n current.toggleCss(\"ag-cell-not-inline-editing\", !editing || !!isPopup);\n }\n };\n const cellWrapperOrUndefined = eCellWrapper.current || void 0;\n cellCtrl.setComp(\n compProxy,\n eRef,\n eWrapper.current ?? void 0,\n cellWrapperOrUndefined,\n printLayout,\n editingCell,\n compBean.current\n );\n }, []);\n const setGuiRef = useCallback9((ref) => {\n eGui.current = ref;\n init();\n }, []);\n const setWrapperRef = useCallback9((ref) => {\n eWrapper.current = ref;\n init();\n }, []);\n const reactCellRendererStateless = useMemo8(() => {\n const res = renderDetails?.compDetails?.componentFromFramework && isComponentStateless(renderDetails.compDetails.componentClass);\n return !!res;\n }, [renderDetails]);\n useLayoutEffect6(() => {\n if (!eGui.current) {\n return;\n }\n const { current } = cssManager;\n current.toggleCss(\"ag-cell-value\", !showCellWrapper);\n current.toggleCss(\"ag-cell-inline-editing\", !!editDetails && !editDetails.popup);\n current.toggleCss(\"ag-cell-popup-editing\", !!editDetails && !!editDetails.popup);\n current.toggleCss(\"ag-cell-not-inline-editing\", !editDetails || !!editDetails.popup);\n });\n const valueOrCellComp = () => {\n const { compDetails, value } = renderDetails;\n if (!compDetails) {\n return value?.toString?.() ?? value;\n }\n if (compDetails.componentFromFramework) {\n const CellRendererClass = compDetails.componentClass;\n return /* @__PURE__ */ React14.createElement(Suspense, { fallback: /* @__PURE__ */ React14.createElement(SkeletonCellRenderer, { cellCtrl, parent: eGui }) }, reactCellRendererStateless ? /* @__PURE__ */ React14.createElement(CellRendererClass, { ...compDetails.params, key: renderKey }) : /* @__PURE__ */ React14.createElement(CellRendererClass, { ...compDetails.params, key: renderKey, ref: cellRendererRef }));\n }\n };\n const showCellOrEditor = () => {\n const showCellValue = () => {\n if (renderDetails == null) {\n return null;\n }\n return showCellWrapper ? /* @__PURE__ */ React14.createElement(\"span\", { role: \"presentation\", id: `cell-${instanceId}`, className: cellValueClass, ref: setCellValueRef }, valueOrCellComp()) : valueOrCellComp();\n };\n const showEditValue = (details) => jsxEditValue(details, setCellEditorRef, eGui.current, cellCtrl, jsEditorComp);\n if (editDetails != null) {\n if (editDetails.popup) {\n return /* @__PURE__ */ React14.createElement(React14.Fragment, null, showCellValue(), showEditValue(editDetails));\n }\n return showEditValue(editDetails);\n }\n return showCellValue();\n };\n const renderCell = () => /* @__PURE__ */ React14.createElement(\"div\", { ref: setGuiRef, style: userStyles, role: cellAriaRole, \"col-id\": colIdSanitised }, showCellWrapper ? /* @__PURE__ */ React14.createElement(\"div\", { className: \"ag-cell-wrapper\", role: \"presentation\", ref: setCellWrapperRef }, showCellOrEditor()) : showCellOrEditor());\n if (cellCtrl.isCellSpanning()) {\n return /* @__PURE__ */ React14.createElement(\"div\", { ref: setWrapperRef, className: \"ag-spanned-cell-wrapper\", role: \"presentation\" }, renderCell());\n }\n return renderCell();\n};\nvar cellComp_default = memo9(CellComp);\n\n// packages/ag-grid-react/src/reactUi/rows/rowComp.tsx\nvar RowComp = ({ rowCtrl, containerType }) => {\n const { context, gos, editSvc } = useContext12(BeansContext);\n const enableUses = useContext12(RenderModeContext) === \"default\";\n const compBean = useRef12();\n const domOrderRef = useRef12(rowCtrl.getDomOrder());\n const isFullWidth = rowCtrl.isFullWidth();\n const isDisplayed = rowCtrl.rowNode.displayed;\n const [rowIndex, setRowIndex] = useState12(\n () => isDisplayed ? rowCtrl.rowNode.getRowIndexString() : null\n );\n const [rowId, setRowId] = useState12(() => rowCtrl.rowId);\n const [rowBusinessKey, setRowBusinessKey] = useState12(() => rowCtrl.businessKey);\n const [userStyles, setUserStyles] = useState12(() => rowCtrl.rowStyles);\n const cellCtrlsRef = useRef12(null);\n const [cellCtrlsFlushSync, setCellCtrlsFlushSync] = useState12(() => null);\n const [fullWidthCompDetails, setFullWidthCompDetails] = useState12();\n const [top, setTop] = useState12(\n () => isDisplayed ? rowCtrl.getInitialRowTop(containerType) : void 0\n );\n const [transform, setTransform] = useState12(\n () => isDisplayed ? rowCtrl.getInitialTransform(containerType) : void 0\n );\n const eGui = useRef12(null);\n const fullWidthCompRef = useRef12();\n const fullWidthParamsRef = useRef12();\n const autoHeightSetup = useRef12(false);\n const [autoHeightSetupAttempt, setAutoHeightSetupAttempt] = useState12(0);\n useEffect8(() => {\n if (autoHeightSetup.current || !fullWidthCompDetails || autoHeightSetupAttempt > 10) {\n return;\n }\n const eChild = eGui.current?.firstChild;\n if (eChild) {\n rowCtrl.setupDetailRowAutoHeight(eChild);\n autoHeightSetup.current = true;\n } else {\n setAutoHeightSetupAttempt((prev) => prev + 1);\n }\n }, [fullWidthCompDetails, autoHeightSetupAttempt]);\n const cssManager = useRef12();\n if (!cssManager.current) {\n cssManager.current = new CssClassManager3(() => eGui.current);\n }\n const cellsChanged = useRef12(() => {\n });\n const sub = useCallback10((onStoreChange) => {\n cellsChanged.current = onStoreChange;\n return () => {\n cellsChanged.current = () => {\n };\n };\n }, []);\n const cellCtrlsUses = agUseSyncExternalStore(\n sub,\n () => {\n return cellCtrlsRef.current;\n },\n []\n );\n const cellCtrlsMerged = enableUses ? cellCtrlsUses : cellCtrlsFlushSync;\n const setRef2 = useCallback10((eRef) => {\n eGui.current = eRef;\n compBean.current = eRef ? context.createBean(new _EmptyBean6()) : context.destroyBean(compBean.current);\n if (!eRef) {\n rowCtrl.unsetComp(containerType);\n return;\n }\n if (!rowCtrl.isAlive() || context.isDestroyed()) {\n return;\n }\n const compProxy = {\n // the rowTop is managed by state, instead of direct style manipulation by rowCtrl (like all the other styles)\n // as we need to have an initial value when it's placed into he DOM for the first time, for animation to work.\n setTop,\n setTransform,\n // i found using React for managing classes at the row level was to slow, as modifying classes caused a lot of\n // React code to execute, so avoiding React for managing CSS Classes made the grid go much faster.\n toggleCss: (name, on) => cssManager.current.toggleCss(name, on),\n setDomOrder: (domOrder) => domOrderRef.current = domOrder,\n setRowIndex,\n setRowId,\n setRowBusinessKey,\n setUserStyles,\n // if we don't maintain the order, then cols will be ripped out and into the dom\n // when cols reordered, which would stop the CSS transitions from working\n setCellCtrls: (next, useFlushSync) => {\n const prevCellCtrls = cellCtrlsRef.current;\n const nextCells = getNextValueIfDifferent(prevCellCtrls, next, domOrderRef.current);\n if (nextCells !== prevCellCtrls) {\n cellCtrlsRef.current = nextCells;\n if (enableUses) {\n cellsChanged.current();\n } else {\n agFlushSync(useFlushSync, () => setCellCtrlsFlushSync(nextCells));\n }\n }\n },\n showFullWidth: (compDetails) => {\n fullWidthParamsRef.current = compDetails.params;\n setFullWidthCompDetails(compDetails);\n },\n getFullWidthCellRenderer: () => fullWidthCompRef.current,\n getFullWidthCellRendererParams: () => fullWidthParamsRef.current,\n refreshFullWidth: (getUpdatedParams) => {\n const fullWidthParams = getUpdatedParams();\n fullWidthParamsRef.current = fullWidthParams;\n if (canRefreshFullWidthRef.current) {\n setFullWidthCompDetails((prevFullWidthCompDetails) => ({\n ...prevFullWidthCompDetails,\n params: fullWidthParams\n }));\n return true;\n } else {\n if (!fullWidthCompRef.current || !fullWidthCompRef.current.refresh) {\n return false;\n }\n return fullWidthCompRef.current.refresh(fullWidthParams);\n }\n }\n };\n rowCtrl.setComp(compProxy, eRef, containerType, compBean.current);\n }, []);\n useLayoutEffect7(\n () => showJsComp(fullWidthCompDetails, context, eGui.current, fullWidthCompRef),\n [fullWidthCompDetails]\n );\n const rowStyles = useMemo9(() => {\n const res = { top, transform };\n Object.assign(res, userStyles);\n return res;\n }, [top, transform, userStyles]);\n const showFullWidthFramework = isFullWidth && fullWidthCompDetails?.componentFromFramework;\n const showCells = !isFullWidth && cellCtrlsMerged != null;\n const reactFullWidthCellRendererStateless = useMemo9(() => {\n const res = fullWidthCompDetails?.componentFromFramework && isComponentStateless(fullWidthCompDetails.componentClass);\n return !!res;\n }, [fullWidthCompDetails]);\n const canRefreshFullWidthRef = useRef12(false);\n useEffect8(() => {\n canRefreshFullWidthRef.current = reactFullWidthCellRendererStateless && !!fullWidthCompDetails && !!gos.get(\"reactiveCustomComponents\");\n }, [reactFullWidthCellRendererStateless, fullWidthCompDetails]);\n const showCellsJsx = () => cellCtrlsMerged?.map((cellCtrl) => /* @__PURE__ */ React15.createElement(\n cellComp_default,\n {\n cellCtrl,\n editingCell: editSvc?.isEditing(cellCtrl, { withOpenEditor: true }) ?? false,\n printLayout: rowCtrl.printLayout,\n key: cellCtrl.instanceId\n }\n ));\n const showFullWidthFrameworkJsx = () => {\n const FullWidthComp = fullWidthCompDetails.componentClass;\n return reactFullWidthCellRendererStateless ? /* @__PURE__ */ React15.createElement(FullWidthComp, { ...fullWidthCompDetails.params }) : /* @__PURE__ */ React15.createElement(FullWidthComp, { ...fullWidthCompDetails.params, ref: fullWidthCompRef });\n };\n return /* @__PURE__ */ React15.createElement(\n \"div\",\n {\n ref: setRef2,\n role: \"row\",\n style: rowStyles,\n \"row-index\": rowIndex,\n \"row-id\": rowId,\n \"row-business-key\": rowBusinessKey\n },\n showCells ? showCellsJsx() : showFullWidthFramework ? showFullWidthFrameworkJsx() : null\n );\n};\nvar rowComp_default = memo10(RowComp);\n\n// packages/ag-grid-react/src/reactUi/rows/rowContainerComp.tsx\nvar RowContainerComp = ({ name }) => {\n const { context, gos } = useContext13(BeansContext);\n const containerOptions = useMemo10(() => _getRowContainerOptions(name), [name]);\n const eViewport = useRef13(null);\n const eContainer = useRef13(null);\n const eSpanContainer = useRef13(null);\n const rowCtrlsRef = useRef13([]);\n const prevRowCtrlsRef = useRef13([]);\n const [rowCtrlsOrdered, setRowCtrlsOrdered] = useState13(() => []);\n const isSpanning = !!gos.get(\"enableCellSpan\") && !!containerOptions.getSpannedRowCtrls;\n const spannedRowCtrlsRef = useRef13([]);\n const prevSpannedRowCtrlsRef = useRef13([]);\n const [spannedRowCtrlsOrdered, setSpannedRowCtrlsOrdered] = useState13(() => []);\n const domOrderRef = useRef13(false);\n const rowContainerCtrlRef = useRef13();\n const viewportClasses = useMemo10(() => classesList(\"ag-viewport\", _getRowViewportClass(name)), [name]);\n const containerClasses = useMemo10(() => classesList(_getRowContainerClass(name)), [name]);\n const spanClasses = useMemo10(() => classesList(\"ag-spanning-container\", _getRowSpanContainerClass(name)), [name]);\n const shouldRenderViewport = containerOptions.type === \"center\" || isSpanning;\n const topLevelRef = shouldRenderViewport ? eViewport : eContainer;\n reactComment_default(\" AG Row Container \" + name + \" \", topLevelRef);\n const areElementsReady = useCallback11(() => {\n const viewportReady = !shouldRenderViewport || eViewport.current != null;\n const containerReady = eContainer.current != null;\n const spanContainerReady = !isSpanning || eSpanContainer.current != null;\n return viewportReady && containerReady && spanContainerReady;\n }, []);\n const areElementsRemoved = useCallback11(() => {\n return eViewport.current == null && eContainer.current == null && eSpanContainer.current == null;\n }, []);\n const setRef2 = useCallback11(() => {\n if (areElementsRemoved()) {\n rowContainerCtrlRef.current = context.destroyBean(rowContainerCtrlRef.current);\n }\n if (context.isDestroyed()) {\n return;\n }\n if (areElementsReady()) {\n const updateRowCtrlsOrdered = (useFlushSync) => {\n const next = getNextValueIfDifferent(\n prevRowCtrlsRef.current,\n rowCtrlsRef.current,\n domOrderRef.current\n );\n if (next !== prevRowCtrlsRef.current) {\n prevRowCtrlsRef.current = next;\n agFlushSync(useFlushSync, () => setRowCtrlsOrdered(next));\n }\n };\n const updateSpannedRowCtrlsOrdered = (useFlushSync) => {\n const next = getNextValueIfDifferent(\n prevSpannedRowCtrlsRef.current,\n spannedRowCtrlsRef.current,\n domOrderRef.current\n );\n if (next !== prevSpannedRowCtrlsRef.current) {\n prevSpannedRowCtrlsRef.current = next;\n agFlushSync(useFlushSync, () => setSpannedRowCtrlsOrdered(next));\n }\n };\n const compProxy = {\n setHorizontalScroll: (offset) => {\n if (eViewport.current) {\n eViewport.current.scrollLeft = offset;\n }\n },\n setViewportHeight: (height) => {\n if (eViewport.current) {\n eViewport.current.style.height = height;\n }\n },\n setRowCtrls: ({ rowCtrls, useFlushSync }) => {\n const useFlush = !!useFlushSync && rowCtrlsRef.current.length > 0 && rowCtrls.length > 0;\n rowCtrlsRef.current = rowCtrls;\n updateRowCtrlsOrdered(useFlush);\n },\n setSpannedRowCtrls: (rowCtrls, useFlushSync) => {\n const useFlush = !!useFlushSync && spannedRowCtrlsRef.current.length > 0 && rowCtrls.length > 0;\n spannedRowCtrlsRef.current = rowCtrls;\n updateSpannedRowCtrlsOrdered(useFlush);\n },\n setDomOrder: (domOrder) => {\n if (domOrderRef.current != domOrder) {\n domOrderRef.current = domOrder;\n updateRowCtrlsOrdered(false);\n }\n },\n setContainerWidth: (width) => {\n if (eContainer.current) {\n eContainer.current.style.width = width;\n }\n },\n setOffsetTop: (offset) => {\n if (eContainer.current) {\n eContainer.current.style.transform = `translateY(${offset})`;\n }\n }\n };\n rowContainerCtrlRef.current = context.createBean(new RowContainerCtrl(name));\n rowContainerCtrlRef.current.setComp(\n compProxy,\n eContainer.current,\n eSpanContainer.current ?? void 0,\n eViewport.current\n );\n }\n }, [areElementsReady, areElementsRemoved]);\n const setContainerRef = useCallback11(\n (e) => {\n eContainer.current = e;\n setRef2();\n },\n [setRef2]\n );\n const setSpanContainerRef = useCallback11(\n (e) => {\n eSpanContainer.current = e;\n setRef2();\n },\n [setRef2]\n );\n const setViewportRef = useCallback11(\n (e) => {\n eViewport.current = e;\n setRef2();\n },\n [setRef2]\n );\n const buildContainer = () => /* @__PURE__ */ React16.createElement(\n \"div\",\n {\n className: containerClasses,\n ref: setContainerRef,\n role: shouldRenderViewport ? \"presentation\" : \"rowgroup\"\n },\n rowCtrlsOrdered.map((rowCtrl) => /* @__PURE__ */ React16.createElement(rowComp_default, { rowCtrl, containerType: containerOptions.type, key: rowCtrl.instanceId }))\n );\n if (!shouldRenderViewport) {\n return buildContainer();\n }\n const buildSpanContainer = () => /* @__PURE__ */ React16.createElement(\"div\", { className: spanClasses, ref: setSpanContainerRef, role: \"presentation\" }, spannedRowCtrlsOrdered.map((rowCtrl) => /* @__PURE__ */ React16.createElement(rowComp_default, { rowCtrl, containerType: containerOptions.type, key: rowCtrl.instanceId })));\n return /* @__PURE__ */ React16.createElement(\"div\", { className: viewportClasses, ref: setViewportRef, role: \"rowgroup\" }, buildContainer(), isSpanning ? buildSpanContainer() : null);\n};\nvar rowContainerComp_default = memo11(RowContainerComp);\n\n// packages/ag-grid-react/src/reactUi/gridBodyComp.tsx\nvar GridBodyComp = () => {\n const beans = useContext14(BeansContext);\n const { context, overlays } = beans;\n const [rowAnimationClass, setRowAnimationClass] = useState14(\"\");\n const [topHeight, setTopHeight] = useState14(0);\n const [bottomHeight, setBottomHeight] = useState14(0);\n const [stickyTopHeight, setStickyTopHeight] = useState14(\"0px\");\n const [stickyTopTop, setStickyTopTop] = useState14(\"0px\");\n const [stickyTopWidth, setStickyTopWidth] = useState14(\"100%\");\n const [stickyBottomHeight, setStickyBottomHeight] = useState14(\"0px\");\n const [stickyBottomBottom, setStickyBottomBottom] = useState14(\"0px\");\n const [stickyBottomWidth, setStickyBottomWidth] = useState14(\"100%\");\n const [topInvisible, setTopInvisible] = useState14(true);\n const [bottomInvisible, setBottomInvisible] = useState14(true);\n const [forceVerticalScrollClass, setForceVerticalScrollClass] = useState14(null);\n const [topAndBottomOverflowY, setTopAndBottomOverflowY] = useState14(\"\");\n const [cellSelectableCss, setCellSelectableCss] = useState14(null);\n const [layoutClass, setLayoutClass] = useState14(\"ag-layout-normal\");\n const cssManager = useRef14();\n if (!cssManager.current) {\n cssManager.current = new CssClassManager4(() => eRoot.current);\n }\n const eRoot = useRef14(null);\n const eTop = useRef14(null);\n const eStickyTop = useRef14(null);\n const eStickyBottom = useRef14(null);\n const eBody = useRef14(null);\n const eBodyViewport = useRef14(null);\n const eBottom = useRef14(null);\n const beansToDestroy = useRef14([]);\n const destroyFuncs = useRef14([]);\n reactComment_default(\" AG Grid Body \", eRoot);\n reactComment_default(\" AG Pinned Top \", eTop);\n reactComment_default(\" AG Sticky Top \", eStickyTop);\n reactComment_default(\" AG Middle \", eBodyViewport);\n reactComment_default(\" AG Pinned Bottom \", eBottom);\n const setRef2 = useCallback12((eRef) => {\n eRoot.current = eRef;\n if (!eRef || context.isDestroyed()) {\n beansToDestroy.current = context.destroyBeans(beansToDestroy.current);\n for (const f of destroyFuncs.current) {\n f();\n }\n destroyFuncs.current = [];\n return;\n }\n const attachToDom = (eParent, eChild) => {\n eParent.appendChild(eChild);\n destroyFuncs.current.push(() => eChild.remove());\n };\n const newComp = (compClass) => {\n const comp = context.createBean(new compClass());\n beansToDestroy.current.push(comp);\n return comp;\n };\n const addComp = (eParent, compClass, comment) => {\n attachToDom(eParent, document.createComment(comment));\n attachToDom(eParent, newComp(compClass).getGui());\n };\n addComp(eRef, FakeHScrollComp, \" AG Fake Horizontal Scroll \");\n const overlayComp = overlays?.getOverlayWrapperCompClass();\n if (overlayComp) {\n addComp(eRef, overlayComp, \" AG Overlay Wrapper \");\n }\n if (eBody.current) {\n addComp(eBody.current, FakeVScrollComp, \" AG Fake Vertical Scroll \");\n }\n const compProxy = {\n setRowAnimationCssOnBodyViewport: setRowAnimationClass,\n setColumnCount: (count) => {\n if (eRoot.current) {\n _setAriaColCount(eRoot.current, count);\n }\n },\n setRowCount: (count) => {\n if (eRoot.current) {\n _setAriaRowCount(eRoot.current, count);\n }\n },\n setTopHeight,\n setBottomHeight,\n setStickyTopHeight,\n setStickyTopTop,\n setStickyTopWidth,\n setTopInvisible,\n setBottomInvisible,\n setColumnMovingCss: (cssClass, flag) => cssManager.current.toggleCss(cssClass, flag),\n updateLayoutClasses: setLayoutClass,\n setAlwaysVerticalScrollClass: setForceVerticalScrollClass,\n setPinnedTopBottomOverflowY: setTopAndBottomOverflowY,\n setCellSelectableCss: (cssClass, flag) => setCellSelectableCss(flag ? cssClass : null),\n setBodyViewportWidth: (width) => {\n if (eBodyViewport.current) {\n eBodyViewport.current.style.width = width;\n }\n },\n registerBodyViewportResizeListener: (listener) => {\n if (eBodyViewport.current) {\n const unsubscribeFromResize = _observeResize(beans, eBodyViewport.current, listener);\n destroyFuncs.current.push(() => unsubscribeFromResize());\n }\n },\n setStickyBottomHeight,\n setStickyBottomBottom,\n setStickyBottomWidth,\n setGridRootRole: (role) => eRef.setAttribute(\"role\", role)\n };\n const ctrl = context.createBean(new GridBodyCtrl());\n beansToDestroy.current.push(ctrl);\n ctrl.setComp(\n compProxy,\n eRef,\n eBodyViewport.current,\n eTop.current,\n eBottom.current,\n eStickyTop.current,\n eStickyBottom.current\n );\n }, []);\n const rootClasses = useMemo11(() => classesList(\"ag-root\", \"ag-unselectable\", layoutClass), [layoutClass]);\n const bodyViewportClasses = useMemo11(\n () => classesList(\n \"ag-body-viewport\",\n rowAnimationClass,\n layoutClass,\n forceVerticalScrollClass,\n cellSelectableCss\n ),\n [rowAnimationClass, layoutClass, forceVerticalScrollClass, cellSelectableCss]\n );\n const bodyClasses = useMemo11(() => classesList(\"ag-body\", layoutClass), [layoutClass]);\n const topClasses = useMemo11(\n () => classesList(\"ag-floating-top\", topInvisible ? \"ag-invisible\" : null, cellSelectableCss),\n [cellSelectableCss, topInvisible]\n );\n const stickyTopClasses = useMemo11(() => classesList(\"ag-sticky-top\", cellSelectableCss), [cellSelectableCss]);\n const stickyBottomClasses = useMemo11(\n () => classesList(\"ag-sticky-bottom\", stickyBottomHeight === \"0px\" ? \"ag-invisible\" : null, cellSelectableCss),\n [cellSelectableCss, stickyBottomHeight]\n );\n const bottomClasses = useMemo11(\n () => classesList(\"ag-floating-bottom\", bottomInvisible ? \"ag-invisible\" : null, cellSelectableCss),\n [cellSelectableCss, bottomInvisible]\n );\n const topStyle = useMemo11(\n () => ({\n height: topHeight,\n minHeight: topHeight,\n overflowY: topAndBottomOverflowY\n }),\n [topHeight, topAndBottomOverflowY]\n );\n const stickyTopStyle = useMemo11(\n () => ({\n height: stickyTopHeight,\n top: stickyTopTop,\n width: stickyTopWidth\n }),\n [stickyTopHeight, stickyTopTop, stickyTopWidth]\n );\n const stickyBottomStyle = useMemo11(\n () => ({\n height: stickyBottomHeight,\n bottom: stickyBottomBottom,\n width: stickyBottomWidth\n }),\n [stickyBottomHeight, stickyBottomBottom, stickyBottomWidth]\n );\n const bottomStyle = useMemo11(\n () => ({\n height: bottomHeight,\n minHeight: bottomHeight,\n overflowY: topAndBottomOverflowY\n }),\n [bottomHeight, topAndBottomOverflowY]\n );\n const createRowContainer = (container) => /* @__PURE__ */ React17.createElement(rowContainerComp_default, { name: container, key: `${container}-container` });\n const createSection = ({\n section,\n children,\n className,\n style\n }) => /* @__PURE__ */ React17.createElement(\"div\", { ref: section, className, role: \"presentation\", style }, children.map(createRowContainer));\n return /* @__PURE__ */ React17.createElement(\"div\", { ref: setRef2, className: rootClasses }, /* @__PURE__ */ React17.createElement(gridHeaderComp_default, null), createSection({\n section: eTop,\n className: topClasses,\n style: topStyle,\n children: [\"topLeft\", \"topCenter\", \"topRight\", \"topFullWidth\"]\n }), /* @__PURE__ */ React17.createElement(\"div\", { className: bodyClasses, ref: eBody, role: \"presentation\" }, createSection({\n section: eBodyViewport,\n className: bodyViewportClasses,\n children: [\"left\", \"center\", \"right\", \"fullWidth\"]\n })), createSection({\n section: eStickyTop,\n className: stickyTopClasses,\n style: stickyTopStyle,\n children: [\"stickyTopLeft\", \"stickyTopCenter\", \"stickyTopRight\", \"stickyTopFullWidth\"]\n }), createSection({\n section: eStickyBottom,\n className: stickyBottomClasses,\n style: stickyBottomStyle,\n children: [\"stickyBottomLeft\", \"stickyBottomCenter\", \"stickyBottomRight\", \"stickyBottomFullWidth\"]\n }), createSection({\n section: eBottom,\n className: bottomClasses,\n style: bottomStyle,\n children: [\"bottomLeft\", \"bottomCenter\", \"bottomRight\", \"bottomFullWidth\"]\n }));\n};\nvar gridBodyComp_default = memo12(GridBodyComp);\n\n// packages/ag-grid-react/src/reactUi/tabGuardComp.tsx\nimport React18, { forwardRef as forwardRef2, memo as memo13, useCallback as useCallback13, useContext as useContext15, useImperativeHandle as useImperativeHandle2, useRef as useRef15 } from \"react\";\nimport { TabGuardClassNames, TabGuardCtrl } from \"ag-grid-community\";\nvar TabGuardCompRef = (props, forwardRef4) => {\n const { children, eFocusableElement, onTabKeyDown, gridCtrl, forceFocusOutWhenTabGuardsAreEmpty, isEmpty } = props;\n const { context } = useContext15(BeansContext);\n const topTabGuardRef = useRef15(null);\n const bottomTabGuardRef = useRef15(null);\n const tabGuardCtrlRef = useRef15();\n const setTabIndex = (value) => {\n const processedValue = value == null ? void 0 : parseInt(value, 10).toString();\n for (const tabGuard of [topTabGuardRef, bottomTabGuardRef]) {\n if (processedValue === void 0) {\n tabGuard.current?.removeAttribute(\"tabindex\");\n } else {\n tabGuard.current?.setAttribute(\"tabindex\", processedValue);\n }\n }\n };\n useImperativeHandle2(forwardRef4, () => ({\n forceFocusOutOfContainer(up) {\n tabGuardCtrlRef.current?.forceFocusOutOfContainer(up);\n }\n }));\n const setupCtrl = useCallback13(() => {\n const topTabGuard = topTabGuardRef.current;\n const bottomTabGuard = bottomTabGuardRef.current;\n if (!topTabGuard && !bottomTabGuard || context.isDestroyed()) {\n tabGuardCtrlRef.current = context.destroyBean(tabGuardCtrlRef.current);\n return;\n }\n if (topTabGuard && bottomTabGuard) {\n const compProxy = {\n setTabIndex\n };\n tabGuardCtrlRef.current = context.createBean(\n new TabGuardCtrl({\n comp: compProxy,\n eTopGuard: topTabGuard,\n eBottomGuard: bottomTabGuard,\n eFocusableElement,\n onTabKeyDown,\n forceFocusOutWhenTabGuardsAreEmpty,\n focusInnerElement: (fromBottom) => gridCtrl.focusInnerElement(fromBottom),\n isEmpty\n })\n );\n }\n }, []);\n const setTopRef = useCallback13(\n (e) => {\n topTabGuardRef.current = e;\n setupCtrl();\n },\n [setupCtrl]\n );\n const setBottomRef = useCallback13(\n (e) => {\n bottomTabGuardRef.current = e;\n setupCtrl();\n },\n [setupCtrl]\n );\n const createTabGuard = (side) => {\n const className = side === \"top\" ? TabGuardClassNames.TAB_GUARD_TOP : TabGuardClassNames.TAB_GUARD_BOTTOM;\n return /* @__PURE__ */ React18.createElement(\n \"div\",\n {\n className: `${TabGuardClassNames.TAB_GUARD} ${className}`,\n role: \"presentation\",\n ref: side === \"top\" ? setTopRef : setBottomRef\n }\n );\n };\n return /* @__PURE__ */ React18.createElement(React18.Fragment, null, createTabGuard(\"top\"), children, createTabGuard(\"bottom\"));\n};\nvar TabGuardComp = forwardRef2(TabGuardCompRef);\nvar tabGuardComp_default = memo13(TabGuardComp);\n\n// packages/ag-grid-react/src/reactUi/gridComp.tsx\nvar GridComp = ({ context }) => {\n const [rtlClass, setRtlClass] = useState15(\"\");\n const [layoutClass, setLayoutClass] = useState15(\"\");\n const [cursor, setCursor] = useState15(null);\n const [userSelect, setUserSelect] = useState15(null);\n const [initialised, setInitialised] = useState15(false);\n const [tabGuardReady, setTabGuardReady] = useState15();\n const gridCtrlRef = useRef16();\n const eRootWrapperRef = useRef16(null);\n const tabGuardRef = useRef16();\n const [eGridBodyParent, setGridBodyParent] = useState15(null);\n const focusInnerElementRef = useRef16(() => void 0);\n const paginationCompRef = useRef16();\n const focusableContainersRef = useRef16([]);\n const onTabKeyDown = useCallback14(() => void 0, []);\n reactComment_default(\" AG Grid \", eRootWrapperRef);\n const setRef2 = useCallback14((eRef) => {\n eRootWrapperRef.current = eRef;\n gridCtrlRef.current = eRef ? context.createBean(new GridCtrl()) : context.destroyBean(gridCtrlRef.current);\n if (!eRef || context.isDestroyed()) {\n return;\n }\n const gridCtrl = gridCtrlRef.current;\n focusInnerElementRef.current = gridCtrl.focusInnerElement.bind(gridCtrl);\n const compProxy = {\n destroyGridUi: () => {\n },\n // do nothing, as framework users destroy grid by removing the comp\n setRtlClass,\n forceFocusOutOfContainer: (up) => {\n if (!up && paginationCompRef.current?.isDisplayed()) {\n paginationCompRef.current.forceFocusOutOfContainer(up);\n return;\n }\n tabGuardRef.current?.forceFocusOutOfContainer(up);\n },\n updateLayoutClasses: setLayoutClass,\n getFocusableContainers: () => {\n const beforeGridBody = [];\n const afterGridBody = [];\n const gridBodyCompEl = eRootWrapperRef.current?.querySelector(\".ag-root\");\n for (const comp of focusableContainersRef.current) {\n if (!comp.isDisplayed()) {\n continue;\n }\n const name = comp.getFocusableContainerName();\n if (name === \"rowGroupToolbar\" || name === \"pivotToolbar\") {\n beforeGridBody.push(comp);\n continue;\n }\n afterGridBody.push(comp);\n }\n const comps = [...beforeGridBody];\n if (gridBodyCompEl) {\n comps.push({\n getGui: () => gridBodyCompEl,\n getFocusableContainerName: () => \"gridBody\"\n });\n }\n comps.push(...afterGridBody);\n return comps;\n },\n setCursor,\n setUserSelect\n };\n gridCtrl.setComp(compProxy, eRef, eRef);\n setInitialised(true);\n }, []);\n useEffect9(() => {\n const gridCtrl = gridCtrlRef.current;\n const eRootWrapper = eRootWrapperRef.current;\n if (!tabGuardReady || !gridCtrl || !eGridBodyParent || !eRootWrapper || context.isDestroyed()) {\n return;\n }\n const beansToDestroy = [];\n focusableContainersRef.current = [];\n paginationCompRef.current = void 0;\n const {\n watermarkSelector,\n paginationSelector,\n sideBarSelector,\n statusBarSelector,\n gridHeaderDropZonesSelector\n } = gridCtrl.getOptionalSelectors();\n const additionalEls = [];\n if (gridHeaderDropZonesSelector) {\n const headerDropZonesComp = context.createBean(\n new gridHeaderDropZonesSelector.component()\n );\n const eGui = headerDropZonesComp.getGui();\n eRootWrapper.insertAdjacentElement(\"afterbegin\", eGui);\n additionalEls.push(eGui);\n beansToDestroy.push(headerDropZonesComp);\n focusableContainersRef.current.push(...headerDropZonesComp.getFocusableContainers?.() ?? []);\n }\n if (sideBarSelector) {\n const sideBarComp = context.createBean(new sideBarSelector.component());\n const eGui = sideBarComp.getGui();\n const bottomTabGuard = eGridBodyParent.querySelector(\".ag-tab-guard-bottom\");\n if (bottomTabGuard) {\n bottomTabGuard.insertAdjacentElement(\"beforebegin\", eGui);\n additionalEls.push(eGui);\n }\n beansToDestroy.push(sideBarComp);\n focusableContainersRef.current.push(sideBarComp);\n }\n const addComponentToDom = (component) => {\n const comp = context.createBean(new component());\n const eGui = comp.getGui();\n eRootWrapper.insertAdjacentElement(\"beforeend\", eGui);\n additionalEls.push(eGui);\n beansToDestroy.push(comp);\n return comp;\n };\n if (statusBarSelector) {\n const statusBarComp = addComponentToDom(statusBarSelector.component);\n focusableContainersRef.current.push(statusBarComp);\n }\n if (paginationSelector) {\n const paginationComp = addComponentToDom(paginationSelector.component);\n paginationCompRef.current = paginationComp;\n focusableContainersRef.current.push(paginationComp);\n }\n if (watermarkSelector) {\n addComponentToDom(watermarkSelector.component);\n }\n return () => {\n context.destroyBeans(beansToDestroy);\n focusableContainersRef.current = [];\n paginationCompRef.current = void 0;\n for (const el of additionalEls) {\n el.remove();\n }\n };\n }, [tabGuardReady, eGridBodyParent, context]);\n const rootWrapperClasses = useMemo12(\n () => classesList(\"ag-root-wrapper\", rtlClass, layoutClass),\n [rtlClass, layoutClass]\n );\n const rootWrapperBodyClasses = useMemo12(\n () => classesList(\"ag-root-wrapper-body\", \"ag-focus-managed\", layoutClass),\n [layoutClass]\n );\n const topStyle = useMemo12(\n () => ({\n userSelect: userSelect != null ? userSelect : \"\",\n WebkitUserSelect: userSelect != null ? userSelect : \"\",\n cursor: cursor != null ? cursor : \"\"\n }),\n [userSelect, cursor]\n );\n const setTabGuardCompRef = useCallback14((ref) => {\n tabGuardRef.current = ref;\n setTabGuardReady(ref !== null);\n }, []);\n const isFocusable = useCallback14(() => !gridCtrlRef.current?.isFocusable(), []);\n return /* @__PURE__ */ React19.createElement(\"div\", { ref: setRef2, className: rootWrapperClasses, style: topStyle, role: \"presentation\" }, /* @__PURE__ */ React19.createElement(\"div\", { className: rootWrapperBodyClasses, ref: setGridBodyParent, role: \"presentation\" }, initialised && eGridBodyParent && !context.isDestroyed() && /* @__PURE__ */ React19.createElement(BeansContext.Provider, { value: context.getBeans() }, /* @__PURE__ */ React19.createElement(\n tabGuardComp_default,\n {\n ref: setTabGuardCompRef,\n eFocusableElement: eGridBodyParent,\n onTabKeyDown,\n gridCtrl: gridCtrlRef.current,\n forceFocusOutWhenTabGuardsAreEmpty: true,\n isEmpty: isFocusable\n },\n // we wait for initialised before rending the children, so GridComp has created and registered with it's\n // GridCtrl before we create the child GridBodyComp. Otherwise the GridBodyComp would initialise first,\n // before we have set the the Layout CSS classes, causing the GridBodyComp to render rows to a grid that\n // doesn't have it's height specified, which would result if all the rows getting rendered (and if many rows,\n // hangs the UI)\n /* @__PURE__ */ React19.createElement(gridBodyComp_default, null)\n ))));\n};\nvar gridComp_default = memo14(GridComp);\n\n// packages/ag-grid-react/src/reactUi/renderStatusService.tsx\nimport { BeanStub } from \"ag-grid-community\";\nvar RenderStatusService = class extends BeanStub {\n postConstruct() {\n if (this.beans.colAutosize) {\n const queueResizeOperationsForTick = this.queueResizeOperationsForTick.bind(this);\n this.addManagedEventListeners({\n rowExpansionStateChanged: queueResizeOperationsForTick,\n expandOrCollapseAll: queueResizeOperationsForTick,\n // Enable devs to resize after they updated via the API\n cellValueChanged: queueResizeOperationsForTick,\n rowNodeDataChanged: queueResizeOperationsForTick,\n rowDataUpdated: queueResizeOperationsForTick\n });\n }\n }\n queueResizeOperationsForTick() {\n const colAutosize = this.beans.colAutosize;\n colAutosize.shouldQueueResizeOperations = true;\n setTimeout(() => {\n colAutosize.processResizeOperations();\n }, 0);\n }\n areHeaderCellsRendered() {\n return this.beans.ctrlsSvc.getHeaderRowContainerCtrls().every((container) => container.getAllCtrls().every((ctrl) => ctrl.areCellsRendered()));\n }\n areCellsRendered() {\n return this.beans.rowRenderer.getAllRowCtrls().every((row) => row.isRowRendered() && row.getAllCellCtrls().every((cellCtrl) => !!cellCtrl.eGui));\n }\n};\n\n// packages/ag-grid-react/src/reactUi/useIsomorphicLayoutEffect.ts\nimport { useEffect as useEffect10, useLayoutEffect as useLayoutEffect8 } from \"react\";\nvar useIsomorphicLayoutEffect = typeof window === \"undefined\" ? useEffect10 : useLayoutEffect8;\n\n// packages/ag-grid-react/src/reactUi/agGridReactUi.tsx\nvar deprecatedProps = {\n setGridApi: void 0,\n maxComponentCreationTimeMs: void 0,\n children: void 0\n};\nvar reactPropsNotGridOptions = {\n gridOptions: void 0,\n modules: void 0,\n containerStyle: void 0,\n className: void 0,\n passGridApi: void 0,\n componentWrappingElement: void 0,\n ...deprecatedProps\n};\nvar excludeReactCompProps = new Set(Object.keys(reactPropsNotGridOptions));\nvar deprecatedReactCompProps = new Set(Object.keys(deprecatedProps));\nvar AgGridReactUi = (props) => {\n const modulesFromContext = useContext16(ModulesContext);\n const licenseKeyFromContext = useContext16(LicenseContext);\n const apiRef = useRef17();\n const eGui = useRef17(null);\n const portalManager = useRef17(null);\n const destroyFuncs = useRef17([]);\n const whenReadyFuncs = useRef17([]);\n const prevProps = useRef17(props);\n const frameworkOverridesRef = useRef17();\n const gridIdRef = useRef17();\n const ready = useRef17(false);\n const [context, setContext] = useState16(void 0);\n const [, setPortalRefresher] = useState16(0);\n const appliedClassName = useRef17();\n const updateClassName = (classNameFromReact) => {\n const classList = eGui.current?.classList;\n const splitClasses = (s = \"\") => s.trim().split(/\\s+/g).filter(Boolean);\n if (appliedClassName.current !== classNameFromReact) {\n for (const cls of splitClasses(appliedClassName.current)) {\n if (classList?.contains(cls)) {\n classList.remove(cls);\n }\n }\n for (const cls of splitClasses(classNameFromReact)) {\n if (!classList?.contains(cls)) {\n classList?.add(cls);\n }\n }\n appliedClassName.current = classNameFromReact;\n }\n };\n useIsomorphicLayoutEffect(() => {\n updateClassName(props.className);\n }, [props.className]);\n const setRef2 = useCallback15((eRef) => {\n eGui.current = eRef;\n updateClassName(props.className);\n if (!eRef) {\n for (const f of destroyFuncs.current) {\n f();\n }\n destroyFuncs.current.length = 0;\n return;\n }\n const modules = [...props.modules ?? [], ...modulesFromContext ?? []];\n if (licenseKeyFromContext) {\n _findEnterpriseCoreModule(modules)?.setLicenseKey(licenseKeyFromContext);\n }\n if (!portalManager.current) {\n portalManager.current = new PortalManager(\n () => setPortalRefresher((prev) => prev + 1),\n props.componentWrappingElement,\n props.maxComponentCreationTimeMs\n );\n destroyFuncs.current.push(() => {\n portalManager.current?.destroy();\n portalManager.current = null;\n });\n }\n const mergedGridOps = _combineAttributesAndGridOptions(\n props.gridOptions,\n props,\n Object.keys(props).filter((key) => !excludeReactCompProps.has(key))\n );\n const processQueuedUpdates = () => {\n if (ready.current) {\n const getFn = () => frameworkOverridesRef.current?.shouldQueueUpdates() ? void 0 : whenReadyFuncs.current.shift();\n let fn = getFn();\n while (fn) {\n fn();\n fn = getFn();\n }\n }\n };\n const frameworkOverrides = new ReactFrameworkOverrides(processQueuedUpdates);\n frameworkOverridesRef.current = frameworkOverrides;\n const renderStatus = new RenderStatusService();\n const gridParams = {\n providedBeanInstances: {\n frameworkCompWrapper: new ReactFrameworkComponentWrapper(portalManager.current, mergedGridOps),\n renderStatus\n },\n modules,\n frameworkOverrides,\n setThemeOnGridDiv: true\n };\n const createUiCallback = (ctx) => {\n setContext(ctx);\n ctx.createBean(renderStatus);\n destroyFuncs.current.push(() => {\n ctx.destroy();\n });\n ctx.getBean(\"ctrlsSvc\").whenReady(\n {\n addDestroyFunc: (func) => {\n destroyFuncs.current.push(func);\n }\n },\n () => {\n if (ctx.isDestroyed()) {\n return;\n }\n const api = apiRef.current;\n if (api) {\n props.passGridApi?.(api);\n }\n }\n );\n };\n const acceptChangesCallback = (context2) => {\n context2.getBean(\"ctrlsSvc\").whenReady(\n {\n addDestroyFunc: (func) => {\n destroyFuncs.current.push(func);\n }\n },\n () => {\n for (const f of whenReadyFuncs.current) {\n f();\n }\n whenReadyFuncs.current.length = 0;\n ready.current = true;\n }\n );\n };\n const gridCoreCreator = new GridCoreCreator();\n mergedGridOps.gridId ?? (mergedGridOps.gridId = gridIdRef.current);\n apiRef.current = gridCoreCreator.create(\n eRef,\n mergedGridOps,\n createUiCallback,\n acceptChangesCallback,\n gridParams\n );\n destroyFuncs.current.push(() => {\n apiRef.current = void 0;\n });\n if (apiRef.current) {\n gridIdRef.current = apiRef.current.getGridId();\n }\n }, []);\n const style = useMemo13(() => {\n return {\n height: \"100%\",\n ...props.containerStyle || {}\n };\n }, [props.containerStyle]);\n const processWhenReady = useCallback15((func) => {\n if (ready.current && !frameworkOverridesRef.current?.shouldQueueUpdates()) {\n func();\n } else {\n whenReadyFuncs.current.push(func);\n }\n }, []);\n useEffect11(() => {\n const changes = extractGridPropertyChanges(prevProps.current, props);\n prevProps.current = props;\n processWhenReady(() => {\n if (apiRef.current) {\n _processOnChange(changes, apiRef.current);\n }\n });\n }, [props]);\n const renderMode = !React20.useSyncExternalStore || _getGridOption(props, \"renderingMode\") === \"legacy\" ? \"legacy\" : \"default\";\n return (\n // IMPORTANT! Don't set className here, we must use classList\n // imperatively to avoid removing classes set by the grid\n /* @__PURE__ */ React20.createElement(\"div\", { style, ref: setRef2 }, /* @__PURE__ */ React20.createElement(RenderModeContext.Provider, { value: renderMode }, context && !context.isDestroyed() ? /* @__PURE__ */ React20.createElement(gridComp_default, { key: context.instanceId, context }) : null, portalManager.current?.getPortals() ?? null))\n );\n};\nfunction extractGridPropertyChanges(prevProps, nextProps) {\n const changes = {};\n for (const propKey of Object.keys(nextProps)) {\n if (excludeReactCompProps.has(propKey)) {\n if (deprecatedReactCompProps.has(propKey)) {\n _warn2(274, { prop: propKey });\n }\n continue;\n }\n const propValue = nextProps[propKey];\n if (prevProps[propKey] !== propValue) {\n changes[propKey] = propValue;\n }\n }\n return changes;\n}\nvar ReactFrameworkComponentWrapper = class extends BaseComponentWrapper {\n constructor(parent, gridOptions) {\n super();\n this.parent = parent;\n this.gridOptions = gridOptions;\n }\n createWrapper(UserReactComponent, componentType) {\n const gridOptions = this.gridOptions;\n const reactiveCustomComponents = _getGridOption(gridOptions, \"reactiveCustomComponents\");\n if (reactiveCustomComponents) {\n const getComponentClass = (propertyName) => {\n switch (propertyName) {\n case \"filter\":\n return _getGridOption(gridOptions, \"enableFilterHandlers\") ? FilterDisplayComponentWrapper : FilterComponentWrapper;\n case \"floatingFilterComponent\":\n return _getGridOption(gridOptions, \"enableFilterHandlers\") ? FloatingFilterDisplayComponentWrapper : FloatingFilterComponentWrapper;\n case \"dateComponent\":\n return DateComponentWrapper;\n case \"dragAndDropImageComponent\":\n return DragAndDropImageComponentWrapper;\n case \"loadingOverlayComponent\":\n case \"noRowsOverlayComponent\":\n case \"activeOverlay\":\n return CustomOverlayComponentWrapper;\n case \"statusPanel\":\n return StatusPanelComponentWrapper;\n case \"toolPanel\":\n return ToolPanelComponentWrapper;\n case \"menuItem\":\n return MenuItemComponentWrapper;\n case \"cellRenderer\":\n return CellRendererComponentWrapper;\n case \"innerHeaderComponent\":\n return InnerHeaderComponentWrapper;\n }\n };\n const ComponentClass = getComponentClass(componentType.name);\n if (ComponentClass) {\n return new ComponentClass(UserReactComponent, this.parent, componentType);\n }\n } else {\n switch (componentType.name) {\n case \"filter\":\n case \"floatingFilterComponent\":\n case \"dateComponent\":\n case \"dragAndDropImageComponent\":\n case \"loadingOverlayComponent\":\n case \"noRowsOverlayComponent\":\n case \"activeOverlay\":\n case \"statusPanel\":\n case \"toolPanel\":\n case \"menuItem\":\n case \"cellRenderer\":\n warnReactiveCustomComponents();\n break;\n }\n }\n const suppressFallbackMethods = !componentType.cellRenderer && componentType.name !== \"toolPanel\";\n return new ReactComponent(UserReactComponent, this.parent, componentType, suppressFallbackMethods);\n }\n};\nvar DetailCellRenderer = forwardRef3((props, ref) => {\n const beans = useContext16(BeansContext);\n const { registry, context, gos, rowModel } = beans;\n const [cssClasses, setCssClasses] = useState16(() => new CssClasses());\n const [gridCssClasses, setGridCssClasses] = useState16(() => new CssClasses());\n const [detailGridOptions, setDetailGridOptions] = useState16();\n const [detailRowData, setDetailRowData] = useState16();\n const ctrlRef = useRef17();\n const eGuiRef = useRef17(null);\n const resizeObserverDestroyFunc = useRef17();\n const parentModules = useMemo13(\n () => _getGridRegisteredModules(props.api.getGridId(), detailGridOptions?.rowModelType ?? \"clientSide\"),\n [props]\n );\n const topClassName = useMemo13(() => cssClasses.toString() + \" ag-details-row\", [cssClasses]);\n const gridClassName = useMemo13(() => gridCssClasses.toString() + \" ag-details-grid\", [gridCssClasses]);\n if (ref) {\n useImperativeHandle3(ref, () => ({\n refresh() {\n return ctrlRef.current?.refresh() ?? false;\n }\n }));\n }\n if (props.template) {\n _warn2(230);\n }\n const setRef2 = useCallback15((eRef) => {\n eGuiRef.current = eRef;\n if (!eRef || context.isDestroyed()) {\n ctrlRef.current = context.destroyBean(ctrlRef.current);\n resizeObserverDestroyFunc.current?.();\n return;\n }\n const compProxy = {\n toggleCss: (name, on) => setCssClasses((prev) => prev.setClass(name, on)),\n toggleDetailGridCss: (name, on) => setGridCssClasses((prev) => prev.setClass(name, on)),\n setDetailGrid: (gridOptions) => setDetailGridOptions(gridOptions),\n setRowData: (rowData) => setDetailRowData(rowData),\n getGui: () => eGuiRef.current\n };\n const ctrl = registry.createDynamicBean(\"detailCellRendererCtrl\", true);\n if (!ctrl) {\n return;\n }\n context.createBean(ctrl);\n ctrl.init(compProxy, props);\n ctrlRef.current = ctrl;\n if (gos.get(\"detailRowAutoHeight\")) {\n const checkRowSizeFunc = () => {\n if (eGuiRef.current == null) {\n return;\n }\n const clientHeight = eGuiRef.current.clientHeight;\n if (clientHeight != null && clientHeight > 0) {\n const updateRowHeightFunc = () => {\n props.node.setRowHeight(clientHeight);\n if (_isClientSideRowModel(gos, rowModel) || _isServerSideRowModel(gos, rowModel)) {\n rowModel.onRowHeightChanged();\n }\n };\n setTimeout(updateRowHeightFunc, 0);\n }\n };\n resizeObserverDestroyFunc.current = _observeResize2(beans, eRef, checkRowSizeFunc);\n checkRowSizeFunc();\n }\n }, []);\n const registerGridApi = useCallback15((api) => {\n ctrlRef.current?.registerDetailWithMaster(api);\n }, []);\n return /* @__PURE__ */ React20.createElement(\"div\", { className: topClassName, ref: setRef2 }, detailGridOptions && /* @__PURE__ */ React20.createElement(\n AgGridReactUi,\n {\n className: gridClassName,\n ...detailGridOptions,\n modules: parentModules,\n rowData: detailRowData,\n passGridApi: registerGridApi\n }\n ));\n});\nvar ReactFrameworkOverrides = class extends VanillaFrameworkOverrides {\n constructor(processQueuedUpdates) {\n super(\"react\");\n this.processQueuedUpdates = processQueuedUpdates;\n this.queueUpdates = false;\n this.renderingEngine = \"react\";\n this.frameworkComponents = {\n agGroupCellRenderer: groupCellRenderer_default,\n agGroupRowRenderer: groupCellRenderer_default,\n agDetailCellRenderer: DetailCellRenderer\n };\n this.wrapIncoming = (callback, source) => {\n if (source === \"ensureVisible\") {\n return runWithoutFlushSync(callback);\n }\n return callback();\n };\n }\n frameworkComponent(name) {\n return this.frameworkComponents[name];\n }\n isFrameworkComponent(comp) {\n if (!comp) {\n return false;\n }\n const prototype = comp.prototype;\n const isJsComp = prototype && \"getGui\" in prototype;\n return !isJsComp;\n }\n getLockOnRefresh() {\n this.queueUpdates = true;\n }\n releaseLockOnRefresh() {\n this.queueUpdates = false;\n this.processQueuedUpdates();\n }\n shouldQueueUpdates() {\n return this.queueUpdates;\n }\n runWhenReadyAsync() {\n return isReact19();\n }\n};\n\n// packages/ag-grid-react/src/agGridReact.tsx\nvar AgGridReact = class extends Component {\n constructor() {\n super(...arguments);\n this.apiListeners = [];\n this.setGridApi = (api) => {\n this.api = api;\n for (const listener of this.apiListeners) {\n listener(api);\n }\n };\n }\n registerApiListener(listener) {\n this.apiListeners.push(listener);\n }\n componentWillUnmount() {\n this.apiListeners.length = 0;\n }\n render() {\n return /* @__PURE__ */ React21.createElement(AgGridReactUi, { ...this.props, passGridApi: this.setGridApi });\n }\n};\n\n// packages/ag-grid-react/src/shared/customComp/interfaces.ts\nimport { useContext as useContext17 } from \"react\";\nfunction useGridCustomComponent(methods) {\n const { setMethods } = useContext17(CustomContext);\n setMethods(methods);\n}\nfunction useGridCellEditor(callbacks) {\n useGridCustomComponent(callbacks);\n}\nfunction useGridDate(callbacks) {\n return useGridCustomComponent(callbacks);\n}\nfunction useGridFilter(callbacks) {\n return useGridCustomComponent(callbacks);\n}\nfunction useGridFilterDisplay(callbacks) {\n return useGridCustomComponent(callbacks);\n}\nfunction useGridFloatingFilter(callbacks) {\n useGridCustomComponent(callbacks);\n}\nfunction useGridMenuItem(callbacks) {\n useGridCustomComponent(callbacks);\n}\nexport {\n AgGridProvider,\n AgGridReact,\n CustomContext as CustomComponentContext,\n getInstance,\n useGridCellEditor,\n useGridDate,\n useGridFilter,\n useGridFilterDisplay,\n useGridFloatingFilter,\n useGridMenuItem,\n warnReactiveCustomComponents\n};\n","import { useMemo } from \"react\";\nimport { useNavigate, useParams } from \"react-router-dom\";\nimport { AgGridReact } from \"ag-grid-react\";\nimport { useStore } from \"../store\";\nimport type { Finding, Sample } from \"../types\";\nimport type { ColDef, ICellRendererParams } from \"ag-grid-community\";\nimport {\n AllCommunityModule,\n ModuleRegistry,\n themeQuartz,\n} from \"ag-grid-community\";\n\nModuleRegistry.registerModules([AllCommunityModule]);\n\ninterface SampleRow {\n index: number;\n id: string | number | null;\n question: string;\n answer: string;\n findings: Finding[];\n}\n\nconst SEVERITY_ORDER: Record = { high: 0, medium: 1, low: 2 };\n\nfunction FindingsBadges({ findings }: { findings: Finding[] }) {\n if (findings.length === 0)\n return ;\n\n const sorted = [...findings].sort(\n (a, b) =>\n (SEVERITY_ORDER[a.severity] ?? 3) - (SEVERITY_ORDER[b.severity] ?? 3),\n );\n\n const badgeCls: Record = {\n high: \"bg-danger\",\n medium: \"bg-warning text-dark\",\n low: \"bg-secondary\",\n };\n\n return (\n \n {sorted.map((f) => (\n \n {f.scanner}\n \n ))}\n \n );\n}\n\nfunction TextCell({ value }: { value: string }) {\n return (\n \n {value}\n \n );\n}\n\nexport function SamplesTab() {\n const findings = useStore((s) => s.findings);\n const samples = useStore((s) => s.samples);\n const summary = useStore((s) => s.summary);\n const setSelectedFinding = useStore((s) => s.setSelectedFinding);\n const navigate = useNavigate();\n const { slug } = useParams<{ slug: string }>();\n\n const sampleMap = useMemo(() => {\n const m = new Map();\n for (const s of samples) m.set(s.index, s);\n return m;\n }, [samples]);\n\n const rows: SampleRow[] = useMemo(() => {\n const totalSamples = summary?.total_samples ?? 0;\n const byIndex = new Map();\n for (const f of findings) {\n const list = byIndex.get(f.sample_index) ?? [];\n list.push(f);\n byIndex.set(f.sample_index, list);\n }\n const result: SampleRow[] = [];\n for (let i = 0; i < totalSamples; i++) {\n const sample = sampleMap.get(i);\n result.push({\n index: i,\n id: sample?.id ?? null,\n question: sample?.question ?? \"\",\n answer: sample?.answer ?? \"\",\n findings: byIndex.get(i) ?? [],\n });\n }\n return result;\n }, [findings, summary, sampleMap]);\n\n const hasSamples = samples.length > 0;\n\n const columnDefs: ColDef[] = useMemo(\n () => [\n {\n headerName: \"#\",\n field: \"index\",\n width: 70,\n sort: \"asc\" as const,\n },\n ...(hasSamples\n ? [\n {\n headerName: \"Question\",\n field: \"question\" as const,\n flex: 2,\n cellRenderer: (params: ICellRendererParams) =>\n params.value != null ? (\n \n ) : null,\n },\n {\n headerName: \"Answer\",\n field: \"answer\" as const,\n flex: 1,\n cellRenderer: (params: ICellRendererParams) =>\n params.value != null ? (\n \n ) : null,\n },\n ]\n : []),\n {\n headerName: \"Findings\",\n field: \"findings\",\n flex: hasSamples ? 0 : 1,\n width: hasSamples ? 220 : undefined,\n cellRenderer: (params: ICellRendererParams) => {\n const row = params.data;\n if (!row) return null;\n return ;\n },\n comparator: (a: Finding[], b: Finding[]) => a.length - b.length,\n },\n {\n headerName: \"N\",\n width: 60,\n valueGetter: (params: { data?: SampleRow }) =>\n params.data?.findings.length ?? 0,\n },\n ],\n [hasSamples],\n );\n\n const onRowClicked = (event: { data?: SampleRow }) => {\n const row = event.data;\n if (row && row.findings.length > 0) {\n setSelectedFinding(row.findings[0]);\n navigate(`/${slug}/findings`);\n }\n };\n\n return (\n
\n
\n \n theme={themeQuartz}\n rowData={rows}\n columnDefs={columnDefs}\n onRowClicked={onRowClicked}\n rowSelection=\"single\"\n getRowStyle={(params) => {\n if (params.data && params.data.findings.length === 0) {\n return { opacity: \"0.5\" };\n }\n return undefined;\n }}\n />\n
\n
\n );\n}\n","import { Link } from \"react-router-dom\";\nimport type { DatasetInfo } from \"../types\";\n\nconst SEVERITY_COLORS: Record = {\n high: \"bg-danger\",\n medium: \"bg-warning text-dark\",\n low: \"bg-secondary\",\n};\n\nfunction SeverityPills({ bySeverity }: { bySeverity: Record }) {\n const order = [\"high\", \"medium\", \"low\"];\n const entries = order\n .filter((s) => (bySeverity[s] ?? 0) > 0)\n .map((s) => ({ severity: s, count: bySeverity[s] }));\n\n if (entries.length === 0)\n return No findings;\n\n return (\n \n {entries.map(({ severity, count }) => (\n \n {count} {severity}\n \n ))}\n \n );\n}\n\nexport function DatasetPicker({ datasets }: { datasets: DatasetInfo[] }) {\n return (\n
\n \n\n
\n
\n Select a dataset to explore\n
\n
\n {datasets.map((ds) => (\n
\n \n
\n
\n {ds.dataset_name}\n
\n {ds.split && (\n
\n [{ds.split}]\n
\n )}\n
\n {ds.total_samples.toLocaleString()} samples ·{\" \"}\n {ds.total_findings} findings\n
\n \n
\n \n
\n ))}\n
\n
\n
\n );\n}\n","import { useEffect, useState } from \"react\";\nimport { Navigate, Outlet, Route, Routes, useParams } from \"react-router-dom\";\nimport { useStore } from \"./store\";\nimport { useKeyboard } from \"./hooks/useKeyboard\";\nimport { Header } from \"./components/Header\";\nimport { ScannerSidebar } from \"./components/ScannerSidebar\";\nimport { FindingsList } from \"./components/FindingsList\";\nimport { FindingDetail } from \"./components/FindingDetail\";\nimport { SamplesTab } from \"./components/SamplesTab\";\nimport { DatasetPicker } from \"./components/DatasetPicker\";\nimport { exportUrl } from \"./api\";\nimport type { DatasetInfo } from \"./types\";\nimport { fetchDatasets } from \"./api\";\n\n// ── Loading / error screens ────────────────────────────────────────────────\n\nfunction LoadingScreen() {\n return (\n
\n
\n Loading…\n
\n
\n );\n}\n\nfunction ErrorScreen({ message }: { message: string }) {\n return (\n
\n
{message}
\n
\n );\n}\n\n// ── Root redirect — fetch datasets, then route accordingly ─────────────────\n\nfunction DatasetRedirect() {\n const loadDatasets = useStore((s) => s.loadDatasets);\n const [datasets, setDatasets] = useState(null);\n const [err, setErr] = useState(null);\n\n useEffect(() => {\n fetchDatasets()\n .then((ds) => {\n loadDatasets(); // populate store for switcher\n setDatasets(ds);\n })\n .catch((e) => setErr(String(e)));\n }, [loadDatasets]);\n\n if (err) return ;\n if (datasets === null) return ;\n if (datasets.length === 0)\n return ;\n if (datasets.length === 1)\n return ;\n\n return ;\n}\n\n// ── Per-dataset layout — loads data when slug changes ─────────────────────\n\nfunction DatasetLayout() {\n const { slug } = useParams<{ slug: string }>();\n const loadDataset = useStore((s) => s.loadDataset);\n const loadDatasets = useStore((s) => s.loadDatasets);\n const currentSlug = useStore((s) => s.currentSlug);\n const datasets = useStore((s) => s.datasets);\n const loading = useStore((s) => s.loading);\n const error = useStore((s) => s.error);\n\n useKeyboard();\n\n // Load dataset list (for switcher) and dataset data when slug changes\n useEffect(() => {\n if (datasets.length === 0) loadDatasets();\n }, [datasets.length, loadDatasets]);\n\n useEffect(() => {\n if (slug && slug !== currentSlug) {\n loadDataset(slug);\n }\n }, [slug, currentSlug, loadDataset]);\n\n if (loading) return ;\n if (error) return ;\n\n return (\n
\n
\n\n
\n \n
\n\n
\n \n Keyboard: c confirm · d dismiss · n/\n p next/prev\n \n \n Export clean_ids.txt\n \n
\n
\n );\n}\n\n// ── Findings page ──────────────────────────────────────────────────────────\n\nfunction FindingsPage() {\n return (\n <>\n \n \n \n \n );\n}\n\n// ── Root ───────────────────────────────────────────────────────────────────\n\nfunction App() {\n return (\n \n } />\n }>\n } />\n } />\n } />\n \n \n );\n}\n\nexport default App;\n","import { StrictMode } from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { BrowserRouter } from \"react-router-dom\";\nimport \"bootstrap/dist/css/bootstrap.min.css\";\nimport \"bootstrap-icons/font/bootstrap-icons.css\";\nimport App from \"./App.tsx\";\n\ncreateRoot(document.getElementById(\"root\")!).render(\n \n \n \n \n ,\n);\n"],"file":"index.js"} \ No newline at end of file diff --git a/src/inspect_dataset/_view/www/dist/index.html b/src/inspect_dataset/_view/www/dist/index.html index f6793fc..ecf26bb 100644 --- a/src/inspect_dataset/_view/www/dist/index.html +++ b/src/inspect_dataset/_view/www/dist/index.html @@ -1,16 +1,14 @@ + + + + inspect-dataset + + + - - - - inspect-dataset - - - - - -
- - - \ No newline at end of file + +
+ + diff --git a/src/inspect_dataset/_view/www/package-lock.json b/src/inspect_dataset/_view/www/package-lock.json index afb99b6..1767730 100644 --- a/src/inspect_dataset/_view/www/package-lock.json +++ b/src/inspect_dataset/_view/www/package-lock.json @@ -16,7 +16,9 @@ "lucide-react": "^1.7.0", "react": "^19.2.4", "react-dom": "^19.2.4", + "react-markdown": "^10.1.0", "react-router-dom": "^7.14.0", + "remark-gfm": "^4.0.1", "zustand": "^5.0.12" }, "devDependencies": { @@ -884,13 +886,39 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/debug": { + "version": "4.1.13", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", + "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, "license": "MIT" }, + "node_modules/@types/estree-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@types/hast": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz", + "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -898,6 +926,21 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, "node_modules/@types/node": { "version": "24.12.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz", @@ -912,7 +955,6 @@ "version": "19.2.14", "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", - "devOptional": true, "license": "MIT", "dependencies": { "csstype": "^3.2.2" @@ -928,6 +970,12 @@ "@types/react": "^19.2.0" } }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "license": "MIT" + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.58.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.58.0.tgz", @@ -1223,6 +1271,12 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.3.tgz", + "integrity": "sha512-60YRaenCQcVjYEKOcG824+DRGGIQ3VKErcBoAEDJZz5bKIs2ZG+X/H9Nk+Q6EVkwJk5QNApxbrc5QtBSwtrXAg==", + "license": "ISC" + }, "node_modules/@vitejs/plugin-react": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.1.tgz", @@ -1341,6 +1395,16 @@ "dev": true, "license": "Python-2.0" }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1472,6 +1536,16 @@ ], "license": "CC-BY-4.0" }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -1489,6 +1563,46 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -1518,6 +1632,16 @@ "dev": true, "license": "MIT" }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1564,14 +1688,12 @@ "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "devOptional": true, "license": "MIT" }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -1585,6 +1707,19 @@ } } }, + "node_modules/decode-named-character-reference": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz", + "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==", + "license": "MIT", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -1592,6 +1727,15 @@ "dev": true, "license": "MIT" }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -1602,6 +1746,19 @@ "node": ">=8" } }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/electron-to-chromium": { "version": "1.5.331", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.331.tgz", @@ -1806,6 +1963,16 @@ "node": ">=4.0" } }, + "node_modules/estree-util-is-identifier-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", + "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -1816,6 +1983,12 @@ "node": ">=0.10.0" } }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -1967,6 +2140,46 @@ "node": ">=8" } }, + "node_modules/hast-util-to-jsx-runtime": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz", + "integrity": "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hermes-estree": { "version": "0.25.1", "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", @@ -1984,6 +2197,16 @@ "hermes-estree": "0.25.1" } }, + "node_modules/html-url-attributes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-url-attributes/-/html-url-attributes-3.0.1.tgz", + "integrity": "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -2021,6 +2244,46 @@ "node": ">=0.8.19" } }, + "node_modules/inline-style-parser": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz", + "integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==", + "license": "MIT" + }, + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "license": "MIT", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2044,6 +2307,28 @@ "node": ">=0.10.0" } }, + "node_modules/is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -2425,6 +2710,16 @@ "dev": true, "license": "MIT" }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -2456,112 +2751,966 @@ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, - "node_modules/minimatch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" + "node_modules/markdown-table": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", + "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], + "node_modules/mdast-util-find-and-replace": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz", + "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==", "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" + "dependencies": { + "@types/mdast": "^4.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "license": "MIT" - }, - "node_modules/node-releases": { - "version": "2.0.37", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.37.tgz", - "integrity": "sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==", - "dev": true, - "license": "MIT" - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "dev": true, + "node_modules/mdast-util-from-markdown": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.3.tgz", + "integrity": "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==", "license": "MIT", "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" }, - "engines": { - "node": ">= 0.8.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/p-limit": { + "node_modules/mdast-util-gfm": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.1.0.tgz", + "integrity": "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==", "license": "MIT", "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-gfm-autolink-literal": "^2.0.0", + "mdast-util-gfm-footnote": "^2.0.0", + "mdast-util-gfm-strikethrough": "^2.0.0", + "mdast-util-gfm-table": "^2.0.0", + "mdast-util-gfm-task-list-item": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, + "node_modules/mdast-util-gfm-autolink-literal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz", + "integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==", "license": "MIT", "dependencies": { - "p-limit": "^3.0.2" + "@types/mdast": "^4.0.0", + "ccount": "^2.0.0", + "devlop": "^1.0.0", + "mdast-util-find-and-replace": "^3.0.0", + "micromark-util-character": "^2.0.0" }, - "engines": { + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-footnote": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.1.0.tgz", + "integrity": "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", + "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "markdown-table": "^3.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", + "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", + "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.0.tgz", + "integrity": "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", + "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-hast": { + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz", + "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz", + "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", + "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", + "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", + "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", + "license": "MIT", + "dependencies": { + "micromark-extension-gfm-autolink-literal": "^2.0.0", + "micromark-extension-gfm-footnote": "^2.0.0", + "micromark-extension-gfm-strikethrough": "^2.0.0", + "micromark-extension-gfm-table": "^2.0.0", + "micromark-extension-gfm-tagfilter": "^2.0.0", + "micromark-extension-gfm-task-list-item": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-autolink-literal": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz", + "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==", + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-footnote": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz", + "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-strikethrough": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz", + "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-table": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz", + "integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-tagfilter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", + "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-task-list-item": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz", + "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-factory-destination": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", + "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-label": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", + "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", + "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-title": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", + "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", + "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-character": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-chunked": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", + "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-classify-character": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", + "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", + "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", + "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-string": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", + "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-encode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", + "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", + "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-resolve-all": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", + "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-subtokenize": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-symbol": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.37", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.37.tgz", + "integrity": "sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==", + "dev": true, + "license": "MIT" + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { "node": ">=10" }, "funding": { @@ -2581,6 +3730,31 @@ "node": ">=6" } }, + "node_modules/parse-entities": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", + "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-entities/node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "license": "MIT" + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -2687,6 +3861,16 @@ "react-is": "^16.13.1" } }, + "node_modules/property-information": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.2.0.tgz", + "integrity": "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -2724,6 +3908,33 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "license": "MIT" }, + "node_modules/react-markdown": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-10.1.0.tgz", + "integrity": "sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "hast-util-to-jsx-runtime": "^2.0.0", + "html-url-attributes": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "unified": "^11.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "@types/react": ">=18", + "react": ">=18" + } + }, "node_modules/react-router": { "version": "7.14.0", "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.14.0.tgz", @@ -2762,6 +3973,72 @@ "react-dom": ">=18" } }, + "node_modules/remark-gfm": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz", + "integrity": "sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-gfm": "^3.0.0", + "micromark-extension-gfm": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-stringify": "^11.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.2.tgz", + "integrity": "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-stringify": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", + "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-to-markdown": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -2868,6 +4145,30 @@ "node": ">=0.10.0" } }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "license": "MIT", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -2881,6 +4182,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/style-to-js": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz", + "integrity": "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==", + "license": "MIT", + "dependencies": { + "style-to-object": "1.0.14" + } + }, + "node_modules/style-to-object": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.14.tgz", + "integrity": "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==", + "license": "MIT", + "dependencies": { + "inline-style-parser": "0.2.7" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2911,6 +4230,26 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/trough": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/ts-api-utils": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", @@ -2990,6 +4329,93 @@ "dev": true, "license": "MIT" }, + "node_modules/unified": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-is": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", + "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", + "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", + "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/update-browserslist-db": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", @@ -3031,6 +4457,34 @@ "punycode": "^2.1.0" } }, + "node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz", + "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/vite": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.3.tgz", @@ -3206,6 +4660,16 @@ "optional": true } } + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } } } } diff --git a/src/inspect_dataset/_view/www/package.json b/src/inspect_dataset/_view/www/package.json index 9ab587d..7920d0c 100644 --- a/src/inspect_dataset/_view/www/package.json +++ b/src/inspect_dataset/_view/www/package.json @@ -20,7 +20,9 @@ "lucide-react": "^1.7.0", "react": "^19.2.4", "react-dom": "^19.2.4", + "react-markdown": "^10.1.0", "react-router-dom": "^7.14.0", + "remark-gfm": "^4.0.1", "zustand": "^5.0.12" }, "devDependencies": { diff --git a/src/inspect_dataset/_view/www/src/components/AuditView.tsx b/src/inspect_dataset/_view/www/src/components/AuditView.tsx new file mode 100644 index 0000000..cc54151 --- /dev/null +++ b/src/inspect_dataset/_view/www/src/components/AuditView.tsx @@ -0,0 +1,154 @@ +import React, { useEffect, useMemo, useState } from "react"; +import ReactMarkdown from "react-markdown"; +import remarkGfm from "remark-gfm"; +import type { Finding, SampleDetail } from "../types"; + +const markdownComponents = { + table: (props: React.ComponentProps<"table">) => ( +
+ ), +}; + +interface AuditViewProps { + detail: SampleDetail; + findings: Finding[]; + onClose: () => void; +} + +/** Full-screen three-pane audit: page image | rendered gold | raw source. + * + * Finding lines are file-based (sidecar frontmatter included); the raw pane + * maps them into the markdown body via the sample's line_offset. + */ +export function AuditView({ detail, findings, onClose }: AuditViewProps) { + const [source, setSource] = useState("gold"); + + useEffect(() => { + const onKey = (e: KeyboardEvent) => { + if (e.key === "Escape") onClose(); + }; + window.addEventListener("keydown", onKey); + return () => window.removeEventListener("keydown", onKey); + }, [onClose]); + + const pageImage = + detail.images.find((img) => img.field === "page") ?? detail.images[0]; + const offset = detail.line_offset ?? 0; + const highlighted = useMemo(() => { + const lines = new Set(); + for (const f of findings) { + if (f.line != null) lines.add(f.line - offset); + } + return lines; + }, [findings, offset]); + + const sourceText = + source === "gold" + ? detail.answer + : (detail.tool_outputs?.find((t) => t.name === source)?.text ?? ""); + + return ( +
+
+
+ Audit — sample {detail.id ?? detail.index} + + {findings.length} finding{findings.length !== 1 ? "s" : ""} + +
+ +
+ +
+ {/* Page image */} +
+
+ Page +
+ {pageImage ? ( + page + ) : ( +
No page image.
+ )} +
+ + {/* Rendered gold */} +
+
+ Rendered gold +
+
+ + {detail.answer} + +
+
+ + {/* Raw source with finding-line highlights */} +
+
+
+ Source +
+ {detail.tool_outputs && detail.tool_outputs.length > 0 && ( + + )} +
+
+            {sourceText.split("\n").map((line, i) => {
+              const isHit = source === "gold" && highlighted.has(i + 1);
+              return (
+                
+ + {i + 1} + + {line || " "} +
+ ); + })} +
+
+
+
+ ); +} diff --git a/src/inspect_dataset/_view/www/src/components/FindingDetail.tsx b/src/inspect_dataset/_view/www/src/components/FindingDetail.tsx index 42a4ada..d273880 100644 --- a/src/inspect_dataset/_view/www/src/components/FindingDetail.tsx +++ b/src/inspect_dataset/_view/www/src/components/FindingDetail.tsx @@ -1,9 +1,18 @@ -import { useEffect, useState } from "react"; +import React, { useEffect, useState } from "react"; +import ReactMarkdown from "react-markdown"; +import remarkGfm from "remark-gfm"; +import { AuditView } from "./AuditView"; import { useParams, useSearchParams } from "react-router-dom"; import { useStore, getFilteredFindings } from "../store"; import { fetchSampleDetail } from "../api"; import type { SampleDetail, TriageStatus } from "../types"; +const markdownComponents = { + table: (props: React.ComponentProps<"table">) => ( +
+ ), +}; + export function FindingDetail() { const finding = useStore((s) => s.selectedFinding); const triageFinding = useStore((s) => s.triageFinding); @@ -11,6 +20,7 @@ export function FindingDetail() { const setSelectedFinding = useStore((s) => s.setSelectedFinding); const [searchParams] = useSearchParams(); const { slug } = useParams<{ slug: string }>(); + const [showAudit, setShowAudit] = useState(false); // Loaded detail is keyed by (slug, sample_index) so the current sample's // detail and loading flag can be derived instead of set in the effect. @@ -72,6 +82,10 @@ export function FindingDetail() { if (next !== idx) setSelectedFinding(filtered[next]); }; + const sampleFindings = findings.filter( + (f) => f.sample_index === finding.sample_index, + ); + const allImages = [ ...(sampleDetail?.images ?? []).map((img) => ({ src: img.data_url, @@ -88,6 +102,13 @@ export function FindingDetail() { className="border-start d-flex flex-column" style={{ width: 380, minWidth: 380, overflowY: "auto" }} > + {showAudit && sampleDetail && ( + setShowAudit(false)} + /> + )} {/* Finding header */}
@@ -138,8 +159,28 @@ export function FindingDetail() {
A: - {sampleDetail.answer} + {sampleDetail.answer.includes("\n") ? ( +
+ + {sampleDetail.answer} + +
+ ) : ( + {sampleDetail.answer} + )}
+ {(allImages.length > 0 || sampleDetail.answer.includes("\n")) && ( + + )} {allImages.map((img) => ( ; triage_status: TriageStatus; } diff --git a/src/inspect_dataset/cli.py b/src/inspect_dataset/cli.py index 2e495a1..f71553c 100644 --- a/src/inspect_dataset/cli.py +++ b/src/inspect_dataset/cli.py @@ -248,6 +248,7 @@ def scan( resolved_split: str | None = split if is_local: + dataset = str(Path(dataset).resolve()) console.print(f"Loading local samples from [bold]{dataset}[/bold]...") records, fields = load_local_samples(dataset, limit=limit) resolved_split = None @@ -329,7 +330,13 @@ def scan( output_dir = f"findings/{slug}_{timestamp}" out = Path(output_dir) - save_findings(run, out, records=records, fields=fields) + save_findings( + run, + out, + records=records, + fields=fields, + files_root=str(Path(files_root).resolve()) if files_root else None, + ) console.print(f"Findings saved to [bold]{out}[/bold]") diff --git a/src/inspect_dataset/report.py b/src/inspect_dataset/report.py index 7b26cd5..7b04ca5 100644 --- a/src/inspect_dataset/report.py +++ b/src/inspect_dataset/report.py @@ -81,6 +81,7 @@ def save_findings( output_dir: Path, records: list[Record] | None = None, fields: FieldMap | None = None, + files_root: str | None = None, ) -> None: """Write per-scanner JSON files, a summary, and optionally samples to output_dir.""" output_dir.mkdir(parents=True, exist_ok=True) @@ -95,6 +96,7 @@ def save_findings( "split": run.split, "source_type": run.source_type, "revision": run.revision, + "files_root": files_root, "total_samples": run.total_samples, "total_findings": len(run.findings), "by_scanner": { diff --git a/tests/test_cross_artifact.py b/tests/test_cross_artifact.py index 1efa535..757cdaf 100644 --- a/tests/test_cross_artifact.py +++ b/tests/test_cross_artifact.py @@ -7,8 +7,7 @@ FIELDS = FieldMap(question="q", answer="a", id="id") PAGE_TEXT = ( - "CONSOLIDATED BALANCE SHEETS\nItem 2023\n" - "Cash and equivalents $ 48,304\nTotal assets 272,425\n" + "CONSOLIDATED BALANCE SHEETS\nItem 2023\nCash and equivalents $ 48,304\nTotal assets 272,425\n" ) GOLD_MD = """\ @@ -109,8 +108,8 @@ def test_empty_tool_outputs_skipped(tmp_path): def test_hyphenated_linebreaks_joined(tmp_path): sample = tmp_path / "s1" sample.mkdir() - (sample / "pymupdf.txt").write_text("Consolidated infor-\nmation follows\n") - rec = record(sample, answer="Consolidated information follows") + (sample / "pymupdf.txt").write_text("correctly hyphen-\nated words\n") + rec = record(sample, answer="correctly hyphenated words") assert text_layer_recall([rec], FIELDS) == [] diff --git a/tests/test_view_local_api.py b/tests/test_view_local_api.py new file mode 100644 index 0000000..d69b0dd --- /dev/null +++ b/tests/test_view_local_api.py @@ -0,0 +1,92 @@ +"""API tests for serving local annotation datasets in the view server.""" + +import asyncio +import json + +import pytest +from aiohttp.test_utils import TestClient, TestServer + +from inspect_dataset._view.server import create_app +from inspect_dataset.loader import load_local_samples +from inspect_dataset.report import save_findings +from inspect_dataset.scanner import run_scanners +from inspect_dataset.scanners import BUILTIN_SCANNER_NAMES + +GOLD_MD = """\ +--- +title: T +source: x.pdf +page: 1 +tier: financial +--- + +# Title + +| Item | 2023 | +| --- | ---: | +| Cash | 10 | +""" + +PNG_1PX = bytes.fromhex( + "89504e470d0a1a0a0000000d49484452000000010000000108060000001f15c489" + "0000000d4944415478da63fccff0bf1e00057f027f8f2b6c1e0000000049454e44ae426082" +) + + +@pytest.fixture +def findings_dir(tmp_path): + samples = tmp_path / "samples" + samples.mkdir() + (samples / "s1.json").write_text( + json.dumps( + { + "id": "s1", + "task_type": "page_roundtrip", + "pdf_path": "corpus/x.pdf", + "page_number": 1, + "tier": "financial", + "ground_truth_markdown_path": "s1.md", + } + ) + ) + (samples / "s1.md").write_text(GOLD_MD) + + cache = tmp_path / "cache" / "s1" + cache.mkdir(parents=True) + (cache / "page.png").write_bytes(PNG_1PX) + (cache / "pymupdf.txt").write_text("Title Item 2023 Cash 10\n") + + records, fields = load_local_samples(samples) + run = run_scanners( + records, + fields, + [BUILTIN_SCANNER_NAMES["markdown_integrity"]], + dataset_name=str(samples), + source_type="local", + ) + out = tmp_path / "findings" + save_findings(run, out, records=records, fields=fields, files_root=str(tmp_path / "cache")) + return out + + +def test_sample_detail_serves_artifacts(findings_dir): + async def run() -> dict: + app = create_app(findings_dir) + async with TestClient(TestServer(app)) as client: + datasets = await (await client.get("/api/datasets")).json() + slug = datasets[0]["slug"] + return await (await client.get(f"/api/{slug}/sample/0")).json() + + detail = asyncio.run(run()) + assert detail["id"] == "s1" + assert detail["answer"].startswith("# Title") + assert detail["line_offset"] == 7 + assert [img["field"] for img in detail["images"]] == ["page"] + assert detail["images"][0]["data_url"].startswith("data:image/png;base64,") + assert [t["name"] for t in detail["tool_outputs"]] == ["pymupdf"] + + +def test_summary_records_files_root(findings_dir): + summary = json.loads((findings_dir / "scan_summary.json").read_text()) + assert summary["source_type"] == "local" + assert summary["files_root"].endswith("cache") From 4beffac05189b8f69a9340d5c707e40b3b573c18 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 18 Jul 2026 22:35:02 +0000 Subject: [PATCH 3/3] Plan v0.6.4: speculative generalisation pass for the audit contract MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Records the known benchmark-vocabulary leakage in the cross-artifact scanners and audit view (skip-field name, task_type magic string, loader schema fallback, artifact layout), the proposed record-adapter contract with reserved dunder fields, and longer-term directions: eval packages shipping their own adapters, a declarative audit UI spec, and inferring the contract from HuggingFace dataset Features. Explicitly deferred until the features have seen real use — and gated before the first PyPI release that includes v0.6, when conventions become API commitments. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01LLg5cbBcfNyyrRGJVPfsA6 --- PLAN.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/PLAN.md b/PLAN.md index b1d0c4b..147a2c8 100644 --- a/PLAN.md +++ b/PLAN.md @@ -521,6 +521,31 @@ Design principles: - [ ] Edit-in-place with write-back to the sidecar file + single-sample re-scan (turns triage into curation) - [ ] Audit provenance: record "verified against page image" per sample in `triage.json` with the md file's git hash, so staleness is detectable +#### v0.6.4 — Generalisation pass: audit contract (speculative) + +> **Status: speculative.** Deliberately deferred until the v0.6.1/v0.6.3 features have been used in anger on the driving benchmark — extracting a contract before first real use means guessing which knobs matter. The forcing deadline is PyPI: the first published release containing v0.6 turns today's implicit conventions into API commitments, so this pass should land (or be consciously rejected) before then. + +The cross-artifact scanners and audit view currently encode the driving benchmark's vocabulary as implicit conventions: + +- `ocr_resistant` — a benchmark-specific record field hardcoded as the cross-artifact skip condition +- `task_type` contains `"page"` — a magic-string rule gating the omission direction +- `ground_truth_table.markdown` — the local loader's fallback reads one benchmark's JSON schema shape +- The artifact-directory layout ("every `*.txt`/`*.md` except `ground_truth.*` and `index.md` is a tool output; `page.png` is the page image") restates one benchmark's cache builder + +These conventions fail *silently* for any dataset shaped differently — a dataset whose skip-field has another name doesn't error, it quietly produces false positives. + +**Proposed shape** (not a pile of CLI flags — a record-level contract): + +- Scanners and viewer consume only **reserved dunder fields**: `__artifacts_dir__` (exists), plus e.g. `__skip_cross_artifact__`, `__gold_covers_source__`, `__page_image__`, `__tool_texts__` +- A **record adapter** hook — a sibling of `--scanner-module` that imports a transform function — lets each benchmark map its own vocabulary onto the contract (`ocr_resistant` → `__skip_cross_artifact__`, etc.), keeping benchmark schema knowledge out of this package +- The artifact layout gets documented as a first-class interface (or replaced by explicit fields set by the adapter) + +**Longer-term, if inspect-dataset gets significant uptake:** + +- Eval packages could *ship their own adapters* the way they ship `@task` definitions today — `inspect-dataset scan some_eval/task --adapter some_eval.audit` with zero local configuration +- An **"audit UI spec"** — a small declarative description an eval provides of what its side-by-side audit view should show (source artifact, rendered gold, comparison panes) — would let the viewer serve very different benchmark shapes without frontend plugins +- The **HuggingFace dataset schema** (`datasets.Features`) is an untapped source for the same contract: `Image` columns could auto-populate the page/source pane, `ClassLabel`/typed columns could drive scanner applicability, and dataset cards could seed the audit spec — much of the adapter could be inferred rather than written for HF-hosted datasets + ______________________________________________________________________ ## CLI Design