diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..41933fb --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +docs/assets/highlighter.js -diff linguist-generated=true diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a9765b3..e7af5ca 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -90,12 +90,36 @@ jobs: run: | cd wasm cargo test --verbose + - name: Install wasm-pack + run: cargo install wasm-pack --locked + - name: Run WASM browser tests + run: | + cd wasm + wasm-pack test --headless --firefox - name: Lint WASM with Clippy run: | rustup component add clippy cd wasm cargo clippy -- -D warnings + build-docs-ui: + runs-on: ubuntu-latest + if: github.event_name == 'push' || github.event_name == 'pull_request' + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v6 + with: + node-version: '24' + cache: npm + cache-dependency-path: docs-ui/package-lock.json + - name: Build and verify syntax highlighting + working-directory: docs-ui + run: | + npm ci + npm test + - name: Check generated highlighter + run: git diff --exit-code -- docs/assets/highlighter.js + publish-library: needs: build-library runs-on: ubuntu-latest @@ -208,7 +232,7 @@ jobs: cargo publish publish-wasm: - needs: build-wasm + needs: [build-wasm, build-docs-ui] runs-on: ubuntu-latest permissions: id-token: write @@ -239,6 +263,11 @@ jobs: cd wasm/pkg npm install npm ci + - name: Build and verify docs highlighter + working-directory: docs-ui + run: | + npm ci + npm test - name: Publish to npm run: | cd wasm/pkg @@ -267,6 +296,6 @@ jobs: run: | git config user.name "github-actions" git config user.email "github-actions@github.com" - git add docs/m_bus_parser_wasm_pack.js docs/m_bus_parser_wasm_pack_bg.js docs/m_bus_parser_wasm_pack_bg.wasm docs/meter.png docs/package.json + git add docs/assets/highlighter.js docs/m_bus_parser_wasm_pack.js docs/m_bus_parser_wasm_pack_bg.js docs/m_bus_parser_wasm_pack_bg.wasm docs/meter.png docs/package.json git commit -m "Update docs wasm artifacts" || echo "No changes to commit" git push origin HEAD:main diff --git a/.gitignore b/.gitignore index 49a3732..b2c8911 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ Cargo.lock # Mac .DS_Store + +# Node build dependencies +node_modules/ diff --git a/CHANGELOG.md b/CHANGELOG.md index ace6554..2811cce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.4.0] + +### Added + +- A versioned canonical output schema shared by Rust, CLI, Python, and WASM, + with exact decimal values, source provenance, partial-decode diagnostics, + stable error codes, and optional manufacturer enrichment. +- Typed `decode_*` and `render_*` Rust APIs, a native-object WASM decoder, a + custom Python exception, strict hexadecimal input, and explicit render + options. +- Responsive Unicode-aware tables that adapt between wide, compact, and + vertical layouts without exceeding the requested terminal or container + width. +- Self-hosted Shiki syntax highlighting for JSON, YAML, CSV, and XML in the + WASM documentation, with light/dark high-contrast themes, line numbers, + keyboard scrolling, forced-colors support, and automated WCAG AA checks. + +### Changed + +- JSON, YAML, CSV, table, Mermaid, annotated, XML, and binding outputs now use + one product-owned contract. Retained legacy serializers are available under + explicit legacy format names through this compatibility release. +- Wireless link frames preserve the raw C-field and expose the decoded + function only when the value is known. + +### Fixed + +- XML rendering now supports clear, encrypted, short/long transport, and ELL + wireless M-Bus frames while retaining byte-for-byte wired libmbus parity. +- Tables no longer wrap or mangle inside narrow terminals and browser output + cards. +- Syntax tokens and line-number gutters meet the WCAG 2.2 AA 4.5:1 text + contrast threshold in both supported themes. + ## [0.3.0] ### Added diff --git a/Cargo.toml b/Cargo.toml index 52721ff..05a8740 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "m-bus-parser" -version = "0.3.0" +version = "0.4.0" edition = "2021" description = "A library for parsing M-Bus frames" license = "MIT" @@ -25,7 +25,7 @@ bindgen = "0.72.0" [features] default = [] -std = ["prettytable-rs", "serde_json", "serde_yaml", "serde", "wired-mbus-link-layer/std", "wireless-mbus-link-layer/std", "m-bus-core/std", "m-bus-application-layer/std"] +std = ["prettytable-rs", "serde_json", "serde_yaml", "serde", "unicode-width", "wired-mbus-link-layer/std", "wireless-mbus-link-layer/std", "m-bus-core/std", "m-bus-application-layer/std"] plaintext-before-extension = ["m-bus-application-layer/plaintext-before-extension"] serde = ["dep:serde", "arrayvec/serde", "bitflags/serde", "wired-mbus-link-layer/serde", "wireless-mbus-link-layer/serde", "m-bus-core/serde", "m-bus-application-layer/serde"] defmt = ["dep:defmt", "wired-mbus-link-layer/defmt", "wireless-mbus-link-layer/defmt", "m-bus-core/defmt", "m-bus-application-layer/defmt"] @@ -44,13 +44,14 @@ prettytable-rs = { version = "^0.10", optional = true } serde_json = { version = "1.0.138", optional = true } serde_yaml = { version = "0.9", optional = true } serde = { version = "1.0", features = ["derive"], optional = true } +unicode-width = { version = "0.2", optional = true } bitflags = "2.8.0" arrayvec = { version = "0.7.4", default-features = false } defmt = { version = "1.0.1", optional = true } -wired-mbus-link-layer = { version = "0.3.0", path = "crates/wired-mbus-link-layer" } -wireless-mbus-link-layer = { version = "0.3.0", path = "crates/wireless-mbus-link-layer" } -m-bus-core = { version = "0.3.0", path = "crates/m-bus-core" } -m-bus-application-layer = { version = "0.3.0", path = "crates/m-bus-application-layer" } +wired-mbus-link-layer = { version = "0.4.0", path = "crates/wired-mbus-link-layer" } +wireless-mbus-link-layer = { version = "0.4.0", path = "crates/wireless-mbus-link-layer" } +m-bus-core = { version = "0.4.0", path = "crates/m-bus-core" } +m-bus-application-layer = { version = "0.4.0", path = "crates/m-bus-application-layer" } aes = { version = "0.9", optional = true, default-features = false } cbc = { version = "0.2", optional = true, default-features = false } cipher = { version = "0.5", optional = true, default-features = false, features = ["block-padding"] } diff --git a/README.md b/README.md index 8030e82..3c9c02e 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,11 @@ An open-source parser (decoder/deserializer) for the **wired** and **wireless** ## Features - Parses **wired M-Bus** (EN 13757-2/-3) and **wireless M-Bus** (wMBus) frames -- **Six output formats**: `table`, `json`, `yaml`, `csv`, `mermaid`, `xml` +- **Eight harmonized output formats**: `table`, `json`, `yaml`, `csv`, + `mermaid`, `xml`, `annotated`, and `annotated-text` +- A versioned canonical schema with exact decimal values, provenance, + partial-decode diagnostics, and stable error codes +- Responsive, Unicode-aware tables for narrow terminals and browser cards - **AES-128 decryption** for encrypted wMBus frames (mode 5 / mode 7) - **`no_std` compatible** — runs on embedded targets (manufacturer lookup and output formats require `std`) - Available as a **Rust library**, **CLI**, **WebAssembly (npm)** and **Python bindings** @@ -69,65 +73,26 @@ m-bus-parser-cli parse [OPTIONS] Options: -d, --data Raw M-Bus frame as a hex string -f, --file File containing a hex frame - -t, --format Output format: table (default), json, yaml, csv, mermaid, xml + -t, --format table, json, yaml, csv, mermaid, xml, annotated, annotated-text -k, --key AES-128 decryption key (32 hex characters) + --width Table width (auto-detected on an interactive terminal) + --no-enrichment Omit manufacturer enrichment ``` -Input hex can be in any of these forms: +Input hex is strict: use compact hexadecimal or complete byte tokens separated +by whitespace, colons, or hyphens. + ``` 68 3D 3D 68 ... (space-separated) 683D3D68... (plain hex) -0x68,0x3D,0x3D,... (0x-prefixed, comma-separated) +0x68:0x3D:0x3D:0x68 (prefixed byte tokens) ``` ### Table output (default) -```bash -m-bus-parser-cli parse -d "68 3D 3D 68 08 01 72 00 51 20 02 82 4D 02 04 00 88 00 00 \ - 04 07 00 00 00 00 0C 15 03 00 00 00 0B 2E 00 00 00 0B 3B 00 00 00 0A 5A 88 12 \ - 0A 5E 16 05 0B 61 23 77 00 02 6C 8C 11 02 27 37 0D 0F 60 00 67 16" -``` - -``` -Long Frame -┌────────────────────────────────┬─────────────┐ -│ Function │ Address │ -├────────────────────────────────┼─────────────┤ -│ RspUd (ACD: false, DFC: false) │ Primary (1) │ -└────────────────────────────────┴─────────────┘ -┌───────────────────────┬──────────────────────────────────────────┐ -│ Field │ Value │ -├───────────────────────┼──────────────────────────────────────────┤ -│ Identification Number │ 02205100 │ -├───────────────────────┼──────────────────────────────────────────┤ -│ Manufacturer │ SLB │ -├───────────────────────┼──────────────────────────────────────────┤ -│ Manufacturer Name │ Schlumberger Industries │ -├───────────────────────┼──────────────────────────────────────────┤ -│ Website │ slb.com │ -├───────────────────────┼──────────────────────────────────────────┤ -│ Description │ Energy and water metering │ -├───────────────────────┼──────────────────────────────────────────┤ -│ Access Number │ 0 │ -├───────────────────────┼──────────────────────────────────────────┤ -│ Status │ Permanent error, Manufacturer specific 3 │ -├───────────────────────┼──────────────────────────────────────────┤ -│ Security Mode │ No encryption used │ -├───────────────────────┼──────────────────────────────────────────┤ -│ Version │ 2 │ -├───────────────────────┼──────────────────────────────────────────┤ -│ DeviceType │ Heat Meter (Return) │ -└───────────────────────┴──────────────────────────────────────────┘ -┌─────────────────────────────────────────┬───────────────────────┬────────────┬─────────────┐ -│ Value │ Data Information │ Header Hex │ Data Hex │ -├─────────────────────────────────────────┼───────────────────────┼────────────┼─────────────┤ -│ (0)e4[Wh] │ 0,Inst,32-bit Integer │ 04 07 │ 00 00 00 00 │ -├─────────────────────────────────────────┼───────────────────────┼────────────┼─────────────┤ -│ (3)e-1[m³](Volume) │ 0,Inst,BCD 8-digit │ 0C 15 │ 03 00 00 00 │ -├─────────────────────────────────────────┼───────────────────────┼────────────┼─────────────┤ -│ (1288)e-1[°C] │ 0,Inst,BCD 4-digit │ 0A 5A │ 88 12 │ -└─────────────────────────────────────────┴───────────────────────┴────────────┴─────────────┘ -``` +The table automatically selects a wide, compact, or vertical-card layout and +never exceeds the detected terminal width. Use `--width 44` to request an exact +maximum explicitly. ### Other formats @@ -144,9 +109,13 @@ m-bus-parser-cli parse -d "..." -t csv # Mermaid diagram source (renders in the web app) m-bus-parser-cli parse -d "..." -t mermaid -# Legacy libmbus normalized XML (drop-in for rSCADA/libmbus consumers) +# Wired-compatible and wireless XML m-bus-parser-cli parse -d "..." -t xml +# Byte annotations as JSON or human-readable text +m-bus-parser-cli parse -d "..." -t annotated +m-bus-parser-cli parse -d "..." -t annotated-text + # With AES-128 decryption key m-bus-parser-cli parse -d "..." -k "000102030405060708090A0B0C0D0E0F" ``` @@ -159,7 +128,7 @@ Add to `Cargo.toml`: ```toml [dependencies] -m-bus-parser = "0.1" +m-bus-parser = { version = "0.4", features = ["std", "serde"] } ``` ### Parse a wired frame @@ -202,32 +171,38 @@ for record in parse_data_records(&data) { } ``` -### Serialize to any format +### Decode and render with typed APIs ```rust -use m_bus_parser::serialize_mbus_data; +use m_bus_parser::{ + DecodeOptions, OutputFormat, RenderOptions, decode_hex, render_hex, +}; let hex = "68 3D 3D 68 08 01 72 ..."; - -let table = serialize_mbus_data(hex, "table", None); -let json = serialize_mbus_data(hex, "json", None); -let yaml = serialize_mbus_data(hex, "yaml", None); -let csv = serialize_mbus_data(hex, "csv", None); -let mermaid = serialize_mbus_data(hex, "mermaid", None); -let xml = serialize_mbus_data(hex, "xml", None); - -// With decryption key -let key: [u8; 16] = [0x00, 0x01, ..., 0x0F]; -let decrypted = serialize_mbus_data(hex, "table", Some(&key)); +let decoded = decode_hex(hex, &DecodeOptions::default())?; +println!("schema v{}: {}", decoded.schema_version, decoded.protocol); + +let table = render_hex( + hex, + OutputFormat::Table, + &RenderOptions { + table_width: Some(72), + ..RenderOptions::default() + }, +)?; ``` +`serialize_mbus_data` remains as a string compatibility wrapper. New code +should use the typed APIs so invalid input and unsupported options remain +machine-readable `OutputError` values. + ### `no_std` usage The core parsing types are `no_std` compatible. Disable default features: ```toml [dependencies] -m-bus-parser = { version = "0.1", default-features = false } +m-bus-parser = { version = "0.4", default-features = false } ``` An embedded example (Cortex-M) is in [`examples/cortex-m/`](./examples/cortex-m). @@ -238,12 +213,14 @@ An embedded example (Cortex-M) is in [`examples/cortex-m/`](./examples/cortex-m) | Format | Flag | Description | |-----------|---------|--------------------------------------------------| -| `table` | default | Human-readable ASCII table | -| `json` | `-t json` | JSON | -| `yaml` | `-t yaml` | YAML | -| `csv` | `-t csv` | Comma-separated values | -| `mermaid` | `-t mermaid` | Mermaid flowchart source (renders in web app)| -| `xml` | `-t xml` | Legacy libmbus normalized XML (rSCADA-compatible)| +| `table` | default | Width-aware human-readable table | +| `json` | `-t json` | Canonical schema as JSON | +| `yaml` | `-t yaml` | Canonical schema as YAML | +| `csv` | `-t csv` | Stable tidy-record CSV | +| `mermaid` | `-t mermaid` | Layer-oriented Mermaid flowchart | +| `xml` | `-t xml` | Wired libmbus-compatible and wireless XML | +| `annotated` | `-t annotated` | Byte-segment annotation envelope | +| `annotated-text`| `-t annotated-text` | Human-readable byte annotations | --- diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 8707e92..86c23ce 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "m-bus-parser-cli" -version = "0.3.0" +version = "0.4.0" edition = "2021" description = "A cli to use the library for parsing M-Bus frames" license = "MIT" @@ -22,6 +22,7 @@ default = ["decryption"] decryption = ["m-bus-parser/decryption"] [dependencies] -m-bus-parser = { path = "..", version = "0.3.0", features = ["std", "serde"] } +m-bus-parser = { path = "..", version = "0.4.0", features = ["std", "serde"] } hex = "0.4" clap = { version = "4.5.4", features = ["derive"] } +terminal_size = "0.4" diff --git a/cli/README.md b/cli/README.md index 81c0771..74f0de7 100644 --- a/cli/README.md +++ b/cli/README.md @@ -1,89 +1,26 @@ -# M-Bus parser (wired) CLI -This is a command line interface for the m-bus parser. The parser is able to parse the link layer of the m-bus protocol. The application layer is not yet implemented fully, but works partially. It is planned to have various formats for the output. **Currently** the output is in a table format. Input can be a file or a string of the format `0x00 0x01 0x02 ...`, `000102...` or `00 01 02...`. -+=====================================+====================+============+ -| (182007+0)e0[](FabricationNumber, ) | 0,Inst,BCD 8-digit | 07 20 18 00| -+-------------------------------------+--------------------+------------+ -| (269+0)e0[m^3 ]() | 0,Inst,BCD 8-digit | 69 02 00 00| -+-------------------------------------+--------------------+------------+ -``` -+===========================+=======================+============+ -| (0+0)e4[W W ]() | 0,Inst,32-bit Integer | 00 00 00 00| -+---------------------------+-----------------------+------------+ -| (3+0)e-1[m^3 ]() | 0,Inst,BCD 8-digit | 03 00 00 00| -+---------------------------+-----------------------+------------+ -| (0+0)e3[W ]() | 0,Inst,BCD 6-digit | 00 00 00| -+---------------------------+-----------------------+------------+ -| (0+0)e-3[m^3 h^-1 ]() | 0,Inst,BCD 6-digit | 00 00 00| -+---------------------------+-----------------------+------------+ -| (1288+0)e-1[°C ]() | 0,Inst,BCD 4-digit | 88 12| -+---------------------------+-----------------------+------------+ -| (516+0)e-1[°C ]() | 0,Inst,BCD 4-digit | 16 05| -+---------------------------+-----------------------+------------+ -| (7723+0)e-2[°K ]() | 0,Inst,BCD 6-digit | 23 77 00| -+---------------------------+-----------------------+------------+ -| (12/Jan/12)(Date) | 0,Inst,Date Type G | 8C 11| -+---------------------------+-----------------------+------------+ -| (3383+0)e0[day ]() | 0,Inst,16-bit Integer | 37 0D| -+---------------------------+-----------------------+------------+ -| (Manufacturer Specific: [15, 96, 0]None) | None | 60 00| -+---------------------------+-----------------------+------------+ -``` -├──────────────────────────────┼────────────────────┼─────────────┤ -│ (182007)(FabricationNumber)) │ 0,Inst,BCD 8-digit │ 07 20 18 00 │ -├──────────────────────────────┼────────────────────┼─────────────┤ -│ (269)[m³](Volume)) │ 0,Inst,BCD 8-digit │ 69 02 00 00 │ -└──────────────────────────────┴────────────────────┴─────────────┘ +# M-Bus parser CLI + +The CLI decodes wired and wireless M-Bus frames through the same canonical +output contract as the Rust, Python, and WebAssembly APIs. + +```console +cargo install m-bus-parser-cli +m-bus-parser-cli parse --data "68 3D 3D 68 ..." --format json ``` -### String input +Formats: `table` (default), `json`, `yaml`, `csv`, `mermaid`, `xml`, +`annotated`, and `annotated-text`. + +Input accepts compact hexadecimal or complete `HH`/`0xHH` byte tokens separated +by whitespace, colons, or hyphens. Ambiguous or partial input is rejected with +a stable error code. -```bash -$ cargo run -p m-bus-parser-cli --release -- parse --data "68 3D 3D 68 08 01 72 00 51 20 02 82 4D 02 04 00 88 00 00 04 07 00 00 00 00 0C 15 03 00 00 00 0B 2E 00 00 00 0B 3B 00 00 00 0A 5A 88 12 0A 5E 16 05 0B 61 23 77 00 02 6C 8C 11 02 27 37 0D 0F 60 00 67 16" +Tables detect the interactive terminal width automatically. For pipes, the +default is 100 columns; override it explicitly when needed: -Long Frame -┌────────────────────────────────┬─────────────┐ -│ Function │ Address │ -├────────────────────────────────┼─────────────┤ -│ RspUd (ACD: false, DFC: false) │ Primary (1) │ -└────────────────────────────────┴─────────────┘ -┌───────────────────────┬────────────────────────────────────────────┐ -│ Field │ Value │ -├───────────────────────┼────────────────────────────────────────────┤ -│ Identification Number │ 02205100 │ -├───────────────────────┼────────────────────────────────────────────┤ -│ Manufacturer │ ManufacturerCode { code: ['S', 'L', 'B'] } │ -├───────────────────────┼────────────────────────────────────────────┤ -│ Access Number │ 0 │ -├───────────────────────┼────────────────────────────────────────────┤ -│ Status │ Permanent error, Manufacturer specific 3 │ -├───────────────────────┼────────────────────────────────────────────┤ -│ Signature │ 0 │ -├───────────────────────┼────────────────────────────────────────────┤ -│ Version │ 2 │ -├───────────────────────┼────────────────────────────────────────────┤ -│ Device Type │ Heat Meter │ -└───────────────────────┴────────────────────────────────────────────┘ -┌──────────────────────────────────────────┬───────────────────────┬─────────────┐ -│ Value │ Data Information │ Hex │ -├──────────────────────────────────────────┼───────────────────────┼─────────────┤ -│ (0)e4[Wh]) │ 0,Inst,32-bit Integer │ 00 00 00 00 │ -├──────────────────────────────────────────┼───────────────────────┼─────────────┤ -│ (3)e-1[m³](Volume)) │ 0,Inst,BCD 8-digit │ 03 00 00 00 │ -├──────────────────────────────────────────┼───────────────────────┼─────────────┤ -│ (0)e3[W]) │ 0,Inst,BCD 6-digit │ 00 00 00 │ -├──────────────────────────────────────────┼───────────────────────┼─────────────┤ -│ (0)e-3[m³h⁻¹]) │ 0,Inst,BCD 6-digit │ 00 00 00 │ -├──────────────────────────────────────────┼───────────────────────┼─────────────┤ -│ (1288)e-1[°C]) │ 0,Inst,BCD 4-digit │ 88 12 │ -├──────────────────────────────────────────┼───────────────────────┼─────────────┤ -│ (516)e-1[°C]) │ 0,Inst,BCD 4-digit │ 16 05 │ -├──────────────────────────────────────────┼───────────────────────┼─────────────┤ -│ (7723)e-2[°K]) │ 0,Inst,BCD 6-digit │ 23 77 00 │ -├──────────────────────────────────────────┼───────────────────────┼─────────────┤ -│ (12/Jan/12)(Date)) │ 0,Inst,Date Type G │ 8C 11 │ -├──────────────────────────────────────────┼───────────────────────┼─────────────┤ -│ (3383)[day]) │ 0,Inst,16-bit Integer │ 37 0D │ -├──────────────────────────────────────────┼───────────────────────┼─────────────┤ -│ (Manufacturer Specific: [15, 96, 0]None) │ None │ 60 00 │ -└──────────────────────────────────────────┴───────────────────────┴─────────────┘ +```console +m-bus-parser-cli parse --file telegram.hex --format table --width 48 ``` + +Pass a 32-digit AES-128 key with `--key`. Use `--no-enrichment` when only +protocol-derived data should be emitted. diff --git a/cli/src/main.rs b/cli/src/main.rs index 915d22a..fcd4b4d 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,8 +1,12 @@ -use clap::{Parser, Subcommand}; -use m_bus_parser::serialize_mbus_data; use std::fs; +use std::io::{self, IsTerminal}; use std::path::PathBuf; -use std::str; +use std::process::ExitCode; +use std::str::FromStr; + +use clap::{Parser, Subcommand}; +use m_bus_parser::{render_hex, DecodeOptions, OutputFormat, RenderOptions}; +use terminal_size::{terminal_size, Width}; #[derive(Parser)] #[command(version, about)] @@ -15,71 +19,105 @@ struct Cli { enum Command { /// Parse an M-Bus data file Parse { - /// The file to parse - #[arg(short = 'f', long)] + /// File containing a hexadecimal M-Bus frame + #[arg(short = 'f', long, conflicts_with = "data")] file: Option, - /// The raw M-Bus data as a string - #[arg(short = 'd', long)] + /// Raw hexadecimal M-Bus frame + #[arg(short = 'd', long, conflicts_with = "file")] data: Option, - /// Output format: table (default), json, yaml, csv, mermaid, xml - #[arg(short = 't', long)] - format: Option, + /// Output format: table, json, yaml, csv, mermaid, xml, annotated, annotated-text + #[arg(short = 't', long, default_value = "table")] + format: String, - /// Decryption key (32 hex characters for AES-128) + /// Decryption key (exactly 32 hexadecimal characters) #[arg(short = 'k', long)] key: Option, + + /// Table width in terminal columns (auto-detected for interactive output) + #[arg(long)] + width: Option, + + /// Omit bundled manufacturer enrichment from canonical outputs + #[arg(long)] + no_enrichment: bool, }, } -fn main() { - let cli = Cli::parse(); +fn main() -> ExitCode { + match run() { + Ok(()) => ExitCode::SUCCESS, + Err(error) => { + eprintln!("error: {error}"); + ExitCode::FAILURE + } + } +} +fn run() -> Result<(), String> { + let cli = Cli::parse(); match cli.command { Command::Parse { file, data, format, key, + width, + no_enrichment, } => { - let key_bytes = parse_key(key.as_deref()); - let fmt = format.as_deref().unwrap_or("table"); - - if let Some(file_path) = file { - let file_content = fs::read_to_string(file_path).expect("Failed to read the file"); - print!( - "{}", - serialize_mbus_data(&file_content, fmt, key_bytes.as_ref()) - ); - } else if let Some(data_string) = data { - print!( - "{}", - serialize_mbus_data(&data_string, fmt, key_bytes.as_ref()) - ); - } else { - eprintln!("Either --file or --data must be provided"); - } + let input = match (file, data) { + (Some(path), None) => fs::read_to_string(&path).map_err(|error| { + format!("[input.file] failed to read {}: {error}", path.display()) + })?, + (None, Some(data)) => data, + (None, None) => { + return Err( + "[option.invalid] either --file or --data must be provided".to_string() + ); + } + (Some(_), Some(_)) => unreachable!("clap enforces conflicts"), + }; + let output_format = OutputFormat::from_str(&format) + .map_err(|error| format!("[{}] {error}", error.code()))?; + let key = key + .as_deref() + .map(parse_key) + .transpose() + .map_err(|error| format!("[option.invalid] {error}"))?; + let width = width.or_else(|| { + if io::stdout().is_terminal() { + terminal_size().map(|(Width(columns), _)| usize::from(columns)) + } else { + Some(100) + } + }); + let rendered = render_hex( + &input, + output_format, + &RenderOptions { + decode: DecodeOptions { + key, + include_enrichment: !no_enrichment, + }, + table_width: width, + }, + ) + .map_err(|error| format!("[{}] {error}", error.code()))?; + print!("{rendered}"); + Ok(()) } } } -fn parse_key(key_hex: Option<&str>) -> Option<[u8; 16]> { - key_hex.and_then(|hex_str| { - hex::decode(hex_str).ok().and_then(|bytes| { - if bytes.len() == 16 { - let mut arr = [0u8; 16]; - arr.copy_from_slice(&bytes); - Some(arr) - } else { - eprintln!( - "Warning: Key must be 16 bytes (32 hex chars), got {} bytes. Ignoring key.", - bytes.len() - ); - None - } - }) - }) +fn parse_key(value: &str) -> Result<[u8; 16], String> { + if value.len() != 32 || !value.chars().all(|character| character.is_ascii_hexdigit()) { + return Err("key must contain exactly 32 hexadecimal characters".to_string()); + } + let bytes = hex::decode(value).map_err(|error| format!("invalid key: {error}"))?; + bytes + .try_into() + .map_err(|_| "key must contain exactly 16 bytes".to_string()) } #[cfg(test)] @@ -87,9 +125,9 @@ mod tests { use super::*; #[test] - fn test_parse_data_from_string() { - let data_string = "0x68, 0x3C, 0x3C, 0x68, 0x08, 0x08, 0x72, 0x78, 0x03, 0x49, 0x11, 0x77, 0x04, 0x0E, 0x16, 0x0A, 0x00, 0x00, 0x00, 0x0C, 0x78, 0x78, 0x03, 0x49, 0x11, 0x04, 0x13, 0x31, 0xD4, 0x00, 0x00, 0x42, 0x6C, 0x00, 0x00, 0x44, 0x13, 0x00, 0x00, 0x00, 0x00, 0x04, 0x6D, 0x0B, 0x0B, 0xCD, 0x13, 0x02, 0x27, 0x00, 0x00, 0x09, 0xFD, 0x0E, 0x02, 0x09, 0xFD, 0x0F, 0x06, 0x0F, 0x00, 0x01, 0x75, 0x13, 0xD3, 0x16"; - let output = serialize_mbus_data(data_string, "table", None); - assert!(output.contains("Hex")); + fn validates_key_exactly() { + assert!(parse_key("00112233445566778899AABBCCDDEEFF").is_ok()); + assert!(parse_key("0011").is_err()); + assert!(parse_key("00112233445566778899AABBCCDDEEFG").is_err()); } } diff --git a/crates/m-bus-application-layer/Cargo.toml b/crates/m-bus-application-layer/Cargo.toml index 79b7138..abc8ead 100644 --- a/crates/m-bus-application-layer/Cargo.toml +++ b/crates/m-bus-application-layer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "m-bus-application-layer" -version = "0.3.0" +version = "0.4.0" edition = "2021" description = "M-Bus application layer parser (DIF/VIF, data records)" license = "MIT" @@ -20,4 +20,4 @@ serde = { version = "1.0", features = ["derive"], optional = true } defmt = { version = "1.0.1", optional = true } bitflags = "2.8.0" arrayvec = { version = "0.7.4", default-features = false } -m-bus-core = { version = "0.3.0", path = "../m-bus-core" } +m-bus-core = { version = "0.4.0", path = "../m-bus-core" } diff --git a/crates/m-bus-core/Cargo.toml b/crates/m-bus-core/Cargo.toml index b511d99..534c019 100644 --- a/crates/m-bus-core/Cargo.toml +++ b/crates/m-bus-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "m-bus-core" -version = "0.3.0" +version = "0.4.0" edition = "2024" description = "Core types for the m-bus-parser M-Bus protocol library" license = "MIT" diff --git a/crates/wired-mbus-link-layer/Cargo.toml b/crates/wired-mbus-link-layer/Cargo.toml index 6b45fbd..087532c 100644 --- a/crates/wired-mbus-link-layer/Cargo.toml +++ b/crates/wired-mbus-link-layer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wired-mbus-link-layer" -version = "0.3.0" +version = "0.4.0" edition = "2024" description = "Wired M-Bus link layer parser (EN 13757-2)" license = "MIT" @@ -15,4 +15,4 @@ defmt = ["dep:defmt"] [dependencies] serde = { version = "1.0", features = ["derive"], optional = true } defmt = { version = "1.0.1", optional = true } -m-bus-core = { version = "0.3.0", path = "../m-bus-core" } +m-bus-core = { version = "0.4.0", path = "../m-bus-core" } diff --git a/crates/wireless-mbus-link-layer/Cargo.toml b/crates/wireless-mbus-link-layer/Cargo.toml index 780e28d..1a4a373 100644 --- a/crates/wireless-mbus-link-layer/Cargo.toml +++ b/crates/wireless-mbus-link-layer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wireless-mbus-link-layer" -version = "0.3.0" +version = "0.4.0" edition = "2024" description = "Wireless M-Bus link layer parser (wMBus)" license = "MIT" @@ -14,6 +14,6 @@ defmt = ["dep:defmt"] [dependencies] crc16 = "0.4.0" -m-bus-core = { version = "0.3.0", path = "../m-bus-core" } +m-bus-core = { version = "0.4.0", path = "../m-bus-core" } serde = { version = "1.0", features = ["derive"], optional = true } defmt = { version = "1.0.1", optional = true } diff --git a/crates/wireless-mbus-link-layer/src/lib.rs b/crates/wireless-mbus-link-layer/src/lib.rs index c2a2ee8..c3b5652 100644 --- a/crates/wireless-mbus-link-layer/src/lib.rs +++ b/crates/wireless-mbus-link-layer/src/lib.rs @@ -94,7 +94,12 @@ pub fn strip_format_a_crcs<'a>(data: &[u8], output: &'a mut [u8]) -> Option<&'a #[derive(Debug, Clone, Copy, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct WirelessFrame<'a> { - pub function: Function, + /// Raw wireless M-Bus C-field. + pub control_field: u8, + /// Decoded C-field when it maps to a function currently known by the + /// shared M-Bus core. Unknown but otherwise valid C-fields are preserved + /// through `control_field` instead of making the frame unparseable. + pub function: Option, pub manufacturer_id: ManufacturerId, #[cfg_attr( feature = "serde", @@ -167,14 +172,15 @@ impl<'a> TryFrom<&'a [u8]> for WirelessFrame<'a> { fn try_from(data: &'a [u8]) -> Result { let length = data.len(); let length_byte = *data.first().ok_or(FrameError::EmptyData)? as usize; - let _c_field = *data.get(1).ok_or(FrameError::TooShort)? as usize; + let control_field = *data.get(1).ok_or(FrameError::TooShort)?; let manufacturer_id = ManufacturerId::try_from(&data[2..])?; // In wireless M-Bus, the L-field contains the number of bytes following the L-field if length_byte + 1 == length { let data_end = trailing_frame_crc_start(data).unwrap_or(length); return Ok(WirelessFrame { - function: Function::SndNk { prm: false }, + control_field, + function: Function::try_from(control_field).ok(), manufacturer_id, data: &data[10..data_end], }); @@ -220,4 +226,26 @@ mod test { &[0x8C, 0x20, 0x27, 0x78, 0x0B, 0x13, 0x43, 0x65, 0x87] ); } + + #[test] + fn c_field_is_decoded_and_preserved() { + let frame = [ + 0x18, 0x44, 0xAE, 0x4C, 0x44, 0x55, 0x22, 0x33, 0x68, 0x07, 0x7A, 0x55, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x13, 0x89, 0xE2, 0x01, 0x00, 0x02, 0x3B, 0x00, + ]; + let parsed = WirelessFrame::try_from(frame.as_slice()).expect("valid wireless frame"); + assert_eq!(parsed.control_field, 0x44); + assert_eq!(parsed.function, Some(Function::SndNr)); + } + + #[test] + fn unknown_c_field_does_not_invalidate_frame() { + let frame = [ + 0x18, 0x45, 0xAE, 0x4C, 0x44, 0x55, 0x22, 0x33, 0x68, 0x07, 0x7A, 0x55, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x13, 0x89, 0xE2, 0x01, 0x00, 0x02, 0x3B, 0x00, + ]; + let parsed = WirelessFrame::try_from(frame.as_slice()).expect("valid wireless frame"); + assert_eq!(parsed.control_field, 0x45); + assert_eq!(parsed.function, None); + } } diff --git a/docs-ui/package-lock.json b/docs-ui/package-lock.json new file mode 100644 index 0000000..edb074e --- /dev/null +++ b/docs-ui/package-lock.json @@ -0,0 +1,1060 @@ +{ + "name": "m-bus-parser-docs-ui", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "m-bus-parser-docs-ui", + "dependencies": { + "@shikijs/langs": "4.3.1", + "@shikijs/themes": "4.3.1", + "shiki": "4.3.1" + }, + "devDependencies": { + "esbuild": "0.28.1" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", + "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", + "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", + "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", + "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", + "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", + "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", + "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", + "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", + "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", + "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", + "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", + "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", + "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", + "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", + "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", + "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", + "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", + "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", + "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", + "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", + "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", + "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", + "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", + "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", + "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", + "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@shikijs/core": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.3.1.tgz", + "integrity": "sha512-ANMDxuaPsNMdDC1m4vfvhlDmJweMwkE5XitTwrq2rWHx5jM+dlm4MmHt2PP6t0uejfR77SuhrhJ0zEijIF/uhA==", + "license": "MIT", + "dependencies": { + "@shikijs/primitive": "4.3.1", + "@shikijs/types": "4.3.1", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4", + "hast-util-to-html": "^9.0.5" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/engine-javascript": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.3.1.tgz", + "integrity": "sha512-JBItcnPuYq7jVJdZo/vMj94r+szT7XEjHFX+mvFDGSEIbVAXAGyHAHzhbWzpGOwYidCZrErJLLgn2PVeiokHnQ==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.3.1", + "@shikijs/vscode-textmate": "^10.0.2", + "oniguruma-to-es": "^4.3.6" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.3.1.tgz", + "integrity": "sha512-OXyNMzg0pews+msMj4cHeqT4xiYKKvbnn6VbdAXxfoFl3SSx4fJTc8FadECuc5/H9p3BzhNAoAUXKwAu9rWYhg==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.3.1", + "@shikijs/vscode-textmate": "^10.0.2" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/langs": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.3.1.tgz", + "integrity": "sha512-m0l9nsDqgBHvbZbk7A0/kXz/impK3uB/c6rAn6Gpg/uPtdZRQ+alsN/17MU5thb68XTj/4DxkZAotrM0GGSpDQ==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.3.1" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/primitive": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.3.1.tgz", + "integrity": "sha512-CXQRQOYy1leqQ8ceTeJdmXv/bsUY++6QyLpXJ94LZAAYj5X2SKRdc5ipguv4NPyGVKItB2PPwUpRNe0Sjh5S1A==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.3.1", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/themes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.3.1.tgz", + "integrity": "sha512-dgpoJ4WqNi2yTmizQHBJ5zcX6j2lE6icN/0yt4l1kkf16jrY/pwPLoTb1ETsWMz0OBLf9ZNvwmxft+cH+N9qSA==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.3.1" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/types": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.3.1.tgz", + "integrity": "sha512-CHFxE0jztBIZRHH6gxXE7DXUCFXjReEGxZ/j0rfSLGKZuwp2xBYycEP14875DSa9KLL/6700oxIq6oO6ef9K2g==", + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", + "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", + "license": "MIT" + }, + "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/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/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/@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/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/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/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/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/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/esbuild": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", + "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.1", + "@esbuild/android-arm": "0.28.1", + "@esbuild/android-arm64": "0.28.1", + "@esbuild/android-x64": "0.28.1", + "@esbuild/darwin-arm64": "0.28.1", + "@esbuild/darwin-x64": "0.28.1", + "@esbuild/freebsd-arm64": "0.28.1", + "@esbuild/freebsd-x64": "0.28.1", + "@esbuild/linux-arm": "0.28.1", + "@esbuild/linux-arm64": "0.28.1", + "@esbuild/linux-ia32": "0.28.1", + "@esbuild/linux-loong64": "0.28.1", + "@esbuild/linux-mips64el": "0.28.1", + "@esbuild/linux-ppc64": "0.28.1", + "@esbuild/linux-riscv64": "0.28.1", + "@esbuild/linux-s390x": "0.28.1", + "@esbuild/linux-x64": "0.28.1", + "@esbuild/netbsd-arm64": "0.28.1", + "@esbuild/netbsd-x64": "0.28.1", + "@esbuild/openbsd-arm64": "0.28.1", + "@esbuild/openbsd-x64": "0.28.1", + "@esbuild/openharmony-arm64": "0.28.1", + "@esbuild/sunos-x64": "0.28.1", + "@esbuild/win32-arm64": "0.28.1", + "@esbuild/win32-ia32": "0.28.1", + "@esbuild/win32-x64": "0.28.1" + } + }, + "node_modules/hast-util-to-html": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz", + "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "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/html-void-elements": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "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/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-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-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-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/oniguruma-parser": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz", + "integrity": "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==", + "license": "MIT" + }, + "node_modules/oniguruma-to-es": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.6.tgz", + "integrity": "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==", + "license": "MIT", + "dependencies": { + "oniguruma-parser": "^0.12.2", + "regex": "^6.1.0", + "regex-recursion": "^6.0.2" + } + }, + "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/regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz", + "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==", + "license": "MIT", + "dependencies": { + "regex-utilities": "^2.3.0" + } + }, + "node_modules/regex-recursion": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz", + "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==", + "license": "MIT", + "dependencies": { + "regex-utilities": "^2.3.0" + } + }, + "node_modules/regex-utilities": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz", + "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==", + "license": "MIT" + }, + "node_modules/shiki": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.3.1.tgz", + "integrity": "sha512-oR+qDVi2OjX1tmDpyv+3KviX01KzO6Af+0NNnKnsp9491UEGz2YpxTuJboS/6VhYpTdqzmuJBuiTlrAWWJAssw==", + "license": "MIT", + "dependencies": { + "@shikijs/core": "4.3.1", + "@shikijs/engine-javascript": "4.3.1", + "@shikijs/engine-oniguruma": "4.3.1", + "@shikijs/langs": "4.3.1", + "@shikijs/themes": "4.3.1", + "@shikijs/types": "4.3.1", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" + } + }, + "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/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/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/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/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/docs-ui/package.json b/docs-ui/package.json new file mode 100644 index 0000000..34db801 --- /dev/null +++ b/docs-ui/package.json @@ -0,0 +1,18 @@ +{ + "name": "m-bus-parser-docs-ui", + "private": true, + "type": "module", + "scripts": { + "build": "esbuild src/highlighter.js --bundle --format=esm --minify --target=es2020 --outfile=../docs/assets/highlighter.js", + "check": "node scripts/check.mjs", + "test": "npm run build && npm run check" + }, + "dependencies": { + "@shikijs/langs": "4.3.1", + "@shikijs/themes": "4.3.1", + "shiki": "4.3.1" + }, + "devDependencies": { + "esbuild": "0.28.1" + } +} diff --git a/docs-ui/scripts/check.mjs b/docs-ui/scripts/check.mjs new file mode 100644 index 0000000..6d48c10 --- /dev/null +++ b/docs-ui/scripts/check.mjs @@ -0,0 +1,79 @@ +import { gzipSync } from 'node:zlib' +import { readFileSync } from 'node:fs' +import { resolve } from 'node:path' +import githubLightHighContrast from '@shikijs/themes/github-light-high-contrast' +import githubDarkHighContrast from '@shikijs/themes/github-dark-high-contrast' + +const REQUIRED_RATIO = 4.5 +const MAX_GZIP_BYTES = 100 * 1024 + +function channels(color) { + const match = /^#([\da-f]{6})(?:[\da-f]{2})?$/i.exec(color) + if (!match) return null + return [0, 2, 4].map((offset) => Number.parseInt(match[1].slice(offset, offset + 2), 16)) +} + +function luminance(color) { + const rgb = channels(color) + if (!rgb) return null + const linear = rgb.map((value) => { + const channel = value / 255 + return channel <= 0.04045 + ? channel / 12.92 + : ((channel + 0.055) / 1.055) ** 2.4 + }) + return 0.2126 * linear[0] + 0.7152 * linear[1] + 0.0722 * linear[2] +} + +function contrast(foreground, background) { + const foregroundLuminance = luminance(foreground) + const backgroundLuminance = luminance(background) + if (foregroundLuminance === null || backgroundLuminance === null) return null + const lighter = Math.max(foregroundLuminance, backgroundLuminance) + const darker = Math.min(foregroundLuminance, backgroundLuminance) + return (lighter + 0.05) / (darker + 0.05) +} + +function themeColors(theme) { + const colors = new Set() + if (theme.fg) colors.add(theme.fg) + for (const setting of theme.settings || []) { + if (setting.settings?.foreground) colors.add(setting.settings.foreground) + } + return colors +} + +function checkTheme(theme) { + const background = theme.bg || theme.colors?.['editor.background'] + const failures = [] + for (const color of themeColors(theme)) { + const ratio = contrast(color, background) + if (ratio !== null && ratio + Number.EPSILON < REQUIRED_RATIO) { + failures.push(`${color} on ${background}: ${ratio.toFixed(2)}:1`) + } + } + if (failures.length) { + throw new Error(`${theme.name} has sub-AA token colors:\n${failures.join('\n')}`) + } +} + +checkTheme(githubLightHighContrast) +checkTheme(githubDarkHighContrast) + +for (const [foreground, background, label] of [ + ['#4b5563', '#ffffff', 'light line numbers'], + ['#c7cdd5', '#0d1117', 'dark line numbers'], +]) { + const ratio = contrast(foreground, background) + if (ratio < REQUIRED_RATIO) { + throw new Error(`${label} contrast is ${ratio.toFixed(2)}:1`) + } +} + +const bundlePath = resolve(import.meta.dirname, '../../docs/assets/highlighter.js') +const gzipBytes = gzipSync(readFileSync(bundlePath)).byteLength +if (gzipBytes > MAX_GZIP_BYTES) { + throw new Error(`highlighter bundle is ${gzipBytes} gzip bytes; budget is ${MAX_GZIP_BYTES}`) +} + +console.log(`Syntax themes meet WCAG AA; highlighter bundle is ${gzipBytes} gzip bytes.`) diff --git a/docs-ui/src/highlighter.js b/docs-ui/src/highlighter.js new file mode 100644 index 0000000..4a1a536 --- /dev/null +++ b/docs-ui/src/highlighter.js @@ -0,0 +1,111 @@ +import json from '@shikijs/langs/json' +import yaml from '@shikijs/langs/yaml' +import csv from '@shikijs/langs/csv' +import xml from '@shikijs/langs/xml' +import githubLightHighContrast from '@shikijs/themes/github-light-high-contrast' +import githubDarkHighContrast from '@shikijs/themes/github-dark-high-contrast' +import { createHighlighterCore } from 'shiki/core' +import { createJavaScriptRegexEngine } from 'shiki/engine/javascript' + +const supportedLanguages = new Set(['json', 'yaml', 'csv', 'xml']) +const aliases = new Map([ + ['yml', 'yaml'], + ['text', 'plaintext'], + ['txt', 'plaintext'], + ['table', 'plaintext'], +]) + +let highlighterPromise + +function getHighlighter() { + highlighterPromise ??= createHighlighterCore({ + themes: [githubLightHighContrast, githubDarkHighContrast], + langs: [json, yaml, csv, xml], + engine: createJavaScriptRegexEngine(), + }) + return highlighterPromise +} + +function normalizeLanguage(language) { + const normalized = String(language || 'plaintext').toLowerCase() + return aliases.get(normalized) || normalized +} + +function createPlainCode(source) { + const pre = document.createElement('pre') + pre.className = 'code-source' + const code = document.createElement('code') + code.textContent = source + pre.appendChild(code) + return pre +} + +function createLineGutter(source) { + const gutter = document.createElement('div') + gutter.className = 'line-gutter' + gutter.setAttribute('aria-hidden', 'true') + const lineCount = Math.max(1, source.split('\n').length) + for (let line = 1; line <= lineCount; line += 1) { + const number = document.createElement('span') + number.textContent = String(line) + gutter.appendChild(number) + } + return gutter +} + +function createViewer(source, codeElement, label) { + const viewer = document.createElement('div') + viewer.className = 'code-viewer' + + const scroll = document.createElement('div') + scroll.className = 'code-scroll' + scroll.setAttribute('role', 'region') + scroll.setAttribute('aria-label', label) + scroll.tabIndex = 0 + + codeElement.classList.add('code-source') + codeElement.removeAttribute('tabindex') + scroll.append(createLineGutter(source), codeElement) + viewer.appendChild(scroll) + return viewer +} + +/** + * Render output with deterministic line numbers and a safe plaintext fallback. + * The returned promise resolves after Shiki has replaced the fallback. + */ +export async function renderCodeViewer( + container, + source, + language = 'plaintext', + label = 'Parser output', +) { + source = String(source ?? '') + const normalizedLanguage = normalizeLanguage(language) + const fallback = createViewer(source, createPlainCode(source), label) + container.replaceChildren(fallback) + + if (!supportedLanguages.has(normalizedLanguage)) return fallback + + try { + const highlighter = await getHighlighter() + const html = highlighter.codeToHtml(source, { + lang: normalizedLanguage, + themes: { + light: 'github-light-high-contrast', + dark: 'github-dark-high-contrast', + }, + defaultColor: false, + }) + const template = document.createElement('template') + template.innerHTML = html + const highlighted = template.content.querySelector('pre') + if (!highlighted || !container.contains(fallback)) return fallback + const viewer = createViewer(source, highlighted, label) + container.replaceChildren(viewer) + return viewer + } catch (error) { + console.warn('Syntax highlighting unavailable; using plaintext output.', error) + return fallback + } +} diff --git a/docs/assets/highlighter.js b/docs/assets/highlighter.js new file mode 100644 index 0000000..adec0c9 --- /dev/null +++ b/docs/assets/highlighter.js @@ -0,0 +1,153 @@ +var zn=Object.defineProperty;var yo=Object.getPrototypeOf;var ko=Reflect.get;var Hn=t=>{throw TypeError(t)};var wo=(t,e,n)=>e in t?zn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var vo=(t,e)=>{for(var n in e)zn(t,n,{get:e[n],enumerable:!0})};var m=(t,e,n)=>wo(t,typeof e!="symbol"?e+"":e,n),zt=(t,e,n)=>e.has(t)||Hn("Cannot "+n);var M=(t,e,n)=>(zt(t,e,"read from private field"),n?n.call(t):e.get(t)),be=(t,e,n)=>e.has(t)?Hn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),q=(t,e,n,r)=>(zt(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Ht=(t,e,n)=>(zt(t,e,"access private method"),n);var Un=(t,e,n)=>ko(yo(t),n,e);var Co=Object.freeze(JSON.parse('{"displayName":"JSON","name":"json","patterns":[{"include":"#value"}],"repository":{"array":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.array.begin.json"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.array.end.json"}},"name":"meta.structure.array.json","patterns":[{"include":"#value"},{"match":",","name":"punctuation.separator.array.json"},{"match":"[^]\\\\s]","name":"invalid.illegal.expected-array-separator.json"}]},"comments":{"patterns":[{"begin":"/\\\\*\\\\*(?!/)","captures":{"0":{"name":"punctuation.definition.comment.json"}},"end":"\\\\*/","name":"comment.block.documentation.json"},{"begin":"/\\\\*","captures":{"0":{"name":"punctuation.definition.comment.json"}},"end":"\\\\*/","name":"comment.block.json"},{"captures":{"1":{"name":"punctuation.definition.comment.json"}},"match":"(//).*$\\\\n?","name":"comment.line.double-slash.js"}]},"constant":{"match":"\\\\b(?:true|false|null)\\\\b","name":"constant.language.json"},"number":{"match":"-?(?:0|[1-9]\\\\d*)(?:(?:\\\\.\\\\d+)?(?:[Ee][-+]?\\\\d+)?)?","name":"constant.numeric.json"},"object":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.dictionary.begin.json"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.dictionary.end.json"}},"name":"meta.structure.dictionary.json","patterns":[{"include":"#objectkey"},{"include":"#comments"},{"begin":":","beginCaptures":{"0":{"name":"punctuation.separator.dictionary.key-value.json"}},"end":"(,)|(?=})","endCaptures":{"1":{"name":"punctuation.separator.dictionary.pair.json"}},"name":"meta.structure.dictionary.value.json","patterns":[{"include":"#value"},{"match":"[^,\\\\s]","name":"invalid.illegal.expected-dictionary-separator.json"}]},{"match":"[^}\\\\s]","name":"invalid.illegal.expected-dictionary-separator.json"}]},"objectkey":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.support.type.property-name.begin.json"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.support.type.property-name.end.json"}},"name":"string.json support.type.property-name.json","patterns":[{"include":"#stringcontent"}]},"string":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.json"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.json"}},"name":"string.quoted.double.json","patterns":[{"include":"#stringcontent"}]},"stringcontent":{"patterns":[{"match":"\\\\\\\\(?:[\\"/\\\\\\\\bfnrt]|u\\\\h{4})","name":"constant.character.escape.json"},{"match":"\\\\\\\\.","name":"invalid.illegal.unrecognized-string-escape.json"}]},"value":{"patterns":[{"include":"#constant"},{"include":"#number"},{"include":"#string"},{"include":"#array"},{"include":"#object"},{"include":"#comments"}]}},"scopeName":"source.json"}')),Wn=[Co];var _o=Object.freeze(JSON.parse(`{"displayName":"YAML","fileTypes":["yaml","yml","rviz","reek","clang-format","yaml-tmlanguage","syntax","sublime-syntax"],"firstLineMatch":"^%YAML( ?1.\\\\d+)?","name":"yaml","patterns":[{"include":"#comment"},{"include":"#property"},{"include":"#directive"},{"match":"^---","name":"entity.other.document.begin.yaml"},{"match":"^\\\\.{3}","name":"entity.other.document.end.yaml"},{"include":"#node"}],"repository":{"block-collection":{"patterns":[{"include":"#block-sequence"},{"include":"#block-mapping"}]},"block-mapping":{"patterns":[{"include":"#block-pair"}]},"block-node":{"patterns":[{"include":"#prototype"},{"include":"#block-scalar"},{"include":"#block-collection"},{"include":"#flow-scalar-plain-out"},{"include":"#flow-node"}]},"block-pair":{"patterns":[{"begin":"\\\\?","beginCaptures":{"1":{"name":"punctuation.definition.key-value.begin.yaml"}},"end":"(?=\\\\?)|^ *(:)|(:)","endCaptures":{"1":{"name":"punctuation.separator.key-value.mapping.yaml"},"2":{"name":"invalid.illegal.expected-newline.yaml"}},"name":"meta.block-mapping.yaml","patterns":[{"include":"#block-node"}]},{"begin":"(?=(?:[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?]\\\\S)([^:\\\\s]|:\\\\S|\\\\s+(?![#\\\\s]))*\\\\s*:(\\\\s|$))","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$))","patterns":[{"include":"#flow-scalar-plain-out-implicit-type"},{"begin":"[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?]\\\\S","beginCaptures":{"0":{"name":"entity.name.tag.yaml"}},"contentName":"entity.name.tag.yaml","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$))","name":"string.unquoted.plain.out.yaml"}]},{"match":":(?=\\\\s|$)","name":"punctuation.separator.key-value.mapping.yaml"}]},"block-scalar":{"begin":"(?:(\\\\|)|(>))([1-9])?([-+])?(.*\\\\n?)","beginCaptures":{"1":{"name":"keyword.control.flow.block-scalar.literal.yaml"},"2":{"name":"keyword.control.flow.block-scalar.folded.yaml"},"3":{"name":"constant.numeric.indentation-indicator.yaml"},"4":{"name":"storage.modifier.chomping-indicator.yaml"},"5":{"patterns":[{"include":"#comment"},{"match":".+","name":"invalid.illegal.expected-comment-or-newline.yaml"}]}},"end":"^(?=\\\\S)|(?!\\\\G)","patterns":[{"begin":"^( +)(?! )","end":"^(?!\\\\1|\\\\s*$)","name":"string.unquoted.block.yaml"}]},"block-sequence":{"match":"(-)(?!\\\\S)","name":"punctuation.definition.block.sequence.item.yaml"},"comment":{"begin":"(?:^([\\\\t ]*)|[\\\\t ]+)(?=#\\\\p{print}*$)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.yaml"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.yaml"}},"end":"\\\\n","name":"comment.line.number-sign.yaml"}]},"directive":{"begin":"^%","beginCaptures":{"0":{"name":"punctuation.definition.directive.begin.yaml"}},"end":"(?=$|[\\\\t ]+($|#))","name":"meta.directive.yaml","patterns":[{"captures":{"1":{"name":"keyword.other.directive.yaml.yaml"},"2":{"name":"constant.numeric.yaml-version.yaml"}},"match":"\\\\G(YAML)[\\\\t ]+(\\\\d+\\\\.\\\\d+)"},{"captures":{"1":{"name":"keyword.other.directive.tag.yaml"},"2":{"name":"storage.type.tag-handle.yaml"},"3":{"name":"support.type.tag-prefix.yaml"}},"match":"\\\\G(TAG)(?:[\\\\t ]+(!(?:[-0-9A-Za-z]*!)?)(?:[\\\\t ]+(!(?:%\\\\h{2}|[]!#$\\\\&-;=?-\\\\[_a-z~])*|(?![]!,\\\\[{}])(?:%\\\\h{2}|[]!#$\\\\&-;=?-\\\\[_a-z~])+))?)?"},{"captures":{"1":{"name":"support.other.directive.reserved.yaml"},"2":{"name":"string.unquoted.directive-name.yaml"},"3":{"name":"string.unquoted.directive-parameter.yaml"}},"match":"\\\\G(\\\\w+)(?:[\\\\t ]+(\\\\w+)(?:[\\\\t ]+(\\\\w+))?)?"},{"match":"\\\\S+","name":"invalid.illegal.unrecognized.yaml"}]},"flow-alias":{"captures":{"1":{"name":"keyword.control.flow.alias.yaml"},"2":{"name":"punctuation.definition.alias.yaml"},"3":{"name":"variable.other.alias.yaml"},"4":{"name":"invalid.illegal.character.anchor.yaml"}},"match":"((\\\\*))([^],/\\\\[{}\\\\s]+)([^],}\\\\s]\\\\S*)?"},"flow-collection":{"patterns":[{"include":"#flow-sequence"},{"include":"#flow-mapping"}]},"flow-mapping":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.mapping.begin.yaml"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.mapping.end.yaml"}},"name":"meta.flow-mapping.yaml","patterns":[{"include":"#prototype"},{"match":",","name":"punctuation.separator.mapping.yaml"},{"include":"#flow-pair"}]},"flow-node":{"patterns":[{"include":"#prototype"},{"include":"#flow-alias"},{"include":"#flow-collection"},{"include":"#flow-scalar"}]},"flow-pair":{"patterns":[{"begin":"\\\\?","beginCaptures":{"0":{"name":"punctuation.definition.key-value.begin.yaml"}},"end":"(?=[],}])","name":"meta.flow-pair.explicit.yaml","patterns":[{"include":"#prototype"},{"include":"#flow-pair"},{"include":"#flow-node"},{"begin":":(?=\\\\s|$|[],\\\\[{}])","beginCaptures":{"0":{"name":"punctuation.separator.key-value.mapping.yaml"}},"end":"(?=[],}])","patterns":[{"include":"#flow-value"}]}]},{"begin":"(?=(?:[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?][^],\\\\[{}\\\\s])([^],:\\\\[{}\\\\s]|:[^],\\\\[{}\\\\s]|\\\\s+(?![#\\\\s]))*\\\\s*:(\\\\s|$))","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$)|\\\\s*:[],\\\\[{}]|\\\\s*[],\\\\[{}])","name":"meta.flow-pair.key.yaml","patterns":[{"include":"#flow-scalar-plain-in-implicit-type"},{"begin":"[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?][^],\\\\[{}\\\\s]","beginCaptures":{"0":{"name":"entity.name.tag.yaml"}},"contentName":"entity.name.tag.yaml","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$)|\\\\s*:[],\\\\[{}]|\\\\s*[],\\\\[{}])","name":"string.unquoted.plain.in.yaml"}]},{"include":"#flow-node"},{"begin":":(?=\\\\s|$|[],\\\\[{}])","captures":{"0":{"name":"punctuation.separator.key-value.mapping.yaml"}},"end":"(?=[],}])","name":"meta.flow-pair.yaml","patterns":[{"include":"#flow-value"}]}]},"flow-scalar":{"patterns":[{"include":"#flow-scalar-double-quoted"},{"include":"#flow-scalar-single-quoted"},{"include":"#flow-scalar-plain-in"}]},"flow-scalar-double-quoted":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.yaml"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.yaml"}},"name":"string.quoted.double.yaml","patterns":[{"match":"\\\\\\\\([ \\"/0LN\\\\\\\\_abefnprtv]|x\\\\d\\\\d|u\\\\d{4}|U\\\\d{8})","name":"constant.character.escape.yaml"},{"match":"\\\\\\\\\\\\n","name":"constant.character.escape.double-quoted.newline.yaml"}]},"flow-scalar-plain-in":{"patterns":[{"include":"#flow-scalar-plain-in-implicit-type"},{"begin":"[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?][^],\\\\[{}\\\\s]","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$)|\\\\s*:[],\\\\[{}]|\\\\s*[],\\\\[{}])","name":"string.unquoted.plain.in.yaml"}]},"flow-scalar-plain-in-implicit-type":{"patterns":[{"captures":{"1":{"name":"constant.language.null.yaml"},"2":{"name":"constant.language.boolean.yaml"},"3":{"name":"constant.numeric.integer.yaml"},"4":{"name":"constant.numeric.float.yaml"},"5":{"name":"constant.other.timestamp.yaml"},"6":{"name":"constant.language.value.yaml"},"7":{"name":"constant.language.merge.yaml"}},"match":"(?:(null|Null|NULL|~)|([Yy]|yes|Yes|YES|[Nn]|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)|([-+]?0b[01_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[_\\\\h]+|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)|([-+]?(?:[0-9][0-9_]*)?\\\\.[.0-9]*(?:[Ee][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\\\.[0-9_]*|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))|(\\\\d{4}-\\\\d{2}-\\\\d{2}|\\\\d{4}-\\\\d{1,2}-\\\\d{1,2}(?:[Tt]|[\\\\t ]+)\\\\d{1,2}:\\\\d{2}:\\\\d{2}(?:\\\\.\\\\d*)?(?:[\\\\t ]*Z|[-+]\\\\d{1,2}(?::\\\\d{1,2})?)?)|(=)|(<<))(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$)|\\\\s*:[],\\\\[{}]|\\\\s*[],\\\\[{}])"}]},"flow-scalar-plain-out":{"patterns":[{"include":"#flow-scalar-plain-out-implicit-type"},{"begin":"[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?]\\\\S","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$))","name":"string.unquoted.plain.out.yaml"}]},"flow-scalar-plain-out-implicit-type":{"patterns":[{"captures":{"1":{"name":"constant.language.null.yaml"},"2":{"name":"constant.language.boolean.yaml"},"3":{"name":"constant.numeric.integer.yaml"},"4":{"name":"constant.numeric.float.yaml"},"5":{"name":"constant.other.timestamp.yaml"},"6":{"name":"constant.language.value.yaml"},"7":{"name":"constant.language.merge.yaml"}},"match":"(?:(null|Null|NULL|~)|([Yy]|yes|Yes|YES|[Nn]|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)|([-+]?0b[01_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[_\\\\h]+|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)|([-+]?(?:[0-9][0-9_]*)?\\\\.[.0-9]*(?:[Ee][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\\\.[0-9_]*|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))|(\\\\d{4}-\\\\d{2}-\\\\d{2}|\\\\d{4}-\\\\d{1,2}-\\\\d{1,2}(?:[Tt]|[\\\\t ]+)\\\\d{1,2}:\\\\d{2}:\\\\d{2}(?:\\\\.\\\\d*)?(?:[\\\\t ]*Z|[-+]\\\\d{1,2}(?::\\\\d{1,2})?)?)|(=)|(<<))(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$))"}]},"flow-scalar-single-quoted":{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.yaml"}},"end":"'(?!')","endCaptures":{"0":{"name":"punctuation.definition.string.end.yaml"}},"name":"string.quoted.single.yaml","patterns":[{"match":"''","name":"constant.character.escape.single-quoted.yaml"}]},"flow-sequence":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.sequence.begin.yaml"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.sequence.end.yaml"}},"name":"meta.flow-sequence.yaml","patterns":[{"include":"#prototype"},{"match":",","name":"punctuation.separator.sequence.yaml"},{"include":"#flow-pair"},{"include":"#flow-node"}]},"flow-value":{"patterns":[{"begin":"\\\\G(?![],}])","end":"(?=[],}])","name":"meta.flow-pair.value.yaml","patterns":[{"include":"#flow-node"}]}]},"node":{"patterns":[{"include":"#block-node"}]},"property":{"begin":"(?=[!\\\\&])","end":"(?!\\\\G)","name":"meta.property.yaml","patterns":[{"captures":{"1":{"name":"keyword.control.property.anchor.yaml"},"2":{"name":"punctuation.definition.anchor.yaml"},"3":{"name":"entity.name.type.anchor.yaml"},"4":{"name":"invalid.illegal.character.anchor.yaml"}},"match":"\\\\G((&))([^],/\\\\[{}\\\\s]+)(\\\\S+)?"},{"match":"\\\\G!(?:<(?:%\\\\h{2}|[]!#$\\\\&-;=?-\\\\[_a-z~])+>|(?:[-0-9A-Za-z]*!)?(?:%\\\\h{2}|[#$\\\\&-+\\\\--;=?-Z_a-z~])+|)(?=[\\\\t ]|$)","name":"storage.type.tag-handle.yaml"},{"match":"\\\\S+","name":"invalid.illegal.tag-handle.yaml"}]},"prototype":{"patterns":[{"include":"#comment"},{"include":"#property"}]}},"scopeName":"source.yaml","aliases":["yml"]}`)),qn=[_o];var So=Object.freeze(JSON.parse('{"displayName":"CSV","fileTypes":["csv"],"name":"csv","patterns":[{"captures":{"1":{"name":"rainbow1"},"2":{"name":"keyword.rainbow2"},"3":{"name":"entity.name.function.rainbow3"},"4":{"name":"comment.rainbow4"},"5":{"name":"string.rainbow5"},"6":{"name":"variable.parameter.rainbow6"},"7":{"name":"constant.numeric.rainbow7"},"8":{"name":"entity.name.type.rainbow8"},"9":{"name":"markup.bold.rainbow9"},"10":{"name":"invalid.rainbow10"}},"match":"( *\\"(?:[^\\"]*\\"\\")*[^\\"]*\\" *(?:,|$)|[^,]*(?:,|$))?( *\\"(?:[^\\"]*\\"\\")*[^\\"]*\\" *(?:,|$)|[^,]*(?:,|$))?( *\\"(?:[^\\"]*\\"\\")*[^\\"]*\\" *(?:,|$)|[^,]*(?:,|$))?( *\\"(?:[^\\"]*\\"\\")*[^\\"]*\\" *(?:,|$)|[^,]*(?:,|$))?( *\\"(?:[^\\"]*\\"\\")*[^\\"]*\\" *(?:,|$)|[^,]*(?:,|$))?( *\\"(?:[^\\"]*\\"\\")*[^\\"]*\\" *(?:,|$)|[^,]*(?:,|$))?( *\\"(?:[^\\"]*\\"\\")*[^\\"]*\\" *(?:,|$)|[^,]*(?:,|$))?( *\\"(?:[^\\"]*\\"\\")*[^\\"]*\\" *(?:,|$)|[^,]*(?:,|$))?( *\\"(?:[^\\"]*\\"\\")*[^\\"]*\\" *(?:,|$)|[^,]*(?:,|$))?( *\\"(?:[^\\"]*\\"\\")*[^\\"]*\\" *(?:,|$)|[^,]*(?:,|$))?","name":"rainbowgroup"}],"scopeName":"text.csv"}')),Vn=[So];var xo=Object.freeze(JSON.parse(`{"displayName":"Java","name":"java","patterns":[{"begin":"\\\\b(package)\\\\b\\\\s*","beginCaptures":{"1":{"name":"keyword.other.package.java"}},"contentName":"storage.modifier.package.java","end":"\\\\s*(;)","endCaptures":{"1":{"name":"punctuation.terminator.java"}},"name":"meta.package.java","patterns":[{"include":"#comments"},{"match":"(?<=\\\\.)\\\\s*\\\\.|\\\\.(?=\\\\s*;)","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"(?","endCaptures":{"0":{"name":"punctuation.bracket.angle.java"}},"patterns":[{"match":"\\\\b(extends|super)\\\\b","name":"storage.modifier.$1.java"},{"captures":{"1":{"name":"storage.type.java"}},"match":"(?>>?|[\\\\^~])","name":"keyword.operator.bitwise.java"},{"match":"(([\\\\&^|]|<<|>>>?)=)","name":"keyword.operator.assignment.bitwise.java"},{"match":"(===?|!=|<=|>=|<>|[<>])","name":"keyword.operator.comparison.java"},{"match":"([-%*+/]=)","name":"keyword.operator.assignment.arithmetic.java"},{"match":"(=)","name":"keyword.operator.assignment.java"},{"match":"(--|\\\\+\\\\+)","name":"keyword.operator.increment-decrement.java"},{"match":"([-%*+/])","name":"keyword.operator.arithmetic.java"},{"match":"(!|&&|\\\\|\\\\|)","name":"keyword.operator.logical.java"},{"match":"([\\\\&|])","name":"keyword.operator.bitwise.java"},{"match":"\\\\b(const|goto)\\\\b","name":"keyword.reserved.java"}]},"lambda-expression":{"patterns":[{"match":"->","name":"storage.type.function.arrow.java"}]},"member-variables":{"begin":"(?=private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final)","end":"(?=[;=])","patterns":[{"include":"#storage-modifiers"},{"include":"#variables"},{"include":"#primitive-arrays"},{"include":"#object-types"}]},"method-call":{"begin":"(\\\\.)\\\\s*([$A-Z_a-z][$\\\\w]*)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"punctuation.separator.period.java"},"2":{"name":"entity.name.function.java"},"3":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"name":"meta.method-call.java","patterns":[{"include":"#code"}]},"methods":{"begin":"(?!new)(?=[<\\\\w].*\\\\s+)(?=([^/=]|/(?!/))+\\\\()","end":"(})|(?=;)","endCaptures":{"1":{"name":"punctuation.section.method.end.bracket.curly.java"}},"name":"meta.method.java","patterns":[{"include":"#storage-modifiers"},{"begin":"(\\\\w+)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"entity.name.function.java"},"2":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"name":"meta.method.identifier.java","patterns":[{"include":"#parameters"},{"include":"#parens"},{"include":"#comments"}]},{"include":"#generics"},{"begin":"(?=\\\\w.*\\\\s+\\\\w+\\\\s*\\\\()","end":"(?=\\\\s+\\\\w+\\\\s*\\\\()","name":"meta.method.return-type.java","patterns":[{"include":"#all-types"},{"include":"#parens"},{"include":"#comments"}]},{"include":"#throws"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.method.begin.bracket.curly.java"}},"contentName":"meta.method.body.java","end":"(?=})","patterns":[{"include":"#code"}]},{"include":"#comments"}]},"module":{"begin":"((open)\\\\s)?(module)\\\\s+(\\\\w+)","beginCaptures":{"1":{"name":"storage.modifier.java"},"3":{"name":"storage.modifier.java"},"4":{"name":"entity.name.type.module.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.module.end.bracket.curly.java"}},"name":"meta.module.java","patterns":[{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.module.begin.bracket.curly.java"}},"contentName":"meta.module.body.java","end":"(?=})","patterns":[{"include":"#comments"},{"include":"#comments-javadoc"},{"match":"\\\\b(requires|transitive|exports|opens|to|uses|provides|with)\\\\b","name":"keyword.module.java"}]}]},"numbers":{"patterns":[{"match":"\\\\b(?)?(\\\\()","beginCaptures":{"1":{"name":"storage.modifier.java"},"2":{"name":"entity.name.type.record.java"},"3":{"patterns":[{"include":"#generics"}]},"4":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"name":"meta.record.identifier.java","patterns":[{"include":"#code"}]},{"begin":"(implements)\\\\s","beginCaptures":{"1":{"name":"storage.modifier.implements.java"}},"end":"(?=\\\\s*\\\\{)","name":"meta.definition.class.implemented.interfaces.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"include":"#record-body"}]},"record-body":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.class.begin.bracket.curly.java"}},"end":"(?=})","name":"meta.record.body.java","patterns":[{"include":"#record-constructor"},{"include":"#class-body"}]},"record-constructor":{"begin":"(?!new)(?=[<\\\\w].*\\\\s+)(?=([^(/=]|/(?!/))+(?=\\\\{))","end":"(})|(?=;)","endCaptures":{"1":{"name":"punctuation.section.method.end.bracket.curly.java"}},"name":"meta.method.java","patterns":[{"include":"#storage-modifiers"},{"begin":"(\\\\w+)","beginCaptures":{"1":{"name":"entity.name.function.java"}},"end":"(?=\\\\s*\\\\{)","name":"meta.method.identifier.java","patterns":[{"include":"#comments"}]},{"include":"#comments"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.method.begin.bracket.curly.java"}},"contentName":"meta.method.body.java","end":"(?=})","patterns":[{"include":"#code"}]}]},"static-initializer":{"patterns":[{"include":"#anonymous-block-and-instance-initializer"},{"match":"static","name":"storage.modifier.java"}]},"storage-modifiers":{"match":"\\\\b(public|private|protected|static|final|native|synchronized|abstract|threadsafe|transient|volatile|default|strictfp|sealed|non-sealed)\\\\b","name":"storage.modifier.java"},"strings":{"patterns":[{"begin":"\\"\\"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.java"}},"end":"\\"\\"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.java"}},"name":"string.quoted.triple.java","patterns":[{"match":"(\\\\\\\\\\"\\"\\")(?!\\")|(\\\\\\\\.)","name":"constant.character.escape.java"}]},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.java"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.java"}},"name":"string.quoted.double.java","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.java"}]},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.java"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.java"}},"name":"string.quoted.single.java","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.java"}]}]},"throws":{"begin":"throws","beginCaptures":{"0":{"name":"storage.modifier.java"}},"end":"(?=[;{])","name":"meta.throwables.java","patterns":[{"match":",","name":"punctuation.separator.delimiter.java"},{"match":"[$A-Z_a-z][$.0-9A-Z_a-z]*","name":"storage.type.java"},{"include":"#comments"}]},"try-catch-finally":{"patterns":[{"begin":"\\\\btry\\\\b","beginCaptures":{"0":{"name":"keyword.control.try.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.try.end.bracket.curly.java"}},"name":"meta.try.java","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.try.resources.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.try.resources.end.bracket.round.java"}},"name":"meta.try.resources.java","patterns":[{"include":"#code"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.try.begin.bracket.curly.java"}},"contentName":"meta.try.body.java","end":"(?=})","patterns":[{"include":"#code"}]}]},{"begin":"\\\\b(catch)\\\\b","beginCaptures":{"1":{"name":"keyword.control.catch.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.catch.end.bracket.curly.java"}},"name":"meta.catch.java","patterns":[{"include":"#comments"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"contentName":"meta.catch.parameters.java","end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"patterns":[{"include":"#comments"},{"include":"#storage-modifiers"},{"begin":"[$A-Z_a-z][$.0-9A-Z_a-z]*","beginCaptures":{"0":{"name":"storage.type.java"}},"end":"(\\\\|)|(?=\\\\))","endCaptures":{"1":{"name":"punctuation.catch.separator.java"}},"patterns":[{"include":"#comments"},{"captures":{"0":{"name":"variable.parameter.java"}},"match":"\\\\w+"}]}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.catch.begin.bracket.curly.java"}},"contentName":"meta.catch.body.java","end":"(?=})","patterns":[{"include":"#code"}]}]},{"begin":"\\\\bfinally\\\\b","beginCaptures":{"0":{"name":"keyword.control.finally.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.finally.end.bracket.curly.java"}},"name":"meta.finally.java","patterns":[{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.finally.begin.bracket.curly.java"}},"contentName":"meta.finally.body.java","end":"(?=})","patterns":[{"include":"#code"}]}]}]},"variables":{"begin":"(?=\\\\b((void|boolean|byte|char|short|int|float|long|double)|(?>(\\\\w+\\\\.)*[A-Z_]+\\\\w*))\\\\b\\\\s*(<[],.<>?\\\\[\\\\w\\\\s]*>)?\\\\s*((\\\\[])*)?\\\\s+[$A-Z_a-z][$\\\\w]*([]$,\\\\[\\\\w][],\\\\[\\\\w\\\\s]*)?\\\\s*([:;=]))","end":"(?=[:;=])","name":"meta.definition.variable.java","patterns":[{"captures":{"1":{"name":"variable.other.definition.java"}},"match":"([$A-Z_a-z][$\\\\w]*)(?=\\\\s*(\\\\[])*\\\\s*([,:;=]))"},{"include":"#all-types"},{"include":"#code"}]},"variables-local":{"begin":"(?=\\\\b(var)\\\\b\\\\s+[$A-Z_a-z][$\\\\w]*\\\\s*([:;=]))","end":"(?=[:;=])","name":"meta.definition.variable.local.java","patterns":[{"match":"\\\\bvar\\\\b","name":"storage.type.local.java"},{"captures":{"1":{"name":"variable.other.definition.java"}},"match":"([$A-Z_a-z][$\\\\w]*)(?=\\\\s*(\\\\[])*\\\\s*([:;=]))"},{"include":"#code"}]}},"scopeName":"source.java"}`)),Zn=[xo];var Io=Object.freeze(JSON.parse(`{"displayName":"XML","name":"xml","patterns":[{"begin":"(<\\\\?)\\\\s*([-0-9A-Z_a-z]+)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.xml"}},"end":"(\\\\?>)","name":"meta.tag.preprocessor.xml","patterns":[{"match":" ([-A-Za-z]+)","name":"entity.other.attribute-name.xml"},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},{"begin":"()","name":"meta.tag.sgml.doctype.xml","patterns":[{"include":"#internalSubset"}]},{"include":"#comments"},{"begin":"(<)((?:([-0-9A-Z_a-z]+)(:))?([-0-:A-Z_a-z]+))(?=(\\\\s[^>]*)?>)","beginCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.xml"},"3":{"name":"entity.name.tag.namespace.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(>)()","endCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"punctuation.definition.tag.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"entity.name.tag.namespace.xml"},"5":{"name":"punctuation.separator.namespace.xml"},"6":{"name":"entity.name.tag.localname.xml"},"7":{"name":"punctuation.definition.tag.xml"}},"name":"meta.tag.no-content.xml","patterns":[{"include":"#tagStuff"}]},{"begin":"()","name":"meta.tag.xml","patterns":[{"include":"#tagStuff"}]},{"include":"#entity"},{"include":"#bare-ampersand"},{"begin":"<%@","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.xml"}},"end":"%>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.xml"}},"name":"source.java-props.embedded.xml","patterns":[{"match":"page|include|taglib","name":"keyword.other.page-props.xml"}]},{"begin":"<%[!=]?(?!--)","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.xml"}},"end":"(?!--)%>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.xml"}},"name":"source.java.embedded.xml","patterns":[{"include":"source.java"}]},{"begin":"","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.unquoted.cdata.xml"}],"repository":{"EntityDecl":{"begin":"()","patterns":[{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},"bare-ampersand":{"match":"&","name":"invalid.illegal.bad-ampersand.xml"},"comments":{"patterns":[{"begin":"<%--","captures":{"0":{"name":"punctuation.definition.comment.xml"},"end":"--%>","name":"comment.block.xml"}},{"begin":"","name":"comment.block.xml","patterns":[{"begin":"--(?!>)","captures":{"0":{"name":"invalid.illegal.bad-comments-or-CDATA.xml"}}}]}]},"doublequotedString":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.double.xml","patterns":[{"include":"#entity"},{"include":"#bare-ampersand"}]},"entity":{"captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"match":"(&)([:A-Z_a-z][-.0-:A-Z_a-z]*|#[0-9]+|#x\\\\h+)(;)","name":"constant.character.entity.xml"},"internalSubset":{"begin":"(\\\\[)","captures":{"1":{"name":"punctuation.definition.constant.xml"}},"end":"(])","name":"meta.internalsubset.xml","patterns":[{"include":"#EntityDecl"},{"include":"#parameterEntity"},{"include":"#comments"}]},"parameterEntity":{"captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"match":"(%)([:A-Z_a-z][-.0-:A-Z_a-z]*)(;)","name":"constant.character.parameter-entity.xml"},"singlequotedString":{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.single.xml","patterns":[{"include":"#entity"},{"include":"#bare-ampersand"}]},"tagStuff":{"patterns":[{"captures":{"1":{"name":"entity.other.attribute-name.namespace.xml"},"2":{"name":"entity.other.attribute-name.xml"},"3":{"name":"punctuation.separator.namespace.xml"},"4":{"name":"entity.other.attribute-name.localname.xml"}},"match":"(?:^|\\\\s+)(?:([-.\\\\w]+)((:)))?([-.:\\\\w]+)\\\\s*="},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]}},"scopeName":"text.xml","embeddedLangs":["java"]}`)),Xn=[...Zn,Io];var Yn=Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#ef5b48","activityBar.background":"#ffffff","activityBar.border":"#20252c","activityBar.foreground":"#0e1116","activityBar.inactiveForeground":"#0e1116","activityBarBadge.background":"#0349b4","activityBarBadge.foreground":"#ffffff","badge.background":"#0349b4","badge.foreground":"#ffffff","breadcrumb.activeSelectionForeground":"#0e1116","breadcrumb.focusForeground":"#0e1116","breadcrumb.foreground":"#0e1116","breadcrumbPicker.background":"#ffffff","button.background":"#055d20","button.foreground":"#ffffff","button.hoverBackground":"#024c1a","button.secondaryBackground":"#acb6c0","button.secondaryForeground":"#0e1116","button.secondaryHoverBackground":"#ced5dc","checkbox.background":"#e7ecf0","checkbox.border":"#20252c","debugConsole.errorForeground":"#a0111f","debugConsole.infoForeground":"#4b535d","debugConsole.sourceForeground":"#744500","debugConsole.warningForeground":"#603700","debugConsoleInputIcon.foreground":"#512598","debugIcon.breakpointForeground":"#a0111f","debugTokenExpression.boolean":"#024c1a","debugTokenExpression.error":"#86061d","debugTokenExpression.name":"#023b95","debugTokenExpression.number":"#024c1a","debugTokenExpression.string":"#032563","debugTokenExpression.value":"#032563","debugToolBar.background":"#ffffff","descriptionForeground":"#0e1116","diffEditor.insertedLineBackground":"#82e5964d","diffEditor.insertedTextBackground":"#43c66380","diffEditor.removedLineBackground":"#ffc1bc4d","diffEditor.removedTextBackground":"#ee5a5d66","dropdown.background":"#ffffff","dropdown.border":"#20252c","dropdown.foreground":"#0e1116","dropdown.listBackground":"#ffffff","editor.background":"#ffffff","editor.findMatchBackground":"#744500","editor.findMatchHighlightBackground":"#f0ce5380","editor.focusedStackFrameHighlightBackground":"#26a148","editor.foldBackground":"#66707b1a","editor.foreground":"#0e1116","editor.inactiveSelectionBackground":"#66707b","editor.lineHighlightBackground":"#e7ecf0","editor.linkedEditingBackground":"#0349b412","editor.selectionBackground":"#0e1116","editor.selectionForeground":"#ffffff","editor.selectionHighlightBackground":"#26a14840","editor.stackFrameHighlightBackground":"#b58407","editor.wordHighlightBackground":"#e7ecf080","editor.wordHighlightBorder":"#acb6c099","editor.wordHighlightStrongBackground":"#acb6c04d","editor.wordHighlightStrongBorder":"#acb6c099","editorBracketHighlight.foreground1":"#0349b4","editorBracketHighlight.foreground2":"#055d20","editorBracketHighlight.foreground3":"#744500","editorBracketHighlight.foreground4":"#a0111f","editorBracketHighlight.foreground5":"#971368","editorBracketHighlight.foreground6":"#622cbc","editorBracketHighlight.unexpectedBracket.foreground":"#0e1116","editorBracketMatch.background":"#26a14840","editorBracketMatch.border":"#26a14899","editorCursor.foreground":"#0349b4","editorGroup.border":"#20252c","editorGroupHeader.tabsBackground":"#ffffff","editorGroupHeader.tabsBorder":"#20252c","editorGutter.addedBackground":"#26a148","editorGutter.deletedBackground":"#ee5a5d","editorGutter.modifiedBackground":"#b58407","editorIndentGuide.activeBackground":"#0e11163d","editorIndentGuide.background":"#0e11161f","editorInlayHint.background":"#acb6c033","editorInlayHint.foreground":"#0e1116","editorInlayHint.paramBackground":"#acb6c033","editorInlayHint.paramForeground":"#0e1116","editorInlayHint.typeBackground":"#acb6c033","editorInlayHint.typeForeground":"#0e1116","editorLineNumber.activeForeground":"#0e1116","editorLineNumber.foreground":"#88929d","editorOverviewRuler.border":"#ffffff","editorWhitespace.foreground":"#acb6c0","editorWidget.background":"#ffffff","errorForeground":"#a0111f","focusBorder":"#0349b4","foreground":"#0e1116","gitDecoration.addedResourceForeground":"#055d20","gitDecoration.conflictingResourceForeground":"#873800","gitDecoration.deletedResourceForeground":"#a0111f","gitDecoration.ignoredResourceForeground":"#66707b","gitDecoration.modifiedResourceForeground":"#744500","gitDecoration.submoduleResourceForeground":"#0e1116","gitDecoration.untrackedResourceForeground":"#055d20","icon.foreground":"#0e1116","input.background":"#ffffff","input.border":"#20252c","input.foreground":"#0e1116","input.placeholderForeground":"#66707b","keybindingLabel.foreground":"#0e1116","list.activeSelectionBackground":"#acb6c033","list.activeSelectionForeground":"#0e1116","list.focusBackground":"#dff7ff","list.focusForeground":"#0e1116","list.highlightForeground":"#0349b4","list.hoverBackground":"#e7ecf0","list.hoverForeground":"#0e1116","list.inactiveFocusBackground":"#dff7ff","list.inactiveSelectionBackground":"#acb6c033","list.inactiveSelectionForeground":"#0e1116","minimapSlider.activeBackground":"#88929d47","minimapSlider.background":"#88929d33","minimapSlider.hoverBackground":"#88929d3d","notificationCenterHeader.background":"#e7ecf0","notificationCenterHeader.foreground":"#0e1116","notifications.background":"#ffffff","notifications.border":"#20252c","notifications.foreground":"#0e1116","notificationsErrorIcon.foreground":"#a0111f","notificationsInfoIcon.foreground":"#0349b4","notificationsWarningIcon.foreground":"#744500","panel.background":"#ffffff","panel.border":"#20252c","panelInput.border":"#20252c","panelTitle.activeBorder":"#ef5b48","panelTitle.activeForeground":"#0e1116","panelTitle.inactiveForeground":"#0e1116","pickerGroup.border":"#20252c","pickerGroup.foreground":"#0e1116","progressBar.background":"#0349b4","quickInput.background":"#ffffff","quickInput.foreground":"#0e1116","scrollbar.shadow":"#66707b33","scrollbarSlider.activeBackground":"#88929d47","scrollbarSlider.background":"#88929d33","scrollbarSlider.hoverBackground":"#88929d3d","settings.headerForeground":"#0e1116","settings.modifiedItemIndicator":"#b58407","sideBar.background":"#ffffff","sideBar.border":"#20252c","sideBar.foreground":"#0e1116","sideBarSectionHeader.background":"#ffffff","sideBarSectionHeader.border":"#20252c","sideBarSectionHeader.foreground":"#0e1116","sideBarTitle.foreground":"#0e1116","statusBar.background":"#ffffff","statusBar.border":"#20252c","statusBar.debuggingBackground":"#a0111f","statusBar.debuggingForeground":"#ffffff","statusBar.focusBorder":"#0349b480","statusBar.foreground":"#0e1116","statusBar.noFolderBackground":"#ffffff","statusBarItem.activeBackground":"#0e11161f","statusBarItem.focusBorder":"#0349b4","statusBarItem.hoverBackground":"#0e111614","statusBarItem.prominentBackground":"#acb6c033","statusBarItem.remoteBackground":"#e7ecf0","statusBarItem.remoteForeground":"#0e1116","symbolIcon.arrayForeground":"#702c00","symbolIcon.booleanForeground":"#023b95","symbolIcon.classForeground":"#702c00","symbolIcon.colorForeground":"#032563","symbolIcon.constantForeground":"#024c1a","symbolIcon.constructorForeground":"#341763","symbolIcon.enumeratorForeground":"#702c00","symbolIcon.enumeratorMemberForeground":"#023b95","symbolIcon.eventForeground":"#4b535d","symbolIcon.fieldForeground":"#702c00","symbolIcon.fileForeground":"#603700","symbolIcon.folderForeground":"#603700","symbolIcon.functionForeground":"#512598","symbolIcon.interfaceForeground":"#702c00","symbolIcon.keyForeground":"#023b95","symbolIcon.keywordForeground":"#86061d","symbolIcon.methodForeground":"#512598","symbolIcon.moduleForeground":"#86061d","symbolIcon.namespaceForeground":"#86061d","symbolIcon.nullForeground":"#023b95","symbolIcon.numberForeground":"#024c1a","symbolIcon.objectForeground":"#702c00","symbolIcon.operatorForeground":"#032563","symbolIcon.packageForeground":"#702c00","symbolIcon.propertyForeground":"#702c00","symbolIcon.referenceForeground":"#023b95","symbolIcon.snippetForeground":"#023b95","symbolIcon.stringForeground":"#032563","symbolIcon.structForeground":"#702c00","symbolIcon.textForeground":"#032563","symbolIcon.typeParameterForeground":"#032563","symbolIcon.unitForeground":"#023b95","symbolIcon.variableForeground":"#702c00","tab.activeBackground":"#ffffff","tab.activeBorder":"#ffffff","tab.activeBorderTop":"#ef5b48","tab.activeForeground":"#0e1116","tab.border":"#20252c","tab.hoverBackground":"#ffffff","tab.inactiveBackground":"#ffffff","tab.inactiveForeground":"#0e1116","tab.unfocusedActiveBorder":"#ffffff","tab.unfocusedActiveBorderTop":"#20252c","tab.unfocusedHoverBackground":"#e7ecf0","terminal.ansiBlack":"#0e1116","terminal.ansiBlue":"#0349b4","terminal.ansiBrightBlack":"#4b535d","terminal.ansiBrightBlue":"#1168e3","terminal.ansiBrightCyan":"#3192aa","terminal.ansiBrightGreen":"#055d20","terminal.ansiBrightMagenta":"#844ae7","terminal.ansiBrightRed":"#86061d","terminal.ansiBrightWhite":"#88929d","terminal.ansiBrightYellow":"#4e2c00","terminal.ansiCyan":"#1b7c83","terminal.ansiGreen":"#024c1a","terminal.ansiMagenta":"#622cbc","terminal.ansiRed":"#a0111f","terminal.ansiWhite":"#66707b","terminal.ansiYellow":"#3f2200","terminal.foreground":"#0e1116","textBlockQuote.background":"#ffffff","textBlockQuote.border":"#20252c","textCodeBlock.background":"#acb6c033","textLink.activeForeground":"#0349b4","textLink.foreground":"#0349b4","textPreformat.background":"#acb6c033","textPreformat.foreground":"#0e1116","textSeparator.foreground":"#88929d","titleBar.activeBackground":"#ffffff","titleBar.activeForeground":"#0e1116","titleBar.border":"#20252c","titleBar.inactiveBackground":"#ffffff","titleBar.inactiveForeground":"#0e1116","tree.indentGuidesStroke":"#88929d","welcomePage.buttonBackground":"#e7ecf0","welcomePage.buttonHoverBackground":"#ced5dc"},"displayName":"GitHub Light High Contrast","name":"github-light-high-contrast","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#66707b"}},{"scope":["constant.other.placeholder","constant.character"],"settings":{"foreground":"#a0111f"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language","entity"],"settings":{"foreground":"#023b95"}},{"scope":["entity.name","meta.export.default","meta.definition.variable"],"settings":{"foreground":"#702c00"}},{"scope":["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.object.member","meta.embedded.expression"],"settings":{"foreground":"#0e1116"}},{"scope":"entity.name.function","settings":{"foreground":"#622cbc"}},{"scope":["entity.name.tag","support.class.component"],"settings":{"foreground":"#024c1a"}},{"scope":"keyword","settings":{"foreground":"#a0111f"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#a0111f"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#0e1116"}},{"scope":["string","string punctuation.section.embedded source"],"settings":{"foreground":"#032563"}},{"scope":"support","settings":{"foreground":"#023b95"}},{"scope":"meta.property-name","settings":{"foreground":"#023b95"}},{"scope":"variable","settings":{"foreground":"#702c00"}},{"scope":"variable.other","settings":{"foreground":"#0e1116"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#6e011a"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#6e011a"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#6e011a"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#6e011a"}},{"scope":"carriage-return","settings":{"background":"#a0111f","content":"^M","fontStyle":"italic underline","foreground":"#ffffff"}},{"scope":"message.error","settings":{"foreground":"#6e011a"}},{"scope":"string variable","settings":{"foreground":"#023b95"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#032563"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#032563"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#024c1a"}},{"scope":"support.constant","settings":{"foreground":"#023b95"}},{"scope":"support.variable","settings":{"foreground":"#023b95"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#024c1a"}},{"scope":"meta.module-reference","settings":{"foreground":"#023b95"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#702c00"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#023b95"}},{"scope":"markup.quote","settings":{"foreground":"#024c1a"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#0e1116"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#0e1116"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#023b95"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#fff0ee","foreground":"#6e011a"}},{"scope":["punctuation.section.embedded"],"settings":{"foreground":"#a0111f"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#d2fedb","foreground":"#024c1a"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#ffc67b","foreground":"#702c00"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#023b95","foreground":"#e7ecf0"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#622cbc"}},{"scope":"meta.diff.header","settings":{"foreground":"#023b95"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#023b95"}},{"scope":"meta.output","settings":{"foreground":"#023b95"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#4b535d"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#6e011a"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"foreground":"#032563"}}],"type":"light"}'));var Jn=Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#ff967d","activityBar.background":"#0a0c10","activityBar.border":"#7a828e","activityBar.foreground":"#f0f3f6","activityBar.inactiveForeground":"#f0f3f6","activityBarBadge.background":"#409eff","activityBarBadge.foreground":"#0a0c10","badge.background":"#409eff","badge.foreground":"#0a0c10","breadcrumb.activeSelectionForeground":"#f0f3f6","breadcrumb.focusForeground":"#f0f3f6","breadcrumb.foreground":"#f0f3f6","breadcrumbPicker.background":"#272b33","button.background":"#09b43a","button.foreground":"#0a0c10","button.hoverBackground":"#26cd4d","button.secondaryBackground":"#4c525d","button.secondaryForeground":"#f0f3f6","button.secondaryHoverBackground":"#525964","checkbox.background":"#272b33","checkbox.border":"#7a828e","debugConsole.errorForeground":"#ffb1af","debugConsole.infoForeground":"#bdc4cc","debugConsole.sourceForeground":"#f7c843","debugConsole.warningForeground":"#f0b72f","debugConsoleInputIcon.foreground":"#cb9eff","debugIcon.breakpointForeground":"#ff6a69","debugTokenExpression.boolean":"#4ae168","debugTokenExpression.error":"#ffb1af","debugTokenExpression.name":"#91cbff","debugTokenExpression.number":"#4ae168","debugTokenExpression.string":"#addcff","debugTokenExpression.value":"#addcff","debugToolBar.background":"#272b33","descriptionForeground":"#f0f3f6","diffEditor.insertedLineBackground":"#09b43a26","diffEditor.insertedTextBackground":"#26cd4d4d","diffEditor.removedLineBackground":"#ff6a6926","diffEditor.removedTextBackground":"#ff94924d","dropdown.background":"#272b33","dropdown.border":"#7a828e","dropdown.foreground":"#f0f3f6","dropdown.listBackground":"#272b33","editor.background":"#0a0c10","editor.findMatchBackground":"#e09b13","editor.findMatchHighlightBackground":"#fbd66980","editor.focusedStackFrameHighlightBackground":"#09b43a","editor.foldBackground":"#9ea7b31a","editor.foreground":"#f0f3f6","editor.inactiveSelectionBackground":"#9ea7b3","editor.lineHighlightBackground":"#9ea7b31a","editor.lineHighlightBorder":"#71b7ff","editor.linkedEditingBackground":"#71b7ff12","editor.selectionBackground":"#ffffff","editor.selectionForeground":"#0a0c10","editor.selectionHighlightBackground":"#26cd4d40","editor.stackFrameHighlightBackground":"#e09b13","editor.wordHighlightBackground":"#9ea7b380","editor.wordHighlightBorder":"#9ea7b399","editor.wordHighlightStrongBackground":"#9ea7b34d","editor.wordHighlightStrongBorder":"#9ea7b399","editorBracketHighlight.foreground1":"#91cbff","editorBracketHighlight.foreground2":"#4ae168","editorBracketHighlight.foreground3":"#f7c843","editorBracketHighlight.foreground4":"#ffb1af","editorBracketHighlight.foreground5":"#ffadd4","editorBracketHighlight.foreground6":"#dbb7ff","editorBracketHighlight.unexpectedBracket.foreground":"#f0f3f6","editorBracketMatch.background":"#26cd4d40","editorBracketMatch.border":"#26cd4d99","editorCursor.foreground":"#71b7ff","editorGroup.border":"#7a828e","editorGroupHeader.tabsBackground":"#010409","editorGroupHeader.tabsBorder":"#7a828e","editorGutter.addedBackground":"#09b43a","editorGutter.deletedBackground":"#ff6a69","editorGutter.modifiedBackground":"#e09b13","editorIndentGuide.activeBackground":"#f0f3f63d","editorIndentGuide.background":"#f0f3f61f","editorInlayHint.background":"#bdc4cc33","editorInlayHint.foreground":"#f0f3f6","editorInlayHint.paramBackground":"#bdc4cc33","editorInlayHint.paramForeground":"#f0f3f6","editorInlayHint.typeBackground":"#bdc4cc33","editorInlayHint.typeForeground":"#f0f3f6","editorLineNumber.activeForeground":"#f0f3f6","editorLineNumber.foreground":"#9ea7b3","editorOverviewRuler.border":"#010409","editorWhitespace.foreground":"#7a828e","editorWidget.background":"#272b33","errorForeground":"#ff6a69","focusBorder":"#409eff","foreground":"#f0f3f6","gitDecoration.addedResourceForeground":"#26cd4d","gitDecoration.conflictingResourceForeground":"#e7811d","gitDecoration.deletedResourceForeground":"#ff6a69","gitDecoration.ignoredResourceForeground":"#9ea7b3","gitDecoration.modifiedResourceForeground":"#f0b72f","gitDecoration.submoduleResourceForeground":"#f0f3f6","gitDecoration.untrackedResourceForeground":"#26cd4d","icon.foreground":"#f0f3f6","input.background":"#0a0c10","input.border":"#7a828e","input.foreground":"#f0f3f6","input.placeholderForeground":"#9ea7b3","keybindingLabel.foreground":"#f0f3f6","list.activeSelectionBackground":"#9ea7b366","list.activeSelectionForeground":"#f0f3f6","list.focusBackground":"#409eff26","list.focusForeground":"#f0f3f6","list.highlightForeground":"#71b7ff","list.hoverBackground":"#9ea7b31a","list.hoverForeground":"#f0f3f6","list.inactiveFocusBackground":"#409eff26","list.inactiveSelectionBackground":"#9ea7b366","list.inactiveSelectionForeground":"#f0f3f6","minimapSlider.activeBackground":"#bdc4cc47","minimapSlider.background":"#bdc4cc33","minimapSlider.hoverBackground":"#bdc4cc3d","notificationCenterHeader.background":"#272b33","notificationCenterHeader.foreground":"#f0f3f6","notifications.background":"#272b33","notifications.border":"#7a828e","notifications.foreground":"#f0f3f6","notificationsErrorIcon.foreground":"#ff6a69","notificationsInfoIcon.foreground":"#71b7ff","notificationsWarningIcon.foreground":"#f0b72f","panel.background":"#010409","panel.border":"#7a828e","panelInput.border":"#7a828e","panelTitle.activeBorder":"#ff967d","panelTitle.activeForeground":"#f0f3f6","panelTitle.inactiveForeground":"#f0f3f6","peekViewEditor.background":"#9ea7b31a","peekViewEditor.matchHighlightBackground":"#e09b13","peekViewResult.background":"#0a0c10","peekViewResult.matchHighlightBackground":"#e09b13","pickerGroup.border":"#7a828e","pickerGroup.foreground":"#f0f3f6","progressBar.background":"#409eff","quickInput.background":"#272b33","quickInput.foreground":"#f0f3f6","scrollbar.shadow":"#7a828e33","scrollbarSlider.activeBackground":"#bdc4cc47","scrollbarSlider.background":"#bdc4cc33","scrollbarSlider.hoverBackground":"#bdc4cc3d","settings.headerForeground":"#f0f3f6","settings.modifiedItemIndicator":"#e09b13","sideBar.background":"#010409","sideBar.border":"#7a828e","sideBar.foreground":"#f0f3f6","sideBarSectionHeader.background":"#010409","sideBarSectionHeader.border":"#7a828e","sideBarSectionHeader.foreground":"#f0f3f6","sideBarTitle.foreground":"#f0f3f6","statusBar.background":"#0a0c10","statusBar.border":"#7a828e","statusBar.debuggingBackground":"#ff6a69","statusBar.debuggingForeground":"#0a0c10","statusBar.focusBorder":"#409eff80","statusBar.foreground":"#f0f3f6","statusBar.noFolderBackground":"#0a0c10","statusBarItem.activeBackground":"#f0f3f61f","statusBarItem.focusBorder":"#409eff","statusBarItem.hoverBackground":"#f0f3f614","statusBarItem.prominentBackground":"#9ea7b366","statusBarItem.remoteBackground":"#525964","statusBarItem.remoteForeground":"#f0f3f6","symbolIcon.arrayForeground":"#fe9a2d","symbolIcon.booleanForeground":"#71b7ff","symbolIcon.classForeground":"#fe9a2d","symbolIcon.colorForeground":"#91cbff","symbolIcon.constantForeground":["#acf7b6","#72f088","#4ae168","#26cd4d","#09b43a","#09b43a","#02a232","#008c2c","#007728","#006222"],"symbolIcon.constructorForeground":"#dbb7ff","symbolIcon.enumeratorForeground":"#fe9a2d","symbolIcon.enumeratorMemberForeground":"#71b7ff","symbolIcon.eventForeground":"#9ea7b3","symbolIcon.fieldForeground":"#fe9a2d","symbolIcon.fileForeground":"#f0b72f","symbolIcon.folderForeground":"#f0b72f","symbolIcon.functionForeground":"#cb9eff","symbolIcon.interfaceForeground":"#fe9a2d","symbolIcon.keyForeground":"#71b7ff","symbolIcon.keywordForeground":"#ff9492","symbolIcon.methodForeground":"#cb9eff","symbolIcon.moduleForeground":"#ff9492","symbolIcon.namespaceForeground":"#ff9492","symbolIcon.nullForeground":"#71b7ff","symbolIcon.numberForeground":"#26cd4d","symbolIcon.objectForeground":"#fe9a2d","symbolIcon.operatorForeground":"#91cbff","symbolIcon.packageForeground":"#fe9a2d","symbolIcon.propertyForeground":"#fe9a2d","symbolIcon.referenceForeground":"#71b7ff","symbolIcon.snippetForeground":"#71b7ff","symbolIcon.stringForeground":"#91cbff","symbolIcon.structForeground":"#fe9a2d","symbolIcon.textForeground":"#91cbff","symbolIcon.typeParameterForeground":"#91cbff","symbolIcon.unitForeground":"#71b7ff","symbolIcon.variableForeground":"#fe9a2d","tab.activeBackground":"#0a0c10","tab.activeBorder":"#0a0c10","tab.activeBorderTop":"#ff967d","tab.activeForeground":"#f0f3f6","tab.border":"#7a828e","tab.hoverBackground":"#0a0c10","tab.inactiveBackground":"#010409","tab.inactiveForeground":"#f0f3f6","tab.unfocusedActiveBorder":"#0a0c10","tab.unfocusedActiveBorderTop":"#7a828e","tab.unfocusedHoverBackground":"#9ea7b31a","terminal.ansiBlack":"#7a828e","terminal.ansiBlue":"#71b7ff","terminal.ansiBrightBlack":"#9ea7b3","terminal.ansiBrightBlue":"#91cbff","terminal.ansiBrightCyan":"#56d4dd","terminal.ansiBrightGreen":"#4ae168","terminal.ansiBrightMagenta":"#dbb7ff","terminal.ansiBrightRed":"#ffb1af","terminal.ansiBrightWhite":"#ffffff","terminal.ansiBrightYellow":"#f7c843","terminal.ansiCyan":"#39c5cf","terminal.ansiGreen":"#26cd4d","terminal.ansiMagenta":"#cb9eff","terminal.ansiRed":"#ff9492","terminal.ansiWhite":"#d9dee3","terminal.ansiYellow":"#f0b72f","terminal.foreground":"#f0f3f6","textBlockQuote.background":"#010409","textBlockQuote.border":"#7a828e","textCodeBlock.background":"#9ea7b366","textLink.activeForeground":"#71b7ff","textLink.foreground":"#71b7ff","textPreformat.background":"#9ea7b366","textPreformat.foreground":"#f0f3f6","textSeparator.foreground":"#7a828e","titleBar.activeBackground":"#0a0c10","titleBar.activeForeground":"#f0f3f6","titleBar.border":"#7a828e","titleBar.inactiveBackground":"#010409","titleBar.inactiveForeground":"#f0f3f6","tree.indentGuidesStroke":"#7a828e","welcomePage.buttonBackground":"#272b33","welcomePage.buttonHoverBackground":"#525964"},"displayName":"GitHub Dark High Contrast","name":"github-dark-high-contrast","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#bdc4cc"}},{"scope":["constant.other.placeholder","constant.character"],"settings":{"foreground":"#ff9492"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language","entity"],"settings":{"foreground":"#91cbff"}},{"scope":["entity.name","meta.export.default","meta.definition.variable"],"settings":{"foreground":"#ffb757"}},{"scope":["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.object.member","meta.embedded.expression"],"settings":{"foreground":"#f0f3f6"}},{"scope":"entity.name.function","settings":{"foreground":"#dbb7ff"}},{"scope":["entity.name.tag","support.class.component"],"settings":{"foreground":"#72f088"}},{"scope":"keyword","settings":{"foreground":"#ff9492"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#ff9492"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#f0f3f6"}},{"scope":["string","string punctuation.section.embedded source"],"settings":{"foreground":"#addcff"}},{"scope":"support","settings":{"foreground":"#91cbff"}},{"scope":"meta.property-name","settings":{"foreground":"#91cbff"}},{"scope":"variable","settings":{"foreground":"#ffb757"}},{"scope":"variable.other","settings":{"foreground":"#f0f3f6"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#ffb1af"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#ffb1af"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#ffb1af"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#ffb1af"}},{"scope":"carriage-return","settings":{"background":"#ff9492","content":"^M","fontStyle":"italic underline","foreground":"#ffffff"}},{"scope":"message.error","settings":{"foreground":"#ffb1af"}},{"scope":"string variable","settings":{"foreground":"#91cbff"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#addcff"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#addcff"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#72f088"}},{"scope":"support.constant","settings":{"foreground":"#91cbff"}},{"scope":"support.variable","settings":{"foreground":"#91cbff"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#72f088"}},{"scope":"meta.module-reference","settings":{"foreground":"#91cbff"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#ffb757"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#91cbff"}},{"scope":"markup.quote","settings":{"foreground":"#72f088"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#f0f3f6"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#f0f3f6"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#91cbff"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#ad0116","foreground":"#ffb1af"}},{"scope":["punctuation.section.embedded"],"settings":{"foreground":"#ff9492"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#006222","foreground":"#72f088"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#a74c00","foreground":"#ffb757"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#91cbff","foreground":"#272b33"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#dbb7ff"}},{"scope":"meta.diff.header","settings":{"foreground":"#91cbff"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#91cbff"}},{"scope":"meta.output","settings":{"foreground":"#91cbff"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#bdc4cc"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#ffb1af"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"foreground":"#addcff"}}],"type":"dark"}'));var A=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Ao(t){return Qt(t)}function Qt(t){return Array.isArray(t)?Eo(t):t instanceof RegExp?t:typeof t=="object"?No(t):t}function Eo(t){let e=[];for(let n=0,r=t.length;n{for(let r in n)t[r]=n[r]}),t}function sr(t){let e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?sr(t.substring(0,t.length-1)):t.substr(~e+1)}var Ut=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ot=class{static hasCaptures(t){return t===null?!1:(Ut.lastIndex=0,Ut.test(t))}static replaceCaptures(t,e,n){return t.replace(Ut,(r,a,o,i)=>{let s=n[parseInt(a||o,10)];if(s){let l=e.substring(s.start,s.end);for(;l[0]===".";)l=l.substring(1);switch(i){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function lr(t,e){return te?1:0}function cr(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let a=0;athis._root.match(t)));this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(jo(t),e)}static createFromParsedTheme(t,e){return Lo(t,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;let e=t.scopeName,r=this._cachedMatchRoot.get(e).find(a=>Ro(t.parent,a.parentScopes));return r?new pr(r.fontStyle,r.foreground,r.background):null}},Wt=class it{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(let r of n)e=new it(e,r);return e}static from(...e){let n=null;for(let r=0;r"){if(n===e.length-1)return!1;r=e[++n],a=!0}for(;t&&!Bo(t.scopeName,r);){if(a)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Bo(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var pr=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function jo(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let a=0,o=e.length;a1&&(w=g.slice(0,g.length-1),w.reverse()),n[r++]=new To(k,w,a,l,c,u)}}return n}var To=class{constructor(t,e,n,r,a,o){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=a,this.background=o}},$=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))($||{});function Lo(t,e){t.sort((l,c)=>{let u=lr(l.scope,c.scope);return u!==0||(u=cr(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",a="#ffffff";for(;t.length>=1&&t[0].scope==="";){let l=t.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(a=l.background)}let o=new $o(e),i=new pr(n,o.getId(r),o.getId(a)),s=new Fo(new Vt(0,null,-1,0,0),[]);for(let l=0,c=t.length;le?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),a!==0&&(this.background=a)}},Fo=class Zt{constructor(e,n=[],r={}){m(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,a=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[a]===">"&&a++,!(r>=e.parentScopes.length||a>=n.parentScopes.length);){let o=n.parentScopes[a].length-e.parentScopes[r].length;if(o!==0)return o;r++,a++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),a,o;if(r===-1?(a=e,o=""):(a=e.substring(0,r),o=e.substring(r+1)),this._children.hasOwnProperty(a))return this._children[a].match(o)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Zt._cmpBySpecificity),n}insert(e,n,r,a,o,i){if(n===""){this._doInsertHere(e,r,a,o,i);return}let s=n.indexOf("."),l,c;s===-1?(l=n,c=""):(l=n.substring(0,s),c=n.substring(s+1));let u;this._children.hasOwnProperty(l)?u=this._children[l]:(u=new Zt(this._mainRule.clone(),Vt.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(e+1,c,r,a,o,i)}_doInsertHere(e,n,r,a,o){if(n===null){this._mainRule.acceptOverwrite(e,r,a,o);return}for(let i=0,s=this._rulesWithParentScopes.length;i>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,a,o,i,s){let l=z.getLanguageId(e),c=z.getTokenType(e),u=z.containsBalancedBrackets(e)?1:0,d=z.getFontStyle(e),p=z.getForeground(e),f=z.getBackground(e);return n!==0&&(l=n),r!==8&&(c=r),a!==null&&(u=a?1:0),o!==-1&&(d=o),i!==0&&(p=i),s!==0&&(f=s),(l<<0|c<<8|u<<10|d<<11|p<<15|f<<24)>>>0}};function lt(t,e){let n=[],r=Mo(t),a=r.next();for(;a!==null;){let l=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=r.next()}let c=i();if(n.push({matcher:c,priority:l}),a!==",")break;a=r.next()}return n;function o(){if(a==="-"){a=r.next();let l=o();return c=>!!l&&!l(c)}if(a==="("){a=r.next();let l=s();return a===")"&&(a=r.next()),l}if(Kn(a)){let l=[];do l.push(a),a=r.next();while(Kn(a));return c=>e(l,c)}return null}function i(){let l=[],c=o();for(;c;)l.push(c),c=o();return u=>l.every(d=>d(u))}function s(){let l=[],c=i();for(;c&&(l.push(c),a==="|"||a===",");){do a=r.next();while(a==="|"||a===",");c=i()}return u=>l.some(d=>d(u))}}function Kn(t){return!!t&&!!t.match(/[\w\.:]+/)}function Mo(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;let r=n[0];return n=e.exec(t),r}}}function gr(t){typeof t.dispose=="function"&&t.dispose()}var Oe=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},Go=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},Oo=class{constructor(){m(this,"_references",[]);m(this,"_seenReferenceKeys",new Set);m(this,"visitedRule",new Set)}get references(){return this._references}add(t){let e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Do=class{constructor(t,e){m(this,"seenFullScopeRequests",new Set);m(this,"seenPartialScopeRequests",new Set);m(this,"Q");this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Oe(this.initialScopeName)]}processQueue(){let t=this.Q;this.Q=[];let e=new Oo;for(let n of t)zo(n,this.initialScopeName,this.repo,e);for(let n of e.references)if(n instanceof Oe){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function zo(t,e,n,r){let a=n.lookup(t.scopeName);if(!a){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}let o=n.lookup(e);t instanceof Oe?st({baseGrammar:o,selfGrammar:a},r):Xt(t.ruleName,{baseGrammar:o,selfGrammar:a,repository:a.repository},r);let i=n.injections(t.scopeName);if(i)for(let s of i)r.add(new Oe(s))}function Xt(t,e,n){if(e.repository&&e.repository[t]){let r=e.repository[t];ct([r],e,n)}}function st(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&ct(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&ct(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function ct(t,e,n){for(let r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let a=r.repository?ir({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&ct(r.patterns,{...e,repository:a},n);let o=r.include;if(!o)continue;let i=mr(o);switch(i.kind){case 0:st({...e,selfGrammar:e.baseGrammar},n);break;case 1:st(e,n);break;case 2:Xt(i.ruleName,{...e,repository:a},n);break;case 3:case 4:let s=i.scopeName===e.selfGrammar.scopeName?e.selfGrammar:i.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(s){let l={baseGrammar:e.baseGrammar,selfGrammar:s,repository:a};i.kind===4?Xt(i.ruleName,l,n):st(l,n)}else i.kind===4?n.add(new Go(i.scopeName,i.ruleName)):n.add(new Oe(i.scopeName));break}}}var Ho=class{constructor(){m(this,"kind",0)}},Uo=class{constructor(){m(this,"kind",1)}},Wo=class{constructor(t){m(this,"kind",2);this.ruleName=t}},qo=class{constructor(t){m(this,"kind",3);this.scopeName=t}},Vo=class{constructor(t,e){m(this,"kind",4);this.scopeName=t,this.ruleName=e}};function mr(t){if(t==="$base")return new Ho;if(t==="$self")return new Uo;let e=t.indexOf("#");if(e===-1)return new qo(t);if(e===0)return new Wo(t.substring(1));{let n=t.substring(0,e),r=t.substring(e+1);return new Vo(n,r)}}var Zo=/\\(\d+)/,er=/\\(\d+)/g;var Xo=-1,hr=-2;var He=class{constructor(t,e,n,r){m(this,"$location");m(this,"id");m(this,"_nameIsCapturing");m(this,"_name");m(this,"_contentNameIsCapturing");m(this,"_contentName");this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=ot.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ot.hasCaptures(this._contentName)}get debugName(){let t=this.$location?`${sr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:ot.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ot.replaceCaptures(this._contentName,t,e)}},Yo=class extends He{constructor(e,n,r,a,o){super(e,n,r,a);m(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,n){throw new Error("Not supported!")}compile(e,n){throw new Error("Not supported!")}compileAG(e,n,r,a){throw new Error("Not supported!")}},Jo=class extends He{constructor(e,n,r,a,o){super(e,n,r,null);m(this,"_match");m(this,"captures");m(this,"_cachedCompiledPatterns");this._match=new De(a,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,n){n.push(this._match)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,a){return this._getCachedCompiledPatterns(e).compileAG(e,r,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ze,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},tr=class extends He{constructor(e,n,r,a,o){super(e,n,r,a);m(this,"hasMissingPatterns");m(this,"patterns");m(this,"_cachedCompiledPatterns");this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,n){for(let r of this.patterns)e.getRule(r).collectPatterns(e,n)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,a){return this._getCachedCompiledPatterns(e).compileAG(e,r,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ze,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Yt=class extends He{constructor(e,n,r,a,o,i,s,l,c,u){super(e,n,r,a);m(this,"_begin");m(this,"beginCaptures");m(this,"_end");m(this,"endHasBackReferences");m(this,"endCaptures");m(this,"applyEndPatternLast");m(this,"hasMissingPatterns");m(this,"patterns");m(this,"_cachedCompiledPatterns");this._begin=new De(o,this.id),this.beginCaptures=i,this._end=new De(s||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=c||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,n){return this._end.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e,n).compile(e)}compileAG(e,n,r,a){return this._getCachedCompiledPatterns(e,n).compileAG(e,r,a)}_getCachedCompiledPatterns(e,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ze;for(let r of this.patterns)e.getRule(r).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},ut=class extends He{constructor(e,n,r,a,o,i,s,l,c){super(e,n,r,a);m(this,"_begin");m(this,"beginCaptures");m(this,"whileCaptures");m(this,"_while");m(this,"whileHasBackReferences");m(this,"hasMissingPatterns");m(this,"patterns");m(this,"_cachedCompiledPatterns");m(this,"_cachedCompiledWhilePatterns");this._begin=new De(o,this.id),this.beginCaptures=i,this.whileCaptures=l,this._while=new De(s,hr),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,n){return this._while.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,a){return this._getCachedCompiledPatterns(e).compileAG(e,r,a)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ze;for(let n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,n){return this._getCachedCompiledWhilePatterns(e,n).compile(e)}compileWhileAG(e,n,r,a){return this._getCachedCompiledWhilePatterns(e,n).compileAG(e,r,a)}_getCachedCompiledWhilePatterns(e,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ze,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"\uFFFF"),this._cachedCompiledWhilePatterns}},br=class P{static createCaptureRule(e,n,r,a,o){return e.registerRule(i=>new Yo(n,i,r,a,o))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(a=>{if(e.id=a,e.match)return new Jo(e.$vscodeTextmateLocation,e.id,e.name,e.match,P._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=ir({},r,e.repository));let o=e.patterns;return typeof o>"u"&&e.include&&(o=[{include:e.include}]),new tr(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,P._compilePatterns(o,n,r))}return e.while?new ut(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,P._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,P._compileCaptures(e.whileCaptures||e.captures,n,r),P._compilePatterns(e.patterns,n,r)):new Yt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,P._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,P._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,P._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let a=[];if(e){let o=0;for(let i in e){if(i==="$vscodeTextmateLocation")continue;let s=parseInt(i,10);s>o&&(o=s)}for(let i=0;i<=o;i++)a[i]=null;for(let i in e){if(i==="$vscodeTextmateLocation")continue;let s=parseInt(i,10),l=0;e[i].patterns&&(l=P.getCompiledRuleId(e[i],n,r)),a[s]=P.createCaptureRule(n,e[i].$vscodeTextmateLocation,e[i].name,e[i].contentName,l)}}return a}static _compilePatterns(e,n,r){let a=[];if(e)for(let o=0,i=e.length;oe.substring(a.start,a.end));return er.lastIndex=0,this.source.replace(er,(a,o)=>ur(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],a=[],o,i,s,l;for(o=0,i=this.source.length;on.source);this._cached=new nr(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(a=>a.resolveAnchors(e,n));return new nr(t,r,this._items.map(a=>a.ruleId))}},nr=class{constructor(t,e,n){m(this,"scanner");this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let t=[];for(let e=0,n=this.rules.length;e{let n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new qt(n,r)}));this._defaultAttributes=new qt(e,8),this._embeddedLanguagesMatcher=new Ko(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?Q._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){let n=e.match(Q.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},m(Q,"_NULL_SCOPE_METADATA",new qt(0,0)),m(Q,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),Q),Ko=class{constructor(t){m(this,"values");m(this,"scopesRegExp");if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);let e=t.map(([n,r])=>ur(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;let e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},jc={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},kr=!1,rr=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function wr(t,e,n,r,a,o,i,s){let l=e.content.length,c=!1,u=-1;if(i){let f=ei(t,e,n,r,a,o);a=f.stack,r=f.linePos,n=f.isFirstLine,u=f.anchorPosition}let d=Date.now();for(;!c;){if(s!==0&&Date.now()-d>s)return new rr(a,!0);p()}return new rr(a,!1);function p(){let f=ti(t,e,n,r,a,u);if(!f){o.produce(a,l),c=!0;return}let g=f.captureIndices,k=f.matchedRuleId,w=g&&g.length>0?g[0].end>r:!1;if(k===Xo){let b=a.getRule(t);o.produce(a,g[0].start),a=a.withContentNameScopesList(a.nameScopesList),Fe(t,e,n,a,o,b.endCaptures,g),o.produce(a,g[0].end);let y=a;if(a=a.parent,u=y.getAnchorPos(),!w&&y.getEnterPos()===r){a=y,o.produce(a,l),c=!0;return}}else{let b=t.getRule(k);o.produce(a,g[0].start);let y=a,v=b.getName(e.content,g),S=a.contentNameScopesList.pushAttributed(v,t);if(a=a.push(k,r,u,g[0].end===l,null,S,S),b instanceof Yt){let I=b;Fe(t,e,n,a,o,I.beginCaptures,g),o.produce(a,g[0].end),u=g[0].end;let L=I.getContentName(e.content,g),F=S.pushAttributed(L,t);if(a=a.withContentNameScopesList(F),I.endHasBackReferences&&(a=a.withEndRule(I.getEndWithResolvedBackReferences(e.content,g))),!w&&y.hasSameRuleAs(a)){a=a.pop(),o.produce(a,l),c=!0;return}}else if(b instanceof ut){let I=b;Fe(t,e,n,a,o,I.beginCaptures,g),o.produce(a,g[0].end),u=g[0].end;let L=I.getContentName(e.content,g),F=S.pushAttributed(L,t);if(a=a.withContentNameScopesList(F),I.whileHasBackReferences&&(a=a.withEndRule(I.getWhileWithResolvedBackReferences(e.content,g))),!w&&y.hasSameRuleAs(a)){a=a.pop(),o.produce(a,l),c=!0;return}}else if(Fe(t,e,n,a,o,b.captures,g),o.produce(a,g[0].end),a=a.pop(),!w){a=a.safePop(),o.produce(a,l),c=!0;return}}g[0].end>r&&(r=g[0].end,n=!1)}}function ei(t,e,n,r,a,o){let i=a.beginRuleCapturedEOL?0:-1,s=[];for(let l=a;l;l=l.pop()){let c=l.getRule(t);c instanceof ut&&s.push({rule:c,stack:l})}for(let l=s.pop();l;l=s.pop()){let{ruleScanner:c,findOptions:u}=ai(l.rule,t,l.stack.endRule,n,r===i),d=c.findNextMatchSync(e,r,u);if(d){if(d.ruleId!==hr){a=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(o.produce(l.stack,d.captureIndices[0].start),Fe(t,e,n,l.stack,o,l.rule.whileCaptures,d.captureIndices),o.produce(l.stack,d.captureIndices[0].end),i=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{a=l.stack.pop();break}}return{stack:a,linePos:r,anchorPosition:i,isFirstLine:n}}function ti(t,e,n,r,a,o){let i=ni(t,e,n,r,a,o),s=t.getInjections();if(s.length===0)return i;let l=ri(s,t,e,n,r,a,o);if(!l)return i;if(!i)return l;let c=i.captureIndices[0].start,u=l.captureIndices[0].start;return u=s)&&(s=v,l=y.captureIndices,c=y.ruleId,u=g.priority,s===a))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function vr(t,e,n,r,a){if(kr){let i=t.compile(e,n),s=Cr(r,a);return{ruleScanner:i,findOptions:s}}return{ruleScanner:t.compileAG(e,n,r,a),findOptions:0}}function ai(t,e,n,r,a){if(kr){let i=t.compileWhile(e,n),s=Cr(r,a);return{ruleScanner:i,findOptions:s}}return{ruleScanner:t.compileWhileAG(e,n,r,a),findOptions:0}}function Cr(t,e){let n=0;return t||(n|=1),e||(n|=4),n}function Fe(t,e,n,r,a,o,i){if(o.length===0)return;let s=e.content,l=Math.min(o.length,i.length),c=[],u=i[0].end;for(let d=0;du)break;for(;c.length>0&&c[c.length-1].endPos<=f.start;)a.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?a.produceFromScopes(c[c.length-1].scopes,f.start):a.produce(r,f.start),p.retokenizeCapturedWithRuleId){let k=p.getName(s,i),w=r.contentNameScopesList.pushAttributed(k,t),b=p.getContentName(s,i),y=w.pushAttributed(b,t),v=r.push(p.retokenizeCapturedWithRuleId,f.start,-1,!1,null,w,y),S=t.createOnigString(s.substring(0,f.end));wr(t,S,n&&f.start===0,f.start,v,a,!1,0),gr(S);continue}let g=p.getName(s,i);if(g!==null){let w=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(g,t);c.push(new oi(w,f.end))}}for(;c.length>0;)a.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var oi=class{constructor(t,e){m(this,"scopes");m(this,"endPos");this.scopes=t,this.endPos=e}};function ii(t,e,n,r,a,o,i,s){return new li(t,e,n,r,a,o,i,s)}function ar(t,e,n,r,a){let o=lt(e,dt),i=br.getCompiledRuleId(n,r,a.repository);for(let s of o)t.push({debugSelector:e,matcher:s.matcher,ruleId:i,grammar:a,priority:s.priority})}function dt(t,e){if(e.length{for(let a=n;an&&t.substr(0,n)===e&&t[n]==="."}var li=class{constructor(t,e,n,r,a,o,i,s){m(this,"_rootId");m(this,"_lastRuleId");m(this,"_ruleId2desc");m(this,"_includedGrammars");m(this,"_grammarRepository");m(this,"_grammar");m(this,"_injections");m(this,"_basicScopeAttributesProvider");m(this,"_tokenTypeMatchers");if(this._rootScopeName=t,this.balancedBracketSelectors=o,this._onigLib=s,this._basicScopeAttributesProvider=new Qo(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=or(e,null),this._injections=null,this._tokenTypeMatchers=[],a)for(let l of Object.keys(a)){let c=lt(l,dt);for(let u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:a[l]})}}get themeProvider(){return this._grammarRepository}dispose(){for(let t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){let t={lookup:a=>a===this._rootScopeName?this._grammar:this.getExternalGrammar(a),injections:a=>this._grammarRepository.injections(a)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){let a=r.injections;if(a)for(let i in a)ar(e,i,a[i],this,r);let o=this._grammarRepository.injections(n);o&&o.forEach(i=>{let s=this.getExternalGrammar(i);if(s){let l=s.injectionSelector;l&&ar(e,l,s,this,s)}})}return e.sort((a,o)=>a.priority-o.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){let e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){let n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=or(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){let r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){let r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=br.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let a;if(!e||e===Jt.NULL){a=!0;let c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=ce.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),p=this.getRule(this._rootId).getName(null,null),f;p?f=Me.createRootAndLookUpScopeName(p,d,this):f=Me.createRoot("unknown",d),e=new Jt(null,this._rootId,-1,-1,!1,null,f,f)}else a=!1,e.reset();t=t+` +`;let o=this.createOnigString(t),i=o.content.length,s=new ui(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),l=wr(this,o,a,0,e,s,!0,r);return gr(o),{lineLength:i,lineTokens:s,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function or(t,e){return t=Ao(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var Me=class Y{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,a=e?.scopePath??null;for(let o of n)a=Wt.push(a,o.scopeNames),r=new Y(r,a,o.encodedTokenAttributes);return r}static createRoot(e,n){return new Y(null,new Wt(null,e),n)}static createRootAndLookUpScopeName(e,n,r){let a=r.getMetadataForScope(e),o=new Wt(null,e),i=r.themeProvider.themeMatch(o),s=Y.mergeAttributes(n,a,i);return new Y(null,o,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return Y.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let a=-1,o=0,i=0;return r!==null&&(a=r.fontStyle,o=r.foregroundId,i=r.backgroundId),ce.set(e,n.languageId,n.tokenType,null,a,o,i)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return Y._pushAttributed(this,e,n);let r=e.split(/ /g),a=this;for(let o of r)a=Y._pushAttributed(a,o,n);return a}static _pushAttributed(e,n,r){let a=r.getMetadataForScope(n),o=e.scopePath.push(n),i=r.themeProvider.themeMatch(o),s=Y.mergeAttributes(e.tokenAttributes,a,i);return new Y(e,o,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let n=[],r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?n.reverse():void 0}},H,Jt=(H=class{constructor(e,n,r,a,o,i,s,l){m(this,"_stackElementBrand");m(this,"_enterPos");m(this,"_anchorPos");m(this,"depth");this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=i,this.nameScopesList=s,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=a}equals(e){return e===null?!1:H._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?Me.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){H._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,a,o,i,s){return new H(this,e,n,r,a,o,i,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new H(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){let r=Me.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new H(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Me.fromExtension(r,n.contentNameScopesList))}},m(H,"NULL",new H(null,0,0,0,!1,null,null,null)),H),ci=class{constructor(t,e){m(this,"balancedBracketScopes");m(this,"unbalancedBracketScopes");m(this,"allowAny",!1);this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):lt(n,dt).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>lt(n,dt).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(let e of this.unbalancedBracketScopes)if(e(t))return!1;for(let e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},ui=class{constructor(t,e,n,r){m(this,"_emitBinaryTokens");m(this,"_lineText");m(this,"_tokens");m(this,"_binaryTokens");m(this,"_lastTokenEndIndex");m(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=t?.tokenAttributes??0,a=!1;if(this.balancedBracketSelectors?.matchesAlways&&(a=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let o=t?.getScopeNames()??[];for(let i of this._tokenTypeOverrides)i.matcher(o)&&(r=ce.set(r,0,i.type,null,-1,0,0));this.balancedBracketSelectors&&(a=this.balancedBracketSelectors.match(o))}if(a&&(r=ce.set(r,0,8,a,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}let n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let r=0,a=this._binaryTokens.length;r0;)o.Q.map(i=>this._loadSingleGrammar(i.scopeName)),o.processQueue();return this._grammarForScopeName(t,e,n,r,a)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){let e=this._options.loadGrammar(t);if(e){let n=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(e,n)}}addGrammar(t,e=[],n=0,r=null){return this._syncRegistry.addGrammar(t,e),this._grammarForScopeName(t.scopeName,n,r)}_grammarForScopeName(t,e=0,n=null,r=null,a=null){return this._syncRegistry.grammarForScopeName(t,e,n,r,a)}},pt=Jt.NULL;function We(t,e){let n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(let[a,o]of Object.entries(e?.colorReplacements||{}))typeof o=="string"?n[a]=o:a===r&&Object.assign(n,o);return n}function K(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function Er(t){return Array.isArray(t)?t:[t]}async function Kt(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function qe(t){return!t||["plaintext","txt","text","plain"].includes(t)}function Nr(t){return t==="ansi"||qe(t)}function Ve(t){return t==="none"}function Rr(t){return Ve(t)}var pi=/(\r?\n)/g;function Re(t,e=!1){if(t.length===0)return[["",0]];let n=t.split(pi),r=0,a=[];for(let o=0;o!l.name&&!l.scope):void 0;s?.settings?.foreground&&(r=s.settings.foreground),s?.settings?.background&&(n=s.settings.background),!r&&e?.colors?.["editor.foreground"]&&(r=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?Sr.light:Sr.dark),n||(n=e.type==="light"?xr.light:xr.dark),e.fg=r,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let a=0,o=new Map;function i(s){if(o.has(s))return o.get(s);a+=1;let l=`#${a.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${l}`]?i(s):(o.set(s,l),l)}e.settings=e.settings.map(s=>{let l=s.settings?.foreground&&!s.settings.foreground.startsWith("#"),c=s.settings?.background&&!s.settings.background.startsWith("#");if(!l&&!c)return s;let u={...s,settings:{...s.settings}};if(l){let d=i(s.settings.foreground);e.colorReplacements[d]=s.settings.foreground,u.settings.foreground=d}if(c){let d=i(s.settings.background);e.colorReplacements[d]=s.settings.background,u.settings.background=d}return u});for(let s of Object.keys(e.colors||{}))if((s==="editor.foreground"||s==="editor.background"||s.startsWith("terminal.ansi"))&&!e.colors[s]?.startsWith("#")){let l=i(e.colors[s]);e.colorReplacements[l]=e.colors[s],e.colors[s]=l}return Object.defineProperty(e,Ir,{enumerable:!1,writable:!1,value:!0}),e}async function Br(t){return[...new Set((await Promise.all(t.filter(e=>!Nr(e)).map(async e=>await Kt(e).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function jr(t){return(await Promise.all(t.map(async e=>Rr(e)?null:ft(await Kt(e))))).filter(e=>!!e)}function Tr(t,e){if(!e)return t;if(e[t]){let n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new A(`Circular alias \`${[...n].join(" -> ")} -> ${t}\``);n.add(t)}}return t}var fi=class extends _r{constructor(e,n,r,a={}){super(e);m(this,"_resolver");m(this,"_themes");m(this,"_langs");m(this,"_alias");m(this,"_resolvedThemes",new Map);m(this,"_resolvedGrammars",new Map);m(this,"_langMap",new Map);m(this,"_langGraph",new Map);m(this,"_textmateThemeCache",new WeakMap);m(this,"_loadedThemesCache",null);m(this,"_loadedLanguagesCache",null);this._resolver=e,this._themes=n,this._langs=r,this._alias=a,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let n=ft(e);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let n=this._textmateThemeCache.get(e);n||(n=Ge.createFromRawTheme(e),this._textmateThemeCache.set(e,n)),this._syncRegistry.setTheme(n)}getGrammar(e){return e=Tr(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let n=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let a=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(a.name=e.name,this._resolvedGrammars.set(e.name,a),e.aliases&&e.aliases.forEach(o=>{this._alias[o]=e.name}),this._loadedLanguagesCache=null,n.size)for(let o of n)this._resolvedGrammars.delete(o.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(o.scopeName),this._syncRegistry?._grammars?.delete(o.scopeName),this.loadLanguage(this._langMap.get(o.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let a of e)this.resolveEmbeddedLanguages(a);let n=[...this._langGraph.entries()],r=n.filter(([a,o])=>!o);if(r.length){let a=n.filter(([o,i])=>i?(i.embeddedLanguages||i.embeddedLangs)?.some(s=>r.map(([l])=>l).includes(s)):!1).filter(o=>!r.includes(o));throw new A(`Missing languages ${r.map(([o])=>`\`${o}\``).join(", ")}, required by ${a.map(([o])=>`\`${o}\``).join(", ")}`)}for(let[a,o]of n)this._resolver.addLanguage(o);for(let[a,o]of n)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let n=e.embeddedLanguages??e.embeddedLangs;if(n)for(let r of n)this._langGraph.set(r,this._langMap.get(r))}},gi=class{constructor(t,e){m(this,"_langs",new Map);m(this,"_scopeToLang",new Map);m(this,"_injections",new Map);m(this,"_onigLib");this._onigLib={createOnigScanner:n=>t.createScanner(n),createOnigString:n=>t.createString(n)},e.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(e=>{this._langs.set(e,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(e=>{this._injections.get(e)||this._injections.set(e,[]),this._injections.get(e).push(t.scopeName)})}getInjections(t){let e=t.split("."),n=[];for(let r=1;r<=e.length;r++){let a=e.slice(0,r).join(".");n=[...n,...this._injections.get(a)||[]]}return n}},Ue=0;function en(t){Ue+=1,t.warnings!==!1&&Ue>=10&&Ue%10===0&&console.warn(`[Shiki] ${Ue} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new A("`engine` option is required for synchronous mode");let n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(ft),a=new fi(new gi(t.engine,n),r,n,t.langAlias),o;function i(y){return Tr(y,t.langAlias)}function s(y){w();let v=a.getGrammar(typeof y=="string"?y:y.name);if(!v)throw new A(`Language \`${y}\` not found, you may need to load it first`);return v}function l(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();let v=a.getTheme(y);if(!v)throw new A(`Theme \`${y}\` not found, you may need to load it first`);return v}function c(y){w();let v=l(y);return o!==y&&(a.setTheme(v),o=y),{theme:v,colorMap:a.getColorMap()}}function u(){return w(),a.getLoadedThemes()}function d(){return w(),a.getLoadedLanguages()}function p(...y){w(),a.loadLanguages(y.flat(1))}async function f(...y){return p(await Br(y))}function g(...y){w();for(let v of y.flat(1))a.loadTheme(v)}async function k(...y){return w(),g(await jr(y))}function w(){if(e)throw new A("Shiki instance has been disposed")}function b(){e||(e=!0,a.dispose(),Ue-=1)}return{setTheme:c,getTheme:l,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:i,loadLanguage:f,loadLanguageSync:p,loadTheme:k,loadThemeSync:g,dispose:b,[Symbol.dispose]:b}}async function tn(t){t.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[e,n,r]=await Promise.all([jr(t.themes||[]),Br(t.langs||[]),t.engine]);return en({...t,themes:e,langs:n,engine:r})}var Lr=new WeakMap;function Ze(t,e){Lr.set(t,e)}function Be(t){return Lr.get(t)}var gt=class $r{constructor(...e){m(this,"_stacks",{});m(this,"lang");if(e.length===2){let[n,r]=e;this.lang=r,this._stacks=n}else{let[n,r,a]=e;this.lang=r,this._stacks={[a]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new $r(Object.fromEntries(Er(n).map(r=>[r,pt])),e)}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return mi(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function mi(t){let e=[],n=new Set;function r(a){if(n.has(a))return;n.add(a);let o=a?.nameScopesList?.scopeName;o&&e.push(o),a.parent&&r(a.parent)}return r(t),e}function hi(t,e){if(!(t instanceof gt))throw new A("Invalid grammar state");return t.getInternalStack(e)}var bi=/,/,yi=/ /;function nn(t,e,n={}){let{theme:r=t.getLoadedThemes()[0]}=n;if(qe(t.resolveLangAlias(n.lang||"text"))||Ve(r))return Re(e).map(s=>[{content:s[0],offset:s[1]}]);let{theme:a,colorMap:o}=t.setTheme(r),i=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==i.name)throw new A(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${i.name}"`);if(!n.grammarState.themes.includes(a.name))throw new A(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return Fr(e,i,a,o,n)}function Pr(...t){if(t.length===2)return Be(t[1]);let[e,n,r={}]=t,{lang:a="text",theme:o=e.getLoadedThemes()[0]}=r;if(qe(a)||Ve(o))throw new A("Plain language does not have grammar state");if(a==="ansi")throw new A("ANSI language does not have grammar state");let{theme:i,colorMap:s}=e.setTheme(o),l=e.getLanguage(a);return new gt(rn(n,l,i,s,r).stateStack,l.name,i.name)}function Fr(t,e,n,r,a){let o=rn(t,e,n,r,a),i=new gt(o.stateStack,e.name,n.name);return Ze(o.tokens,i),o.tokens}function rn(t,e,n,r,a){let o=We(n,a),{tokenizeMaxLineLength:i=0,tokenizeTimeLimit:s=500,includeExplanation:l=!1}=a,c=Re(t),u=a.grammarState?hi(a.grammarState,n.name)??pt:a.grammarContextCode!=null?rn(a.grammarContextCode,e,n,r,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:pt,d=[],p=[];for(let f=0,g=c.length;f0&&k.length>=i){d=[],p.push([{content:k,offset:w,color:"",fontStyle:0}]);continue}let b,y,v;l&&l!=="tokenType"&&(b=e.tokenizeLine(k,u,s),y=b.tokens,v=0);let S=e.tokenizeLine2(k,u,s),I=S.tokens.length/2;for(let L=0;LDt.trim());break;case"object":Ne=J.scope;break;default:continue}On.push({settings:J,selectors:Ne.map(Dt=>Dt.split(yi))})}X.explanation=[];let Dn=0;for(;F+Dn({scopeName:e}))}function wi(t,e){let n=[];for(let r=0,a=e.length;r=0&&a>=0;)Ar(t[r],n[a])&&(r-=1),a-=1;return r===-1}function Ci(t,e,n){let r=[];for(let{selectors:a,settings:o}of t)for(let i of a)if(vi(i,e,n)){r.push(o);break}return r}function mt(t,e,n,r=nn){let a=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),o=a.map(c=>{let u=r(t,e,{...n,theme:c.theme});return{tokens:u,state:Be(u),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),i=_i(...o.map(c=>c.tokens)),s=i[0].map((c,u)=>c.map((d,p)=>{let f={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=d.explanation),i.forEach((g,k)=>{let{content:w,explanation:b,offset:y,...v}=g[u][p];f.variants[a[k].color]=v}),f})),l=o[0].state?new gt(Object.fromEntries(o.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),o[0].state.lang):void 0;return l&&Ze(s,l),s}function _i(...t){let e=t.map(()=>[]),n=t.length;for(let r=0;rl[r]),o=e.map(()=>[]);e.forEach((l,c)=>l.push(o[c]));let i=a.map(()=>0),s=a.map(l=>l[0]);for(;s.every(l=>l);){let l=Math.min(...s.map(c=>c.content.length));for(let c=0;cC,booleanish:()=>E,commaOrSpaceSeparated:()=>G,commaSeparated:()=>te,number:()=>h,overloadedBoolean:()=>ht,spaceSeparated:()=>x});var Si=0,C=ye(),E=ye(),ht=ye(),h=ye(),x=ye(),te=ye(),G=ye();function ye(){return 2**++Si}var on=Object.keys(Ye),ke=class extends T{constructor(e,n,r,a){let o=-1;if(super(e,n),Gr(this,"space",a),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ii.test(e)){if(e.charAt(4)==="-"){let o=e.slice(5).replace(zr,Ei);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=e.slice(4);if(!zr.test(o)){let i=o.replace(xi,Ai);i.charAt(0)!=="-"&&(i="-"+i),e="data"+i}}a=ke}return new a(r,e)}function Ai(t){return"-"+t.toLowerCase()}function Ei(t){return t.charAt(1).toUpperCase()}var Hr=an([sn,Or,ln,cn,un],"html"),kt=an([sn,Dr,ln,cn,un],"svg");var Ur={}.hasOwnProperty;function Wr(t,e){let n=e||{};function r(a,...o){let i=r.invalid,s=r.handlers;if(a&&Ur.call(a,t)){let l=String(a[t]);i=Ur.call(s,l)?s[l]:r.unknown}if(i)return i.call(this,a,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Ni=/["&'<>`]/g,Ri=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Bi=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ji=/[|\\{}()[\]^$+*?.]/g,qr=new WeakMap;function Vr(t,e){if(t=t.replace(e.subset?Ti(e.subset):Ni,r),e.subset||e.escapeOnly)return t;return t.replace(Ri,n).replace(Bi,r);function n(a,o,i){return e.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,i.charCodeAt(o+2),e)}function r(a,o,i){return e.format(a.charCodeAt(0),i.charCodeAt(o+1),e)}}function Ti(t){let e=qr.get(t);return e||(e=Li(t),qr.set(t,e)),e}function Li(t){let e=[],n=-1;for(;++n",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"};var Jr=["cent","copy","divide","gt","lt","not","para","times"];var Qr={}.hasOwnProperty,pn={},vt;for(vt in wt)Qr.call(wt,vt)&&(pn[wt[vt]]=vt);var Fi=/[^\dA-Za-z]/;function Kr(t,e,n,r){let a=String.fromCharCode(t);if(Qr.call(pn,a)){let o=pn[a],i="&"+o;return n&&Yr.includes(o)&&!Jr.includes(o)&&(!r||e&&e!==61&&Fi.test(String.fromCharCode(e)))?i:i+";"}return""}function ea(t,e,n){let r=Zr(t,e,n.omitOptionalSemicolons),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=Kr(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){let o=Xr(t,e,n.omitOptionalSemicolons);o.length|^->||--!>|"],Oi=["<",">"];function ta(t,e,n,r){return r.settings.bogusComments?"":"";function a(o){return ne(o,Object.assign({},r.settings.characterReferences,{subset:Oi}))}}function na(t,e,n,r){return""}function fn(t,e){let n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(e);for(;a!==-1;)r++,a=n.indexOf(e,a+e.length);return r}function ra(t,e){let n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function aa(t){return t.join(" ").trim()}var Di=/[ \t\n\f\r]/g;function we(t){return typeof t=="object"?t.type==="text"?oa(t.value):!1:oa(t)}function oa(t){return t.replace(Di,"")===""}var N=ia(1),gn=ia(-1),zi=[];function ia(t){return e;function e(n,r,a){let o=n?n.children:zi,i=(r||0)+t,s=o[i];if(!a)for(;s&&we(s);)i+=t,s=o[i];return s}}var Hi={}.hasOwnProperty;function Ct(t){return e;function e(n,r,a){return Hi.call(t,n.tagName)&&t[n.tagName](n,r,a)}}var Je=Ct({body:Wi,caption:mn,colgroup:mn,dd:Xi,dt:Zi,head:mn,html:Ui,li:Vi,optgroup:Yi,option:Ji,p:qi,rp:sa,rt:sa,tbody:Ki,td:la,tfoot:es,th:la,thead:Qi,tr:ts});function mn(t,e,n){let r=N(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&we(r.value.charAt(0)))}function Ui(t,e,n){let r=N(n,e);return!r||r.type!=="comment"}function Wi(t,e,n){let r=N(n,e);return!r||r.type!=="comment"}function qi(t,e,n){let r=N(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Vi(t,e,n){let r=N(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Zi(t,e,n){let r=N(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Xi(t,e,n){let r=N(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function sa(t,e,n){let r=N(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Yi(t,e,n){let r=N(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Ji(t,e,n){let r=N(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Qi(t,e,n){let r=N(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Ki(t,e,n){let r=N(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function es(t,e,n){return!N(n,e)}function ts(t,e,n){let r=N(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function la(t,e,n){let r=N(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}var ca=Ct({body:as,colgroup:os,head:rs,html:ns,tbody:is});function ns(t){let e=N(t,-1);return!e||e.type!=="comment"}function rs(t){let e=new Set;for(let r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}let n=t.children[0];return!n||n.type==="element"}function as(t){let e=N(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&we(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function os(t,e,n){let r=gn(n,e),a=N(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Je(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function is(t,e,n){let r=gn(n,e),a=N(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Je(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}var _t={name:[[` +\f\r &/=>`.split(""),` +\f\r "&'/=>\``.split("")],[`\0 +\f\r "&'/<=>`.split(""),`\0 +\f\r "&'/<=>\``.split("")]],unquoted:[[` +\f\r &>`.split(""),`\0 +\f\r "&'<=>\``.split("")],[`\0 +\f\r "&'<=>\``.split(""),`\0 +\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function ua(t,e,n,r){let a=r.schema,o=a.space==="svg"?!1:r.settings.omitOptionalTags,i=a.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase()),s=[],l;a.space==="html"&&t.tagName==="svg"&&(r.schema=kt);let c=ss(r,t.properties),u=r.all(a.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=a,u&&(i=!1),(c||!o||!ca(t,e,n))&&(s.push("<",t.tagName,c?" "+c:""),i&&(a.space==="svg"||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&s.push(" "),s.push("/")),s.push(">")),s.push(u),!i&&(!o||!Je(t,e,n))&&s.push(""),s.join("")}function ss(t,e){let n=[],r=-1,a;if(e){for(a in e)if(e[a]!==null&&e[a]!==void 0){let o=ls(t,a,e[a]);o&&n.push(o)}}for(;++rfn(n,t.alternative)&&(i=t.alternative),s=i+ne(n,Object.assign({},t.settings.characterReferences,{subset:(i==="'"?_t.single:_t.double)[a][o],attribute:!0}))+i),l+(s&&"="+s))}var cs=["<","&"];function St(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:ne(t.value,Object.assign({},r.settings.characterReferences,{subset:cs}))}function da(t,e,n,r){return r.settings.allowDangerousHtml?t.value:St(t,e,n,r)}function pa(t,e,n,r){return r.all(t)}var fa=Wr("type",{invalid:us,unknown:ds,handlers:{comment:ta,doctype:na,element:ua,raw:da,root:pa,text:St}});function us(t){throw new Error("Expected node, not `"+t+"`")}function ds(t){let e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}var ps={},fs={},gs=[];function hn(t,e){let n=e||ps,r=n.quote||'"',a=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ms,all:hs,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Mr,characterReferences:n.characterReferences||fs,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?kt:Hr,quote:r,alternative:a}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function ms(t,e,n){return fa(t,e,n,this)}function hs(t){let e=[],n=t&&t.children||gs,r=-1;for(;++ra);function n(a){if(a===t.length)return{line:e.length-1,character:e.at(-1).length};let o=a,i=0;for(let s of e){if(on&&r.push({...t,content:t.content.slice(n,a),offset:t.offset+n}),n=a;return nr-a);return n.length?t.map(r=>r.flatMap(a=>{let o=n.filter(i=>a.offseti-a.offset).sort((i,s)=>i-s);return o.length?ks(a,o):a})):t}function vs(t,e,n,r,a="css-vars"){let o={content:t.content,explanation:t.explanation,offset:t.offset},i=e.map(u=>xt(t.variants[u])),s=new Set(i.flatMap(u=>Object.keys(u))),l={},c=(u,d)=>{let p=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+e[u]+(d==="color"?"":p)};return i.forEach((u,d)=>{for(let p of s){let f=u[p]||"inherit";if(d===0&&r&&ys.includes(p))if(r==="light-dark()"&&i.length>1){let g=e.findIndex(w=>w==="light"),k=e.findIndex(w=>w==="dark");if(g===-1||k===-1)throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');l[p]=`light-dark(${i[g][p]||"inherit"}, ${i[k][p]||"inherit"})`,a==="css-vars"&&(l[c(d,p)]=f)}else l[p]=f;else a==="css-vars"&&(l[c(d,p)]=f)}}),o.htmlStyle=l,o}function xt(t){let e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&$.Italic&&(e["font-style"]="italic"),t.fontStyle&$.Bold&&(e["font-weight"]="bold");let n=[];t.fontStyle&$.Underline&&n.push("underline"),t.fontStyle&$.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function yn(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}function Cs(){let t=new WeakMap;function e(n){if(!t.has(n.meta)){let a=function(i){if(typeof i=="number"){if(i<0||i>n.source.length)throw new A(`Invalid decoration offset: ${i}. Code length: ${n.source.length}`);return{...r.indexToPos(i),offset:i}}else{let s=r.lines[i.line];if(s===void 0)throw new A(`Invalid decoration position ${JSON.stringify(i)}. Lines length: ${r.lines.length}`);let l=i.character;if(l<0&&(l=s.length+l),l<0||l>s.length)throw new A(`Invalid decoration position ${JSON.stringify(i)}. Line ${i.line} length: ${s.length}`);return{...i,character:l,offset:r.posToIndex(i.line,l)}}},r=bs(n.source),o=(n.options.decorations||[]).map(i=>({...i,start:a(i.start),end:a(i.end)}));_s(o),t.set(n.meta,{decorations:o,converter:r,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return ws(n,e(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;let r=e(this),a=[...n.children].filter(u=>u.type==="element"&&u.tagName==="span");if(a.length!==r.converter.lines.length)throw new A(`Number of lines in code element (${a.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function o(u,d,p,f){let g=a[u],k="",w=-1,b=-1;if(d===0&&(w=0),p===0&&(b=0),p===Number.POSITIVE_INFINITY&&(b=g.children.length),w===-1||b===-1)for(let v=0;vk);return u.tagName=d.tagName||"span",u.properties={...u.properties,...f,class:u.properties.class},d.properties?.class&&ba(u,d.properties.class),u=g(u,p)||u,u}let l=[],c=r.decorations.sort((u,d)=>d.start.offset-u.start.offset||u.end.offset-d.end.offset);for(let u of c){let{start:d,end:p}=u;if(d.line===p.line)o(d.line,d.character,p.character,u);else if(d.linei(f,u));o(p.line,0,p.character,u)}}l.forEach(u=>u())}}}function _s(t){for(let e=0;en.end.offset)throw new A(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=e+1;rNumber.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){let n=t.shift();if(n)return{type:"table",index:Number(n)}}}function As(t){let e=[];for(;t.length>0;){let n=t.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)bn[r]&&e.push({type:"setDecoration",value:bn[r]});else if(r<=29){let a=bn[r-20];a&&(e.push({type:"resetDecoration",value:a}),a==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:ve[r-30]}});else if(r===38){let a=ma(t);a&&e.push({type:"setForegroundColor",value:a})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:ve[r-40]}});else if(r===48){let a=ma(t);a&&e.push({type:"setBackgroundColor",value:a})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:ve[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:ve[r-100+8]}})}return e}function Es(){let t=null,e=null,n=new Set;return{parse(r){let a=[],o=0;do{let i=Is(r,o),s=i.sequence?r.substring(o,i.startPosition):r.substring(o);if(s.length>0&&a.push({value:s,foreground:t,background:e,decorations:new Set(n)}),i.sequence){let l=As(i.sequence);for(let c of l)c.type==="resetAll"?(t=null,e=null,n.clear()):c.type==="resetForegroundColor"?t=null:c.type==="resetBackgroundColor"?e=null:c.type==="resetDecoration"&&n.delete(c.value);for(let c of l)c.type==="setForegroundColor"?t=c.value:c.type==="setBackgroundColor"?e=c.value:c.type==="setDecoration"&&n.add(c.value)}o=i.position}while(oMath.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function a(){if(r)return r;r=[];for(let c=0;c{let l=`terminal.ansi${s[0].toUpperCase()}${s.substring(1)}`;return[s,t.colors?.[l]||Ts[s]]}))),i=Es();return a.map(s=>i.parse(s[0]).map(l=>{let c,u;l.decorations.has("reverse")?(c=l.background?o.value(l.background):t.bg,u=l.foreground?o.value(l.foreground):t.fg):(c=l.foreground?o.value(l.foreground):t.fg,u=l.background?o.value(l.background):void 0),c=K(c,r),u=K(u,r),l.decorations.has("dim")&&(c=$s(c));let d=$.None;return l.decorations.has("bold")&&(d|=$.Bold),l.decorations.has("italic")&&(d|=$.Italic),l.decorations.has("underline")&&(d|=$.Underline),l.decorations.has("strikethrough")&&(d|=$.Strikethrough),{content:l.value,offset:s[1],color:c,bgColor:u,fontStyle:d}}))}function $s(t){let e=t.match(Bs);if(e){let r=e[1];if(r.length===8){let a=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${a}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){let a=r[0],o=r[1],i=r[2],s=r[3];return`#${a}${a}${o}${o}${i}${i}${Math.round(Number.parseInt(`${s}${s}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){let a=r[0],o=r[1],i=r[2];return`#${a}${a}${o}${o}${i}${i}80`}}}let n=t.match(js);return n?`var(${n[1]}-dim)`:t}function kn(t,e,n={}){let r=t.resolveLangAlias(n.lang||"text"),{theme:a=t.getLoadedThemes()[0]}=n;if(!qe(r)&&!Ve(a)&&r==="ansi"){let{theme:o}=t.setTheme(a);return Ls(o,e,n)}return nn(t,e,n)}function At(t,e,n){let r,a,o,i,s,l;if("themes"in n){let{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:d="css-vars"}=n,p=Object.entries(n.themes).filter(b=>b[1]).map(b=>({color:b[0],theme:b[1]})).sort((b,y)=>b.color===c?-1:y.color===c?1:0);if(p.length===0)throw new A("`themes` option must not be empty");let f=mt(t,e,n,kn);if(l=Be(f),c&&c!=="light-dark()"&&!p.some(b=>b.color===c))throw new A(`\`themes\` option must contain the defaultColor key \`${c}\``);let g=p.map(b=>t.getTheme(b.theme)),k=p.map(b=>b.color);o=f.map(b=>b.map(y=>vs(y,k,u,c,d))),l&&Ze(o,l);let w=p.map(b=>We(b.theme,n));a=ha(p,g,w,u,c,"fg",d),r=ha(p,g,w,u,c,"bg",d),i=`shiki-themes ${g.map(b=>b.name).join(" ")}`,s=c?void 0:[a,r].join(";")}else if("theme"in n){let c=We(n.theme,n);o=kn(t,e,n);let u=t.getTheme(n.theme);r=K(u.bg,c),a=K(u.fg,c),i=u.name,l=Be(o)}else throw new A("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:a,bg:r,themeName:i,rootStyle:s,grammarState:l}}function ha(t,e,n,r,a,o,i){return t.map((s,l)=>{let c=K(e[l][o],n[l])||"inherit",u=`${r+s.color}${o==="bg"?"-bg":""}:${c}`;if(l===0&&a){if(a==="light-dark()"&&t.length>1){let d=t.findIndex(f=>f.color==="light"),p=t.findIndex(f=>f.color==="dark");if(d===-1||p===-1)throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${K(e[d][o],n[d])||"inherit"}, ${K(e[p][o],n[p])||"inherit"});${u}`}return c}return i==="css-vars"?u:null}).filter(s=>!!s).join(";")}var ka=/^\s+$/,Ps=/^(\s*)(.*?)(\s*)$/;function Et(t,e,n,r={meta:{},options:n,codeToHast:(a,o)=>Et(t,a,o),codeToTokens:(a,o)=>At(t,a,o)}){let a=e;for(let g of It(n))a=g.preprocess?.call(r,a,n)||a;let{tokens:o,fg:i,bg:s,themeName:l,rootStyle:c,grammarState:u}=At(t,a,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:p=!1}=n;d===!0?o=Ms(o):d==="never"&&(o=Gs(o)),p&&(o=Os(o));let f={...r,get source(){return a}};for(let g of It(n))o=g.tokens?.call(f,o)||o;return Fs(o,{...n,fg:i,bg:s,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},f,u)}function Fs(t,e,n,r=Be(t)){let a=It(e),o=[],i={type:"root",children:[]},{structure:s="classic",tabindex:l="0"}=e,c={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?c.style=e.rootStyle:c.style=`background-color:${e.bg};color:${e.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(let[k,w]of Object.entries(e.meta||{}))k.startsWith("_")||(c[k]=w);let u={type:"element",tagName:"pre",properties:c,children:[],data:e.data},d={type:"element",tagName:"code",properties:{},children:o},p=[],f={...n,structure:s,addClassToHast:ba,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return i},get pre(){return u},get code(){return d},get lines(){return p}};if(t.forEach((k,w)=>{w&&(s==="inline"?i.children.push({type:"element",tagName:"br",properties:{},children:[]}):s==="classic"&&o.push({type:"text",value:` +`}));let b={type:"element",tagName:"span",properties:{class:"line"},children:[]},y=0;for(let v of k){let S={type:"element",tagName:"span",properties:{...v.htmlAttrs},children:[{type:"text",value:v.content}]},I=yn(v.htmlStyle||xt(v));I&&(S.properties.style=I);for(let L of a)S=L?.span?.call(f,S,w+1,y,b,v)||S;s==="inline"?i.children.push(S):s==="classic"&&b.children.push(S),y+=v.content.length}if(s==="classic"){for(let v of a)b=v?.line?.call(f,b,w+1)||b;p.push(b),o.push(b)}else s==="inline"&&p.push(b)}),s==="classic"){for(let k of a)d=k?.code?.call(f,d)||d;u.children.push(d);for(let k of a)u=k?.pre?.call(f,u)||u;i.children.push(u)}else if(s==="inline"){let k=[],w={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let y of i.children)y.type==="element"&&y.tagName==="br"?(k.push(w),w={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(y.type==="element"||y.type==="text")&&w.children.push(y);k.push(w);let b={type:"element",tagName:"code",properties:{},children:k};for(let y of a)b=y?.code?.call(f,b)||b;i.children=[];for(let y=0;y0&&i.children.push({type:"element",tagName:"br",properties:{},children:[]});let v=b.children[y];v.type==="element"&&i.children.push(...v.children)}}let g=i;for(let k of a)g=k?.root?.call(f,g)||g;return r&&Ze(g,r),g}function Ms(t){return t.map(e=>{let n=[],r="",a;return e.forEach((o,i)=>{let s=!(o.fontStyle&&(o.fontStyle&$.Underline||o.fontStyle&$.Strikethrough));s&&ka.test(o.content)&&e[i+1]?(a===void 0&&(a=o.offset),r+=o.content):r?(s?n.push({...o,offset:a,content:r+o.content}):n.push({content:r,offset:a},o),a=void 0,r=""):n.push(o)}),n})}function Gs(t){return t.map(e=>e.flatMap(n=>{if(ka.test(n.content))return n;let r=n.content.match(Ps);if(!r)return n;let[,a,o,i]=r;if(!a&&!i)return n;let s=[{...n,offset:n.offset+a.length,content:o}];return a&&s.unshift({content:a,offset:n.offset}),i&&s.push({content:i,offset:n.offset+a.length+o.length}),s}))}function Os(t){return t.map(e=>{let n=[];for(let r of e){if(n.length===0){n.push({...r});continue}let a=n.at(-1),o=yn(a.htmlStyle||xt(a)),i=yn(r.htmlStyle||xt(r)),s=a.fontStyle&&(a.fontStyle&$.Underline||a.fontStyle&$.Strikethrough),l=r.fontStyle&&(r.fontStyle&$.Underline||r.fontStyle&$.Strikethrough);!s&&!l&&o===i?a.content+=r.content:n.push({...r})}return n})}var Ds=hn;function zs(t,e,n){let r={meta:{},options:n,codeToHast:(o,i)=>Et(t,o,i),codeToTokens:(o,i)=>At(t,o,i)},a=Ds(Et(t,e,n,r));for(let o of It(n))a=o.postprocess?.call(r,a,n)||a;return a}async function wa(t){let e=await tn(t);return{getLastGrammarState:(...n)=>Pr(e,...n),codeToTokensBase:(n,r)=>kn(e,n,r),codeToTokensWithThemes:(n,r)=>mt(e,n,r),codeToTokens:(n,r)=>At(e,n,r),codeToHast:(n,r)=>Et(e,n,r),codeToHtml:(n,r)=>zs(e,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}var va=class{constructor(t,e={}){m(this,"patterns");m(this,"options");m(this,"regexps");this.patterns=t,this.options=e;let{forgiving:n=!1,cache:r,regexConstructor:a}=e;if(!a)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(o=>{if(typeof o!="string")return o;let i=r?.get(o);if(i){if(i instanceof RegExp)return i;if(n)return null;throw i}try{let s=a(o);return r?.set(o,s),s}catch(s){if(r?.set(o,s),n)return null;throw s}})}findNextMatchSync(t,e,n){let r=typeof t=="string"?t:t.content,a=[];function o(i,s,l=0){return{index:i,captureIndices:s.indices.map(c=>c==null?{start:4294967295,end:4294967295,length:0}:{start:c[0]+l,end:c[1]+l,length:c[1]-c[0]})}}for(let i=0;is[1].index));for(let[s,l,c]of a)if(l.index===i)return o(s,l,c)}return null}};function ue(t){if([...t].length!==1)throw new Error(`Expected "${t}" to be a single code point`);return t.codePointAt(0)}function Ca(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}var Qe=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),B=String.raw;function re(t,e){if(t==null)throw new Error(e??"Value expected");return t}var Ea=B`\[\^?`,Na=`c.? | C(?:-.?)?|${B`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${B`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${B`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${B`o\{[^\}]*\}?`}|${B`\d{1,3}`}`,vn=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Nt=new RegExp(B` + \\ (?: + ${Na} + | [gk]<[^>]*>? + | [gk]'[^']*'? + | . + ) + | \( (?: + \? (?: + [:=!>({] + | <[=!] + | <[^>]*> + | '[^']*' + | ~\|? + | #(?:[^)\\]|\\.?)* + | [^:)]*[:)] + )? + | \*[^\)]*\)? + )? + | (?:${vn.source})+ + | ${Ea} + | . +`.replace(/\s+/g,""),"gsu"),wn=new RegExp(B` + \\ (?: + ${Na} + | . + ) + | \[:(?:\^?\p{Alpha}+|\^):\] + | ${Ea} + | && + | . +`.replace(/\s+/g,""),"gsu");function Ra(t,e={}){let n={flags:"",...e,rules:{captureGroup:!1,singleline:!1,...e.rules}};if(typeof t!="string")throw new Error("String expected as pattern");let r=sl(n.flags),a=[r.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX(){return a.at(-1)},numOpenGroups:0,popModX(){a.pop()},pushModX(d){a.push(d)},replaceCurrentModX(d){a[a.length-1]=d},singleline:n.rules.singleline},i=[],s;for(Nt.lastIndex=0;s=Nt.exec(t);){let d=Hs(o,t,s[0],Nt.lastIndex);d.tokens?i.push(...d.tokens):d.token&&i.push(d.token),d.lastIndex!==void 0&&(Nt.lastIndex=d.lastIndex)}let l=[],c=0;i.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++c:d.raw==="("&&l.push(d)}),c||l.forEach((d,p)=>{d.kind="capturing",d.number=p+1});let u=c||l.length;return{tokens:i.map(d=>d.type==="EscapedNumber"?cl(d,u):d).flat(),flags:r}}function Hs(t,e,n,r){let[a,o]=n;if(n==="["||n==="[^"){let i=Us(e,n,r);return{tokens:i.tokens,lastIndex:i.lastIndex}}if(a==="\\"){if("AbBGyYzZ".includes(o))return{token:_a(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:el(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:ja(n)}}if(o==="K")return{token:Ta("keep",n)};if(o==="N"||o==="R")return{token:Ce("newline",n,{negate:o==="N"})};if(o==="O")return{token:Ce("any",n)};if(o==="X")return{token:Ce("text_segment",n)};let i=Ba(n,{inCharClass:!1});return Array.isArray(i)?{tokens:i}:{token:i}}if(a==="("){if(o==="*")return{token:al(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(e[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:rl(n,t)};if(t.pushModX(t.getCurrentModX()),t.numOpenGroups++,n==="("&&!t.captureGroup||n==="(?:")return{token:je("group",n)};if(n==="(?>")return{token:je("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?")||n.startsWith("(?'")&&n.endsWith("'"))return{token:je("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:je("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(t.popModX(),t.numOpenGroups--,t.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:Js(n)}}if(t.getCurrentModX()){if(n==="#"){let i=e.indexOf(` +`,r);return{lastIndex:i===-1?e.length:i}}if(/^\s$/.test(n)){let i=/\s+/y;return i.lastIndex=r,{lastIndex:i.exec(e)?i.lastIndex:r}}}if(n===".")return{token:Ce("dot",n)};if(n==="^"||n==="$"){let i=t.singleline?{"^":B`\A`,$:B`\Z`}[n]:n;return{token:_a(i,n)}}return n==="|"?{token:qs(n)}:vn.test(n)?{tokens:ul(n)}:{token:ae(ue(n),n)}}function Us(t,e,n){let r=[Sa(e[1]==="^",e)],a=1,o;for(wn.lastIndex=n;o=wn.exec(t);){let i=o[0];if(i[0]==="["&&i[1]!==":")a++,r.push(Sa(i[1]==="^",i));else if(i==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(ae(93,i));else if(a--,r.push(Vs(i)),!a)break}else{let s=Ws(i);Array.isArray(s)?r.push(...s):r.push(s)}}return{tokens:r,lastIndex:wn.lastIndex||t.length}}function Ws(t){if(t[0]==="\\")return Ba(t,{inCharClass:!0});if(t[0]==="["){let e=/\[:(?\^?)(?[a-z]+):\]/.exec(t);if(!e||!Qe.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return Ce("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?Zs(t):t==="&&"?Xs(t):ae(ue(t),t)}function Ba(t,{inCharClass:e}){let n=t[1];if(n==="c"||n==="C")return nl(t);if("dDhHsSwW".includes(n))return ol(t);if(t.startsWith(B`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${t}"`);if(/^\\[pP]\{/.test(t)){if(t.length===3)throw new Error(`Incomplete or invalid Unicode property "${t}"`);return il(t)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(t))try{let r=t.split(/\\x/).slice(1).map(i=>parseInt(i,16)),a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),o=new TextEncoder;return[...a].map(i=>{let s=[...o.encode(i)].map(l=>`\\x${l.toString(16)}`).join("");return ae(ue(i),s)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return ae(ll(t),t);if(xa.has(n))return ae(xa.get(n),t);if(/\d/.test(n))return Ys(e,t);if(t==="\\")throw new Error(B`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return ae(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function qs(t){return{type:"Alternator",raw:t}}function _a(t,e){return{type:"Assertion",kind:t,raw:e}}function ja(t){return{type:"Backreference",raw:t}}function ae(t,e){return{type:"Character",value:t,raw:e}}function Vs(t){return{type:"CharacterClassClose",raw:t}}function Zs(t){return{type:"CharacterClassHyphen",raw:t}}function Xs(t){return{type:"CharacterClassIntersector",raw:t}}function Sa(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function Ce(t,e,n={}){return{type:"CharacterSet",kind:t,...n,raw:e}}function Ta(t,e,n={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:re(n.flags),raw:e}}function Ys(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function Js(t){return{type:"GroupClose",raw:t}}function je(t,e,n={}){return{type:"GroupOpen",kind:t,...n,raw:e}}function Qs(t,e,n,r){return{type:"NamedCallout",kind:t,tag:e,arguments:n,raw:r}}function Ks(t,e,n,r){return{type:"Quantifier",kind:t,min:e,max:n,raw:r}}function el(t){return{type:"Subroutine",raw:t}}var tl=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),xa=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function nl(t){let e=t[1]==="c"?t[2]:t[3];if(!e||!/[A-Za-z]/.test(e))throw new Error(`Unsupported control character "${t}"`);return ae(ue(e.toUpperCase())-64,t)}function rl(t,e){let{on:n,off:r}=/^\(\?(?[imx]*)(?:-(?[-imx]*))?/.exec(t).groups;r??(r="");let a=(e.getCurrentModX()||n.includes("x"))&&!r.includes("x"),o=Aa(n),i=Aa(r),s={};if(o&&(s.enable=o),i&&(s.disable=i),t.endsWith(")"))return e.replaceCurrentModX(a),Ta("flags",t,{flags:s});if(t.endsWith(":"))return e.pushModX(a),e.numOpenGroups++,je("group",t,{...(o||i)&&{flags:s}});throw new Error(`Unexpected flag modifier "${t}"`)}function al(t){let e=/\(\*(?[A-Za-z_]\w*)?(?:\[(?(?:[A-Za-z_]\w*)?)\])?(?:\{(?[^}]*)\})?\)/.exec(t);if(!e)throw new Error(`Incomplete or invalid named callout "${t}"`);let{name:n,tag:r,args:a}=e.groups;if(!n)throw new Error(`Invalid named callout "${t}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);let o=a?a.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[i,s,l]=o,c=tl.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(o.length>0)throw new Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(typeof i=="string")throw new Error(`Named callout argument must be a number "${i}"`);break;case"max":if(!o.length||o.length>2)throw new Error(`Named callout must have one or two arguments "${o}"`);if(typeof i=="string"&&!/^[A-Za-z_]\w*$/.test(i))throw new Error(`Named callout argument one must be a tag or number "${i}"`);if(o.length===2&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case"count":case"total_count":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(o.length===1&&(typeof i=="number"||!/^[<>X]$/.test(i)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${i}"`);break;case"cmp":if(o.length!==3)throw new Error(`Named callout must have three arguments "${o}"`);if(typeof i=="string"&&!/^[A-Za-z_]\w*$/.test(i))throw new Error(`Named callout argument one must be a tag or number "${i}"`);if(typeof s=="number"||!/^(?:[<>!=]=|[<>])$/.test(s))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return Qs(c,r??null,a?.split(",")??null,t)}function Ia(t){let e=null,n,r;if(t[0]==="{"){let{minStr:a,maxStr:o}=/^\{(?\d*)(?:,(?\d*))?/.exec(t).groups,i=1e5;if(+a>i||o&&+o>i)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+a,r=o===void 0?+a:o===""?1/0:+o,n>r&&(e="possessive",[n,r]=[r,n]),t.endsWith("?")){if(e==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');e="lazy"}else e||(e="greedy")}else n=t[0]==="+"?1:0,r=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return Ks(e,n,r,t)}function ol(t){let e=t[1].toLowerCase();return Ce({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function il(t){let{p:e,neg:n,value:r}=/^\\(?

[pP])\{(?\^?)(?[^}]+)/.exec(t).groups;return Ce("property",t,{value:r,negate:e==="P"&&!n||e==="p"&&!!n})}function Aa(t){let e={};return t.includes("i")&&(e.ignoreCase=!0),t.includes("m")&&(e.dotAll=!0),t.includes("x")&&(e.extended=!0),Object.keys(e).length?e:null}function sl(t){let e={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n\p{AHex}+)/u.exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function cl(t,e){let{raw:n,inCharClass:r}=t,a=n.slice(1);if(!r&&(a!=="0"&&a.length===1||a[0]!=="0"&&+a<=e))return[ja(n)];let o=[],i=a.match(/^[0-7]+|\d/g);for(let s=0;s127)throw new Error(B`Octal encoded byte above 177 unsupported "${n}"`)}else c=ue(l);o.push(ae(c,(s===0?"\\":"")+l))}return o}function ul(t){let e=[],n=new RegExp(vn,"gy"),r;for(;r=n.exec(t);){let a=r[0];if(a[0]==="{"){let o=/^\{(?\d+),(?\d+)\}\??$/.exec(a);if(o){let{min:i,max:s}=o.groups;if(+i>+s&&a.endsWith("?")){n.lastIndex--,e.push(Ia(a.slice(0,-1)));continue}}}e.push(Ia(a))}return e}function Rt(t,e){if(!Array.isArray(t.body))throw new Error("Expected node with body array");if(t.body.length!==1)return!1;let n=t.body[0];return!e||Object.keys(e).every(r=>e[r]===n[r])}function La(t){return dl.has(t.type)}var dl=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function jt(t,e={}){let n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},r=Ra(t,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),a=(p,f)=>{let g=r.tokens[o.nextIndex];switch(o.parent=p,o.nextIndex++,g.type){case"Alternator":return oe();case"Assertion":return pl(g);case"Backreference":return fl(g,o);case"Character":return Te(g.value,{useLastValid:!!f.isCheckingRangeEnd});case"CharacterClassHyphen":return gl(g,o,f);case"CharacterClassOpen":return ml(g,o,f);case"CharacterSet":return hl(g,o);case"Directive":return Cl(g.kind,{flags:g.flags});case"GroupOpen":return bl(g,o,f);case"NamedCallout":return Sl(g.kind,g.tag,g.arguments);case"Quantifier":return yl(g,o);case"Subroutine":return kl(g,o);default:throw new Error(`Unexpected token type "${g.type}"`)}},o={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:a},i=Il(_l(r.flags)),s=i.body[0];for(;o.nextIndexl.length)throw new Error("Subroutine uses a group number that's not defined");p&&(l[p-1].isSubroutined=!0)}else if(u.has(p)){if(u.get(p).length>1)throw new Error(B`Subroutine uses a duplicate group name "\g<${p}>"`);u.get(p)[0].isSubroutined=!0}else throw new Error(B`Subroutine uses a group name that's not defined "\g<${p}>"`);return i}function pl({kind:t}){return Tt(re({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[t],`Unexpected assertion kind "${t}"`),{negate:t===B`\B`||t===B`\Y`})}function fl({raw:t},e){let n=/^\\k[<']/.test(t),r=n?t.slice(3,-1):t.slice(1),a=(o,i=!1)=>{let s=e.capturingGroups.length,l=!1;if(o>s)if(e.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${t}"`);return e.hasNumberedRef=!0,Bt(i?s+1-o:o,{orphan:l})};if(n){let o=/^(?-?)0*(?[1-9]\d*)$/.exec(r);if(o)return a(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${t}"`);return Bt(r)}return a(+r)}function gl(t,e,n){let{tokens:r,walk:a}=e,o=e.parent,i=o.body.at(-1),s=r[e.nextIndex];if(!n.isCheckingRangeEnd&&i&&i.type!=="CharacterClass"&&i.type!=="CharacterClassRange"&&s&&s.type!=="CharacterClassOpen"&&s.type!=="CharacterClassClose"&&s.type!=="CharacterClassIntersector"){let l=a(o,{...n,isCheckingRangeEnd:!0});if(i.type==="Character"&&l.type==="Character")return o.body.pop(),vl(i,l);throw new Error("Invalid character class range")}return Te(ue("-"))}function ml({negate:t},e,n){let{tokens:r,walk:a}=e,o=[Ke()],i=r[e.nextIndex],s=Fa(i);for(;s.type!=="CharacterClassClose";){if(s.type==="CharacterClassIntersector")o.push(Ke()),e.nextIndex++;else{let c=o.at(-1);c.body.push(a(c,n))}s=Fa(r[e.nextIndex],i)}let l=Ke({negate:t});return o.length===1?l.body=o[0].body:(l.kind="intersection",l.body=o.map(c=>c.body.length===1?c.body[0]:c)),e.nextIndex++,l}function hl({kind:t,negate:e,value:n},r){let{normalizeUnknownPropertyNames:a,skipPropertyNameValidation:o,unicodePropertyMap:i}=r;if(t==="property"){let s=Le(n);if(Qe.has(s)&&!i?.has(s))t="posix",n=s;else return _e(n,{negate:e,normalizeUnknownPropertyNames:a,skipPropertyNameValidation:o,unicodePropertyMap:i})}return t==="posix"?xl(n,{negate:e}):Lt(t,{negate:e})}function bl(t,e,n){let{tokens:r,capturingGroups:a,namedGroupsByName:o,skipLookbehindValidation:i,walk:s}=e,l=Al(t),c=l.type==="AbsenceFunction",u=Pa(l),d=u&&l.negate;if(l.type==="CapturingGroup"&&(a.push(l),l.name&&Ca(o,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let p=Ma(r[e.nextIndex]);for(;p.type!=="GroupClose";){if(p.type==="Alternator")l.body.push(oe()),e.nextIndex++;else{let f=l.body.at(-1),g=s(f,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(f.body.push(g),(u||n.isInLookbehind)&&!i){let k="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if($a(g)||g.type==="CapturingGroup")throw new Error(k)}else if($a(g)||Pa(g)&&g.negate)throw new Error(k)}}p=Ma(r[e.nextIndex])}return e.nextIndex++,l}function yl({kind:t,min:e,max:n},r){let a=r.parent,o=a.body.at(-1);if(!o||!La(o))throw new Error("Quantifier requires a repeatable token");let i=_n(t,e,n,o);return a.body.pop(),i}function kl({raw:t},e){let{capturingGroups:n,subroutines:r}=e,a=t.slice(3,-1),o=/^(?[-+]?)0*(?[1-9]\d*)$/.exec(a);if(o){let s=+o.groups.num,l=n.length;if(e.hasNumberedRef=!0,a={"":s,"+":l+s,"-":l+1-s}[o.groups.sign],a<1)throw new Error("Invalid subroutine number")}else a==="0"&&(a=0);let i=Sn(a);return r.push(i),i}function wl(t,e){if(t!=="repeater")throw new Error(`Unexpected absence function kind "${t}"`);return{type:"AbsenceFunction",kind:t,body:et(e?.body)}}function oe(t){return{type:"Alternative",body:Ga(t?.body)}}function Tt(t,e){let n={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(n.negate=!!e?.negate),n}function Bt(t,e){let n=!!e?.orphan;return{type:"Backreference",ref:t,...n&&{orphan:n}}}function Cn(t,e){let n={name:void 0,isSubroutined:!1,...e};if(n.name!==void 0&&!El(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:t,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:et(e?.body)}}function Te(t,e){let n={useLastValid:!1,...e};if(t>1114111){let r=t.toString(16);if(n.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:t}}function Ke(t){let e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:Ga(t?.body)}}function vl(t,e){if(e.valuen)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:n,body:r}}function Il(t,e){return{type:"Regex",body:et(e?.body),flags:t}}function Sn(t){return{type:"Subroutine",ref:t}}function _e(t,e){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e},r=n.unicodePropertyMap?.get(Le(t));if(!r){if(n.normalizeUnknownPropertyNames)r=Nl(t);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(B`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:r??t,negate:n.negate}}function Al({flags:t,kind:e,name:n,negate:r,number:a}){switch(e){case"absence_repeater":return wl("repeater");case"atomic":return D({atomic:!0});case"capturing":return Cn(a,{name:n});case"group":return D({flags:t});case"lookahead":case"lookbehind":return de({behind:e==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${e}"`)}}function et(t){if(t===void 0)t=[oe()];else if(!Array.isArray(t)||!t.length||!t.every(e=>e.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return t}function Ga(t){if(t===void 0)t=[];else if(!Array.isArray(t)||!t.every(e=>!!e.type))throw new Error("Invalid body; expected array of nodes");return t}function $a(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function Pa(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function El(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function Nl(t){return t.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function Le(t){return t.replace(/[- _]+/g,"").toLowerCase()}function Fa(t,e){let n=e;return re(t,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function Ma(t){return re(t,"Unclosed group")}function Se(t,e,n=null){function r(o,i){for(let s=0;sA-Za-z\-]|<[=!]|\(DEFINE\))`;function Da(t,e){for(let n=0;n=e&&t[n]++}function za(t,e,n,r){return t.slice(0,e)+r+t.slice(e+n.length)}var O=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function tt(t,e,n,r){let a=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1],i=0,s="";for(let l of t.matchAll(a)){let{0:c,groups:{$skip:u}}=l;if(!u&&(!r||r===O.DEFAULT==!i)){n instanceof Function?s+=n(l,{context:i?O.CHAR_CLASS:O.DEFAULT,negated:o[o.length-1]}):s+=n;continue}c[0]==="["?(i++,o.push(c[1]==="^")):c==="]"&&i&&(i--,o.pop()),s+=c}return s}function xn(t,e,n,r){tt(t,e,n,r)}function Rl(t,e,n=0,r){if(!new RegExp(e,"su").test(t))return null;let a=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");a.lastIndex=n;let o=0,i;for(;i=a.exec(t);){let{0:s,groups:{$skip:l}}=i;if(!l&&(!r||r===O.DEFAULT==!o))return i;s==="["?o++:s==="]"&&o&&o--,a.lastIndex==i.index&&a.lastIndex++}return null}function nt(t,e,n){return!!Rl(t,e,0,n)}function Ha(t,e){let n=/\\?./gsu;n.lastIndex=e;let r=t.length,a=0,o=1,i;for(;i=n.exec(t);){let[s]=i;if(s==="[")a++;else if(a)s==="]"&&a--;else if(s==="(")o++;else if(s===")"&&(o--,!o)){r=i.index;break}}return t.slice(e,r)}var Ua=new RegExp(String.raw`(?${Oa})|(?\((?:\?<[^>]+>)?)|\\?.`,"gsu");function An(t,e){let n=e?.hiddenCaptures??[],r=e?.captureTransfers??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:r,hiddenCaptures:n};let a="(?>",o="(?:(?=(",i=[0],s=[],l=0,c=0,u=NaN,d;do{d=!1;let p=0,f=0,g=!1,k;for(Ua.lastIndex=Number.isNaN(u)?0:u+o.length;k=Ua.exec(t);){let{0:w,index:b,groups:{capturingStart:y,noncapturingStart:v}}=k;if(w==="[")p++;else if(p)w==="]"&&p--;else if(w===a&&!g)u=b,g=!0;else if(g&&v)f++;else if(y)g?f++:(l++,i.push(l+c));else if(w===")"&&g){if(!f){c++;let S=l+c;if(t=`${t.slice(0,u)}${o}${t.slice(u+a.length,b)}))<$$${S}>)${t.slice(b+1)}`,d=!0,s.push(S),Da(n,S),r.size){let I=new Map;r.forEach((L,F)=>{I.set(F>=S?F+1:F,L.map(Z=>Z>=S?Z+1:Z))}),r=I}break}f--}}}while(d);return n.push(...s),t=tt(t,String.raw`\\(?[1-9]\d*)|<\$\$(?\d+)>`,({0:p,groups:{backrefNum:f,wrappedBackrefNum:g}})=>{if(f){let k=+f;if(k>i.length-1)throw new Error(`Backref "${p}" greater than number of captures`);return`\\${i[k]}`}return`\\${g}`},O.DEFAULT),{pattern:t,captureTransfers:r,hiddenCaptures:n}}var Wa=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,In=new RegExp(String.raw` +\\(?: \d+ + | c[A-Za-z] + | [gk]<[^>]+> + | [pPu]\{[^\}]+\} + | u[A-Fa-f\d]{4} + | x[A-Fa-f\d]{2} + ) +| \((?: \? (?: [:=!>] + | <(?:[=!]|[^>]+>) + | [A-Za-z\-]+: + | \(DEFINE\) + ))? +| (?${Wa})(?[?+]?)(?[?*+\{]?) +| \\?. +`.replace(/\s+/g,""),"gsu");function En(t){if(!new RegExp(`${Wa}\\+`).test(t))return{pattern:t};let e=[],n=null,r=null,a="",o=0,i;for(In.lastIndex=0;i=In.exec(t);){let{0:s,index:l,groups:{qBase:c,qMod:u,invalidQ:d}}=i;if(s==="[")o||(r=l),o++;else if(s==="]")o?o--:r=null;else if(!o)if(u==="+"&&a&&!a.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${s}"`);let p=-1;if(/^\{\d+\}$/.test(c))t=za(t,l+c.length,u,"");else{if(a===")"||a==="]"){let f=a===")"?n:r;if(f===null)throw new Error(`Invalid unmatched "${a}"`);t=`${t.slice(0,f)}(?>${t.slice(f,l)}${c})${t.slice(l+s.length)}`}else t=`${t.slice(0,l-a.length)}(?>${a}${c})${t.slice(l+s.length)}`;p+=4}In.lastIndex+=p}else s[0]==="("?e.push(l):s===")"&&(n=e.length?e.pop():null);a=s}return{pattern:t}}var W=String.raw,Bl=W`\\g<(?[^>&]+)&R=(?[^>]+)>`,Rn=W`\(\?R=(?[^\)]+)\)|${Bl}`,Pt=W`\(\?<(?![=!])(?[^>]+)>`,Ya=W`${Pt}|(?\()(?!\?)`,xe=new RegExp(W`${Pt}|${Rn}|\(\?|\\?.`,"gsu"),Nn="Cannot use multiple overlapping recursions";function Ja(t,e){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...e},a=e?.captureTransfers??new Map;if(!new RegExp(Rn,"su").test(t))return{pattern:t,captureTransfers:a,hiddenCaptures:n};if(r==="plugin"&&nt(t,W`\(\?\(DEFINE\)`,O.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");let o=[],i=nt(t,W`\\[1-9]`,O.DEFAULT),s=new Map,l=[],c=!1,u=0,d=0,p;for(xe.lastIndex=0;p=xe.exec(t);){let{0:f,groups:{captureName:g,rDepth:k,gRNameOrNum:w,gRDepth:b}}=p;if(f==="[")u++;else if(u)f==="]"&&u--;else if(k){if(qa(k),c)throw new Error(Nn);if(i)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);let y=t.slice(0,p.index),v=t.slice(xe.lastIndex);if(nt(v,Rn,O.DEFAULT))throw new Error(Nn);let S=+k-1;t=Va(y,v,S,!1,n,o,d),a=Xa(a,y,S,o.length,0,d);break}else if(w){qa(b);let y=!1;for(let X of l)if(X.name===w||X.num===+w){if(y=!0,X.hasRecursedWithin)throw new Error(Nn);break}if(!y)throw new Error(W`Recursive \g cannot be used outside the referenced group "${r==="external"?w:W`\g<${w}&R=${b}>`}"`);let v=s.get(w),S=Ha(t,v);if(i&&nt(S,W`${Pt}|\((?!\?)`,O.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);let I=t.slice(v,p.index),L=S.slice(I.length+f.length),F=o.length,Z=+b-1,Ee=Va(I,L,Z,!0,n,o,d);a=Xa(a,I,Z,o.length-F,F,d);let Gt=t.slice(0,v),Ot=t.slice(v+S.length);t=`${Gt}${Ee}${Ot}`,xe.lastIndex+=Ee.length-f.length-I.length-L.length,l.forEach(X=>X.hasRecursedWithin=!0),c=!0}else if(g)d++,s.set(String(d),xe.lastIndex),s.set(g,xe.lastIndex),l.push({num:d,name:g});else if(f[0]==="("){let y=f==="(";y&&(d++,s.set(String(d),xe.lastIndex)),l.push(y?{num:d}:{})}else f===")"&&l.pop()}return n.push(...o),{pattern:t,captureTransfers:a,hiddenCaptures:n}}function qa(t){let e=`Max depth must be integer between 2 and 100; used ${t}`;if(!/^[1-9]\d*$/.test(t))throw new Error(e);if(t=+t,t<2||t>100)throw new Error(e)}function Va(t,e,n,r,a,o,i){let s=new Set;r&&xn(t+e,Pt,({groups:{captureName:c}})=>{s.add(c)},O.DEFAULT);let l=[n,r?s:null,a,o,i];return`${t}${Za(`(?:${t}`,"forward",...l)}(?:)${Za(`${e})`,"backward",...l)}${e}`}function Za(t,e,n,r,a,o,i){let l=u=>e==="forward"?u+2:n-u+2-1,c="";for(let u=0;u[^>]+)>`,({0:p,groups:{captureName:f,unnamed:g,backref:k}})=>{if(k&&r&&!r.has(k))return p;let w=`_$${d}`;if(g||f){let b=i+o.length+1;return o.push(b),jl(a,b),g?p:`(?<${f}${w}>`}return W`\k<${k}${w}>`},O.DEFAULT)}return c}function jl(t,e){for(let n=0;n=e&&t[n]++}function Xa(t,e,n,r,a,o){if(t.size&&r){let i=0;xn(e,Ya,()=>i++,O.DEFAULT);let s=o-i+a,l=new Map;return t.forEach((c,u)=>{let d=(r-i*n)/n,p=i*n,f=u>s+i?u+r:u,g=[];for(let k of c)if(k<=s)g.push(k);else if(k>s+i+d)g.push(k+r);else if(k<=s+i)for(let w=0;w<=n;w++)g.push(k+i*w);else for(let w=0;w<=n;w++)g.push(k+p+d*w);l.set(f,g)}),l}return t}var j=String.fromCodePoint,_=String.raw,V={},Mt=globalThis.RegExp;V.flagGroups=(()=>{try{new Mt("(?i:)")}catch{return!1}return!0})();V.unicodeSets=(()=>{try{new Mt("[[]]","v")}catch{return!1}return!0})();V.bugFlagVLiteralHyphenIsRange=V.unicodeSets?(()=>{try{new Mt(_`[\d\-a]`,"v")}catch{return!0}return!1})():!1;V.bugNestedClassIgnoresNegation=V.unicodeSets&&new Mt("[[^a]]","v").test("a");function Ft(t,{enable:e,disable:n}){return{dotAll:!n?.dotAll&&!!(e?.dotAll||t.dotAll),ignoreCase:!n?.ignoreCase&&!!(e?.ignoreCase||t.ignoreCase)}}function rt(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}function $n(t,e){return Qa[t]>=Qa[e]}function Tl(t,e){if(t==null)throw new Error(e??"Value expected");return t}var Qa={ES2025:2025,ES2024:2024,ES2018:2018},Ll={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function ro(t={}){if({}.toString.call(t)!=="[object Object]")throw new Error("Unexpected options");if(t.target!==void 0&&!Ll[t.target])throw new Error(`Unexpected target "${t.target}"`);let e={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...t,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...t.rules}};return e.target==="auto"&&(e.target=V.flagGroups?"ES2025":V.unicodeSets?"ES2024":"ES2018"),e}var $l="[ -\r ]",Pl=new Set([j(304),j(305)]),ie=_`[\p{L}\p{M}\p{N}\p{Pc}]`;function ao(t){if(Pl.has(t))return[t];let e=new Set,n=t.toLowerCase(),r=n.toUpperCase(),a=Gl.get(n),o=Fl.get(n),i=Ml.get(n);return[...r].length===1&&e.add(r),i&&e.add(i),a&&e.add(a),e.add(n),o&&e.add(o),[...e]}var Fn=new Map(`C Other +Cc Control cntrl +Cf Format +Cn Unassigned +Co Private_Use +Cs Surrogate +L Letter +LC Cased_Letter +Ll Lowercase_Letter +Lm Modifier_Letter +Lo Other_Letter +Lt Titlecase_Letter +Lu Uppercase_Letter +M Mark Combining_Mark +Mc Spacing_Mark +Me Enclosing_Mark +Mn Nonspacing_Mark +N Number +Nd Decimal_Number digit +Nl Letter_Number +No Other_Number +P Punctuation punct +Pc Connector_Punctuation +Pd Dash_Punctuation +Pe Close_Punctuation +Pf Final_Punctuation +Pi Initial_Punctuation +Po Other_Punctuation +Ps Open_Punctuation +S Symbol +Sc Currency_Symbol +Sk Modifier_Symbol +Sm Math_Symbol +So Other_Symbol +Z Separator +Zl Line_Separator +Zp Paragraph_Separator +Zs Space_Separator +ASCII +ASCII_Hex_Digit AHex +Alphabetic Alpha +Any +Assigned +Bidi_Control Bidi_C +Bidi_Mirrored Bidi_M +Case_Ignorable CI +Cased +Changes_When_Casefolded CWCF +Changes_When_Casemapped CWCM +Changes_When_Lowercased CWL +Changes_When_NFKC_Casefolded CWKCF +Changes_When_Titlecased CWT +Changes_When_Uppercased CWU +Dash +Default_Ignorable_Code_Point DI +Deprecated Dep +Diacritic Dia +Emoji +Emoji_Component EComp +Emoji_Modifier EMod +Emoji_Modifier_Base EBase +Emoji_Presentation EPres +Extended_Pictographic ExtPict +Extender Ext +Grapheme_Base Gr_Base +Grapheme_Extend Gr_Ext +Hex_Digit Hex +IDS_Binary_Operator IDSB +IDS_Trinary_Operator IDST +ID_Continue IDC +ID_Start IDS +Ideographic Ideo +Join_Control Join_C +Logical_Order_Exception LOE +Lowercase Lower +Math +Noncharacter_Code_Point NChar +Pattern_Syntax Pat_Syn +Pattern_White_Space Pat_WS +Quotation_Mark QMark +Radical +Regional_Indicator RI +Sentence_Terminal STerm +Soft_Dotted SD +Terminal_Punctuation Term +Unified_Ideograph UIdeo +Uppercase Upper +Variation_Selector VS +White_Space space +XID_Continue XIDC +XID_Start XIDS`.split(/\s/).map(t=>[Le(t),t])),Fl=new Map([["s",j(383)],[j(383),"s"]]),Ml=new Map([[j(223),j(7838)],[j(107),j(8490)],[j(229),j(8491)],[j(969),j(8486)]]),Gl=new Map([pe(453),pe(456),pe(459),pe(498),...Bn(8072,8079),...Bn(8088,8095),...Bn(8104,8111),pe(8124),pe(8140),pe(8188)]),Ol=new Map([["alnum",_`[\p{Alpha}\p{Nd}]`],["alpha",_`\p{Alpha}`],["ascii",_`\p{ASCII}`],["blank",_`[\p{Zs}\t]`],["cntrl",_`\p{Cc}`],["digit",_`\p{Nd}`],["graph",_`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",_`\p{Lower}`],["print",_`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",_`[\p{P}\p{S}]`],["space",_`\p{space}`],["upper",_`\p{Upper}`],["word",_`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",_`\p{AHex}`]]);function Dl(t,e){let n=[];for(let r=t;r<=e;r++)n.push(r);return n}function pe(t){let e=j(t);return[e.toLowerCase(),e]}function Bn(t,e){return Dl(t,e).map(n=>pe(n))}var oo=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function zl(t,e){let n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...e};io(t);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:$n(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:t.flags.digitIsAscii,spaceIsAscii:t.flags.spaceIsAscii,wordIsAscii:t.flags.wordIsAscii};Se(t,Hl,r);let a={dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},o={currentFlags:a,prevFlags:null,globalFlags:a,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Se(t,Ul,o);let i={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return Se(t,Wl,i),t._originMap=o.groupOriginByCopy,t._strategy=r.strategy,t}var Hl={AbsenceFunction({node:t,parent:e,replaceWith:n}){let{body:r,kind:a}=t;if(a==="repeater"){let o=D();o.body[0].body.push(de({negate:!0,body:r}),_e("Any"));let i=D();i.body[0].body.push(_n("greedy",0,1/0,o)),n(R(i,e),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:t,parent:e,key:n},{flagDirectivesByAlt:r}){let a=t.body.filter(o=>o.kind==="flags");for(let o=n+1;o\r\n|${a?_`\p{RGI_Emoji}`:p}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),e))}else if(l==="hex")n(fe(_e("AHex",{negate:c}),e));else if(l==="newline")n(R(se(c?`[^ +]`:`(?>\r +?|[ +\v\f\x85\u2028\u2029])`),e));else if(l==="posix")if(!a&&(u==="graph"||u==="print")){if(r==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[u];c&&(d=`\0-${j(d.codePointAt(0)-1)}${j(d.codePointAt(2)+1)}-\u{10FFFF}`),n(R(se(`[${d}]`),e))}else n(R(Ln(se(Ol.get(u)),c),e));else if(l==="property")Fn.has(Le(u))||(t.key="sc");else if(l==="space")n(fe(_e("space",{negate:c}),e));else if(l==="word")n(R(Ln(se(ie),c),e));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:t,parent:e,root:n,remove:r,replaceWith:a,removeAllPrevSiblings:o,removeAllNextSiblings:i}){let{kind:s,flags:l}=t;if(s==="flags")if(!l.enable&&!l.disable)r();else{let c=D({flags:l});c.body[0].body=i(),a(R(c,e),{traverse:!0})}else if(s==="keep"){let c=n.body[0],d=n.body.length===1&&Rt(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(e.parent!==d||d.body.length>1)throw new Error(_`Uses "\K" in a way that's unsupported`);let p=de({behind:!0});p.body[0].body=o(),a(R(p,e))}else throw new Error(`Unexpected directive kind "${s}"`)},Flags({node:t,parent:e}){if(t.posixIsAscii)throw new Error('Unsupported flag "P"');if(t.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete t[n]),Object.assign(t,{global:!1,hasIndices:!1,multiline:!1,sticky:t.sticky??!1}),e.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:t}){if(!t.flags)return;let{enable:e,disable:n}=t.flags;e?.extended&&delete e.extended,n?.extended&&delete n.extended,e?.dotAll&&n?.dotAll&&delete e.dotAll,e?.ignoreCase&&n?.ignoreCase&&delete e.ignoreCase,e&&!Object.keys(e).length&&delete t.flags.enable,n&&!Object.keys(n).length&&delete t.flags.disable,!t.flags.enable&&!t.flags.disable&&delete t.flags},LookaroundAssertion({node:t},e){let{kind:n}=t;n==="lookbehind"&&(e.passedLookbehind=!0)},NamedCallout({node:t,parent:e,replaceWith:n}){let{kind:r}=t;if(r==="fail")n(R(de({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){let e=D();e.body[0].body.push(t.body),t.body=R(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){let n=[],r=!1,a=!1;for(let o of t.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{let i=uo(o.body);i?(r=!0,Array.isArray(i)?n.push(...i):n.push(i)):a=!0}r&&!a&&n.forEach(o=>e.add(o))},exit(t,{accuracy:e,passedLookbehind:n,strategy:r}){if(e==="strict"&&n&&r)throw new Error(_`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!Tn(n)&&(n=jn(n,e),t.ref=n)}},Ul={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:n}){let{orphan:r,ref:a}=t;r||n.set(t,[...e.get(a).map(({node:o})=>o)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:n,skip:r},{groupOriginByCopy:a,groupsByName:o,multiplexCapturesToLeftByRef:i,openRefs:s,reffedNodesByReferencer:l}){let c=a.get(t);if(c&&s.has(t.number)){let d=fe(Ka(t.number),e);l.set(d,s.get(t.number)),n(d);return}s.set(t.number,t),i.set(t.number,[]),t.name&&rt(i,t.name,[]);let u=i.get(t.name??t.number);for(let d=0;dp.type==="Group"&&!!p.flags)),d=u?Ft(r.globalFlags,u):r.globalFlags;ql(d,r.currentFlags)||(c=D({flags:Xl(d)}),c.body[0].body.push(l))}n(R(c,e),{traverse:!s})}},Wl={Backreference({node:t,parent:e,replaceWith:n},r){if(t.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,t.ref);return}let o=r.reffedNodesByReferencer.get(t).filter(i=>Vl(i,t));if(!o.length)n(R(de({negate:!0}),e));else if(o.length>1){let i=D({atomic:!0,body:o.reverse().map(s=>oe({body:[Bt(s.number)]}))});n(R(i,e))}else t.ref=o[0].number},CapturingGroup({node:t},e){t.number=++e.numCapturesToLeft,t.name&&e.groupsByName.get(t.name).get(t).hasDuplicateNameToRemove&&delete t.name},Regex:{exit({node:t},e){let n=Math.max(e.highestOrphanBackref-e.numCapturesToLeft,0);for(let r=0;r{e.forEach(a=>{r.enable?.[a]&&(delete n.disable[a],n.enable[a]=!0),r.disable?.[a]&&(n.disable[a]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Xl({dotAll:t,ignoreCase:e}){let n={};return(t||e)&&(n.enable={},t&&(n.enable.dotAll=!0),e&&(n.enable.ignoreCase=!0)),(!t||!e)&&(n.disable={},!t&&(n.disable.dotAll=!0),!e&&(n.disable.ignoreCase=!0)),n}function co(t){if(!t)throw new Error("Node expected");let{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function uo(t){let e=t.find(n=>n.kind==="search_start"||Ql(n,{negate:!1})||!Yl(n));if(!e)return null;if(e.kind==="search_start")return e;if(e.type==="LookaroundAssertion")return e.body[0].body[0];if(e.type==="CapturingGroup"||e.type==="Group"){let n=[];for(let r of e.body){let a=uo(r.body);if(!a)return null;Array.isArray(a)?n.push(...a):n.push(a)}return n}return null}function po(t,e){let n=co(t)??[];for(let r of n)if(r===e||po(r,e))return!0;return!1}function Yl({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function Jl(t){let e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function Ql(t,e){let n={negate:null,...e};return t.type==="LookaroundAssertion"&&(n.negate===null||t.negate===n.negate)&&t.body.length===1&&Rt(t.body[0],{type:"Assertion",kind:"search_start"})}function Tn(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function se(t,e){let r=jt(t,{...e,unicodePropertyMap:Fn}).body;return r.length>1||r[0].body.length>1?D({body:r}):r[0].body[0]}function Ln(t,e){return t.negate=e,t}function fe(t,e){return t.parent=e,t}function R(t,e){return io(t),t.parent=e,t}function Kl(t,e){let n=ro(e),r=$n(n.target,"ES2024"),a=$n(n.target,"ES2025"),o=n.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw new Error("Invalid recursionLimit; use 2-20");let i=null,s=null;if(!a){let f=[t.flags.ignoreCase];Se(t,ec,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(g){f.push(g)},setHasCasedChar(){f.at(-1)?i=!0:s=!0}})}let l={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||i)&&!s)},c=t,u={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:t._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!a&&i&&s),useFlagMods:a,useFlagV:r,verbose:n.verbose};function d(f){return u.lastNode=c,c=f,Tl(tc[f.type],`Unexpected node type "${f.type}"`)(f,u,d)}let p={pattern:t.body.map(d).join("|"),flags:d(t.flags),options:{...t.options}};return r||(delete p.options.force.v,p.options.disable.v=!0,p.options.unicodeSetsPlugin=null),p._captureTransfers=new Map,p._hiddenCaptures=[],u.captureMap.forEach((f,g)=>{f.hidden&&p._hiddenCaptures.push(g),f.transferTo&&rt(p._captureTransfers,f.transferTo,[]).push(g)}),p}var ec={"*":{enter({node:t},e){if(to(t)){let n=e.getCurrentModI();e.pushModI(t.flags?Ft({ignoreCase:n},t.flags).ignoreCase:n)}},exit({node:t},e){to(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){Mn(j(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},n){e(),fo(t,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&oo.has(t.value)&&e.setHasCasedChar()}},tc={Alternative({body:t},e,n){return t.map(n).join("")},Assertion({kind:t,negate:e}){if(t==="string_end")return"$";if(t==="string_start")return"^";if(t==="word_boundary")return e?_`\B`:_`\b`;throw new Error(`Unexpected assertion kind "${t}"`)},Backreference({ref:t},e){if(typeof t!="number")throw new Error("Unexpected named backref in transformed AST");if(!e.useFlagMods&&e.accuracy==="strict"&&e.currentFlags.ignoreCase&&!e.captureMap.get(t).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+t},CapturingGroup(t,e,n){let{body:r,name:a,number:o}=t,i={ignoreCase:e.currentFlags.ignoreCase},s=e.originMap.get(t);return s&&(i.hidden=!0,o>s.number&&(i.transferTo=s.number)),e.captureMap.set(o,i),`(${a?`?<${a}>`:""}${r.map(n).join("|")})`},Character({value:t},e){let n=j(t),r=Pe(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(r!==n)return r;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&Mn(n)){let a=ao(n);return e.inCharClass?a.join(""):a.length>1?`[${a.join("")}]`:a[0]}return n},CharacterClass(t,e,n){let{kind:r,negate:a,parent:o}=t,{body:i}=t;if(r==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");V.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&i.some(no)&&(i=[Te(45),...i.filter(c=>!no(c))]);let s=()=>`[${a?"^":""}${i.map(n).join(r==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||V.bugNestedClassIgnoresNegation)&&!a){let u=i.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(u.length){let d=D(),p=d.body[0];return d.parent=o,p.parent=d,i=i.filter(f=>!u.includes(f)),t.body=i,i.length?(t.parent=p,p.body.push(t)):d.body.pop(),u.forEach(f=>{let g=oe({body:[f]});f.parent=g,g.parent=d,d.body.push(g)}),n(d)}}e.inCharClass=!0;let c=s();return e.inCharClass=!1,c}let l=i[0];if(r==="union"&&!a&&l&&((!e.useFlagV||!e.verbose)&&o.kind==="union"&&!(V.bugFlagVLiteralHyphenIsRange&&e.useFlagV)||!e.verbose&&o.kind==="intersection"&&i.length===1&&l.type!=="CharacterClassRange"))return i.map(n).join("");if(!e.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return s()},CharacterClassRange(t,e){let n=t.min.value,r=t.max.value,a={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},o=Pe(n,a),i=Pe(r,a),s=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){let l=fo(t);ic(l).forEach(u=>{s.add(Array.isArray(u)?`${Pe(u[0],a)}-${Pe(u[1],a)}`:Pe(u,a))})}return`${o}-${i}${[...s].join("")}`},CharacterSet({kind:t,negate:e,value:n,key:r},a){if(t==="dot")return a.currentFlags.dotAll?a.appliedGlobalFlags.dotAll||a.useFlagMods?".":"[^]":_`[^\n]`;if(t==="digit")return e?_`\D`:_`\d`;if(t==="property"){if(a.useAppliedIgnoreCase&&a.currentFlags.ignoreCase&&oo.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${e?_`\P`:_`\p`}{${r?`${r}=`:""}${n}}`}if(t==="word")return e?_`\W`:_`\w`;throw new Error(`Unexpected character set kind "${t}"`)},Flags(t,e){return(e.appliedGlobalFlags.ignoreCase?"i":"")+(t.dotAll?"s":"")+(t.sticky?"y":"")},Group({atomic:t,body:e,flags:n,parent:r},a,o){let i=a.currentFlags;n&&(a.currentFlags=Ft(i,n));let s=e.map(o).join("|"),l=!a.verbose&&e.length===1&&r.type!=="Quantifier"&&!t&&(!a.useFlagMods||!n)?s:`(?${sc(t,n,a.useFlagMods)}${s})`;return a.currentFlags=i,l},LookaroundAssertion({body:t,kind:e,negate:n},r,a){return`(?${`${e==="lookahead"?"":"<"}${n?"!":"="}`}${t.map(a).join("|")})`},Quantifier(t,e,n){return n(t.body)+lc(t)},Subroutine({isRecursive:t,ref:e},n){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");let r=n.recursionLimit;return e===0?`(?R=${r})`:_`\g<${e}&R=${r}>`}},nc=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),rc=new Set(["-","\\","]","^","["]),ac=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),eo=new Map([[9,_`\t`],[10,_`\n`],[11,_`\v`],[12,_`\f`],[13,_`\r`],[8232,_`\u2028`],[8233,_`\u2029`],[65279,_`\uFEFF`]]),oc=/^\p{Cased}$/u;function Mn(t){return oc.test(t)}function fo(t,e){let n=!!e?.firstOnly,r=t.min.value,a=t.max.value,o=[];if(r<65&&(a===65535||a>=131071)||r===65536&&a>=131071)return o;for(let i=r;i<=a;i++){let s=j(i);if(!Mn(s))continue;let l=ao(s).filter(c=>{let u=c.codePointAt(0);return ua});if(l.length&&(o.push(...l),n))break}return o}function Pe(t,{escDigit:e,inCharClass:n,useFlagV:r}){if(eo.has(t))return eo.get(t);if(t<32||t>126&&t<160||t>262143||e&&cc(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;let a=n?r?ac:rc:nc,o=j(t);return(a.has(o)?"\\":"")+o}function ic(t){let e=t.map(a=>a.codePointAt(0)).sort((a,o)=>a-o),n=[],r=null;for(let a=0;a";let r="";if(e&&n){let{enable:a,disable:o}=e;r=(a?.ignoreCase?"i":"")+(a?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${r}:`}function lc({kind:t,max:e,min:n}){let r;return!n&&e===1?r="?":!n&&e===1/0?r="*":n===1&&e===1/0?r="+":n===e?r=`{${n}}`:r=`{${n},${e===1/0?"":e}}`,r+{greedy:"",lazy:"?",possessive:"+"}[t]}function to({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function cc(t){return t>47&&t<58}function no({type:t,value:e}){return t==="Character"&&e===45}var ge,le,Ie,me,Ae,at,Pn,he,uc=(he=class extends RegExp{constructor(n,r,a){var e=(...mf)=>(super(...mf),be(this,at),be(this,ge,new Map),be(this,le,null),be(this,Ie),be(this,me,null),be(this,Ae,null),m(this,"rawOptions",{}),this);let o=!!a?.lazyCompile;if(n instanceof RegExp){if(a)throw new Error("Cannot provide options when copying a regexp");let i=n;e(i,r),q(this,Ie,i.source),i instanceof he&&(q(this,ge,M(i,ge)),q(this,me,M(i,me)),q(this,Ae,M(i,Ae)),this.rawOptions=i.rawOptions)}else{let i={hiddenCaptures:[],strategy:null,transfers:[],...a};e(o?"":n,r),q(this,Ie,n),q(this,ge,pc(i.hiddenCaptures,i.transfers)),q(this,Ae,i.strategy),this.rawOptions=a??{}}o||q(this,le,this)}get source(){return M(this,Ie)||"(?:)"}exec(n){if(!M(this,le)){let{lazyCompile:o,...i}=this.rawOptions;q(this,le,new he(M(this,Ie),this.flags,i))}let r=this.global||this.sticky,a=this.lastIndex;if(M(this,Ae)==="clip_search"&&r&&a){this.lastIndex=0;let o=Ht(this,at,Pn).call(this,n.slice(a));return o&&(dc(o,a,n,this.hasIndices),this.lastIndex+=a),o}return Ht(this,at,Pn).call(this,n)}},ge=new WeakMap,le=new WeakMap,Ie=new WeakMap,me=new WeakMap,Ae=new WeakMap,at=new WeakSet,Pn=function(n){M(this,le).lastIndex=this.lastIndex;let r=Un(he.prototype,this,"exec").call(M(this,le),n);if(this.lastIndex=M(this,le).lastIndex,!r||!M(this,ge).size)return r;let a=[...r];r.length=1;let o;this.hasIndices&&(o=[...r.indices],r.indices.length=1);let i=[0];for(let s=1;s{let s=o[i];s&&(o[i]=[s[0]+e,s[1]+e])})}}function pc(t,e){let n=new Map;for(let r of t)n.set(r,{hidden:!0});for(let[r,a]of e)for(let o of a)rt(n,o,{}).transferTo=r;return n}function fc(t){let e=/(?\((?:\?<(?![=!])(?[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,a=0,o;for(;o=e.exec(t);){let{0:i,groups:{capture:s,name:l}}=o;i==="["?r++:r?i==="]"&&r--:s&&(a++,l&&n.set(a,l))}return n}function go(t,e){let n=gc(t,e);return n.options?new uc(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function gc(t,e){let n=ro(e),r=jt(t,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Fn}),a=zl(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),o=Kl(a,n),i=Ja(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),s=En(i.pattern),l=An(s.pattern,{captureTransfers:i.captureTransfers,hiddenCaptures:i.hiddenCaptures}),c={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{let u=l.hiddenCaptures.sort((g,k)=>g-k),d=Array.from(l.captureTransfers),p=a._strategy,f=c.pattern.length>=n.lazyCompileLength;(u.length||d.length||p||f)&&(c.options={...u.length&&{hiddenCaptures:u},...d.length&&{transfers:d},...p&&{strategy:p},...f&&{lazyCompile:f}})}return c}function mo(t,e){return go(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function Gn(t={}){let e={target:"auto",cache:new Map,...t};return e.regexConstructor||(e.regexConstructor=n=>mo(n,{target:e.target})),{createScanner(n){return new va(n,e)},createString(n){return{content:n}}}}var mc=new Set(["json","yaml","csv","xml"]),hc=new Map([["yml","yaml"],["text","plaintext"],["txt","plaintext"],["table","plaintext"]]),ho;function bc(){return ho??(ho=wa({themes:[Yn,Jn],langs:[Wn,qn,Vn,Xn],engine:Gn()})),ho}function yc(t){let e=String(t||"plaintext").toLowerCase();return hc.get(e)||e}function kc(t){let e=document.createElement("pre");e.className="code-source";let n=document.createElement("code");return n.textContent=t,e.appendChild(n),e}function wc(t){let e=document.createElement("div");e.className="line-gutter",e.setAttribute("aria-hidden","true");let n=Math.max(1,t.split(` +`).length);for(let r=1;r<=n;r+=1){let a=document.createElement("span");a.textContent=String(r),e.appendChild(a)}return e}function bo(t,e,n){let r=document.createElement("div");r.className="code-viewer";let a=document.createElement("div");return a.className="code-scroll",a.setAttribute("role","region"),a.setAttribute("aria-label",n),a.tabIndex=0,e.classList.add("code-source"),e.removeAttribute("tabindex"),a.append(wc(t),e),r.appendChild(a),r}async function Rf(t,e,n="plaintext",r="Parser output"){e=String(e??"");let a=yc(n),o=bo(e,kc(e),r);if(t.replaceChildren(o),!mc.has(a))return o;try{let s=(await bc()).codeToHtml(e,{lang:a,themes:{light:"github-light-high-contrast",dark:"github-dark-high-contrast"},defaultColor:!1}),l=document.createElement("template");l.innerHTML=s;let c=l.content.querySelector("pre");if(!c||!t.contains(o))return o;let u=bo(e,c,r);return t.replaceChildren(u),u}catch(i){return console.warn("Syntax highlighting unavailable; using plaintext output.",i),o}}export{Rf as renderCodeViewer}; diff --git a/docs/index.html b/docs/index.html index 4fe0b86..24740fa 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,9 +4,6 @@ M-Bus Parser (Wired & Wireless) - - - @@ -686,14 +783,17 @@

Online M-Bus Parser -

+