diff --git a/vl-convert-python/tests/test_specs.py b/vl-convert-python/tests/test_specs.py index 8acf6413..3f9c181d 100644 --- a/vl-convert-python/tests/test_specs.py +++ b/vl-convert-python/tests/test_specs.py @@ -72,7 +72,7 @@ def load_expected_png(name, vl_version, theme=None): @pytest.mark.parametrize("name", ["circle_binned", "seattle-weather", "stacked_bar_h"]) @pytest.mark.parametrize( "vl_version", - ["v5_8", "v5_12", "v5_13", "v5_14", "v5_15", "v5_16", "v5_17", "v5_18", "v5_19"], + ["v5_8", "v5_13", "v5_14", "v5_15", "v5_16", "v5_17", "v5_18", "v5_19", "v5_20"], ) @pytest.mark.parametrize("as_dict", [False, True]) def test_vega(name, vl_version, as_dict): @@ -96,7 +96,6 @@ def test_vega(name, vl_version, as_dict): "vl_version", [ "5.8", - "5.12", "5.13", "5.14", "5.15", @@ -104,6 +103,7 @@ def test_vega(name, vl_version, as_dict): "5.17", "5.18", "5.19", + "5.20", ], ) def test_vegalite_to_html_no_bundle(name, vl_version): @@ -132,7 +132,6 @@ def test_vegalite_to_html_no_bundle(name, vl_version): "vl_version", [ "5.8", - "5.12", "5.13", "5.14", "5.15", @@ -140,6 +139,7 @@ def test_vegalite_to_html_no_bundle(name, vl_version): "5.17", "5.18", "5.19", + "5.20", ], ) def test_vegalite_to_html_bundle(name, vl_version): diff --git a/vl-convert-rs/src/module_loader/import_map.rs b/vl-convert-rs/src/module_loader/import_map.rs index bc17e3d2..a0731707 100644 --- a/vl-convert-rs/src/module_loader/import_map.rs +++ b/vl-convert-rs/src/module_loader/import_map.rs @@ -10,9 +10,9 @@ pub const SKYPACK_URL: &str = "https://cdn.skypack.dev"; pub const VEGA_PATH: &str = "/pin/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/mode=imports,min/optimized/vega.js"; pub const VEGA_THEMES_PATH: &str = - "/pin/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/mode=imports,min/optimized/vega-themes.js"; + "/pin/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/mode=imports,min/optimized/vega-themes.js"; pub const VEGA_EMBED_PATH: &str = - "/pin/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/mode=imports,min/optimized/vega-embed.js"; + "/pin/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/mode=imports,min/optimized/vega-embed.js"; pub const DEBOUNCE_PATH: &str = "/pin/lodash.debounce@v4.0.8-aOLIwnE2RethWPrEzTeR/mode=imports,min/optimized/lodash.debounce.js"; pub fn url_for_path(path: &str) -> String { @@ -31,7 +31,6 @@ pub fn vega_themes_url() -> String { #[allow(non_camel_case_types)] pub enum VlVersion { v5_8, - v5_12, v5_13, v5_14, v5_15, @@ -39,6 +38,7 @@ pub enum VlVersion { v5_17, v5_18, v5_19, + v5_20, } impl VlVersion { @@ -46,14 +46,14 @@ impl VlVersion { use VlVersion::*; let path = match self { v5_8 => "/pin/vega-lite@v5.8.0-4snbURNltT4se5LjMOKF/mode=imports,min/optimized/vega-lite.js", - v5_12 => "/pin/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/mode=imports,min/optimized/vega-lite.js", v5_13 => "/pin/vega-lite@v5.13.0-GkFo6HVxfKtvVL5RV8aE/mode=imports,min/optimized/vega-lite.js", v5_14 => "/pin/vega-lite@v5.14.1-0IRM1VigcIVzRzBRoLFR/mode=imports,min/optimized/vega-lite.js", v5_15 => "/pin/vega-lite@v5.15.1-lQeQs8sDPgFa9d7Jm3sd/mode=imports,min/optimized/vega-lite.js", v5_16 => "/pin/vega-lite@v5.16.3-Hw7pZxUuaiVgThsNMjY9/mode=imports,min/optimized/vega-lite.js", v5_17 => "/pin/vega-lite@v5.17.0-jkfrfJOQ30TsVIlEEbKQ/mode=imports,min/optimized/vega-lite.js", v5_18 => "/pin/vega-lite@v5.18.1-CIbWw1F4YnIlhO9UCtHA/mode=imports,min/optimized/vega-lite.js", - v5_19 => "/pin/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/mode=imports,min/optimized/vega-lite.js" + v5_19 => "/pin/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/mode=imports,min/optimized/vega-lite.js", + v5_20 => "/pin/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/mode=imports,min/optimized/vega-lite.js" }; path.to_string() } @@ -66,7 +66,6 @@ impl VlVersion { use VlVersion::*; match self { v5_8 => "5.8", - v5_12 => "5.12", v5_13 => "5.13", v5_14 => "5.14", v5_15 => "5.15", @@ -74,13 +73,14 @@ impl VlVersion { v5_17 => "5.17", v5_18 => "5.18", v5_19 => "5.19", + v5_20 => "5.20", } } } impl Default for VlVersion { fn default() -> Self { - VlVersion::from_str("5.19").unwrap() + VlVersion::from_str("5.20").unwrap() } } @@ -90,7 +90,6 @@ impl FromStr for VlVersion { fn from_str(s: &str) -> Result { Ok(match s { "5.8" | "v5.8" | "5_8" | "v5_8" => Self::v5_8, - "5.12" | "v5.12" | "5_12" | "v5_12" => Self::v5_12, "5.13" | "v5.13" | "5_13" | "v5_13" => Self::v5_13, "5.14" | "v5.14" | "5_14" | "v5_14" => Self::v5_14, "5.15" | "v5.15" | "5_15" | "v5_15" => Self::v5_15, @@ -98,6 +97,7 @@ impl FromStr for VlVersion { "5.17" | "v5.17" | "5_17" | "v5_17" => Self::v5_17, "5.18" | "v5.18" | "5_18" | "v5_18" => Self::v5_18, "5.19" | "v5.19" | "5_19" | "v5_19" => Self::v5_19, + "5.20" | "v5.20" | "5_20" | "v5_20" => Self::v5_20, _ => bail!("Unsupported Vega-Lite version string {}", s), }) } @@ -105,7 +105,6 @@ impl FromStr for VlVersion { pub const VL_VERSIONS: &[VlVersion] = &[ VlVersion::v5_8, - VlVersion::v5_12, VlVersion::v5_13, VlVersion::v5_14, VlVersion::v5_15, @@ -113,6 +112,7 @@ pub const VL_VERSIONS: &[VlVersion] = &[ VlVersion::v5_17, VlVersion::v5_18, VlVersion::v5_19, + VlVersion::v5_20, ]; pub fn build_import_map() -> HashMap { @@ -149,7 +149,7 @@ pub fn build_import_map() -> HashMap { m.insert("/-/vega-canvas@v1.2.7-hCEcvULuKIOqBVGX1Tn8/dist=es2020,mode=imports,min/optimized/vega-canvas.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-canvas@v1.2.7-hCEcvULuKIOqBVGX1Tn8/dist=es2020,mode=imports,min/optimized/vega-canvas.js").to_string()); m.insert("/-/vega-crossfilter@v4.1.2-4tsGV0HzWFU39iiKcBjX/dist=es2020,mode=imports,min/optimized/vega-crossfilter.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-crossfilter@v4.1.2-4tsGV0HzWFU39iiKcBjX/dist=es2020,mode=imports,min/optimized/vega-crossfilter.js").to_string()); m.insert("/-/vega-dataflow@v5.7.6-WDoszrJUyhTwz7sPwzda/dist=es2020,mode=imports,min/optimized/vega-dataflow.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-dataflow@v5.7.6-WDoszrJUyhTwz7sPwzda/dist=es2020,mode=imports,min/optimized/vega-dataflow.js").to_string()); - m.insert("/-/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/dist=es2020,mode=imports,min/optimized/vega-embed.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/dist=es2020,mode=imports,min/optimized/vega-embed.js").to_string()); + m.insert("/-/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/dist=es2020,mode=imports,min/optimized/vega-embed.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/dist=es2020,mode=imports,min/optimized/vega-embed.js").to_string()); m.insert("/-/vega-encode@v4.10.1-Pg43i2sI9rM8xoeOkJ8i/dist=es2020,mode=imports,min/optimized/vega-encode.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-encode@v4.10.1-Pg43i2sI9rM8xoeOkJ8i/dist=es2020,mode=imports,min/optimized/vega-encode.js").to_string()); m.insert("/-/vega-event-selector@v3.0.1-UgiEAWJA4WQL4DTKnV4R/dist=es2020,mode=imports,min/optimized/vega-event-selector.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-event-selector@v3.0.1-UgiEAWJA4WQL4DTKnV4R/dist=es2020,mode=imports,min/optimized/vega-event-selector.js").to_string()); m.insert("/-/vega-expression@v5.1.1-K4clrYr2THuj5KncykTn/dist=es2020,mode=imports,min/optimized/vega-expression.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-expression@v5.1.1-K4clrYr2THuj5KncykTn/dist=es2020,mode=imports,min/optimized/vega-expression.js").to_string()); @@ -160,15 +160,14 @@ pub fn build_import_map() -> HashMap { m.insert("/-/vega-hierarchy@v4.1.2-3wVtPHq13u3t0KUNwYDf/dist=es2020,mode=imports,min/optimized/vega-hierarchy.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-hierarchy@v4.1.2-3wVtPHq13u3t0KUNwYDf/dist=es2020,mode=imports,min/optimized/vega-hierarchy.js").to_string()); m.insert("/-/vega-interpreter@v1.0.5-xGayK8haM1EVgaoW7oOi/dist=es2020,mode=imports,min/optimized/vega-interpreter.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-interpreter@v1.0.5-xGayK8haM1EVgaoW7oOi/dist=es2020,mode=imports,min/optimized/vega-interpreter.js").to_string()); m.insert("/-/vega-label@v1.3.0-9aipnSY6IQFGc3Lm2JSc/dist=es2020,mode=imports,min/optimized/vega-label.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-label@v1.3.0-9aipnSY6IQFGc3Lm2JSc/dist=es2020,mode=imports,min/optimized/vega-label.js").to_string()); - m.insert("/-/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/dist=es2020,mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/dist=es2020,mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/-/vega-lite@v5.13.0-GkFo6HVxfKtvVL5RV8aE/dist=es2020,mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-lite@v5.13.0-GkFo6HVxfKtvVL5RV8aE/dist=es2020,mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/-/vega-lite@v5.14.1-0IRM1VigcIVzRzBRoLFR/dist=es2020,mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-lite@v5.14.1-0IRM1VigcIVzRzBRoLFR/dist=es2020,mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/-/vega-lite@v5.15.1-lQeQs8sDPgFa9d7Jm3sd/dist=es2020,mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-lite@v5.15.1-lQeQs8sDPgFa9d7Jm3sd/dist=es2020,mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/-/vega-lite@v5.16.3-Hw7pZxUuaiVgThsNMjY9/dist=es2020,mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-lite@v5.16.3-Hw7pZxUuaiVgThsNMjY9/dist=es2020,mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/-/vega-lite@v5.17.0-jkfrfJOQ30TsVIlEEbKQ/dist=es2020,mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-lite@v5.17.0-jkfrfJOQ30TsVIlEEbKQ/dist=es2020,mode=imports,min/optimized/vega-lite.js").to_string()); - m.insert("/-/vega-lite@v5.18.0-FtLrd9Ks5cFttxoTAph7/dist=es2020,mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-lite@v5.18.0-FtLrd9Ks5cFttxoTAph7/dist=es2020,mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/-/vega-lite@v5.18.1-CIbWw1F4YnIlhO9UCtHA/dist=es2020,mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-lite@v5.18.1-CIbWw1F4YnIlhO9UCtHA/dist=es2020,mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/-/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/dist=es2020,mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/dist=es2020,mode=imports,min/optimized/vega-lite.js").to_string()); + m.insert("/-/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/dist=es2020,mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/dist=es2020,mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/-/vega-lite@v5.8.0-4snbURNltT4se5LjMOKF/dist=es2020,mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-lite@v5.8.0-4snbURNltT4se5LjMOKF/dist=es2020,mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/-/vega-loader@v4.5.2-1ImBl2TigOVzvurACWyz/dist=es2020,mode=imports,min/optimized/vega-loader.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-loader@v4.5.2-1ImBl2TigOVzvurACWyz/dist=es2020,mode=imports,min/optimized/vega-loader.js").to_string()); m.insert("/-/vega-parser@v6.4.0-nwGMLAa2L4N1N7f1iRh9/dist=es2020,mode=imports,min/optimized/vega-parser.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-parser@v6.4.0-nwGMLAa2L4N1N7f1iRh9/dist=es2020,mode=imports,min/optimized/vega-parser.js").to_string()); @@ -180,7 +179,7 @@ pub fn build_import_map() -> HashMap { m.insert("/-/vega-schema-url-parser@v2.2.0-YmXJGRcKOXOac3VG4xfw/dist=es2020,mode=imports,min/optimized/vega-schema-url-parser.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-schema-url-parser@v2.2.0-YmXJGRcKOXOac3VG4xfw/dist=es2020,mode=imports,min/optimized/vega-schema-url-parser.js").to_string()); m.insert("/-/vega-selections@v5.4.2-kOpqaoZxiZQE5rKxTnvY/dist=es2020,mode=imports,min/optimized/vega-selections.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-selections@v5.4.2-kOpqaoZxiZQE5rKxTnvY/dist=es2020,mode=imports,min/optimized/vega-selections.js").to_string()); m.insert("/-/vega-statistics@v1.9.0-Qw8CjSQVQOg2M6VMgsme/dist=es2020,mode=imports,min/optimized/vega-statistics.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-statistics@v1.9.0-Qw8CjSQVQOg2M6VMgsme/dist=es2020,mode=imports,min/optimized/vega-statistics.js").to_string()); - m.insert("/-/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/dist=es2020,mode=imports,min/optimized/vega-themes.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/dist=es2020,mode=imports,min/optimized/vega-themes.js").to_string()); + m.insert("/-/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/dist=es2020,mode=imports,min/optimized/vega-themes.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/dist=es2020,mode=imports,min/optimized/vega-themes.js").to_string()); m.insert("/-/vega-time@v2.1.2-0zBPNlF5GMoxR6YChBaP/dist=es2020,mode=imports,min/optimized/vega-time.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-time@v2.1.2-0zBPNlF5GMoxR6YChBaP/dist=es2020,mode=imports,min/optimized/vega-time.js").to_string()); m.insert("/-/vega-tooltip@v0.34.0-YVV3uKnnOnCt2kW7Vclb/dist=es2020,mode=imports,min/optimized/vega-tooltip.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-tooltip@v0.34.0-YVV3uKnnOnCt2kW7Vclb/dist=es2020,mode=imports,min/optimized/vega-tooltip.js").to_string()); m.insert("/-/vega-transforms@v4.12.0-yproJe1RDXbiUml7qQ0X/dist=es2020,mode=imports,min/optimized/vega-transforms.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-transforms@v4.12.0-yproJe1RDXbiUml7qQ0X/dist=es2020,mode=imports,min/optimized/vega-transforms.js").to_string()); @@ -191,8 +190,7 @@ pub fn build_import_map() -> HashMap { m.insert("/-/vega-wordcloud@v4.1.5-5xdRMt86NkNNCDjMSy6z/dist=es2020,mode=imports,min/optimized/vega-wordcloud.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega-wordcloud@v4.1.5-5xdRMt86NkNNCDjMSy6z/dist=es2020,mode=imports,min/optimized/vega-wordcloud.js").to_string()); m.insert("/-/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/dist=es2020,mode=imports,min/optimized/vega.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/-/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/dist=es2020,mode=imports,min/optimized/vega.js").to_string()); m.insert("/pin/lodash.debounce@v4.0.8-aOLIwnE2RethWPrEzTeR/mode=imports,min/optimized/lodash.debounce.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/lodash.debounce@v4.0.8-aOLIwnE2RethWPrEzTeR/mode=imports,min/optimized/lodash.debounce.js").to_string()); - m.insert("/pin/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/mode=imports,min/optimized/vega-embed.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/mode=imports,min/optimized/vega-embed.js").to_string()); - m.insert("/pin/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/mode=imports,min/optimized/vega-lite.js").to_string()); + m.insert("/pin/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/mode=imports,min/optimized/vega-embed.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/mode=imports,min/optimized/vega-embed.js").to_string()); m.insert("/pin/vega-lite@v5.13.0-GkFo6HVxfKtvVL5RV8aE/mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-lite@v5.13.0-GkFo6HVxfKtvVL5RV8aE/mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/pin/vega-lite@v5.14.1-0IRM1VigcIVzRzBRoLFR/mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-lite@v5.14.1-0IRM1VigcIVzRzBRoLFR/mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/pin/vega-lite@v5.15.1-lQeQs8sDPgFa9d7Jm3sd/mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-lite@v5.15.1-lQeQs8sDPgFa9d7Jm3sd/mode=imports,min/optimized/vega-lite.js").to_string()); @@ -200,8 +198,9 @@ pub fn build_import_map() -> HashMap { m.insert("/pin/vega-lite@v5.17.0-jkfrfJOQ30TsVIlEEbKQ/mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-lite@v5.17.0-jkfrfJOQ30TsVIlEEbKQ/mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/pin/vega-lite@v5.18.1-CIbWw1F4YnIlhO9UCtHA/mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-lite@v5.18.1-CIbWw1F4YnIlhO9UCtHA/mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/pin/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/mode=imports,min/optimized/vega-lite.js").to_string()); + m.insert("/pin/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/mode=imports,min/optimized/vega-lite.js").to_string()); m.insert("/pin/vega-lite@v5.8.0-4snbURNltT4se5LjMOKF/mode=imports,min/optimized/vega-lite.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-lite@v5.8.0-4snbURNltT4se5LjMOKF/mode=imports,min/optimized/vega-lite.js").to_string()); - m.insert("/pin/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/mode=imports,min/optimized/vega-themes.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/mode=imports,min/optimized/vega-themes.js").to_string()); + m.insert("/pin/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/mode=imports,min/optimized/vega-themes.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/mode=imports,min/optimized/vega-themes.js").to_string()); m.insert("/pin/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/mode=imports,min/optimized/vega.js".to_string(), include_str!("../../vendor/cdn.skypack.dev/pin/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/mode=imports,min/optimized/vega.js").to_string()); m } diff --git a/vl-convert-rs/tests/test_specs.rs b/vl-convert-rs/tests/test_specs.rs index 64efde1b..8becb0ba 100644 --- a/vl-convert-rs/tests/test_specs.rs +++ b/vl-convert-rs/tests/test_specs.rs @@ -316,7 +316,6 @@ mod test_vegalite_to_vega { fn test( #[values( VlVersion::v5_8, - VlVersion::v5_12, VlVersion::v5_13, VlVersion::v5_14, VlVersion::v5_15, @@ -324,6 +323,7 @@ mod test_vegalite_to_vega { VlVersion::v5_17, VlVersion::v5_18, VlVersion::v5_19, + VlVersion::v5_20, )] vl_version: VlVersion, @@ -361,7 +361,6 @@ mod test_vegalite_to_html_no_bundle { fn test( #[values( VlVersion::v5_8, - VlVersion::v5_12, VlVersion::v5_13, VlVersion::v5_14, VlVersion::v5_15, @@ -369,6 +368,7 @@ mod test_vegalite_to_html_no_bundle { VlVersion::v5_17, VlVersion::v5_18, VlVersion::v5_19, + VlVersion::v5_20, )] vl_version: VlVersion, @@ -409,7 +409,6 @@ mod test_vegalite_to_html_bundle { fn test( #[values( VlVersion::v5_8, - VlVersion::v5_12, VlVersion::v5_13, VlVersion::v5_14, VlVersion::v5_15, @@ -417,6 +416,7 @@ mod test_vegalite_to_html_bundle { VlVersion::v5_17, VlVersion::v5_18, VlVersion::v5_19, + VlVersion::v5_20, )] vl_version: VlVersion, diff --git a/vl-convert-rs/tests/vl-specs/expected/v5_12/seattle-weather.vg.json b/vl-convert-rs/tests/vl-specs/expected/v5_12/seattle-weather.vg.json deleted file mode 100644 index fece2fb7..00000000 --- a/vl-convert-rs/tests/vl-specs/expected/v5_12/seattle-weather.vg.json +++ /dev/null @@ -1 +0,0 @@ -{"$schema":"https://vega.github.io/schema/vega/v5.json","background":"white","padding":5,"width":600,"title":{"text":"Seattle Weather, 2012-2015","anchor":"start"},"data":[{"name":"brush_store"},{"name":"click_store"},{"name":"source_0","url":"https://raw.githubusercontent.com/vega/vega-datasets/next/data/seattle-weather.csv","format":{"type":"csv","parse":{"date":"date"}}},{"name":"data_0","source":"source_0","transform":[{"type":"filter","expr":"!length(data(\"click_store\")) || vlSelectionTest(\"click_store\", datum)"},{"field":"date","type":"timeunit","units":["month","date"],"as":["monthdate_date","monthdate_date_end"]},{"type":"filter","expr":"(isDate(datum[\"monthdate_date\"]) || (isValid(datum[\"monthdate_date\"]) && isFinite(+datum[\"monthdate_date\"]))) && isValid(datum[\"temp_max\"]) && isFinite(+datum[\"temp_max\"]) && isValid(datum[\"precipitation\"]) && isFinite(+datum[\"precipitation\"])"}]},{"name":"data_1","source":"source_0","transform":[{"field":"date","type":"timeunit","units":["month","date"],"as":["monthdate_date","monthdate_date_end"]},{"type":"filter","expr":"!length(data(\"brush_store\")) || vlSelectionTest(\"brush_store\", datum)"},{"type":"aggregate","groupby":["weather"],"ops":["count"],"fields":[null],"as":["__count"]}]}],"signals":[{"name":"concat_0_height","value":300},{"name":"concat_1_y_step","value":20},{"name":"concat_1_height","update":"bandspace(domain('concat_1_y').length, 0.1, 0.05) * concat_1_y_step"},{"name":"unit","value":{},"on":[{"events":"mousemove","update":"isTuple(group()) ? group() : unit"}]},{"name":"brush","update":"vlSelectionResolve(\"brush_store\", \"union\")"},{"name":"click","update":"vlSelectionResolve(\"click_store\", \"union\", true, true)"}],"layout":{"padding":20,"columns":1,"bounds":"full","align":"each"},"marks":[{"type":"group","name":"concat_0_group","style":"cell","encode":{"update":{"width":{"signal":"width"},"height":{"signal":"concat_0_height"}}},"signals":[{"name":"brush_x","value":[],"on":[{"events":{"source":"scope","type":"mousedown","filter":["!event.item || event.item.mark.name !== \"brush_brush\""]},"update":"[x(unit), x(unit)]"},{"events":{"source":"window","type":"mousemove","consume":true,"between":[{"source":"scope","type":"mousedown","filter":["!event.item || event.item.mark.name !== \"brush_brush\""]},{"source":"window","type":"mouseup"}]},"update":"[brush_x[0], clamp(x(unit), 0, width)]"},{"events":{"signal":"brush_scale_trigger"},"update":"[scale(\"concat_0_x\", brush_monthdate_date[0]), scale(\"concat_0_x\", brush_monthdate_date[1])]"},{"events":[{"source":"view","type":"dblclick"}],"update":"[0, 0]"},{"events":{"signal":"brush_translate_delta"},"update":"clampRange(panLinear(brush_translate_anchor.extent_x, brush_translate_delta.x / span(brush_translate_anchor.extent_x)), 0, width)"},{"events":{"signal":"brush_zoom_delta"},"update":"clampRange(zoomLinear(brush_x, brush_zoom_anchor.x, brush_zoom_delta), 0, width)"}]},{"name":"brush_monthdate_date","on":[{"events":{"signal":"brush_x"},"update":"brush_x[0] === brush_x[1] ? null : invert(\"concat_0_x\", brush_x)"}]},{"name":"brush_scale_trigger","value":{},"on":[{"events":[{"scale":"concat_0_x"}],"update":"(!isArray(brush_monthdate_date) || (+invert(\"concat_0_x\", brush_x)[0] === +brush_monthdate_date[0] && +invert(\"concat_0_x\", brush_x)[1] === +brush_monthdate_date[1])) ? brush_scale_trigger : {}"}]},{"name":"brush_tuple","on":[{"events":[{"signal":"brush_monthdate_date"}],"update":"brush_monthdate_date ? {unit: \"concat_0\", fields: brush_tuple_fields, values: [brush_monthdate_date]} : null"}]},{"name":"brush_tuple_fields","value":[{"field":"monthdate_date","channel":"x","type":"R"}]},{"name":"brush_translate_anchor","value":{},"on":[{"events":[{"source":"scope","type":"mousedown","markname":"brush_brush"}],"update":"{x: x(unit), y: y(unit), extent_x: slice(brush_x)}"}]},{"name":"brush_translate_delta","value":{},"on":[{"events":[{"source":"window","type":"mousemove","consume":true,"between":[{"source":"scope","type":"mousedown","markname":"brush_brush"},{"source":"window","type":"mouseup"}]}],"update":"{x: brush_translate_anchor.x - x(unit), y: brush_translate_anchor.y - y(unit)}"}]},{"name":"brush_zoom_anchor","on":[{"events":[{"source":"scope","type":"wheel","consume":true,"markname":"brush_brush"}],"update":"{x: x(unit), y: y(unit)}"}]},{"name":"brush_zoom_delta","on":[{"events":[{"source":"scope","type":"wheel","consume":true,"markname":"brush_brush"}],"force":true,"update":"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]},{"name":"brush_modify","on":[{"events":{"signal":"brush_tuple"},"update":"modify(\"brush_store\", brush_tuple, true)"}]}],"marks":[{"name":"brush_brush_bg","type":"rect","clip":true,"encode":{"enter":{"fill":{"value":"#333"},"fillOpacity":{"value":0.125}},"update":{"x":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","signal":"brush_x[0]"},{"value":0}],"y":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","value":0},{"value":0}],"x2":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","signal":"brush_x[1]"},{"value":0}],"y2":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","field":{"group":"height"}},{"value":0}]}}},{"name":"concat_0_marks","type":"symbol","style":["point"],"interactive":true,"from":{"data":"data_0"},"encode":{"update":{"opacity":{"value":0.7},"fill":{"value":"transparent"},"stroke":[{"test":"!length(data(\"brush_store\")) || vlSelectionTest(\"brush_store\", datum)","scale":"color","field":"weather"},{"value":"lightgray"}],"ariaRoleDescription":{"value":"point"},"description":{"signal":"\"Date: \" + (timeFormat(datum[\"monthdate_date\"], '%b')) + \"; Maximum Daily Temperature (C): \" + (format(datum[\"temp_max\"], \"\")) + \"; Weather: \" + (isValid(datum[\"weather\"]) ? datum[\"weather\"] : \"\"+datum[\"weather\"]) + \"; Precipitation: \" + (format(datum[\"precipitation\"], \"\"))"},"x":{"scale":"concat_0_x","field":"monthdate_date"},"y":{"scale":"concat_0_y","field":"temp_max"},"size":{"scale":"size","field":"precipitation"}}}},{"name":"brush_brush","type":"rect","clip":true,"encode":{"enter":{"fill":{"value":"transparent"}},"update":{"x":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","signal":"brush_x[0]"},{"value":0}],"y":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","value":0},{"value":0}],"x2":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","signal":"brush_x[1]"},{"value":0}],"y2":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","field":{"group":"height"}},{"value":0}],"stroke":[{"test":"brush_x[0] !== brush_x[1]","value":"white"},{"value":null}]}}}],"axes":[{"scale":"concat_0_x","orient":"bottom","gridScale":"concat_0_y","grid":true,"tickCount":{"signal":"ceil(width/40)"},"tickMinStep":{"signal":"datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)"},"domain":false,"labels":false,"aria":false,"maxExtent":0,"minExtent":0,"ticks":false,"zindex":0},{"scale":"concat_0_y","orient":"left","gridScale":"concat_0_x","grid":true,"tickCount":{"signal":"ceil(concat_0_height/40)"},"domain":false,"labels":false,"aria":false,"maxExtent":0,"minExtent":0,"ticks":false,"zindex":0},{"scale":"concat_0_x","orient":"bottom","grid":false,"title":"Date","format":"%b","labelFlush":true,"labelOverlap":true,"tickCount":{"signal":"ceil(width/40)"},"tickMinStep":{"signal":"datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)"},"zindex":0},{"scale":"concat_0_y","orient":"left","grid":false,"title":"Maximum Daily Temperature (C)","labelOverlap":true,"tickCount":{"signal":"ceil(concat_0_height/40)"},"zindex":0}]},{"type":"group","name":"concat_1_group","style":"cell","encode":{"update":{"width":{"signal":"width"},"height":{"signal":"concat_1_height"}}},"signals":[{"name":"click_tuple","on":[{"events":[{"source":"scope","type":"click"}],"update":"datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0 ? {unit: \"concat_1\", fields: click_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)[\"weather\"]]} : null","force":true},{"events":[{"source":"view","type":"dblclick"}],"update":"null"}]},{"name":"click_tuple_fields","value":[{"field":"weather","channel":"color","type":"E"}]},{"name":"click_toggle","value":false,"on":[{"events":[{"source":"scope","type":"click"}],"update":"event.shiftKey"},{"events":[{"source":"view","type":"dblclick"}],"update":"false"}]},{"name":"click_modify","on":[{"events":{"signal":"click_tuple"},"update":"modify(\"click_store\", click_toggle ? null : click_tuple, click_toggle ? null : true, click_toggle ? click_tuple : null)"}]}],"marks":[{"name":"concat_1_marks","type":"rect","style":["bar"],"interactive":true,"from":{"data":"data_1"},"encode":{"update":{"fill":[{"test":"!length(data(\"click_store\")) || vlSelectionTest(\"click_store\", datum)","scale":"color","field":"weather"},{"value":"lightgray"}],"ariaRoleDescription":{"value":"bar"},"description":{"signal":"\"Count of Records: \" + (format(datum[\"__count\"], \"\")) + \"; Weather: \" + (isValid(datum[\"weather\"]) ? datum[\"weather\"] : \"\"+datum[\"weather\"]) + \"; weather: \" + (isValid(datum[\"weather\"]) ? datum[\"weather\"] : \"\"+datum[\"weather\"])"},"x":{"scale":"concat_1_x","field":"__count"},"x2":{"scale":"concat_1_x","value":0},"y":{"scale":"concat_1_y","field":"weather"},"height":{"signal":"max(0.25, bandwidth('concat_1_y'))"}}}}],"axes":[{"scale":"concat_1_x","orient":"bottom","gridScale":"concat_1_y","grid":true,"tickCount":{"signal":"ceil(width/40)"},"domain":false,"labels":false,"aria":false,"maxExtent":0,"minExtent":0,"ticks":false,"zindex":0},{"scale":"concat_1_x","orient":"bottom","grid":false,"title":"Count of Records","labelFlush":true,"labelOverlap":true,"tickCount":{"signal":"ceil(width/40)"},"zindex":0},{"scale":"concat_1_y","orient":"left","grid":false,"title":"Weather","zindex":0}]}],"scales":[{"name":"color","type":"ordinal","domain":["sun","fog","drizzle","rain","snow"],"range":["#e7ba52","#a7a7a7","#aec7e8","#1f77b4","#9467bd"]},{"name":"size","type":"linear","domain":[-1,50],"range":[0,361],"zero":true},{"name":"concat_0_x","type":"time","domain":{"data":"data_0","field":"monthdate_date"},"range":[0,{"signal":"width"}]},{"name":"concat_0_y","type":"linear","domain":[-5,40],"range":[{"signal":"concat_0_height"},0],"zero":true},{"name":"concat_1_x","type":"linear","domain":{"data":"data_1","field":"__count"},"range":[0,{"signal":"width"}],"nice":true,"zero":true},{"name":"concat_1_y","type":"band","domain":{"data":"data_1","field":"weather","sort":true},"range":{"step":{"signal":"concat_1_y_step"}},"paddingInner":0.1,"paddingOuter":0.05}],"legends":[{"title":"Weather","stroke":"color","symbolType":"circle","encode":{"symbols":{"update":{"opacity":{"value":0.7}}}},"fill":"color"},{"title":"Precipitation","size":"size","symbolType":"circle","encode":{"symbols":{"update":{"fill":{"value":"transparent"},"stroke":{"value":"lightgray"},"opacity":{"value":0.7}}}}}]} \ No newline at end of file diff --git a/vl-convert-rs/tests/vl-specs/expected/v5_12/circle_binned.vg.json b/vl-convert-rs/tests/vl-specs/expected/v5_20/circle_binned.vg.json similarity index 98% rename from vl-convert-rs/tests/vl-specs/expected/v5_12/circle_binned.vg.json rename to vl-convert-rs/tests/vl-specs/expected/v5_20/circle_binned.vg.json index 16b33a5b..df19e41d 100644 --- a/vl-convert-rs/tests/vl-specs/expected/v5_12/circle_binned.vg.json +++ b/vl-convert-rs/tests/vl-specs/expected/v5_20/circle_binned.vg.json @@ -1 +1 @@ -{"$schema":"https://vega.github.io/schema/vega/v5.json","background":"white","padding":5,"width":200,"height":200,"style":"cell","data":[{"name":"source_0","url":"https://raw.githubusercontent.com/vega/vega-datasets/next/data/movies.json","format":{"type":"json"},"transform":[{"type":"extent","field":"IMDB Rating","signal":"bin_maxbins_10_IMDB_Rating_extent"},{"type":"bin","field":"IMDB Rating","as":["bin_maxbins_10_IMDB Rating","bin_maxbins_10_IMDB Rating_end"],"signal":"bin_maxbins_10_IMDB_Rating_bins","extent":{"signal":"bin_maxbins_10_IMDB_Rating_extent"},"maxbins":10},{"type":"extent","field":"Rotten Tomatoes Rating","signal":"bin_maxbins_10_Rotten_Tomatoes_Rating_extent"},{"type":"bin","field":"Rotten Tomatoes Rating","as":["bin_maxbins_10_Rotten Tomatoes Rating","bin_maxbins_10_Rotten Tomatoes Rating_end"],"signal":"bin_maxbins_10_Rotten_Tomatoes_Rating_bins","extent":{"signal":"bin_maxbins_10_Rotten_Tomatoes_Rating_extent"},"maxbins":10},{"type":"aggregate","groupby":["bin_maxbins_10_IMDB Rating","bin_maxbins_10_IMDB Rating_end","bin_maxbins_10_Rotten Tomatoes Rating","bin_maxbins_10_Rotten Tomatoes Rating_end"],"ops":["count"],"fields":[null],"as":["__count"]},{"type":"filter","expr":"isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) && isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) && isValid(datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"]) && isFinite(+datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"])"}]}],"marks":[{"name":"marks","type":"symbol","style":["circle"],"from":{"data":"source_0"},"encode":{"update":{"fill":{"value":"#4c78a8"},"ariaRoleDescription":{"value":"circle"},"description":{"signal":"\"IMDB Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_IMDB Rating\"], \"\") + \" – \" + format(datum[\"bin_maxbins_10_IMDB Rating_end\"], \"\")) + \"; Rotten Tomatoes Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"], \"\") + \" – \" + format(datum[\"bin_maxbins_10_Rotten Tomatoes Rating_end\"], \"\")) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"},"x":{"signal":"scale(\"x\", 0.5 * datum[\"bin_maxbins_10_IMDB Rating\"] + 0.5 * datum[\"bin_maxbins_10_IMDB Rating_end\"])"},"y":{"signal":"scale(\"y\", 0.5 * datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"] + 0.5 * datum[\"bin_maxbins_10_Rotten Tomatoes Rating_end\"])"},"size":{"scale":"size","field":"__count"},"shape":{"value":"circle"}}}}],"scales":[{"name":"x","type":"linear","domain":{"signal":"[bin_maxbins_10_IMDB_Rating_bins.start, bin_maxbins_10_IMDB_Rating_bins.stop]"},"range":[0,{"signal":"width"}],"bins":{"signal":"bin_maxbins_10_IMDB_Rating_bins"},"zero":false},{"name":"y","type":"linear","domain":{"signal":"[bin_maxbins_10_Rotten_Tomatoes_Rating_bins.start, bin_maxbins_10_Rotten_Tomatoes_Rating_bins.stop]"},"range":[{"signal":"height"},0],"bins":{"signal":"bin_maxbins_10_Rotten_Tomatoes_Rating_bins"},"zero":false},{"name":"size","type":"linear","domain":{"data":"source_0","field":"__count"},"range":[0,{"signal":"pow(0.95 * min(width / ((bin_maxbins_10_IMDB_Rating_bins.stop - bin_maxbins_10_IMDB_Rating_bins.start) / bin_maxbins_10_IMDB_Rating_bins.step), height / ((bin_maxbins_10_Rotten_Tomatoes_Rating_bins.stop - bin_maxbins_10_Rotten_Tomatoes_Rating_bins.start) / bin_maxbins_10_Rotten_Tomatoes_Rating_bins.step)), 2)"}],"zero":true}],"axes":[{"scale":"x","orient":"bottom","grid":false,"title":"IMDB Rating (binned)","labelFlush":true,"labelOverlap":true,"tickCount":{"signal":"ceil(width/10)"},"zindex":0},{"scale":"y","orient":"left","grid":false,"title":"Rotten Tomatoes Rating (binned)","labelOverlap":true,"tickCount":{"signal":"ceil(height/10)"},"zindex":0}],"legends":[{"size":"size","symbolType":"circle","title":"Count of Records","encode":{"symbols":{"update":{"fill":{"value":"#4c78a8"},"stroke":{"value":"transparent"}}}}}]} \ No newline at end of file +{"$schema":"https://vega.github.io/schema/vega/v5.json","background":"white","padding":5,"width":200,"height":200,"style":"cell","data":[{"name":"source_0","url":"https://raw.githubusercontent.com/vega/vega-datasets/next/data/movies.json","format":{"type":"json"},"transform":[{"type":"extent","field":"IMDB Rating","signal":"bin_maxbins_10_IMDB_Rating_extent"},{"type":"bin","field":"IMDB Rating","as":["bin_maxbins_10_IMDB Rating","bin_maxbins_10_IMDB Rating_end"],"signal":"bin_maxbins_10_IMDB_Rating_bins","extent":{"signal":"bin_maxbins_10_IMDB_Rating_extent"},"maxbins":10},{"type":"extent","field":"Rotten Tomatoes Rating","signal":"bin_maxbins_10_Rotten_Tomatoes_Rating_extent"},{"type":"bin","field":"Rotten Tomatoes Rating","as":["bin_maxbins_10_Rotten Tomatoes Rating","bin_maxbins_10_Rotten Tomatoes Rating_end"],"signal":"bin_maxbins_10_Rotten_Tomatoes_Rating_bins","extent":{"signal":"bin_maxbins_10_Rotten_Tomatoes_Rating_extent"},"maxbins":10},{"type":"aggregate","groupby":["bin_maxbins_10_IMDB Rating","bin_maxbins_10_IMDB Rating_end","bin_maxbins_10_Rotten Tomatoes Rating","bin_maxbins_10_Rotten Tomatoes Rating_end"],"ops":["count"],"fields":[null],"as":["__count"]},{"type":"filter","expr":"isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) && isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) && isValid(datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"]) && isFinite(+datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"])"}]}],"marks":[{"name":"marks","type":"symbol","style":["circle"],"from":{"data":"source_0"},"encode":{"update":{"fill":{"value":"#4c78a8"},"ariaRoleDescription":{"value":"circle"},"description":{"signal":"\"IMDB Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_IMDB Rating\"], \"\") + \" – \" + format(datum[\"bin_maxbins_10_IMDB Rating_end\"], \"\")) + \"; Rotten Tomatoes Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"], \"\") + \" – \" + format(datum[\"bin_maxbins_10_Rotten Tomatoes Rating_end\"], \"\")) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"},"x":{"signal":"scale(\"x\", 0.5 * datum[\"bin_maxbins_10_IMDB Rating\"] + 0.5 * datum[\"bin_maxbins_10_IMDB Rating_end\"])"},"y":{"signal":"scale(\"y\", 0.5 * datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"] + 0.5 * datum[\"bin_maxbins_10_Rotten Tomatoes Rating_end\"])"},"size":{"scale":"size","field":"__count"},"shape":{"value":"circle"}}}}],"scales":[{"name":"x","type":"linear","domain":{"signal":"[bin_maxbins_10_IMDB_Rating_bins.start, bin_maxbins_10_IMDB_Rating_bins.stop]"},"range":[0,{"signal":"width"}],"bins":{"signal":"bin_maxbins_10_IMDB_Rating_bins"},"zero":false},{"name":"y","type":"linear","domain":{"signal":"[bin_maxbins_10_Rotten_Tomatoes_Rating_bins.start, bin_maxbins_10_Rotten_Tomatoes_Rating_bins.stop]"},"range":[{"signal":"height"},0],"bins":{"signal":"bin_maxbins_10_Rotten_Tomatoes_Rating_bins"},"zero":false},{"name":"size","type":"linear","domain":{"data":"source_0","field":"__count"},"range":[4,{"signal":"pow(0.95 * min(width / ((bin_maxbins_10_IMDB_Rating_bins.stop - bin_maxbins_10_IMDB_Rating_bins.start) / bin_maxbins_10_IMDB_Rating_bins.step), height / ((bin_maxbins_10_Rotten_Tomatoes_Rating_bins.stop - bin_maxbins_10_Rotten_Tomatoes_Rating_bins.start) / bin_maxbins_10_Rotten_Tomatoes_Rating_bins.step)), 2)"}],"zero":true}],"axes":[{"scale":"x","orient":"bottom","grid":false,"title":"IMDB Rating (binned)","labelFlush":true,"labelOverlap":true,"tickCount":{"signal":"ceil(width/10)"},"zindex":0},{"scale":"y","orient":"left","grid":false,"title":"Rotten Tomatoes Rating (binned)","labelOverlap":true,"tickCount":{"signal":"ceil(height/10)"},"zindex":0}],"legends":[{"size":"size","symbolType":"circle","title":"Count of Records","encode":{"symbols":{"update":{"fill":{"value":"#4c78a8"},"stroke":{"value":"transparent"}}}}}]} \ No newline at end of file diff --git a/vl-convert-rs/tests/vl-specs/expected/v5_12/circle_binned.vg.pretty.json b/vl-convert-rs/tests/vl-specs/expected/v5_20/circle_binned.vg.pretty.json similarity index 99% rename from vl-convert-rs/tests/vl-specs/expected/v5_12/circle_binned.vg.pretty.json rename to vl-convert-rs/tests/vl-specs/expected/v5_20/circle_binned.vg.pretty.json index 3f4af8ca..e4ca8e98 100644 --- a/vl-convert-rs/tests/vl-specs/expected/v5_12/circle_binned.vg.pretty.json +++ b/vl-convert-rs/tests/vl-specs/expected/v5_20/circle_binned.vg.pretty.json @@ -155,7 +155,7 @@ "field": "__count" }, "range": [ - 0, + 4, { "signal": "pow(0.95 * min(width / ((bin_maxbins_10_IMDB_Rating_bins.stop - bin_maxbins_10_IMDB_Rating_bins.start) / bin_maxbins_10_IMDB_Rating_bins.step), height / ((bin_maxbins_10_Rotten_Tomatoes_Rating_bins.stop - bin_maxbins_10_Rotten_Tomatoes_Rating_bins.start) / bin_maxbins_10_Rotten_Tomatoes_Rating_bins.step)), 2)" } diff --git a/vl-convert-rs/tests/vl-specs/expected/v5_20/seattle-weather.vg.json b/vl-convert-rs/tests/vl-specs/expected/v5_20/seattle-weather.vg.json new file mode 100644 index 00000000..aaf2fa38 --- /dev/null +++ b/vl-convert-rs/tests/vl-specs/expected/v5_20/seattle-weather.vg.json @@ -0,0 +1 @@ +{"$schema":"https://vega.github.io/schema/vega/v5.json","background":"white","padding":5,"width":600,"title":{"text":"Seattle Weather, 2012-2015","anchor":"start"},"data":[{"name":"brush_store"},{"name":"click_store"},{"name":"source_0","url":"https://raw.githubusercontent.com/vega/vega-datasets/next/data/seattle-weather.csv","format":{"type":"csv","parse":{"date":"date"}}},{"name":"data_0","source":"source_0","transform":[{"type":"filter","expr":"!length(data(\"click_store\")) || vlSelectionTest(\"click_store\", datum)"},{"field":"date","type":"timeunit","units":["month","date"],"as":["monthdate_date","monthdate_date_end"]},{"type":"filter","expr":"(isDate(datum[\"monthdate_date\"]) || (isValid(datum[\"monthdate_date\"]) && isFinite(+datum[\"monthdate_date\"]))) && isValid(datum[\"temp_max\"]) && isFinite(+datum[\"temp_max\"]) && isValid(datum[\"precipitation\"]) && isFinite(+datum[\"precipitation\"])"}]},{"name":"data_1","source":"source_0","transform":[{"field":"date","type":"timeunit","units":["month","date"],"as":["monthdate_date","monthdate_date_end"]},{"type":"filter","expr":"!length(data(\"brush_store\")) || vlSelectionTest(\"brush_store\", datum)"},{"type":"aggregate","groupby":["weather"],"ops":["count"],"fields":[null],"as":["__count"]}]}],"signals":[{"name":"concat_0_height","value":300},{"name":"concat_1_y_step","value":20},{"name":"concat_1_height","update":"bandspace(domain('concat_1_y').length, 0.1, 0.05) * concat_1_y_step"},{"name":"unit","value":{},"on":[{"events":"pointermove","update":"isTuple(group()) ? group() : unit"}]},{"name":"brush","update":"vlSelectionResolve(\"brush_store\", \"union\")"},{"name":"click","update":"vlSelectionResolve(\"click_store\", \"union\", true, true)"}],"layout":{"padding":20,"columns":1,"bounds":"full","align":"each"},"marks":[{"type":"group","name":"concat_0_group","style":"cell","encode":{"update":{"width":{"signal":"width"},"height":{"signal":"concat_0_height"}}},"signals":[{"name":"brush_x","value":[],"on":[{"events":{"source":"scope","type":"pointerdown","filter":["!event.item || event.item.mark.name !== \"brush_brush\""]},"update":"[x(unit), x(unit)]"},{"events":{"source":"window","type":"pointermove","consume":true,"between":[{"source":"scope","type":"pointerdown","filter":["!event.item || event.item.mark.name !== \"brush_brush\""]},{"source":"window","type":"pointerup"}]},"update":"[brush_x[0], clamp(x(unit), 0, width)]"},{"events":{"signal":"brush_scale_trigger"},"update":"[scale(\"concat_0_x\", brush_monthdate_date[0]), scale(\"concat_0_x\", brush_monthdate_date[1])]"},{"events":[{"source":"view","type":"dblclick"}],"update":"[0, 0]"},{"events":{"signal":"brush_translate_delta"},"update":"clampRange(panLinear(brush_translate_anchor.extent_x, brush_translate_delta.x / span(brush_translate_anchor.extent_x)), 0, width)"},{"events":{"signal":"brush_zoom_delta"},"update":"clampRange(zoomLinear(brush_x, brush_zoom_anchor.x, brush_zoom_delta), 0, width)"}]},{"name":"brush_monthdate_date","on":[{"events":{"signal":"brush_x"},"update":"brush_x[0] === brush_x[1] ? null : invert(\"concat_0_x\", brush_x)"}]},{"name":"brush_scale_trigger","value":{},"on":[{"events":[{"scale":"concat_0_x"}],"update":"(!isArray(brush_monthdate_date) || (+invert(\"concat_0_x\", brush_x)[0] === +brush_monthdate_date[0] && +invert(\"concat_0_x\", brush_x)[1] === +brush_monthdate_date[1])) ? brush_scale_trigger : {}"}]},{"name":"brush_tuple","on":[{"events":[{"signal":"brush_monthdate_date"}],"update":"brush_monthdate_date ? {unit: \"concat_0\", fields: brush_tuple_fields, values: [brush_monthdate_date]} : null"}]},{"name":"brush_tuple_fields","value":[{"field":"monthdate_date","channel":"x","type":"R"}]},{"name":"brush_translate_anchor","value":{},"on":[{"events":[{"source":"scope","type":"pointerdown","markname":"brush_brush"}],"update":"{x: x(unit), y: y(unit), extent_x: slice(brush_x)}"}]},{"name":"brush_translate_delta","value":{},"on":[{"events":[{"source":"window","type":"pointermove","consume":true,"between":[{"source":"scope","type":"pointerdown","markname":"brush_brush"},{"source":"window","type":"pointerup"}]}],"update":"{x: brush_translate_anchor.x - x(unit), y: brush_translate_anchor.y - y(unit)}"}]},{"name":"brush_zoom_anchor","on":[{"events":[{"source":"scope","type":"wheel","consume":true,"markname":"brush_brush"}],"update":"{x: x(unit), y: y(unit)}"}]},{"name":"brush_zoom_delta","on":[{"events":[{"source":"scope","type":"wheel","consume":true,"markname":"brush_brush"}],"force":true,"update":"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]},{"name":"brush_modify","on":[{"events":{"signal":"brush_tuple"},"update":"modify(\"brush_store\", brush_tuple, true)"}]}],"marks":[{"name":"brush_brush_bg","type":"rect","clip":true,"encode":{"enter":{"fill":{"value":"#333"},"fillOpacity":{"value":0.125}},"update":{"x":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","signal":"brush_x[0]"},{"value":0}],"y":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","value":0},{"value":0}],"x2":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","signal":"brush_x[1]"},{"value":0}],"y2":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","field":{"group":"height"}},{"value":0}]}}},{"name":"concat_0_marks","type":"symbol","style":["point"],"interactive":true,"from":{"data":"data_0"},"encode":{"update":{"opacity":{"value":0.7},"fill":{"value":"transparent"},"stroke":[{"test":"!length(data(\"brush_store\")) || vlSelectionTest(\"brush_store\", datum)","scale":"color","field":"weather"},{"value":"lightgray"}],"ariaRoleDescription":{"value":"point"},"description":{"signal":"\"Date: \" + (timeFormat(datum[\"monthdate_date\"], '%b')) + \"; Maximum Daily Temperature (C): \" + (format(datum[\"temp_max\"], \"\")) + \"; Weather: \" + (isValid(datum[\"weather\"]) ? datum[\"weather\"] : \"\"+datum[\"weather\"]) + \"; Precipitation: \" + (format(datum[\"precipitation\"], \"\"))"},"x":{"scale":"concat_0_x","field":"monthdate_date"},"y":{"scale":"concat_0_y","field":"temp_max"},"size":{"scale":"size","field":"precipitation"}}}},{"name":"brush_brush","type":"rect","clip":true,"encode":{"enter":{"cursor":{"value":"move"},"fill":{"value":"transparent"}},"update":{"x":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","signal":"brush_x[0]"},{"value":0}],"y":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","value":0},{"value":0}],"x2":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","signal":"brush_x[1]"},{"value":0}],"y2":[{"test":"data(\"brush_store\").length && data(\"brush_store\")[0].unit === \"concat_0\"","field":{"group":"height"}},{"value":0}],"stroke":[{"test":"brush_x[0] !== brush_x[1]","value":"white"},{"value":null}]}}}],"axes":[{"scale":"concat_0_x","orient":"bottom","gridScale":"concat_0_y","grid":true,"tickCount":{"signal":"ceil(width/40)"},"tickMinStep":{"signal":"datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)"},"domain":false,"labels":false,"aria":false,"maxExtent":0,"minExtent":0,"ticks":false,"zindex":0},{"scale":"concat_0_y","orient":"left","gridScale":"concat_0_x","grid":true,"tickCount":{"signal":"ceil(concat_0_height/40)"},"domain":false,"labels":false,"aria":false,"maxExtent":0,"minExtent":0,"ticks":false,"zindex":0},{"scale":"concat_0_x","orient":"bottom","grid":false,"title":"Date","format":"%b","labelFlush":true,"labelOverlap":true,"tickCount":{"signal":"ceil(width/40)"},"tickMinStep":{"signal":"datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)"},"zindex":0},{"scale":"concat_0_y","orient":"left","grid":false,"title":"Maximum Daily Temperature (C)","labelOverlap":true,"tickCount":{"signal":"ceil(concat_0_height/40)"},"zindex":0}]},{"type":"group","name":"concat_1_group","style":"cell","encode":{"update":{"width":{"signal":"width"},"height":{"signal":"concat_1_height"}}},"signals":[{"name":"click_tuple","on":[{"events":[{"source":"scope","type":"click"}],"update":"datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0 ? {unit: \"concat_1\", fields: click_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)[\"weather\"]]} : null","force":true},{"events":[{"source":"view","type":"dblclick"}],"update":"null"}]},{"name":"click_tuple_fields","value":[{"field":"weather","channel":"color","type":"E"}]},{"name":"click_toggle","value":false,"on":[{"events":[{"source":"scope","type":"click"}],"update":"event.shiftKey"},{"events":[{"source":"view","type":"dblclick"}],"update":"false"}]},{"name":"click_modify","on":[{"events":{"signal":"click_tuple"},"update":"modify(\"click_store\", click_toggle ? null : click_tuple, click_toggle ? null : true, click_toggle ? click_tuple : null)"}]}],"marks":[{"name":"concat_1_marks","type":"rect","style":["bar"],"interactive":true,"from":{"data":"data_1"},"encode":{"update":{"fill":[{"test":"!length(data(\"click_store\")) || vlSelectionTest(\"click_store\", datum)","scale":"color","field":"weather"},{"value":"lightgray"}],"ariaRoleDescription":{"value":"bar"},"description":{"signal":"\"Count of Records: \" + (format(datum[\"__count\"], \"\")) + \"; Weather: \" + (isValid(datum[\"weather\"]) ? datum[\"weather\"] : \"\"+datum[\"weather\"]) + \"; weather: \" + (isValid(datum[\"weather\"]) ? datum[\"weather\"] : \"\"+datum[\"weather\"])"},"x":{"scale":"concat_1_x","field":"__count"},"x2":{"scale":"concat_1_x","value":0},"y":{"scale":"concat_1_y","field":"weather"},"height":{"signal":"max(0.25, bandwidth('concat_1_y'))"}}}}],"axes":[{"scale":"concat_1_x","orient":"bottom","gridScale":"concat_1_y","grid":true,"tickCount":{"signal":"ceil(width/40)"},"domain":false,"labels":false,"aria":false,"maxExtent":0,"minExtent":0,"ticks":false,"zindex":0},{"scale":"concat_1_x","orient":"bottom","grid":false,"title":"Count of Records","labelFlush":true,"labelOverlap":true,"tickCount":{"signal":"ceil(width/40)"},"zindex":0},{"scale":"concat_1_y","orient":"left","grid":false,"title":"Weather","zindex":0}]}],"scales":[{"name":"color","type":"ordinal","domain":["sun","fog","drizzle","rain","snow"],"range":["#e7ba52","#a7a7a7","#aec7e8","#1f77b4","#9467bd"]},{"name":"size","type":"linear","domain":[-1,50],"range":[4,361],"zero":true},{"name":"concat_0_x","type":"time","domain":{"data":"data_0","field":"monthdate_date"},"range":[0,{"signal":"width"}]},{"name":"concat_0_y","type":"linear","domain":[-5,40],"range":[{"signal":"concat_0_height"},0],"zero":true},{"name":"concat_1_x","type":"linear","domain":{"data":"data_1","field":"__count"},"range":[0,{"signal":"width"}],"nice":true,"zero":true},{"name":"concat_1_y","type":"band","domain":{"data":"data_1","field":"weather","sort":true},"range":{"step":{"signal":"concat_1_y_step"}},"paddingInner":0.1,"paddingOuter":0.05}],"legends":[{"title":"Weather","stroke":"color","symbolType":"circle","encode":{"symbols":{"update":{"opacity":{"value":0.7}}}},"fill":"color"},{"title":"Precipitation","size":"size","symbolType":"circle","encode":{"symbols":{"update":{"fill":{"value":"transparent"},"stroke":{"value":"lightgray"},"opacity":{"value":0.7}}}}}]} \ No newline at end of file diff --git a/vl-convert-rs/tests/vl-specs/expected/v5_12/seattle-weather.vg.pretty.json b/vl-convert-rs/tests/vl-specs/expected/v5_20/seattle-weather.vg.pretty.json similarity index 97% rename from vl-convert-rs/tests/vl-specs/expected/v5_12/seattle-weather.vg.pretty.json rename to vl-convert-rs/tests/vl-specs/expected/v5_20/seattle-weather.vg.pretty.json index 00af74f0..3e00f2e5 100644 --- a/vl-convert-rs/tests/vl-specs/expected/v5_12/seattle-weather.vg.pretty.json +++ b/vl-convert-rs/tests/vl-specs/expected/v5_20/seattle-weather.vg.pretty.json @@ -106,7 +106,7 @@ "value": {}, "on": [ { - "events": "mousemove", + "events": "pointermove", "update": "isTuple(group()) ? group() : unit" } ] @@ -149,7 +149,7 @@ { "events": { "source": "scope", - "type": "mousedown", + "type": "pointerdown", "filter": [ "!event.item || event.item.mark.name !== \"brush_brush\"" ] @@ -159,19 +159,19 @@ { "events": { "source": "window", - "type": "mousemove", + "type": "pointermove", "consume": true, "between": [ { "source": "scope", - "type": "mousedown", + "type": "pointerdown", "filter": [ "!event.item || event.item.mark.name !== \"brush_brush\"" ] }, { "source": "window", - "type": "mouseup" + "type": "pointerup" } ] }, @@ -262,7 +262,7 @@ "events": [ { "source": "scope", - "type": "mousedown", + "type": "pointerdown", "markname": "brush_brush" } ], @@ -278,17 +278,17 @@ "events": [ { "source": "window", - "type": "mousemove", + "type": "pointermove", "consume": true, "between": [ { "source": "scope", - "type": "mousedown", + "type": "pointerdown", "markname": "brush_brush" }, { "source": "window", - "type": "mouseup" + "type": "pointerup" } ] } @@ -453,6 +453,9 @@ "clip": true, "encode": { "enter": { + "cursor": { + "value": "move" + }, "fill": { "value": "transparent" } @@ -773,7 +776,7 @@ 50 ], "range": [ - 0, + 4, 361 ], "zero": true diff --git a/vl-convert-rs/tests/vl-specs/expected/v5_12/stacked_bar_h.vg.json b/vl-convert-rs/tests/vl-specs/expected/v5_20/stacked_bar_h.vg.json similarity index 100% rename from vl-convert-rs/tests/vl-specs/expected/v5_12/stacked_bar_h.vg.json rename to vl-convert-rs/tests/vl-specs/expected/v5_20/stacked_bar_h.vg.json diff --git a/vl-convert-rs/tests/vl-specs/expected/v5_12/stacked_bar_h.vg.pretty.json b/vl-convert-rs/tests/vl-specs/expected/v5_20/stacked_bar_h.vg.pretty.json similarity index 100% rename from vl-convert-rs/tests/vl-specs/expected/v5_12/stacked_bar_h.vg.pretty.json rename to vl-convert-rs/tests/vl-specs/expected/v5_20/stacked_bar_h.vg.pretty.json diff --git a/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/dist=es2020,mode=imports,min/optimized/vega-embed.js b/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/dist=es2020,mode=imports,min/optimized/vega-embed.js deleted file mode 100644 index 060af5bc..00000000 --- a/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/dist=es2020,mode=imports,min/optimized/vega-embed.js +++ /dev/null @@ -1,124 +0,0 @@ -import{applyPatch as ct}from"/-/fast-json-patch@v3.1.1-IjacxII42OC4A6OXhkDe/dist=es2020,mode=imports,min/optimized/fast-json-patch.js";import Ie from"/-/json-stringify-pretty-compact@v3.0.0-RM0i5NMwoiFhg7YNuXef/dist=es2020,mode=imports,min/optimized/json-stringify-pretty-compact.js";import*as ut from"/-/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/dist=es2020,mode=imports,min/optimized/vega.js";import{isString as ue,mergeConfig as De,isBoolean as ht,isObject as ft,writeConfig as pt}from"/-/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/dist=es2020,mode=imports,min/optimized/vega.js";import{expressionInterpreter as dt}from"/-/vega-interpreter@v1.0.5-xGayK8haM1EVgaoW7oOi/dist=es2020,mode=imports,min/optimized/vega-interpreter.js";import*as mt from"/-/vega-lite@v5.18.0-FtLrd9Ks5cFttxoTAph7/dist=es2020,mode=imports,min/optimized/vega-lite.js";import Pe from"/-/vega-schema-url-parser@v2.2.0-YmXJGRcKOXOac3VG4xfw/dist=es2020,mode=imports,min/optimized/vega-schema-url-parser.js";import*as vt from"/-/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/dist=es2020,mode=imports,min/optimized/vega-themes.js";import{Handler as Et}from"/-/vega-tooltip@v0.34.0-YVV3uKnnOnCt2kW7Vclb/dist=es2020,mode=imports,min/optimized/vega-tooltip.js";function _e(){throw new Error("setTimeout has not been defined")}function Fe(){throw new Error("clearTimeout has not been defined")}var W=_e,q=Fe,Q;typeof window!="undefined"?Q=window:typeof self!="undefined"?Q=self:Q={},typeof Q.setTimeout=="function"&&(W=setTimeout),typeof Q.clearTimeout=="function"&&(q=clearTimeout);function je(t){if(W===setTimeout)return setTimeout(t,0);if((W===_e||!W)&&setTimeout)return W=setTimeout,setTimeout(t,0);try{return W(t,0)}catch(e){try{return W.call(null,t,0)}catch(r){return W.call(this,t,0)}}}function gt(t){if(q===clearTimeout)return clearTimeout(t);if((q===Fe||!q)&&clearTimeout)return q=clearTimeout,clearTimeout(t);try{return q(t)}catch(e){try{return q.call(null,t)}catch(r){return q.call(this,t)}}}var z=[],Z=!1,Y,he=-1;function $t(){if(!Z||!Y)return;Z=!1,Y.length?z=Y.concat(z):he=-1,z.length&&Ge()}function Ge(){if(Z)return;var t=je($t);Z=!0;for(var e=z.length;e;){for(Y=z,z=[];++he1)for(var r=1;r0)for(var r=0,i=arguments.length;r1)r=e;else if(this.head)i=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)r=t(r,i.value,n),i=i.next;return r},R.prototype.reduceReverse=function(t,e){var r,i=this.tail;if(arguments.length>1)r=e;else if(this.tail)i=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)r=t(r,i.value,n),i=i.prev;return r},R.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t},R.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t},R.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new R;if(ethis.length&&(e=this.length);for(var i=0,n=this.head;n!==null&&ithis.length&&(e=this.length);for(var i=this.length,n=this.tail;n!==null&&i>e;i--)n=n.prev;for(;n!==null&&i>t;i--,n=n.prev)r.push(n.value);return r},R.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,n=this.head;n!==null&&i1;class Jt{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[K]=e.max||Infinity;const r=e.length||be;if(this[te]=typeof r!="function"?be:r,this[oe]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[J]=e.maxAge||0,this[M]=e.dispose,this[Ve]=e.noDisposeOnSet||!1,this[ze]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[K]=e||Infinity,le(this)}get max(){return this[K]}set allowStale(e){this[oe]=!!e}get allowStale(){return this[oe]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[J]=e,le(this)}get maxAge(){return this[J]}set lengthCalculator(e){typeof e!="function"&&(e=be),e!==this[te]&&(this[te]=e,this[H]=0,this[C].forEach(r=>{r.length=this[te](r.value,r.key),this[H]+=r.length})),le(this)}get lengthCalculator(){return this[te]}get length(){return this[H]}get itemCount(){return this[C].length}rforEach(e,r){r=r||this;for(let i=this[C].tail;i!==null;){const n=i.prev;He(this,e,i,r),i=n}}forEach(e,r){r=r||this;for(let i=this[C].head;i!==null;){const n=i.next;He(this,e,i,r),i=n}}keys(){return this[C].toArray().map(e=>e.key)}values(){return this[C].toArray().map(e=>e.value)}reset(){this[M]&&this[C]&&this[C].length&&this[C].forEach(e=>this[M](e.key,e.value)),this[U]=new Map,this[C]=new Kt,this[H]=0}dump(){return this[C].map(e=>pe(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[C]}set(e,r,i){if(i=i||this[J],i&&typeof i!="number")throw new TypeError("maxAge must be a number");const n=i?Date.now():0,a=this[te](r,e);if(this[U].has(e)){if(a>this[K])return re(this,this[U].get(e)),!1;const y=this[U].get(e),s=y.value;return this[M]&&(this[Ve]||this[M](e,s.value)),s.now=n,s.maxAge=i,s.value=r,this[H]+=a-s.length,s.length=a,this.get(e),le(this),!0}const I=new Qt(e,r,a,n,i);return I.length>this[K]?(this[M]&&this[M](e,r),!1):(this[H]+=I.length,this[C].unshift(I),this[U].set(e,this[C].head),le(this),!0)}has(e){if(!this[U].has(e))return!1;const r=this[U].get(e).value;return!pe(this,r)}get(e){return Ne(this,e,!0)}peek(e){return Ne(this,e,!1)}pop(){const e=this[C].tail;return e?(re(this,e),e.value):null}del(e){re(this,this[U].get(e))}load(e){this.reset();const r=Date.now();for(let i=e.length-1;i>=0;i--){const n=e[i],a=n.e||0;if(a===0)this.set(n.k,n.v);else{const I=a-r;I>0&&this.set(n.k,n.v,I)}}}prune(){this[U].forEach((e,r)=>Ne(this,r,!1))}}const Ne=(t,e,r)=>{const i=t[U].get(e);if(i){const n=i.value;if(pe(t,n)){if(re(t,i),!t[oe])return}else r&&(t[ze]&&(i.value.now=Date.now()),t[C].unshiftNode(i));return n.value}},pe=(t,e)=>{if(!e||!e.maxAge&&!t[J])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[J]&&r>t[J]},le=t=>{if(t[H]>t[K])for(let e=t[C].tail;t[H]>t[K]&&e!==null;){const r=e.prev;re(t,e),e=r}},re=(t,e)=>{if(e){const r=e.value;t[M]&&t[M](r.key,r.value),t[H]-=r.length,t[U].delete(r.key),t[C].removeNode(e)}};class Qt{constructor(e,r,i,n,a){this.key=e,this.value=r,this.length=i,this.now=n,this.maxAge=a||0}}const He=(t,e,r,i)=>{let n=r.value;pe(t,n)&&(re(t,r),t[oe]||(n=void 0)),n&&e.call(i,n.value,n.key,t)};var Zt=Jt;const er=Object.freeze({loose:!0}),tr=Object.freeze({}),rr=t=>t?typeof t!="object"?er:t:tr;var Oe=rr,Te={exports:{}};const ir="2.0.0",Me=256,nr=Number.MAX_SAFE_INTEGER||9007199254740991,sr=16,ar=Me-6,or=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Ae={MAX_LENGTH:Me,MAX_SAFE_COMPONENT_LENGTH:sr,MAX_SAFE_BUILD_LENGTH:ar,MAX_SAFE_INTEGER:nr,RELEASE_TYPES:or,SEMVER_SPEC_VERSION:ir,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const lr=typeof fe=="object"&&fe.env&&fe.env.NODE_DEBUG&&/\bsemver\b/i.test(fe.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var de=lr;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:n}=Ae,a=de;e=t.exports={};const I=e.re=[],y=e.safeRe=[],s=e.src=[],o=e.t={};let h=0;const $="[a-zA-Z0-9-]",w=[["\\s",1],["\\d",n],[$,i]],_=G=>{for(const[D,x]of w)G=G.split(`${D}*`).join(`${D}{0,${x}}`).split(`${D}+`).join(`${D}{1,${x}}`);return G},f=(G,D,x)=>{const O=_(D),F=h++;a(G,F,D),o[G]=F,s[F]=D,I[F]=new RegExp(D,x?"g":void 0),y[F]=new RegExp(O,x?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${$}*`),f("MAINVERSION",`(${s[o.NUMERICIDENTIFIER]})\\.(${s[o.NUMERICIDENTIFIER]})\\.(${s[o.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${s[o.NUMERICIDENTIFIERLOOSE]})\\.(${s[o.NUMERICIDENTIFIERLOOSE]})\\.(${s[o.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${s[o.NUMERICIDENTIFIER]}|${s[o.NONNUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${s[o.NUMERICIDENTIFIERLOOSE]}|${s[o.NONNUMERICIDENTIFIER]})`),f("PRERELEASE",`(?:-(${s[o.PRERELEASEIDENTIFIER]}(?:\\.${s[o.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${s[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[o.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${$}+`),f("BUILD",`(?:\\+(${s[o.BUILDIDENTIFIER]}(?:\\.${s[o.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${s[o.MAINVERSION]}${s[o.PRERELEASE]}?${s[o.BUILD]}?`),f("FULL",`^${s[o.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${s[o.MAINVERSIONLOOSE]}${s[o.PRERELEASELOOSE]}?${s[o.BUILD]}?`),f("LOOSE",`^${s[o.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${s[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${s[o.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${s[o.XRANGEIDENTIFIER]})(?:\\.(${s[o.XRANGEIDENTIFIER]})(?:\\.(${s[o.XRANGEIDENTIFIER]})(?:${s[o.PRERELEASE]})?${s[o.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${s[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[o.XRANGEIDENTIFIERLOOSE]})(?:${s[o.PRERELEASELOOSE]})?${s[o.BUILD]}?)?)?`),f("XRANGE",`^${s[o.GTLT]}\\s*${s[o.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${s[o.GTLT]}\\s*${s[o.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),f("COERCE",`${s[o.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",s[o.COERCEPLAIN]+`(?:${s[o.PRERELEASE]})?(?:${s[o.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",s[o.COERCE],!0),f("COERCERTLFULL",s[o.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${s[o.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",f("TILDE",`^${s[o.LONETILDE]}${s[o.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${s[o.LONETILDE]}${s[o.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${s[o.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",f("CARET",`^${s[o.LONECARET]}${s[o.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${s[o.LONECARET]}${s[o.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${s[o.GTLT]}\\s*(${s[o.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${s[o.GTLT]}\\s*(${s[o.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${s[o.GTLT]}\\s*(${s[o.LOOSEPLAIN]}|${s[o.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${s[o.XRANGEPLAIN]})\\s+-\\s+(${s[o.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${s[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[o.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Te,Te.exports);var Se=Te.exports;const We=/^[0-9]+$/,qe=(t,e)=>{const r=We.test(t),i=We.test(e);return r&&i&&(t=+t,e=+e),t===e?0:r&&!i?-1:i&&!r?1:tqe(e,t);var ur={compareIdentifiers:qe,rcompareIdentifiers:cr};const me=de,{MAX_LENGTH:Ye,MAX_SAFE_INTEGER:ve}=Ae,{safeRe:Be,t:ke}=Se,hr=Oe,{compareIdentifiers:ie}=ur;let fr=class V{constructor(e,r){if(r=hr(r),e instanceof V){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Ye)throw new TypeError(`version is longer than ${Ye} characters`);me("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const i=e.trim().match(r.loose?Be[ke.LOOSE]:Be[ke.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>ve||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ve||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ve||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){const a=+n;if(a>=0&&a=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(r===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let a=[r,n];i===!1&&(a=[r]),ie(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var we=fr;const Ke=we,pr=(t,e,r)=>new Ke(t,r).compare(new Ke(e,r));var ne=pr;const dr=ne,mr=(t,e,r)=>dr(t,e,r)===0;var vr=mr;const Er=ne,gr=(t,e,r)=>Er(t,e,r)!==0;var $r=gr;const Rr=ne,yr=(t,e,r)=>Rr(t,e,r)>0;var Ir=yr;const Lr=ne,br=(t,e,r)=>Lr(t,e,r)>=0;var Nr=br;const Or=ne,Tr=(t,e,r)=>Or(t,e,r)<0;var Ar=Tr;const Sr=ne,wr=(t,e,r)=>Sr(t,e,r)<=0;var xr=wr;const Cr=vr,Dr=$r,Pr=Ir,_r=Nr,Fr=Ar,jr=xr,Gr=(t,e,r,i)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Cr(t,r,i);case"!=":return Dr(t,r,i);case">":return Pr(t,r,i);case">=":return _r(t,r,i);case"<":return Fr(t,r,i);case"<=":return jr(t,r,i);default:throw new TypeError(`Invalid operator: ${e}`)}};var Ur=Gr,xe,Je;function Xr(){if(Je)return xe;Je=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(h,$){if($=r($),h instanceof e){if(h.loose===!!$.loose)return h;h=h.value}h=h.trim().split(/\s+/).join(" "),I("comparator",h,$),this.options=$,this.loose=!!$.loose,this.parse(h),this.semver===t?this.value="":this.value=this.operator+this.semver.version,I("comp",this)}parse(h){const $=this.options.loose?i[n.COMPARATORLOOSE]:i[n.COMPARATOR],w=h.match($);if(!w)throw new TypeError(`Invalid comparator: ${h}`);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new y(w[2],this.options.loose):this.semver=t}toString(){return this.value}test(h){if(I("Comparator.test",h,this.options.loose),this.semver===t||h===t)return!0;if(typeof h=="string")try{h=new y(h,this.options)}catch($){return!1}return a(h,this.operator,this.semver,this.options)}intersects(h,$){if(!(h instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new s(h.value,$).test(this.value):h.operator===""?h.value===""?!0:new s(this.value,$).test(h.semver):($=r($),$.includePrerelease&&(this.value==="<0.0.0-0"||h.value==="<0.0.0-0")||!$.includePrerelease&&(this.value.startsWith("<0.0.0")||h.value.startsWith("<0.0.0"))?!1:this.operator.startsWith(">")&&h.operator.startsWith(">")||(this.operator.startsWith("<")&&h.operator.startsWith("<")||(this.semver.version===h.semver.version&&this.operator.includes("=")&&h.operator.includes("=")||a(this.semver,"<",h.semver,$)&&this.operator.startsWith(">")&&h.operator.startsWith("<")))?!0:!!(a(this.semver,">",h.semver,$)&&this.operator.startsWith("<")&&h.operator.startsWith(">")))}}xe=e;const r=Oe,{safeRe:i,t:n}=Se,a=Ur,I=de,y=we,s=Ze();return xe}var Ce,Qe;function Ze(){if(Qe)return Ce;Qe=1;class t{constructor(l,m){if(m=i(m),l instanceof t)return l.loose===!!m.loose&&l.includePrerelease===!!m.includePrerelease?l:new t(l.raw,m);if(l instanceof n)return this.raw=l.value,this.set=[[l]],this.format(),this;if(this.options=m,this.loose=!!m.loose,this.includePrerelease=!!m.includePrerelease,this.raw=l.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(p=>this.parseRange(p.trim())).filter(p=>p.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const p=this.set[0];if(this.set=this.set.filter(d=>!f(d[0])),this.set.length===0)this.set=[p];else if(this.set.length>1){for(const d of this.set)if(d.length===1&&G(d[0])){this.set=[d];break}}}this.format()}format(){return this.range=this.set.map(l=>l.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(l){const m=(this.options.includePrerelease&&w)|(this.options.loose&&_),p=m+":"+l,d=r.get(p);if(d)return d;const u=this.options.loose,v=u?y[s.HYPHENRANGELOOSE]:y[s.HYPHENRANGE];l=l.replace(v,Re(this.options.includePrerelease)),a("hyphen replace",l),l=l.replace(y[s.COMPARATORTRIM],o),a("comparator trim",l),l=l.replace(y[s.TILDETRIM],h),a("tilde trim",l),l=l.replace(y[s.CARETTRIM],$),a("caret trim",l);let L=l.split(" ").map(S=>x(S,this.options)).join(" ").split(/\s+/).map(S=>$e(S,this.options));u&&(L=L.filter(S=>(a("loose invalid filter",S,this.options),!!S.match(y[s.COMPARATORLOOSE])))),a("range list",L);const E=new Map,T=L.map(S=>new n(S,this.options));for(const S of T){if(f(S))return[S];E.set(S.value,S)}E.size>1&&E.has("")&&E.delete("");const P=[...E.values()];return r.set(p,P),P}intersects(l,m){if(!(l instanceof t))throw new TypeError("a Range is required");return this.set.some(p=>D(p,m)&&l.set.some(d=>D(d,m)&&p.every(u=>d.every(v=>u.intersects(v,m)))))}test(l){if(!l)return!1;if(typeof l=="string")try{l=new I(l,this.options)}catch(m){return!1}for(let m=0;mc.value==="<0.0.0-0",G=c=>c.value==="",D=(c,l)=>{let m=!0;const p=c.slice();let d=p.pop();for(;m&&p.length;)m=p.every(u=>d.intersects(u,l)),d=p.pop();return m},x=(c,l)=>(a("comp",c,l),c=b(c,l),a("caret",c),c=F(c,l),a("tildes",c),c=g(c,l),a("xrange",c),c=j(c,l),a("stars",c),c),O=c=>!c||c.toLowerCase()==="x"||c==="*",F=(c,l)=>c.trim().split(/\s+/).map(m=>ge(m,l)).join(" "),ge=(c,l)=>{const m=l.loose?y[s.TILDELOOSE]:y[s.TILDE];return c.replace(m,(p,d,u,v,L)=>{a("tilde",c,p,d,u,v,L);let E;return O(d)?E="":O(u)?E=`>=${d}.0.0 <${+d+1}.0.0-0`:O(v)?E=`>=${d}.${u}.0 <${d}.${+u+1}.0-0`:L?(a("replaceTilde pr",L),E=`>=${d}.${u}.${v}-${L} <${d}.${+u+1}.0-0`):E=`>=${d}.${u}.${v} <${d}.${+u+1}.0-0`,a("tilde return",E),E})},b=(c,l)=>c.trim().split(/\s+/).map(m=>N(m,l)).join(" "),N=(c,l)=>{a("caret",c,l);const m=l.loose?y[s.CARETLOOSE]:y[s.CARET],p=l.includePrerelease?"-0":"";return c.replace(m,(d,u,v,L,E)=>{a("caret",c,d,u,v,L,E);let T;return O(u)?T="":O(v)?T=`>=${u}.0.0${p} <${+u+1}.0.0-0`:O(L)?u==="0"?T=`>=${u}.${v}.0${p} <${u}.${+v+1}.0-0`:T=`>=${u}.${v}.0${p} <${+u+1}.0.0-0`:E?(a("replaceCaret pr",E),u==="0"?v==="0"?T=`>=${u}.${v}.${L}-${E} <${u}.${v}.${+L+1}-0`:T=`>=${u}.${v}.${L}-${E} <${u}.${+v+1}.0-0`:T=`>=${u}.${v}.${L}-${E} <${+u+1}.0.0-0`):(a("no pr"),u==="0"?v==="0"?T=`>=${u}.${v}.${L}${p} <${u}.${v}.${+L+1}-0`:T=`>=${u}.${v}.${L}${p} <${u}.${+v+1}.0-0`:T=`>=${u}.${v}.${L} <${+u+1}.0.0-0`),a("caret return",T),T})},g=(c,l)=>(a("replaceXRanges",c,l),c.split(/\s+/).map(m=>A(m,l)).join(" ")),A=(c,l)=>{c=c.trim();const m=l.loose?y[s.XRANGELOOSE]:y[s.XRANGE];return c.replace(m,(p,d,u,v,L,E)=>{a("xRange",c,p,d,u,v,L,E);const T=O(u),P=T||O(v),S=P||O(L),ae=S;return d==="="&&ae&&(d=""),E=l.includePrerelease?"-0":"",T?d===">"||d==="<"?p="<0.0.0-0":p="*":d&&ae?(P&&(v=0),L=0,d===">"?(d=">=",P?(u=+u+1,v=0,L=0):(v=+v+1,L=0)):d==="<="&&(d="<",P?u=+u+1:v=+v+1),d==="<"&&(E="-0"),p=`${d+u}.${v}.${L}${E}`):P?p=`>=${u}.0.0${E} <${+u+1}.0.0-0`:S&&(p=`>=${u}.${v}.0${E} <${u}.${+v+1}.0-0`),a("xRange return",p),p})},j=(c,l)=>(a("replaceStars",c,l),c.trim().replace(y[s.STAR],"")),$e=(c,l)=>(a("replaceGTE0",c,l),c.trim().replace(y[l.includePrerelease?s.GTE0PRE:s.GTE0],"")),Re=c=>(l,m,p,d,u,v,L,E,T,P,S,ae,bi)=>(O(p)?m="":O(d)?m=`>=${p}.0.0${c?"-0":""}`:O(u)?m=`>=${p}.${d}.0${c?"-0":""}`:v?m=`>=${m}`:m=`>=${m}${c?"-0":""}`,O(T)?E="":O(P)?E=`<${+T+1}.0.0-0`:O(S)?E=`<${T}.${+P+1}.0-0`:ae?E=`<=${T}.${P}.${S}-${ae}`:c?E=`<${T}.${P}.${+S+1}-0`:E=`<=${E}`,`${m} ${E}`.trim()),ye=(c,l,m)=>{for(let p=0;p0){const d=c[p].semver;if(d.major===l.major&&d.minor===l.minor&&d.patch===l.patch)return!0}}return!1}return!0};return Ce}const Vr=Ze(),zr=(t,e,r)=>{try{e=new Vr(e,r)}catch(i){return!1}return e.test(t)};var Hr=zr,et=Mt(Hr);function Mr(t,e,r){const i=t.open(e),n=1e4,a=250,{origin:I}=new URL(e);let y=~~(n/a);function s(h){h.source===i&&(y=0,t.removeEventListener("message",s,!1))}t.addEventListener("message",s,!1);function o(){if(y<=0)return;i.postMessage(r,I),setTimeout(o,a),y-=1}setTimeout(o,a)}var Wr=`.vega-embed { - position: relative; - display: inline-block; - box-sizing: border-box; -} -.vega-embed.has-actions { - padding-right: 38px; -} -.vega-embed details:not([open]) > :not(summary) { - display: none !important; -} -.vega-embed summary { - list-style: none; - position: absolute; - top: 0; - right: 0; - padding: 6px; - z-index: 1000; - background: white; - box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); - color: #1b1e23; - border: 1px solid #aaa; - border-radius: 999px; - opacity: 0.2; - transition: opacity 0.4s ease-in; - cursor: pointer; - line-height: 0px; -} -.vega-embed summary::-webkit-details-marker { - display: none; -} -.vega-embed summary:active { - box-shadow: #aaa 0px 0px 0px 1px inset; -} -.vega-embed summary svg { - width: 14px; - height: 14px; -} -.vega-embed details[open] summary { - opacity: 0.7; -} -.vega-embed:hover summary, .vega-embed:focus-within summary { - opacity: 1 !important; - transition: opacity 0.2s ease; -} -.vega-embed .vega-actions { - position: absolute; - z-index: 1001; - top: 35px; - right: -9px; - display: flex; - flex-direction: column; - padding-bottom: 8px; - padding-top: 8px; - border-radius: 4px; - box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2); - border: 1px solid #d9d9d9; - background: white; - animation-duration: 0.15s; - animation-name: scale-in; - animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5); - text-align: left; -} -.vega-embed .vega-actions a { - padding: 8px 16px; - font-family: sans-serif; - font-size: 14px; - font-weight: 600; - white-space: nowrap; - color: #434a56; - text-decoration: none; -} -.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus { - background-color: #f7f7f9; - color: black; -} -.vega-embed .vega-actions::before, .vega-embed .vega-actions::after { - content: ""; - display: inline-block; - position: absolute; -} -.vega-embed .vega-actions::before { - left: auto; - right: 14px; - top: -16px; - border: 8px solid rgba(0, 0, 0, 0); - border-bottom-color: #d9d9d9; -} -.vega-embed .vega-actions::after { - left: auto; - right: 15px; - top: -14px; - border: 7px solid rgba(0, 0, 0, 0); - border-bottom-color: #fff; -} -.vega-embed .chart-wrapper.fit-x { - width: 100%; -} -.vega-embed .chart-wrapper.fit-y { - height: 100%; -} - -.vega-embed-wrapper { - max-width: 100%; - overflow: auto; - padding-right: 14px; -} - -@keyframes scale-in { - from { - opacity: 0; - transform: scale(0.6); - } - to { - opacity: 1; - transform: scale(1); - } -} -`;function tt(t,...e){for(const r of e)qr(t,r);return t}function qr(t,e){for(const r of Object.keys(e))pt(t,r,e[r],!0)}var Yr="vega-embed",Br="6.25.0",kr="Publish Vega visualizations as embedded web components.",Kr=["vega","data","visualization","component","embed"],Jr={type:"git",url:"http://github.com/vega/vega-embed.git"},Qr={name:"UW Interactive Data Lab",url:"http://idl.cs.washington.edu"},Zr=[{name:"Dominik Moritz",url:"https://www.domoritz.de"}],ei={url:"https://github.com/vega/vega-embed/issues"},ti="https://github.com/vega/vega-embed#readme",ri="BSD-3-Clause",ii="build/vega-embed.js",ni="build/vega-embed.module.js",si="build/vega-embed.min.js",ai="build/vega-embed.min.js",oi="build/vega-embed.module.d.ts",li=["src","build"],ci={"@babel/core":"^7.24.4","@babel/plugin-transform-runtime":"^7.24.3","@babel/preset-env":"^7.24.4","@babel/preset-typescript":"^7.24.1","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-commonjs":"25.0.7","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@types/jest":"^29.5.12","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.6.0","@typescript-eslint/parser":"^7.6.0","browser-sync":"^3.0.2",concurrently:"^8.2.2","del-cli":"^5.1.0",eslint:"^8.56.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^28.2.0","eslint-plugin-prettier":"^5.1.3",jest:"^29.7.0","jest-canvas-mock":"^2.5.2","jest-environment-jsdom":"^29.7.0","postinstall-postinstall":"^2.1.0",prettier:"^3.2.5","release-it":"^17.1.1",rollup:"4.14.1","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.4.5",sass:"^1.74.1",typescript:"^5.4.5",vega:"^5.22.1","vega-lite":"^5.2.0"},ui={vega:"^5.21.0","vega-lite":"*"},hi={"fast-json-patch":"^3.1.1","json-stringify-pretty-compact":"^3.0.0",semver:"^7.6.0",tslib:"^2.6.2","vega-interpreter":"^1.0.5","vega-schema-url-parser":"^2.2.0","vega-themes":"^2.14.0","vega-tooltip":"^0.34.0"},fi={prebuild:"yarn clean && yarn build:style",build:"rollup -c","build:style":"./build-style.sh",clean:"del-cli build src/style.ts",prepublishOnly:"yarn clean && yarn build",preversion:"yarn lint && yarn test",serve:"browser-sync start --directory -s -f build *.html",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",pretest:"yarn build:style",test:"jest","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand",prettierbase:"prettier '*.{css,scss,html}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",release:"release-it"},pi={name:Yr,version:Br,description:kr,keywords:Kr,repository:Jr,author:Qr,contributors:Zr,bugs:ei,homepage:ti,license:ri,main:ii,module:ni,unpkg:si,jsdelivr:ai,types:oi,files:li,devDependencies:ci,peerDependencies:ui,dependencies:hi,scripts:fi};const di=pi.version,X=ut;let se=mt;const rt=typeof window!="undefined"?window:void 0;se===void 0&&rt?.vl?.compile&&(se=rt.vl);const it={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},mi={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},ce={vega:"Vega","vega-lite":"Vega-Lite"},Ee={vega:X.version,"vega-lite":se?se.version:"not available"},vi={vega:t=>t,"vega-lite":(t,e)=>se.compile(t,{config:e}).spec},Ei=` - - - - -`,gi="chart-wrapper";function $i(t){return typeof t=="function"}function nt(t,e,r,i){const n=`${e}
`,a=`
${r}`,I=window.open("");I.document.write(n+t+a),I.document.title=`${ce[i]} JSON Source`}function st(t,e){if(t.$schema){const r=Pe(t.$schema);e&&e!==r.library&&console.warn(`The given visualization spec is written in ${ce[r.library]}, but mode argument sets ${ce[e]??e}.`);const i=r.library;return et(Ee[i],`^${r.version.slice(1)}`)||console.warn(`The input spec uses ${ce[i]} ${r.version}, but the current version of ${ce[i]} is v${Ee[i]}.`),i}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":e??"vega"}function at(t){return!!(t&&"load"in t)}function ot(t){return at(t)?t:X.loader(t)}function Ri(t){const e=t.usermeta?.embedOptions??{};return ue(e.defaultStyle)&&(e.defaultStyle=!1),e}async function yi(t,e,r={}){let i,n;ue(e)?(n=ot(r.loader),i=JSON.parse(await n.load(e))):i=e;const a=Ri(i),I=a.loader;(!n||I)&&(n=ot(r.loader??I));const y=await lt(a,n),s=await lt(r,n),o={...tt(s,y),config:De(s.config??{},y.config??{})};return await Li(t,i,o,n)}async function lt(t,e){const r=ue(t.config)?JSON.parse(await e.load(t.config)):t.config??{},i=ue(t.patch)?JSON.parse(await e.load(t.patch)):t.patch;return{...t,...i?{patch:i}:{},...r?{config:r}:{}}}function Ii(t){const e=t.getRootNode?t.getRootNode():document;return e instanceof ShadowRoot?{root:e,rootContainer:e}:{root:document,rootContainer:document.head??document.body}}async function Li(t,e,r={},i){const n=r.theme?De(vt[r.theme],r.config??{}):r.config,a=ht(r.actions)?r.actions:tt({},it,r.actions??{}),I={...mi,...r.i18n},y=r.renderer??"canvas",s=r.logLevel??X.Warn,o=r.downloadFileName??"visualization",h=typeof t=="string"?document.querySelector(t):t;if(!h)throw new Error(`${t} does not exist`);if(r.defaultStyle!==!1){const b="vega-embed-style",{root:N,rootContainer:g}=Ii(h);if(!N.getElementById(b)){const A=document.createElement("style");A.id=b,A.innerHTML=r.defaultStyle===void 0||r.defaultStyle===!0?Wr.toString():r.defaultStyle,g.appendChild(A)}}const $=st(e,r.mode);let w=vi[$](e,n);if($==="vega-lite"&&w.$schema){const b=Pe(w.$schema);et(Ee.vega,`^${b.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${b.version}, but current version is v${Ee.vega}.`)}h.classList.add("vega-embed"),a&&h.classList.add("has-actions"),h.innerHTML="";let _=h;if(a){const b=document.createElement("div");b.classList.add(gi),h.appendChild(b),_=b}const f=r.patch;if(f&&(w=f instanceof Function?f(w):ct(w,f,!0,!1).newDocument),r.formatLocale&&X.formatLocale(r.formatLocale),r.timeFormatLocale&&X.timeFormatLocale(r.timeFormatLocale),r.expressionFunctions)for(const b in r.expressionFunctions){const N=r.expressionFunctions[b];"fn"in N?X.expressionFunction(b,N.fn,N.visitor):N instanceof Function&&X.expressionFunction(b,N)}const{ast:G}=r,D=X.parse(w,$==="vega-lite"?{}:n,{ast:G}),x=new(r.viewClass||X.View)(D,{loader:i,logLevel:s,renderer:y,...G?{expr:X.expressionInterpreter??r.expr??dt}:{}});if(x.addSignalListener("autosize",(b,N)=>{const{type:g}=N;g=="fit-x"?(_.classList.add("fit-x"),_.classList.remove("fit-y")):g=="fit-y"?(_.classList.remove("fit-x"),_.classList.add("fit-y")):g=="fit"?_.classList.add("fit-x","fit-y"):_.classList.remove("fit-x","fit-y")}),r.tooltip!==!1){const{loader:b,tooltip:N}=r,g=b&&!at(b)?b?.baseURL:void 0,A=$i(N)?N:new Et({baseURL:g,...N===!0?{}:N}).call;x.tooltip(A)}let{hover:O}=r;if(O===void 0&&(O=$==="vega"),O){const{hoverSet:b,updateSet:N}=typeof O=="boolean"?{}:O;x.hover(b,N)}r&&(r.width!=null&&x.width(r.width),r.height!=null&&x.height(r.height),r.padding!=null&&x.padding(r.padding)),await x.initialize(_,r.bind).runAsync();let F;if(a!==!1){let b=h;if(r.defaultStyle!==!1||r.forceActionsMenu){const g=document.createElement("details");g.title=I.CLICK_TO_VIEW_ACTIONS,h.append(g),b=g;const A=document.createElement("summary");A.innerHTML=Ei,g.append(A),F=j=>{g.contains(j.target)||g.removeAttribute("open")},document.addEventListener("click",F)}const N=document.createElement("div");if(b.append(N),N.classList.add("vega-actions"),a===!0||a.export!==!1){for(const g of["svg","png"])if(a===!0||a.export===!0||a.export[g]){const A=I[`${g.toUpperCase()}_ACTION`],j=document.createElement("a"),$e=ft(r.scaleFactor)?r.scaleFactor[g]:r.scaleFactor;j.text=A,j.href="#",j.target="_blank",j.download=`${o}.${g}`,j.addEventListener("mousedown",async function(Re){Re.preventDefault();const ye=await x.toImageURL(g,$e);this.href=ye}),N.append(j)}}if(a===!0||a.source!==!1){const g=document.createElement("a");g.text=I.SOURCE_ACTION,g.href="#",g.addEventListener("click",function(A){nt(Ie(e),r.sourceHeader??"",r.sourceFooter??"",$),A.preventDefault()}),N.append(g)}if($==="vega-lite"&&(a===!0||a.compiled!==!1)){const g=document.createElement("a");g.text=I.COMPILED_ACTION,g.href="#",g.addEventListener("click",function(A){nt(Ie(w),r.sourceHeader??"",r.sourceFooter??"","vega"),A.preventDefault()}),N.append(g)}if(a===!0||a.editor!==!1){const g=r.editorUrl??"https://vega.github.io/editor/",A=document.createElement("a");A.text=I.EDITOR_ACTION,A.href="#",A.addEventListener("click",function(j){Mr(window,g,{config:n,mode:$,renderer:y,spec:Ie(e)}),j.preventDefault()}),N.append(A)}}function ge(){F&&document.removeEventListener("click",F),x.finalize()}return{view:x,spec:e,vgSpec:w,finalize:ge,embedOptions:r}}export default yi;export{it as DEFAULT_ACTIONS,st as guessMode,X as vega,se as vegaLite,di as version}; diff --git a/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/dist=es2020,mode=imports,min/optimized/vega-embed.js b/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/dist=es2020,mode=imports,min/optimized/vega-embed.js new file mode 100644 index 00000000..15f81500 --- /dev/null +++ b/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/dist=es2020,mode=imports,min/optimized/vega-embed.js @@ -0,0 +1,124 @@ +import{applyPatch as ze}from"/-/fast-json-patch@v3.1.1-IjacxII42OC4A6OXhkDe/dist=es2020,mode=imports,min/optimized/fast-json-patch.js";import ce from"/-/json-stringify-pretty-compact@v3.0.0-RM0i5NMwoiFhg7YNuXef/dist=es2020,mode=imports,min/optimized/json-stringify-pretty-compact.js";import*as He from"/-/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/dist=es2020,mode=imports,min/optimized/vega.js";import{isString as Z,mergeConfig as ve,isBoolean as Me,isObject as We,writeConfig as qe}from"/-/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/dist=es2020,mode=imports,min/optimized/vega.js";import{expressionInterpreter as Ye}from"/-/vega-interpreter@v1.0.5-xGayK8haM1EVgaoW7oOi/dist=es2020,mode=imports,min/optimized/vega-interpreter.js";import*as Be from"/-/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/dist=es2020,mode=imports,min/optimized/vega-lite.js";import ge from"/-/vega-schema-url-parser@v2.2.0-YmXJGRcKOXOac3VG4xfw/dist=es2020,mode=imports,min/optimized/vega-schema-url-parser.js";import*as Ke from"/-/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/dist=es2020,mode=imports,min/optimized/vega-themes.js";import{Handler as Je}from"/-/vega-tooltip@v0.34.0-YVV3uKnnOnCt2kW7Vclb/dist=es2020,mode=imports,min/optimized/vega-tooltip.js";function $e(){throw new Error("setTimeout has not been defined")}function Ie(){throw new Error("clearTimeout has not been defined")}var k=$e,X=Ie,H;typeof window!="undefined"?H=window:typeof self!="undefined"?H=self:H={},typeof H.setTimeout=="function"&&(k=setTimeout),typeof H.clearTimeout=="function"&&(X=clearTimeout);function Re(r){if(k===setTimeout)return setTimeout(r,0);if((k===$e||!k)&&setTimeout)return k=setTimeout,setTimeout(r,0);try{return k(r,0)}catch(t){try{return k.call(null,r,0)}catch(e){return k.call(this,r,0)}}}function Ze(r){if(X===clearTimeout)return clearTimeout(r);if((X===Ie||!X)&&clearTimeout)return X=clearTimeout,clearTimeout(r);try{return X(r)}catch(t){try{return X.call(null,r)}catch(e){return X.call(this,r)}}}var U=[],M=!1,V,Q=-1;function Qe(){if(!M||!V)return;M=!1,V.length?U=V.concat(U):Q=-1,U.length&&Le()}function Le(){if(M)return;var r=Re(Qe);M=!0;for(var t=U.length;t;){for(V=U,U=[];++Q1)for(var e=1;e=this.max){const h=this.map.keys().next().value;this.delete(h)}this.map.set(t,e)}return this}}var wt=Ot;const Tt=Object.freeze({loose:!0}),yt=Object.freeze({}),At=r=>r?typeof r!="object"?Tt:r:yt;var ue=At,de={exports:{}};const St="2.0.0",be=256,Ct=Number.MAX_SAFE_INTEGER||9007199254740991,xt=16,Dt=be-6,Pt=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var fe={MAX_LENGTH:be,MAX_SAFE_COMPONENT_LENGTH:xt,MAX_SAFE_BUILD_LENGTH:Dt,MAX_SAFE_INTEGER:Ct,RELEASE_TYPES:Pt,SEMVER_SPEC_VERSION:St,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Ft=typeof ee=="object"&&ee.env&&ee.env.NODE_DEBUG&&/\bsemver\b/i.test(ee.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};var te=Ft;(function(r,t){const{MAX_SAFE_COMPONENT_LENGTH:e,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:h}=fe,o=te;t=r.exports={};const w=t.re=[],I=t.safeRe=[],i=t.src=[],n=t.t={};let d=0;const $="[a-zA-Z0-9-]",A=[["\\s",1],["\\d",h],[$,s]],D=_=>{for(const[C,S]of A)_=_.split(`${C}*`).join(`${C}{0,${S}}`).split(`${C}+`).join(`${C}{1,${S}}`);return _},c=(_,C,S)=>{const b=D(C),P=d++;o(_,P,C),n[_]=P,i[P]=C,w[P]=new RegExp(C,S?"g":void 0),I[P]=new RegExp(b,S?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","\\d+"),c("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${$}*`),c("MAINVERSION",`(${i[n.NUMERICIDENTIFIER]})\\.(${i[n.NUMERICIDENTIFIER]})\\.(${i[n.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${i[n.NUMERICIDENTIFIERLOOSE]})\\.(${i[n.NUMERICIDENTIFIERLOOSE]})\\.(${i[n.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${i[n.NUMERICIDENTIFIER]}|${i[n.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${i[n.NUMERICIDENTIFIERLOOSE]}|${i[n.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${i[n.PRERELEASEIDENTIFIER]}(?:\\.${i[n.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${i[n.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[n.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER",`${$}+`),c("BUILD",`(?:\\+(${i[n.BUILDIDENTIFIER]}(?:\\.${i[n.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${i[n.MAINVERSION]}${i[n.PRERELEASE]}?${i[n.BUILD]}?`),c("FULL",`^${i[n.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${i[n.MAINVERSIONLOOSE]}${i[n.PRERELEASELOOSE]}?${i[n.BUILD]}?`),c("LOOSE",`^${i[n.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${i[n.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${i[n.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${i[n.XRANGEIDENTIFIER]})(?:\\.(${i[n.XRANGEIDENTIFIER]})(?:\\.(${i[n.XRANGEIDENTIFIER]})(?:${i[n.PRERELEASE]})?${i[n.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${i[n.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[n.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[n.XRANGEIDENTIFIERLOOSE]})(?:${i[n.PRERELEASELOOSE]})?${i[n.BUILD]}?)?)?`),c("XRANGE",`^${i[n.GTLT]}\\s*${i[n.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${i[n.GTLT]}\\s*${i[n.XRANGEPLAINLOOSE]}$`),c("COERCEPLAIN",`(^|[^\\d])(\\d{1,${e}})(?:\\.(\\d{1,${e}}))?(?:\\.(\\d{1,${e}}))?`),c("COERCE",`${i[n.COERCEPLAIN]}(?:$|[^\\d])`),c("COERCEFULL",i[n.COERCEPLAIN]+`(?:${i[n.PRERELEASE]})?(?:${i[n.BUILD]})?(?:$|[^\\d])`),c("COERCERTL",i[n.COERCE],!0),c("COERCERTLFULL",i[n.COERCEFULL],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${i[n.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",c("TILDE",`^${i[n.LONETILDE]}${i[n.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${i[n.LONETILDE]}${i[n.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${i[n.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",c("CARET",`^${i[n.LONECARET]}${i[n.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${i[n.LONECARET]}${i[n.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${i[n.GTLT]}\\s*(${i[n.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${i[n.GTLT]}\\s*(${i[n.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${i[n.GTLT]}\\s*(${i[n.LOOSEPLAIN]}|${i[n.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${i[n.XRANGEPLAIN]})\\s+-\\s+(${i[n.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${i[n.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[n.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(de,de.exports);var pe=de.exports;const Oe=/^[0-9]+$/,we=(r,t)=>{const e=Oe.test(r),s=Oe.test(t);return e&&s&&(r=+r,t=+t),r===t?0:e&&!s?-1:s&&!e?1:rwe(t,r);var Gt={compareIdentifiers:we,rcompareIdentifiers:_t};const re=te,{MAX_LENGTH:Te,MAX_SAFE_INTEGER:ie}=fe,{safeRe:ye,t:Ae}=pe,jt=ue,{compareIdentifiers:q}=Gt;let Ut=class j{constructor(t,e){if(e=jt(e),t instanceof j){if(t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Te)throw new TypeError(`version is longer than ${Te} characters`);re("SemVer",t,e),this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease;const s=t.trim().match(e.loose?ye[Ae.LOOSE]:ye[Ae.FULL]);if(!s)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>ie||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ie||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ie||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(h=>{if(/^[0-9]+$/.test(h)){const o=+h;if(o>=0&&o=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(e===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(h)}}if(e){let o=[e,h];s===!1&&(o=[e]),q(this.prerelease[0],e)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var he=Ut;const Se=he,kt=(r,t,e)=>new Se(r,e).compare(new Se(t,e));var Y=kt;const Xt=Y,Vt=(r,t,e)=>Xt(r,t,e)===0;var zt=Vt;const Ht=Y,Mt=(r,t,e)=>Ht(r,t,e)!==0;var Wt=Mt;const qt=Y,Yt=(r,t,e)=>qt(r,t,e)>0;var Bt=Yt;const Kt=Y,Jt=(r,t,e)=>Kt(r,t,e)>=0;var Zt=Jt;const Qt=Y,er=(r,t,e)=>Qt(r,t,e)<0;var tr=er;const rr=Y,ir=(r,t,e)=>rr(r,t,e)<=0;var sr=ir;const nr=zt,ar=Wt,or=Bt,lr=Zt,cr=tr,ur=sr,dr=(r,t,e,s)=>{switch(t){case"===":return typeof r=="object"&&(r=r.version),typeof e=="object"&&(e=e.version),r===e;case"!==":return typeof r=="object"&&(r=r.version),typeof e=="object"&&(e=e.version),r!==e;case"":case"=":case"==":return nr(r,e,s);case"!=":return ar(r,e,s);case">":return or(r,e,s);case">=":return lr(r,e,s);case"<":return cr(r,e,s);case"<=":return ur(r,e,s);default:throw new TypeError(`Invalid operator: ${t}`)}};var fr=dr,me,Ce;function pr(){if(Ce)return me;Ce=1;const r=Symbol("SemVer ANY");class t{static get ANY(){return r}constructor(d,$){if($=e($),d instanceof t){if(d.loose===!!$.loose)return d;d=d.value}d=d.trim().split(/\s+/).join(" "),w("comparator",d,$),this.options=$,this.loose=!!$.loose,this.parse(d),this.semver===r?this.value="":this.value=this.operator+this.semver.version,w("comp",this)}parse(d){const $=this.options.loose?s[h.COMPARATORLOOSE]:s[h.COMPARATOR],A=d.match($);if(!A)throw new TypeError(`Invalid comparator: ${d}`);this.operator=A[1]!==void 0?A[1]:"",this.operator==="="&&(this.operator=""),A[2]?this.semver=new I(A[2],this.options.loose):this.semver=r}toString(){return this.value}test(d){if(w("Comparator.test",d,this.options.loose),this.semver===r||d===r)return!0;if(typeof d=="string")try{d=new I(d,this.options)}catch($){return!1}return o(d,this.operator,this.semver,this.options)}intersects(d,$){if(!(d instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new i(d.value,$).test(this.value):d.operator===""?d.value===""?!0:new i(this.value,$).test(d.semver):($=e($),$.includePrerelease&&(this.value==="<0.0.0-0"||d.value==="<0.0.0-0")||!$.includePrerelease&&(this.value.startsWith("<0.0.0")||d.value.startsWith("<0.0.0"))?!1:this.operator.startsWith(">")&&d.operator.startsWith(">")||(this.operator.startsWith("<")&&d.operator.startsWith("<")||(this.semver.version===d.semver.version&&this.operator.includes("=")&&d.operator.includes("=")||o(this.semver,"<",d.semver,$)&&this.operator.startsWith(">")&&d.operator.startsWith("<")))?!0:!!(o(this.semver,">",d.semver,$)&&this.operator.startsWith("<")&&d.operator.startsWith(">")))}}me=t;const e=ue,{safeRe:s,t:h}=pe,o=fr,w=te,I=he,i=De();return me}var Ee,xe;function De(){if(xe)return Ee;xe=1;class r{constructor(a,m){if(m=s(m),a instanceof r)return a.loose===!!m.loose&&a.includePrerelease===!!m.includePrerelease?a:new r(a.raw,m);if(a instanceof h)return this.raw=a.value,this.set=[[a]],this.format(),this;if(this.options=m,this.loose=!!m.loose,this.includePrerelease=!!m.includePrerelease,this.raw=a.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(f=>this.parseRange(f.trim())).filter(f=>f.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const f=this.set[0];if(this.set=this.set.filter(p=>!c(p[0])),this.set.length===0)this.set=[f];else if(this.set.length>1){for(const p of this.set)if(p.length===1&&_(p[0])){this.set=[p];break}}}this.format()}format(){return this.range=this.set.map(a=>a.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(a){const m=(this.options.includePrerelease&&A)|(this.options.loose&&D),f=m+":"+a,p=e.get(f);if(p)return p;const u=this.options.loose,E=u?I[i.HYPHENRANGELOOSE]:I[i.HYPHENRANGE];a=a.replace(E,oe(this.options.includePrerelease)),o("hyphen replace",a),a=a.replace(I[i.COMPARATORTRIM],n),o("comparator trim",a),a=a.replace(I[i.TILDETRIM],d),o("tilde trim",a),a=a.replace(I[i.CARETTRIM],$),o("caret trim",a);let R=a.split(" ").map(y=>S(y,this.options)).join(" ").split(/\s+/).map(y=>ae(y,this.options));u&&(R=R.filter(y=>(o("loose invalid filter",y,this.options),!!y.match(I[i.COMPARATORLOOSE])))),o("range list",R);const v=new Map,O=R.map(y=>new h(y,this.options));for(const y of O){if(c(y))return[y];v.set(y.value,y)}v.size>1&&v.has("")&&v.delete("");const x=[...v.values()];return e.set(f,x),x}intersects(a,m){if(!(a instanceof r))throw new TypeError("a Range is required");return this.set.some(f=>C(f,m)&&a.set.some(p=>C(p,m)&&f.every(u=>p.every(E=>u.intersects(E,m)))))}test(a){if(!a)return!1;if(typeof a=="string")try{a=new w(a,this.options)}catch(m){return!1}for(let m=0;ml.value==="<0.0.0-0",_=l=>l.value==="",C=(l,a)=>{let m=!0;const f=l.slice();let p=f.pop();for(;m&&f.length;)m=f.every(u=>p.intersects(u,a)),p=f.pop();return m},S=(l,a)=>(o("comp",l,a),l=L(l,a),o("caret",l),l=P(l,a),o("tildes",l),l=g(l,a),o("xrange",l),l=F(l,a),o("stars",l),l),b=l=>!l||l.toLowerCase()==="x"||l==="*",P=(l,a)=>l.trim().split(/\s+/).map(m=>ne(m,a)).join(" "),ne=(l,a)=>{const m=a.loose?I[i.TILDELOOSE]:I[i.TILDE];return l.replace(m,(f,p,u,E,R)=>{o("tilde",l,f,p,u,E,R);let v;return b(p)?v="":b(u)?v=`>=${p}.0.0 <${+p+1}.0.0-0`:b(E)?v=`>=${p}.${u}.0 <${p}.${+u+1}.0-0`:R?(o("replaceTilde pr",R),v=`>=${p}.${u}.${E}-${R} <${p}.${+u+1}.0-0`):v=`>=${p}.${u}.${E} <${p}.${+u+1}.0-0`,o("tilde return",v),v})},L=(l,a)=>l.trim().split(/\s+/).map(m=>N(m,a)).join(" "),N=(l,a)=>{o("caret",l,a);const m=a.loose?I[i.CARETLOOSE]:I[i.CARET],f=a.includePrerelease?"-0":"";return l.replace(m,(p,u,E,R,v)=>{o("caret",l,p,u,E,R,v);let O;return b(u)?O="":b(E)?O=`>=${u}.0.0${f} <${+u+1}.0.0-0`:b(R)?u==="0"?O=`>=${u}.${E}.0${f} <${u}.${+E+1}.0-0`:O=`>=${u}.${E}.0${f} <${+u+1}.0.0-0`:v?(o("replaceCaret pr",v),u==="0"?E==="0"?O=`>=${u}.${E}.${R}-${v} <${u}.${E}.${+R+1}-0`:O=`>=${u}.${E}.${R}-${v} <${u}.${+E+1}.0-0`:O=`>=${u}.${E}.${R}-${v} <${+u+1}.0.0-0`):(o("no pr"),u==="0"?E==="0"?O=`>=${u}.${E}.${R}${f} <${u}.${E}.${+R+1}-0`:O=`>=${u}.${E}.${R}${f} <${u}.${+E+1}.0-0`:O=`>=${u}.${E}.${R} <${+u+1}.0.0-0`),o("caret return",O),O})},g=(l,a)=>(o("replaceXRanges",l,a),l.split(/\s+/).map(m=>T(m,a)).join(" ")),T=(l,a)=>{l=l.trim();const m=a.loose?I[i.XRANGELOOSE]:I[i.XRANGE];return l.replace(m,(f,p,u,E,R,v)=>{o("xRange",l,f,p,u,E,R,v);const O=b(u),x=O||b(E),y=x||b(R),K=y;return p==="="&&K&&(p=""),v=a.includePrerelease?"-0":"",O?p===">"||p==="<"?f="<0.0.0-0":f="*":p&&K?(x&&(E=0),R=0,p===">"?(p=">=",x?(u=+u+1,E=0,R=0):(E=+E+1,R=0)):p==="<="&&(p="<",x?u=+u+1:E=+E+1),p==="<"&&(v="-0"),f=`${p+u}.${E}.${R}${v}`):x?f=`>=${u}.0.0${v} <${+u+1}.0.0-0`:y&&(f=`>=${u}.${E}.0${v} <${u}.${+E+1}.0-0`),o("xRange return",f),f})},F=(l,a)=>(o("replaceStars",l,a),l.trim().replace(I[i.STAR],"")),ae=(l,a)=>(o("replaceGTE0",l,a),l.trim().replace(I[a.includePrerelease?i.GTE0PRE:i.GTE0],"")),oe=l=>(a,m,f,p,u,E,R,v,O,x,y,K)=>(b(f)?m="":b(p)?m=`>=${f}.0.0${l?"-0":""}`:b(u)?m=`>=${f}.${p}.0${l?"-0":""}`:E?m=`>=${m}`:m=`>=${m}${l?"-0":""}`,b(O)?v="":b(x)?v=`<${+O+1}.0.0-0`:b(y)?v=`<${O}.${+x+1}.0-0`:K?v=`<=${O}.${x}.${y}-${K}`:l?v=`<${O}.${x}.${+y+1}-0`:v=`<=${v}`,`${m} ${v}`.trim()),le=(l,a,m)=>{for(let f=0;f0){const p=l[f].semver;if(p.major===a.major&&p.minor===a.minor&&p.patch===a.patch)return!0}}return!1}return!0};return Ee}const hr=De(),mr=(r,t,e)=>{try{t=new hr(t,e)}catch(s){return!1}return t.test(r)};var Er=mr,Pe=bt(Er);function vr(r,t,e){const s=r.open(t),h=1e4,o=250,{origin:w}=new URL(t);let I=~~(h/o);function i(d){d.source===s&&(I=0,r.removeEventListener("message",i,!1))}r.addEventListener("message",i,!1);function n(){if(I<=0)return;s.postMessage(e,w),setTimeout(n,o),I-=1}setTimeout(n,o)}var gr=`.vega-embed { + position: relative; + display: inline-block; + box-sizing: border-box; +} +.vega-embed.has-actions { + padding-right: 38px; +} +.vega-embed details:not([open]) > :not(summary) { + display: none !important; +} +.vega-embed summary { + list-style: none; + position: absolute; + top: 0; + right: 0; + padding: 6px; + z-index: 1000; + background: white; + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); + color: #1b1e23; + border: 1px solid #aaa; + border-radius: 999px; + opacity: 0.2; + transition: opacity 0.4s ease-in; + cursor: pointer; + line-height: 0px; +} +.vega-embed summary::-webkit-details-marker { + display: none; +} +.vega-embed summary:active { + box-shadow: #aaa 0px 0px 0px 1px inset; +} +.vega-embed summary svg { + width: 14px; + height: 14px; +} +.vega-embed details[open] summary { + opacity: 0.7; +} +.vega-embed:hover summary, .vega-embed:focus-within summary { + opacity: 1 !important; + transition: opacity 0.2s ease; +} +.vega-embed .vega-actions { + position: absolute; + z-index: 1001; + top: 35px; + right: -9px; + display: flex; + flex-direction: column; + padding-bottom: 8px; + padding-top: 8px; + border-radius: 4px; + box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2); + border: 1px solid #d9d9d9; + background: white; + animation-duration: 0.15s; + animation-name: scale-in; + animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5); + text-align: left; +} +.vega-embed .vega-actions a { + padding: 8px 16px; + font-family: sans-serif; + font-size: 14px; + font-weight: 600; + white-space: nowrap; + color: #434a56; + text-decoration: none; +} +.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus { + background-color: #f7f7f9; + color: black; +} +.vega-embed .vega-actions::before, .vega-embed .vega-actions::after { + content: ""; + display: inline-block; + position: absolute; +} +.vega-embed .vega-actions::before { + left: auto; + right: 14px; + top: -16px; + border: 8px solid rgba(0, 0, 0, 0); + border-bottom-color: #d9d9d9; +} +.vega-embed .vega-actions::after { + left: auto; + right: 15px; + top: -14px; + border: 7px solid rgba(0, 0, 0, 0); + border-bottom-color: #fff; +} +.vega-embed .chart-wrapper.fit-x { + width: 100%; +} +.vega-embed .chart-wrapper.fit-y { + height: 100%; +} + +.vega-embed-wrapper { + max-width: 100%; + overflow: auto; + padding-right: 14px; +} + +@keyframes scale-in { + from { + opacity: 0; + transform: scale(0.6); + } + to { + opacity: 1; + transform: scale(1); + } +} +`;function Fe(r,...t){for(const e of t)$r(r,e);return r}function $r(r,t){for(const e of Object.keys(t))qe(r,e,t[e],!0)}var Ir="vega-embed",Rr="6.26.0",Lr="Publish Vega visualizations as embedded web components.",Nr=["vega","data","visualization","component","embed"],br={type:"git",url:"http://github.com/vega/vega-embed.git"},Or={name:"UW Interactive Data Lab",url:"http://idl.cs.washington.edu"},wr=[{name:"Dominik Moritz",url:"https://www.domoritz.de"}],Tr={url:"https://github.com/vega/vega-embed/issues"},yr="https://github.com/vega/vega-embed#readme",Ar="BSD-3-Clause",Sr="build/vega-embed.js",Cr="build/vega-embed.module.js",xr="build/vega-embed.min.js",Dr="build/vega-embed.min.js",Pr="build/vega-embed.module.d.ts",Fr=["src","build"],_r={".":{import:{types:"./build/vega-embed.module.d.ts",default:"./build/vega-embed.module.js"},require:{default:"./build/vega-embed.js"}}},Gr={"@babel/core":"^7.24.7","@babel/eslint-parser":"^7.24.7","@babel/plugin-transform-runtime":"^7.24.7","@babel/preset-env":"^7.24.7","@babel/preset-typescript":"^7.24.7","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-commonjs":"26.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@types/semver":"^7.5.8","@typescript-eslint/parser":"^7.15.0","@vitest/coverage-v8":"^1.6.0","browser-sync":"^3.0.2",concurrently:"^8.2.2","del-cli":"^5.1.0",eslint:"^9.6.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","eslint-plugin-vitest":"^0.5.4",jsdom:"^24.1.0","postinstall-postinstall":"^2.1.0",prettier:"^3.3.2","release-it":"^17.4.1",rollup:"4.18.0","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.4.5",sass:"^1.77.6",typescript:"^5.5.3","typescript-eslint":"^7.15.0",vega:"^5.30.0","vega-lite":"^5.19.0",vitest:"^1.6.0","vitest-canvas-mock":"^0.3.3"},jr={vega:"^5.21.0","vega-lite":"*"},Ur={"fast-json-patch":"^3.1.1","json-stringify-pretty-compact":"^3.0.0",semver:"^7.6.2",tslib:"^2.6.3","vega-interpreter":"^1.0.5","vega-schema-url-parser":"^2.2.0","vega-themes":"^2.15.0","vega-tooltip":"^0.34.0"},kr={prebuild:"yarn clean && yarn build:style",build:"rollup -c","build:style":"./build-style.sh",clean:"del-cli build src/style.ts",prepublishOnly:"yarn clean && yarn build",preversion:"yarn lint && yarn test",serve:"browser-sync start --directory -s -f build *.html",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",pretest:"yarn build:style",test:"vitest run",prettierbase:"prettier '*.{css,scss,html}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",release:"release-it"},Xr={name:Ir,version:Rr,description:Lr,keywords:Nr,repository:br,author:Or,contributors:wr,bugs:Tr,homepage:yr,license:Ar,main:Sr,module:Cr,unpkg:xr,jsdelivr:Dr,types:Pr,files:Fr,exports:_r,devDependencies:Gr,peerDependencies:jr,dependencies:Ur,scripts:kr};const Vr=Xr.version,G=He;let B=Be;const _e=typeof window!="undefined"?window:void 0;B===void 0&&_e?.vl?.compile&&(B=_e.vl);const Ge={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},zr={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},J={vega:"Vega","vega-lite":"Vega-Lite"},se={vega:G.version,"vega-lite":B?B.version:"not available"},Hr={vega:r=>r,"vega-lite":(r,t)=>B.compile(r,{config:t}).spec},Mr=` + + + + +`,Wr="chart-wrapper";function qr(r){return typeof r=="function"}function je(r,t,e,s){const h=`${t}
`,o=`
${e}`,w=window.open("");w.document.write(h+r+o),w.document.title=`${J[s]} JSON Source`}function Ue(r,t){if(r.$schema){const e=ge(r.$schema);t&&t!==e.library&&console.warn(`The given visualization spec is written in ${J[e.library]}, but mode argument sets ${J[t]??t}.`);const s=e.library;return Pe(se[s],`^${e.version.slice(1)}`)||console.warn(`The input spec uses ${J[s]} ${e.version}, but the current version of ${J[s]} is v${se[s]}.`),s}return"mark"in r||"encoding"in r||"layer"in r||"hconcat"in r||"vconcat"in r||"facet"in r||"repeat"in r?"vega-lite":"marks"in r||"signals"in r||"scales"in r||"axes"in r?"vega":t??"vega"}function ke(r){return!!(r&&"load"in r)}function Xe(r){return ke(r)?r:G.loader(r)}function Yr(r){const t=r.usermeta?.embedOptions??{};return Z(t.defaultStyle)&&(t.defaultStyle=!1),t}async function Br(r,t,e={}){let s,h;Z(t)?(h=Xe(e.loader),s=JSON.parse(await h.load(t))):s=t;const o=Yr(s),w=o.loader;(!h||w)&&(h=Xe(e.loader??w));const I=await Ve(o,h),i=await Ve(e,h),n={...Fe(i,I),config:ve(i.config??{},I.config??{})};return await Jr(r,s,n,h)}async function Ve(r,t){const e=Z(r.config)?JSON.parse(await t.load(r.config)):r.config??{},s=Z(r.patch)?JSON.parse(await t.load(r.patch)):r.patch;return{...r,...s?{patch:s}:{},...e?{config:e}:{}}}function Kr(r){const t=r.getRootNode?r.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function Jr(r,t,e={},s){const h=e.theme?ve(Ke[e.theme],e.config??{}):e.config,o=Me(e.actions)?e.actions:Fe({},Ge,e.actions??{}),w={...zr,...e.i18n},I=e.renderer??"canvas",i=e.logLevel??G.Warn,n=e.downloadFileName??"visualization",d=typeof r=="string"?document.querySelector(r):r;if(!d)throw new Error(`${r} does not exist`);if(e.defaultStyle!==!1){const L="vega-embed-style",{root:N,rootContainer:g}=Kr(d);if(!N.getElementById(L)){const T=document.createElement("style");T.id=L,T.innerHTML=e.defaultStyle===void 0||e.defaultStyle===!0?gr.toString():e.defaultStyle,g.appendChild(T)}}const $=Ue(t,e.mode);let A=Hr[$](t,h);if($==="vega-lite"&&A.$schema){const L=ge(A.$schema);Pe(se.vega,`^${L.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${L.version}, but current version is v${se.vega}.`)}d.classList.add("vega-embed"),o&&d.classList.add("has-actions"),d.innerHTML="";let D=d;if(o){const L=document.createElement("div");L.classList.add(Wr),d.appendChild(L),D=L}const c=e.patch;if(c&&(A=c instanceof Function?c(A):ze(A,c,!0,!1).newDocument),e.formatLocale&&G.formatLocale(e.formatLocale),e.timeFormatLocale&&G.timeFormatLocale(e.timeFormatLocale),e.expressionFunctions)for(const L in e.expressionFunctions){const N=e.expressionFunctions[L];"fn"in N?G.expressionFunction(L,N.fn,N.visitor):N instanceof Function&&G.expressionFunction(L,N)}const{ast:_}=e,C=G.parse(A,$==="vega-lite"?{}:h,{ast:_}),S=new(e.viewClass||G.View)(C,{loader:s,logLevel:i,renderer:I,..._?{expr:G.expressionInterpreter??e.expr??Ye}:{}});if(S.addSignalListener("autosize",(L,N)=>{const{type:g}=N;g=="fit-x"?(D.classList.add("fit-x"),D.classList.remove("fit-y")):g=="fit-y"?(D.classList.remove("fit-x"),D.classList.add("fit-y")):g=="fit"?D.classList.add("fit-x","fit-y"):D.classList.remove("fit-x","fit-y")}),e.tooltip!==!1){const{loader:L,tooltip:N}=e,g=L&&!ke(L)?L?.baseURL:void 0,T=qr(N)?N:new Je({baseURL:g,...N===!0?{}:N}).call;S.tooltip(T)}let{hover:b}=e;if(b===void 0&&(b=$==="vega"),b){const{hoverSet:L,updateSet:N}=typeof b=="boolean"?{}:b;S.hover(L,N)}e&&(e.width!=null&&S.width(e.width),e.height!=null&&S.height(e.height),e.padding!=null&&S.padding(e.padding)),await S.initialize(D,e.bind).runAsync();let P;if(o!==!1){let L=d;if(e.defaultStyle!==!1||e.forceActionsMenu){const g=document.createElement("details");g.title=w.CLICK_TO_VIEW_ACTIONS,d.append(g),L=g;const T=document.createElement("summary");T.innerHTML=Mr,g.append(T),P=F=>{g.contains(F.target)||g.removeAttribute("open")},document.addEventListener("click",P)}const N=document.createElement("div");if(L.append(N),N.classList.add("vega-actions"),o===!0||o.export!==!1){for(const g of["svg","png"])if(o===!0||o.export===!0||o.export[g]){const T=w[`${g.toUpperCase()}_ACTION`],F=document.createElement("a"),ae=We(e.scaleFactor)?e.scaleFactor[g]:e.scaleFactor;F.text=T,F.href="#",F.target="_blank",F.download=`${n}.${g}`,F.addEventListener("mousedown",async function(oe){oe.preventDefault();const le=await S.toImageURL(g,ae);this.href=le}),N.append(F)}}if(o===!0||o.source!==!1){const g=document.createElement("a");g.text=w.SOURCE_ACTION,g.href="#",g.addEventListener("click",function(T){je(ce(t),e.sourceHeader??"",e.sourceFooter??"",$),T.preventDefault()}),N.append(g)}if($==="vega-lite"&&(o===!0||o.compiled!==!1)){const g=document.createElement("a");g.text=w.COMPILED_ACTION,g.href="#",g.addEventListener("click",function(T){je(ce(A),e.sourceHeader??"",e.sourceFooter??"","vega"),T.preventDefault()}),N.append(g)}if(o===!0||o.editor!==!1){const g=e.editorUrl??"https://vega.github.io/editor/",T=document.createElement("a");T.text=w.EDITOR_ACTION,T.href="#",T.addEventListener("click",function(F){vr(window,g,{config:h,mode:c?"vega":$,renderer:I,spec:ce(c?A:t)}),F.preventDefault()}),N.append(T)}}function ne(){P&&document.removeEventListener("click",P),S.finalize()}return{view:S,spec:t,vgSpec:A,finalize:ne,embedOptions:e}}export default Br;export{Ge as DEFAULT_ACTIONS,Ue as guessMode,G as vega,B as vegaLite,Vr as version}; diff --git a/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/dist=es2020,mode=imports,min/optimized/vega-lite.js b/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/dist=es2020,mode=imports,min/optimized/vega-lite.js deleted file mode 100644 index b7b66da6..00000000 --- a/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/dist=es2020,mode=imports,min/optimized/vega-lite.js +++ /dev/null @@ -1 +0,0 @@ -import{hasOwnProperty as an,isNumber as V,isString as N,writeConfig as Cf,splitAccessPath as cn,stringValue as A,isObject as L,isBoolean as jn,isArray as v,array as q,logger as Ff,Warn as Nf,isFunction as Tf,mergeConfig as Ko,identity as Af}from"/-/vega-util@v1.17.2-LUfkDhormMyfWqy3Ts6U/dist=es2020,mode=imports,min/optimized/vega-util.js";import Of from"/-/clone@v2.1.2-inH2VLNzDGiYU9HUWyZM/dist=es2020,mode=imports,min/optimized/clone.js";import Pf from"/-/fast-deep-equal@v3.1.3-ysejKs1WDEDPxUJhgGoP/dist=es2020,mode=imports,min/optimized/fast-deep-equal.js";import kr from"/-/fast-json-stable-stringify@v2.1.0-HLgsuOtxPikt0pw16nth/dist=es2020,mode=imports,min/optimized/fast-json-stable-stringify.js";import{isObject as Cr,writeConfig as zf,isArray as Qo,isString as mi}from"/-/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/dist=es2020,mode=imports,min/optimized/vega.js";import{parseSelector as un}from"/-/vega-event-selector@v3.0.1-UgiEAWJA4WQL4DTKnV4R/dist=es2020,mode=imports,min/optimized/vega-event-selector.js";import{parseExpression as Rf}from"/-/vega-expression@v5.1.1-K4clrYr2THuj5KncykTn/dist=es2020,mode=imports,min/optimized/vega-expression.js";const If="vega-lite",Lf='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',Mf="5.12.0",Df=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],jf="https://vega.github.io/vega-lite/",Uf="Vega-Lite is a concise high-level language for interactive visualization.",Bf=["vega","chart","visualization"],Wf="build/vega-lite.js",Hf="build/vega-lite.min.js",qf="build/vega-lite.min.js",Gf="build/src/index",Vf="build/src/index.d.ts",Xf={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},Yf=["bin","build","src","vega-lite*","tsconfig.json"],Kf={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",jest:"NODE_OPTIONS=--experimental-vm-modules npx jest",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk --experimental-vm-modules ./node_modules/.bin/jest --runInBand test","test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},Qf={type:"git",url:"https://github.com/vega/vega-lite.git"},Zf="BSD-3-Clause",Jf={url:"https://github.com/vega/vega-lite/issues"},ed={"@babel/core":"^7.21.8","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/preset-env":"^7.21.5","@babel/preset-typescript":"^7.21.5","@release-it/conventional-changelog":"^5.1.1","@rollup/plugin-alias":"^5.0.0","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-commonjs":"^25.0.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.2","@rollup/plugin-terser":"^0.4.1","@types/chai":"^4.3.5","@types/d3":"^7.4.0","@types/jest":"^27.4.1","@types/pako":"^2.0.0","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5",ajv:"^8.12.0","ajv-formats":"^2.1.1",chai:"^4.3.7",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^3.0.0",d3:"^7.8.4","del-cli":"^5.0.0",eslint:"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-jest":"^27.2.1","eslint-plugin-prettier":"^4.2.1","highlight.js":"^11.8.0",jest:"^27.5.1","jest-dev-server":"^6.1.1",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^2.8.8",puppeteer:"^15.0.0","release-it":"^15.10.3",rollup:"^3.21.6","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-sourcemaps":"^0.6.3",serve:"^14.2.0",terser:"^5.17.3","ts-jest":"^29.1.0","ts-json-schema-generator":"^1.2.0",typescript:"~4.9.5","vega-cli":"^5.25.0","vega-datasets":"^2.7.0","vega-embed":"^6.22.1","vega-tooltip":"^0.32.0","yaml-front-matter":"^4.1.1"},td={"@types/clone":"~2.1.1",clone:"~2.1.2","fast-deep-equal":"~3.1.3","fast-json-stable-stringify":"~2.1.0","json-stringify-pretty-compact":"~3.0.0",tslib:"~2.5.0","vega-event-selector":"~3.0.1","vega-expression":"~5.1.0","vega-util":"~1.17.2",yargs:"~17.7.2"},nd={vega:"^5.24.0"},id={node:">=16"};var rd={name:If,author:Lf,version:Mf,collaborators:Df,homepage:jf,description:Uf,keywords:Bf,main:Wf,unpkg:Hf,jsdelivr:qf,module:Gf,types:Vf,bin:Xf,files:Yf,scripts:Kf,repository:Qf,license:Zf,bugs:Jf,devDependencies:ed,dependencies:td,peerDependencies:nd,engines:id};function Fr(e){return!!e.or}function Nr(e){return!!e.and}function Tr(e){return!!e.not}function hi(e,t){if(Tr(e))hi(e.not,t);else if(Nr(e))for(const n of e.and)hi(n,t);else if(Fr(e))for(const n of e.or)hi(n,t);else t(e)}function ln(e,t){return Tr(e)?{not:ln(e.not,t)}:Nr(e)?{and:e.and.map(n=>ln(n,t))}:Fr(e)?{or:e.or.map(n=>ln(n,t))}:t(e)}const De=Pf,k=Of;function Zo(e){throw new Error(e)}function fn(e,t){const n={};for(const i of t)an(e,i)&&(n[i]=e[i]);return n}function ue(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>kr(e)).join(",")})`};const D=kr;function O(e){if(V(e))return e;const t=N(e)?e:kr(e);if(t.length<250)return t;let n=0;for(let i=0;ia===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function Rr(e,t){return e===void 0||t===void 0?!0:Pr(zr(e),zr(t))}function I(e){return b(e).length===0}const b=Object.keys,te=Object.values,bt=Object.entries;function Un(e){return e===!0||e===!1}function W(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Bn(e,t){return Tr(e)?`!(${Bn(e.not,t)})`:Nr(e)?`(${e.and.map(n=>Bn(n,t)).join(") && (")})`:Fr(e)?`(${e.or.map(n=>Bn(n,t)).join(") || (")})`:t(e)}function yi(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&yi(e[n],t)&&delete e[n],I(e)}function Wn(e){return e.charAt(0).toUpperCase()+e.substr(1)}function Ir(e,t="datum"){const n=cn(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(A).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function ta(e,t="datum"){return`${t}[${A(cn(e).join("."))}]`}function ad(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Se(e){return`${cn(e).map(ad).join("\\.")}`}function Lt(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Lr(e){return`${cn(e).join(".")}`}function dn(e){return e?cn(e).length:0}function X(...e){for(const t of e)if(t!==void 0)return t;return}let na=42;function ia(e){const t=++na;return e?String(e)+t:t}function cd(){na=42}function ra(e){return sa(e)?e:`__${e}`}function sa(e){return e.startsWith("__")}function Hn(e){return e===void 0?void 0:(e%360+360)%360}function bi(e){return V(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const nt="row",it="column",xi="facet",H="x",K="y",_e="x2",Ue="y2",xt="xOffset",pn="yOffset",ke="radius",rt="radius2",we="theta",st="theta2",Ce="latitude",Fe="longitude",Ne="latitude2",$e="longitude2",le="color",Be="fill",We="stroke",fe="shape",ot="size",Mt="angle",at="opacity",St="fillOpacity",wt="strokeOpacity",$t="strokeWidth",vt="strokeDash",qn="text",gn="order",Gn="detail",Si="key",Dt="tooltip",wi="href",$i="url",vi="description",ud={x:1,y:1,x2:1,y2:1},oa={theta:1,theta2:1,radius:1,radius2:1};function aa(e){return e in oa}const Mr={longitude:1,longitude2:1,latitude:1,latitude2:1};function ca(e){switch(e){case Ce:return"y";case Ne:return"y2";case Fe:return"x";case $e:return"x2"}}function ua(e){return e in Mr}const ld=b(Mr),Dr={...ud,...oa,...Mr,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function mn(e){return e===le||e===Be||e===We}const la={row:1,column:1,facet:1},ve=b(la),jr={...Dr,...la},fd=b(jr),{order:MS,detail:DS,tooltip:jS,...dd}=jr,{row:US,column:BS,facet:WS,...pd}=dd;function gd(e){return!!pd[e]}function fa(e){return!!jr[e]}const md=[_e,Ue,Ne,$e,st,rt];function da(e){const t=jt(e);return t!==e}function jt(e){switch(e){case _e:return H;case Ue:return K;case Ne:return Ce;case $e:return Fe;case st:return we;case rt:return ke}return e}function Et(e){if(aa(e))switch(e){case we:return"startAngle";case st:return"endAngle";case ke:return"outerRadius";case rt:return"innerRadius"}return e}function He(e){switch(e){case H:return _e;case K:return Ue;case Ce:return Ne;case Fe:return $e;case we:return st;case ke:return rt}return}function de(e){switch(e){case H:case _e:return"width";case K:case Ue:return"height"}return}function pa(e){switch(e){case H:return"xOffset";case K:return"yOffset";case _e:return"x2Offset";case Ue:return"y2Offset";case we:return"thetaOffset";case ke:return"radiusOffset";case st:return"theta2Offset";case rt:return"radius2Offset"}return}function Ur(e){switch(e){case H:return"xOffset";case K:return"yOffset"}return}function ga(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const hd=b(Dr),{x:HS,y:qS,x2:GS,y2:VS,xOffset:XS,yOffset:YS,latitude:KS,longitude:QS,latitude2:ZS,longitude2:JS,theta:ew,theta2:tw,radius:nw,radius2:iw,...Br}=Dr,yd=b(Br),Wr={x:1,y:1},qe=b(Wr);function Q(e){return e in Wr}const Hr={theta:1,radius:1},bd=b(Hr);function Ei(e){return e==="width"?H:K}const ma={xOffset:1,yOffset:1};function hn(e){return e in ma}const{text:rw,tooltip:sw,href:ow,url:aw,description:cw,detail:uw,key:lw,order:fw,...ha}=Br,xd=b(ha);function Sd(e){return!!Br[e]}function wd(e){switch(e){case le:case Be:case We:case ot:case fe:case at:case $t:case vt:return!0;case St:case wt:case Mt:return!1}}const ya={...Wr,...Hr,...ma,...ha},_i=b(ya);function ct(e){return!!ya[e]}function $d(e,t){return Ed(e)[t]}const ba={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:dw,...vd}=ba;function Ed(e){switch(e){case le:case Be:case We:case vi:case Gn:case Si:case Dt:case wi:case gn:case at:case St:case wt:case $t:case xi:case nt:case it:return ba;case H:case K:case xt:case pn:case Ce:case Fe:return vd;case _e:case Ue:case Ne:case $e:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case ot:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case vt:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case fe:return{point:"always",geoshape:"always"};case qn:return{text:"always"};case Mt:return{point:"always",square:"always",text:"always"};case $i:return{image:"always"};case we:return{text:"always",arc:"always"};case ke:return{text:"always",arc:"always"};case st:case rt:return{arc:"always"}}}function qr(e){switch(e){case H:case K:case we:case ke:case xt:case pn:case ot:case Mt:case $t:case at:case St:case wt:case _e:case Ue:case st:case rt:return;case xi:case nt:case it:case fe:case vt:case qn:case Dt:case wi:case $i:case vi:return"discrete";case le:case Be:case We:return"flexible";case Ce:case Fe:case Ne:case $e:case Gn:case Si:case gn:return}}const _d={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},kd={count:1,min:1,max:1};function ut(e){return!!e&&!!e.argmin}function _t(e){return!!e&&!!e.argmax}function Gr(e){return N(e)&&!!_d[e]}const Cd=new Set(["count","valid","missing","distinct"]);function xa(e){return N(e)&&Cd.has(e)}function Fd(e){return N(e)&&P(["min","max"],e)}const Nd=new Set(["count","sum","distinct","valid","missing"]),Td=new Set(["mean","average","median","q1","q3","min","max"]);function Sa(e){return jn(e)&&(e=qi(e,void 0)),"bin"+b(e).map(t=>ki(e[t])?W(`_${t}_${bt(e[t])}`):W(`_${t}_${e[t]}`)).join("")}function j(e){return e===!0||Ut(e)&&!e.binned}function ne(e){return e==="binned"||Ut(e)&&e.binned===!0}function Ut(e){return L(e)}function ki(e){return e?.param}function wa(e){switch(e){case nt:case it:case ot:case le:case Be:case We:case $t:case at:case St:case wt:case fe:return 6;case vt:return 4;default:return 10}}function Vn(e){return!!e?.expr}function pe(e){const t=b(e||{}),n={};for(const i of t)n[i]=ye(e[i]);return n}function $a(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:c,subtitleFont:u,subtitleFontSize:l,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:p,subtitlePadding:g,...m}=e,h={...m,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},$={...c?{subtitleColor:c}:{},...u?{subtitleFont:u}:{},...l?{subtitleFontSize:l}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...p?{subtitleLineHeight:p}:{},...g?{subtitlePadding:g}:{}},C=fn(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:h,subtitleMarkConfig:C,nonMarkTitleProperties:y,subtitle:$}}function kt(e){return N(e)||v(e)&&N(e[0])}function E(e){return!!e?.signal}function Ct(e){return!!e.step}function Ad(e){return v(e)?!1:"fields"in e&&!("data"in e)}function Od(e){return v(e)?!1:"fields"in e&&"data"in e}function lt(e){return v(e)?!1:"field"in e&&"data"in e}const Pd={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},zd=b(Pd),Rd={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Vr=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function va(e){const t=v(e.condition)?e.condition.map(Ea):Ea(e.condition);return{...ye(e),condition:t}}function ye(e){if(Vn(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Ea(e){if(Vn(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function B(e){if(Vn(e)){const{expr:t,...n}=e;return{signal:t,...n}}return E(e)?e:e!==void 0?{value:e}:void 0}function Id(e){return E(e)?e.signal:A(e)}function _a(e){return E(e)?e.signal:A(e.value)}function Te(e){return E(e)?e.signal:e==null?null:A(e)}function Ld(e,t,n){for(const i of n){const r=ft(i,t.markDef,t.config);r!==void 0&&(e[i]=B(r))}return e}function ka(e){return[].concat(e.type,e.style??[])}function z(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&t[r]!==void 0?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:ft(e,t,n,i)}function ft(e,t,n,{vgChannel:i}={}){return X(i?Ci(e,t,n.style):void 0,Ci(e,t,n.style),i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function Ci(e,t,n){return Ca(e,ka(t),n)}function Ca(e,t,n){t=q(t);let i;for(const r of t){const s=n[r];s&&s[e]!==void 0&&(i=s[e])}return i}function Fa(e,t){return q(e).reduce((n,i)=>(n.field.push(w(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function Na(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(De(r,i))return;n.push(i)}),n}function Ta(e,t){return De(e,t)||!t?e:e?[...q(e),...q(t)].join(", "):t}function Aa(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((kt(n)||E(n))&&(kt(i)||E(i)))return{explicit:e.explicit,value:Ta(n,i)};if(kt(n)||E(n))return{explicit:e.explicit,value:n};if(kt(i)||E(i))return{explicit:e.explicit,value:i};if(!kt(n)&&!E(n)&&!kt(i)&&!E(i))return{explicit:e.explicit,value:Na(n,i)};throw new Error("It should never reach here")}function Xr(e){return`Invalid specification ${D(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Md='Autosize "fit" only works for single views and layered views.';function Oa(e){const t=e=="width"?"Width":"Height";return`${t} "container" only works for single views and layered views.`}function Pa(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function za(e){return e?`Dropping "fit-${e}" because spec has discrete ${de(e)}.`:'Dropping "fit" because spec has discrete size.'}function Yr(e){return`Unknown field for ${e}. Cannot calculate view size.`}function Ra(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Dd(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function jd(e){return`The "nearest" transform is not supported for ${e} marks.`}function Ia(e){return`Selection not supported for ${e} yet.`}function Ud(e){return`Cannot find a selection named "${e}".`}const Bd="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Wd="Legend bindings are only supported for selections over an individual field or encoding channel.";function Hd(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function qd(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const Gd="The same selection must be used to override scale domains in a layered view.",Vd='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function Xd(e){return`Unknown repeated value "${e}".`}function La(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Yd="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Kd(e){return`Unrecognized parse "${e}".`}function Ma(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Qd="Attempt to add the same child twice.";function Zd(e){return`Ignoring an invalid transform: ${D(e)}.`}const Jd='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function Da(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function ep(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${D(t)} is overridden by a child projection ${D(n)}.`}const tp="Arc marks uses theta channel rather than angle, replacing angle with theta.";function np(e){return`${e}Offset dropped because ${e} is continuous`}function ip(e){return`There is no ${e} encoding. Replacing ${e}Offset encoding as ${e}.`}function rp(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${D(n)}}.`}function ja(e){return`Invalid field type "${e}".`}function sp(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function op(e){return`Invalid aggregation operator "${e}".`}function Ua(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function ap(e){return`Position range does not support relative band size for ${e}.`}function Kr(e,t){return`Dropping ${D(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const cp="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function Fi(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function up(e){return`${e} encoding has no scale, so specified scale is ignored.`}function lp(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function fp(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function dp(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function pp(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function Qr(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function gp(e){return`The ${e} for range marks cannot be an expression`}function mp(e,t){const n=e&&t?"x2 and y2":e?"x2":"y2";return`Line mark is for continuous lines and thus cannot be used with ${n}. We will use the rule mark (line segments) instead.`}function hp(e,t){return`Specified orient "${e}" overridden with "${t}".`}function yp(e){return`Cannot use the scale property "${e}" with non-color channel.`}function bp(e){return`Cannot use the relative band size with ${e} scale.`}function xp(e){return`Using unaggregated domain with raw field has no effect (${D(e)}).`}function Sp(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function wp(e){return`Unaggregated domain is currently unsupported for log scale (${D(e)}).`}function $p(e){return`Cannot apply size to non-oriented mark "${e}".`}function vp(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Ep(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function Ba(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function Wa(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function _p(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${D(n)} and ${D(i)}). Using ${D(n)}.`}function kp(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${D(n)} and ${D(i)}). Using the union of the two domains.`}function Cp(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function Fp(e){return`Dropping sort property ${D(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const Ha="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Np="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",Tp="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",Ap="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function Op(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Pp(e){return`Cannot stack non-linear scale (${e}).`}function zp(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function Ni(e,t){return`Invalid ${e}: ${D(t)}.`}function Rp(e){return`Dropping day from datetime ${D(e)} as day cannot be combined with other units.`}function Ip(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Lp(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Mp(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function qa(e){return`1D error band does not support ${e}.`}function Ga(e){return`Channel ${e} is required for "binned" bin.`}function Dp(e){return`Channel ${e} should not be used with "binned" bin.`}function jp(e){return`Domain for ${e} is required for threshold scale.`}var pw=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},gw=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)};const Va=Ff(Nf);let yn=Va;function Up(e){return yn=e,yn}function Bp(){return yn=Va,yn}function x(...e){yn.warn(...e)}function Wp(...e){yn.debug(...e)}function Bt(e){if(e&&L(e)){for(const t of Jr)if(t in e)return!0}return!1}const Xa=["january","february","march","april","may","june","july","august","september","october","november","december"],Hp=Xa.map(e=>e.substr(0,3)),Ya=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],qp=Ya.map(e=>e.substr(0,3));function Gp(e){if(bi(e)&&(e=+e),V(e))return e>4&&x(Ni("quarter",e)),e-1;throw new Error(Ni("quarter",e))}function Vp(e){if(bi(e)&&(e=+e),V(e))return e-1;{const t=e.toLowerCase(),n=Xa.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Hp.indexOf(i);if(r!==-1)return r;throw new Error(Ni("month",e))}}function Xp(e){if(bi(e)&&(e=+e),V(e))return e%7;{const t=e.toLowerCase(),n=Ya.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=qp.indexOf(i);if(r!==-1)return r;throw new Error(Ni("day",e))}}function Zr(e,t){const n=[];if(t&&e.day!==void 0&&(b(e).length>1&&(x(Rp(e)),e=k(e),delete e.day)),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?Vp(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?Gp(e.quarter):e.quarter;n.push(V(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?Xp(e.day):e.day;n.push(V(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r=="undefined"?0:r)}return n}function Wt(e){const t=Zr(e,!0),n=t.join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Yp(e){const t=Zr(e,!1),n=t.join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Kp(e){const t=Zr(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const Ka={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Jr=b(Ka);function Qp(e){return!!Ka[e]}function Ht(e){return L(e)?e.binned:Qa(e)}function Qa(e){return e&&e.startsWith("binned")}function es(e){return e.startsWith("utc")}function Zp(e){return e.substring(3)}const Jp={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Ti(e){return Jr.filter(t=>Ja(e,t))}function Za(e){const t=Ti(e);return t[t.length-1]}function Ja(e,t){const n=e.indexOf(t);return n<0||(n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o")?!1:!(n>0&&t==="year"&&e.charAt(n-1)==="f")}function eg(e,t,{end:n}={end:!1}){const i=Ir(t),r=es(e)?"utc":"";function s(c){return c==="quarter"?`(${r}quarter(${i})-1)`:`${r}${c}(${i})`}let o;const a={};for(const c of Jr)Ja(e,c)&&(a[c]=s(c),o=c);return n&&(a[o]+="+1"),Yp(a)}function ec(e){if(!e)return;const t=Ti(e);return`timeUnitSpecifier(${D(t)}, ${D(Jp)})`}function tg(e,t,n){if(!e)return;const i=ec(e),r=n||es(e);return`${r?"utc":"time"}Format(${t}, ${i})`}function Z(e){if(!e)return;let t;return N(e)?Qa(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:L(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),es(t.unit)&&(t.utc=!0,t.unit=Zp(t.unit)),t}function ng(e){const{utc:t,...n}=Z(e);return n.unit?(t?"utc":"")+b(n).map(i=>W(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+b(n).map(i=>W(`_${i}_${n[i]}`)).join("")}function tc(e,t=n=>n){const n=Z(e),i=Za(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:o}=nc(i,n.step),a={...r,[o]:+r[o]+s};return`${t(Wt(a))} - ${t(Wt(r))}`}return}const ig={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function rg(e){return!!ig[e]}function nc(e,t=1){if(rg(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function sg(e){return e?.param}function ts(e){return!!e?.field&&e.equal!==void 0}function ns(e){return!!e?.field&&e.lt!==void 0}function is(e){return!!e?.field&&e.lte!==void 0}function rs(e){return!!e?.field&&e.gt!==void 0}function ss(e){return!!e?.field&&e.gte!==void 0}function os(e){if(e?.field){if(v(e.range)&&e.range.length===2)return!0;if(E(e.range))return!0}return!1}function as(e){return!!e?.field&&(v(e.oneOf)||v(e.in))}function og(e){return!!e?.field&&e.valid!==void 0}function ic(e){return as(e)||ts(e)||os(e)||ns(e)||rs(e)||is(e)||ss(e)}function Ge(e,t){return Gi(e,{timeUnit:t,wrapTime:!0})}function ag(e,t){return e.map(n=>Ge(n,t))}function rc(e,t=!0){const{field:n}=e,i=Z(e.timeUnit),{unit:r,binned:s}=i||{},o=w(e,{expr:"datum"}),a=r?`time(${s?o:eg(r,n)})`:o;if(ts(e))return`${a}===${Ge(e.equal,r)}`;if(ns(e)){const c=e.lt;return`${a}<${Ge(c,r)}`}else if(rs(e)){const c=e.gt;return`${a}>${Ge(c,r)}`}else if(is(e)){const c=e.lte;return`${a}<=${Ge(c,r)}`}else if(ss(e)){const c=e.gte;return`${a}>=${Ge(c,r)}`}else{if(as(e))return`indexof([${ag(e.oneOf,r).join(",")}], ${a}) !== -1`;if(og(e))return cs(a,e.valid);if(os(e)){const{range:c}=e,u=E(c)?{signal:`${c.signal}[0]`}:c[0],l=E(c)?{signal:`${c.signal}[1]`}:c[1];if(u!==null&&l!==null&&t)return"inrange("+a+", ["+Ge(u,r)+", "+Ge(l,r)+"])";const f=[];return u!==null&&f.push(`${a} >= ${Ge(u,r)}`),l!==null&&f.push(`${a} <= ${Ge(l,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${D(e)}`)}function cs(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function cg(e){return ic(e)&&e.timeUnit?{...e,timeUnit:Z(e.timeUnit)}:e}const Xn={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function ug(e){return e==="quantitative"||e==="temporal"}function sc(e){return e==="ordinal"||e==="nominal"}const qt=Xn.quantitative,us=Xn.ordinal,bn=Xn.temporal,ls=Xn.nominal,xn=Xn.geojson;function lg(e){if(e){e=e.toLowerCase();switch(e){case"q":case qt:return"quantitative";case"t":case bn:return"temporal";case"o":case us:return"ordinal";case"n":case ls:return"nominal";case xn:return"geojson"}}return}const ge={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},fs={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function fg(e,t){const n=fs[e],i=fs[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const dg={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function oc(e){return dg[e]}const ac=new Set(["linear","log","pow","sqrt","symlog"]),cc=new Set([...ac,"time","utc"]);function uc(e){return ac.has(e)}const lc=new Set(["quantile","quantize","threshold"]),pg=new Set([...cc,...lc,"sequential","identity"]),gg=new Set(["ordinal","bin-ordinal","point","band"]);function J(e){return gg.has(e)}function be(e){return pg.has(e)}function Ae(e){return cc.has(e)}function Sn(e){return lc.has(e)}const mg={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function hg(e){return!N(e)&&!!e.name}function fc(e){return e?.param}function yg(e){return e?.unionWith}function bg(e){return Cr(e)&&"field"in e}const xg={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:mw,domain:hw,range:yw,rangeMax:bw,rangeMin:xw,scheme:Sw,...Sg}=xg,wg=b(Sg);function ds(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return Ae(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return Ae(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"clamp":return Ae(e);case"nice":return Ae(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return be(e)&&!P(["log","time","utc","threshold","quantile"],e)}}function dc(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return mn(e)?void 0:yp(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function $g(e,t){return P([us,ls],t)?e===void 0||J(e):t===bn?P([ge.TIME,ge.UTC,void 0],e):t===qt?uc(e)||Sn(e)||e===void 0:!0}function vg(e,t,n=!1){if(!ct(e))return!1;switch(e){case H:case K:case xt:case pn:case we:case ke:return Ae(t)||t==="band"?!0:t==="point"?!n:!1;case ot:case $t:case at:case St:case wt:case Mt:return Ae(t)||Sn(t)||P(["band","point","ordinal"],t);case le:case Be:case We:return t!=="band";case vt:case fe:return t==="ordinal"||Sn(t)}}const oe={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},pc=oe.arc,Ai=oe.area,Oi=oe.bar,Eg=oe.image,Pi=oe.line,zi=oe.point,_g=oe.rect,Ri=oe.rule,gc=oe.text,ps=oe.tick,kg=oe.trail,gs=oe.circle,ms=oe.square,mc=oe.geoshape;function Ft(e){return["line","area","trail"].includes(e)}function hs(e){return["rect","bar","image","arc"].includes(e)}const Cg=new Set(b(oe));function Ve(e){return e.type}const Fg=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],Ng=["fill","fillOpacity"],Tg=[...Fg,...Ng],Ag={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},hc=b(Ag),Og={area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]},Pg={color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},zg={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},yc=b(zg);function Gt(e){return e&&e.band!=null}const Rg={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},bc=5,Ig={binSpacing:1,continuousBandSize:bc,minBandSize:.25,timeUnitBandPosition:.5},Lg={binSpacing:0,continuousBandSize:bc,minBandSize:.25,timeUnitBandPosition:.5},Mg={thickness:1};function Dg(e){return Ve(e)?e.type:e}function ys(e){const{channel:t,channelDef:n,markDef:i,scale:r,config:s}=e,o=xs(e);return S(n)&&!xa(n.aggregate)&&r&&Ae(r.get("type"))?jg({fieldDef:n,channel:t,markDef:i,ref:o,config:s}):o}function jg({fieldDef:e,channel:t,markDef:n,ref:i,config:r}){if(Ft(n.type))return i;const s=z("invalid",n,r);return s===null?[Ug(e,t),i]:i}function Ug(e,t){const n=bs(e,!0),i=jt(t),r=i==="y"?{field:{group:"height"}}:{value:0};return{test:n,...r}}function bs(e,t=!0){return cs(N(e)?e:w(e,{expr:"datum"}),!t)}function Bg(e){const{datum:t}=e;return Bt(t)?Wt(t):`${D(t)}`}function Vt(e,t,n,i){const r={};if(t&&(r.scale=t),Ye(e)){const{datum:s}=e;Bt(s)?r.signal=Wt(s):E(s)?r.signal=s.signal:Vn(s)?r.signal=s.expr:r.value=s}else r.field=w(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function Ii({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,bandPosition:s=.5}){const o=0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return nm(e);default:return tm(e,t)}};let Lc=Ic;function Mc(e){Lc=e}function im(){Mc(Ic)}function vn(e,t,{allowDisabling:n,includeDefault:i=!0}){const r=Es(e)?.title;if(!S(e))return r??e.title;const s=e,o=i?_s(s,t):void 0;return n?X(r,s.title,o):r??s.title??o}function Es(e){return $n(e)&&e.axis?e.axis:zc(e)&&e.legend?e.legend:$s(e)&&e.header?e.header:void 0}function _s(e,t){return Lc(e,t)}function Wi(e){if(Rc(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=Es(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function rm(e,t){switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(vs(e)&&v(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!_t(n)&&!ut(n))return"quantitative";if(Yt(e)&&e.scale?.type)switch(fs[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Ke(e){return S(e)?e:ji(e)?e.condition:void 0}function Y(e){return F(e)?e:Zn(e)?e.condition:void 0}function Dc(e,t,n,i={}){if(N(e)||V(e)||jn(e)){const r=N(e)?"string":V(e)?"number":"boolean";return x(rp(t,r,e)),{value:e}}return F(e)?Hi(e,t,n,i):Zn(e)?{...e,condition:Hi(e.condition,t,n,i)}:e}function Hi(e,t,n,i){if(Rc(e)){const{format:r,formatType:s,...o}=e;if(Xt(s)&&!n.customFormatTypes)return x(Da(t)),Hi(o,t,n,i)}else{const r=$n(e)?"axis":zc(e)?"legend":$s(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(Xt(o)&&!n.customFormatTypes)return x(Da(t)),Hi({...e,[r]:a},t,n,i)}}return S(e)?ks(e,t,i):sm(e)}function sm(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=V(n)?"quantitative":N(n)?"nominal":Bt(n)?"temporal":void 0,{...e,type:t}}function ks(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!Gr(i)&&!_t(i)&&!ut(i)&&(x(op(i)),delete a.aggregate),r&&(a.timeUnit=Z(r)),o&&(a.field=`${o}`),j(s)&&(a.bin=qi(s,t)),ne(s)&&!Q(t)&&x(Dp(t)),ae(a)){const{type:c}=a,u=lg(c);c!==u&&(a.type=u),c!=="quantitative"&&(xa(i)&&(x(sp(c,i)),a.type="quantitative"))}else if(!da(t)){const c=rm(a,t);a.type=c}if(ae(a)){const{compatible:c,warning:u}=om(a,t)||{};c===!1&&x(u)}if(vs(a)&&N(a.sort)){const{sort:c}=a;if(_c(c))return{...a,sort:{encoding:c}};const u=c.substr(1);if(c.charAt(0)==="-"&&_c(u))return{...a,sort:{encoding:u,order:"descending"}}}if($s(a)){const{header:c}=a;if(c){const{orient:u,...l}=c;if(u)return{...a,header:{...l,labelOrient:c.labelOrient||u,titleOrient:c.titleOrient||u}}}}return a}function qi(e,t){return jn(e)?{maxbins:wa(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:wa(t)}:e}const En={compatible:!0};function om(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case nt:case it:case xi:return Bi(e)?En:{compatible:!1,warning:fp(t)};case H:case K:case xt:case pn:case le:case Be:case We:case qn:case Gn:case Si:case Dt:case wi:case $i:case Mt:case we:case ke:case vi:return En;case Fe:case $e:case Ce:case Ne:return n!==qt?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:En;case at:case St:case wt:case $t:case ot:case st:case rt:case _e:case Ue:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:En;case fe:case vt:return!Bi(e)&&!Jg(e)?{compatible:!1,warning:dp(t)}:En;case gn:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:En}}function _n(e){const{formatType:t}=Wi(e);return t==="time"||!t&&am(e)}function am(e){return e&&(e.type==="temporal"||S(e)&&!!e.timeUnit)}function Gi(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){const s=t&&Z(t)?.unit;let o=s||n==="temporal",a;return Vn(e)?a=e.expr:E(e)?a=e.signal:Bt(e)?(o=!0,a=Wt(e)):(N(e)||V(e))&&(o&&(a=`datetime(${D(e)})`,Qp(s)&&((V(e)&&e<1e4||N(e)&&isNaN(Date.parse(e)))&&(a=Wt({[s]:e}))))),a?i&&o?`time(${a})`:a:r?void 0:D(e)}function jc(e,t){const{type:n}=e;return t.map(i=>{const r=S(e)&&!Ht(e.timeUnit)?e.timeUnit:void 0,s=Gi(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function Jn(e,t){return j(e.bin)?ct(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const Uc={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function ei(e){return e?.condition}const Bc=["domain","grid","labels","ticks","title"],cm={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},Wc={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},um={...Wc,style:1,labelExpr:1,encoding:1};function Hc(e){return!!um[e]}const lm={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},qc=b(lm);function dt(e){return"mark"in e}class Vi{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return dt(t)?Dg(t.mark)===this.name:!1}}function Kt(e,t){const n=e&&e[t];return n?v(n)?It(n,i=>!!i.field):S(n)||ji(n):!1}function Gc(e,t){const n=e&&e[t];return n?v(n)?It(n,i=>!!i.field):S(n)||Ye(n)||Zn(n):!1}function Cs(e,t){if(Q(t)){const n=e[t];if((S(n)||Ye(n))&&(sc(n.type)||S(n)&&n.timeUnit)){const i=Ur(t);return Gc(e,i)}}return!1}function Fs(e){return It(fd,t=>{if(Kt(e,t)){const n=e[t];if(v(n))return It(n,i=>!!i.aggregate);{const i=Ke(n);return i&&!!i.aggregate}}return!1})}function Vc(e,t){const n=[],i=[],r=[],s=[],o={};return Ns(e,(a,c)=>{if(S(a)){const{field:u,aggregate:l,bin:f,timeUnit:d,...p}=a;if(l||d||f){const g=Es(a),m=g?.title;let h=w(a,{forAs:!0});const y={...m?[]:{title:vn(a,t,{allowDisabling:!0})},...p,field:h};if(l){let $;if(_t(l)?($="argmax",h=w({op:"argmax",field:l.argmax},{forAs:!0}),y.field=`${h}.${u}`):ut(l)?($="argmin",h=w({op:"argmin",field:l.argmin},{forAs:!0}),y.field=`${h}.${u}`):l!=="boxplot"&&l!=="errorbar"&&l!=="errorband"&&($=l),$){const C={op:$,as:h};u&&(C.field=u),s.push(C)}}else if(n.push(h),ae(a)&&j(f)){if(i.push({bin:f,field:u,as:h}),n.push(w(a,{binSuffix:"end"})),Jn(a,c)&&n.push(w(a,{binSuffix:"range"})),Q(c)){const $={field:`${h}_end`};o[`${c}2`]=$}y.bin="binned",da(c)||(y.type=qt)}else if(d&&!Ht(d)){r.push({timeUnit:d,field:u,as:h});const $=ae(a)&&a.type!==bn&&"time";$&&(c===qn||c===Dt?y.formatType=$:Sd(c)?y.legend={formatType:$,...y.legend}:Q(c)&&(y.axis={formatType:$,...y.axis}))}o[c]=y}else n.push(u),o[c]=e[c]}else o[c]=e[c]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function fm(e,t,n){const i=$d(t,n);if(i){if(i==="binned"){const r=e[t===_e?H:K];return!!(S(r)&&S(e[t])&&ne(r.bin))}}else return!1;return!0}function dm(e,t,n,i){const r={};for(const s of b(e))fa(s)||x(lp(s));for(let s of hd){if(!e[s])continue;const o=e[s];if(hn(s)){const a=ga(s),c=r[a];if(S(c)){if(ug(c.type)&&(S(o)&&!c.timeUnit)){x(np(a));continue}}else s=a,x(ip(a))}if(s==="angle"&&t==="arc"&&!e.theta&&(x(tp),s=we),!fm(e,s,t)){x(Fi(s,t));continue}if(s===ot&&t==="line"){const a=Ke(e[s]);if(a?.aggregate){x(cp);continue}}if(s===le&&(n?"fill"in e:"stroke"in e)){x(Ua("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===Gn||s===gn&&!v(o)&&!Pe(o)||s===Dt&&v(o)){if(o){if(s===gn){const a=e[s];if(Oc(a)){r[s]=a;continue}}r[s]=q(o).reduce((a,c)=>(S(c)?a.push(ks(c,s)):x(Kr(c,s)),a),[])}}else{if(s===Dt&&o===null)r[s]=null;else if(!S(o)&&!Ye(o)&&!Pe(o)&&!Di(o)&&!E(o)){x(Kr(o,s));continue}r[s]=Dc(o,s,i)}}return r}function Xi(e,t){const n={};for(const i of b(e)){const r=Dc(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function pm(e){const t=[];for(const n of b(e))if(Kt(e,n)){const i=e[n],r=q(i);for(const s of r)S(s)?t.push(s):ji(s)&&t.push(s.condition)}return t}function Ns(e,t,n){if(!e)return;for(const i of b(e)){const r=e[i];if(v(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function gm(e,t,n,i){return e?b(e).reduce((r,s)=>{const o=e[s];return v(o)?o.reduce((a,c)=>t.call(i,a,c,s),r):t.call(i,r,o,s)},n):n}function Xc(e,t){return b(t).reduce((n,i)=>{switch(i){case H:case K:case wi:case vi:case $i:case _e:case Ue:case xt:case pn:case we:case st:case ke:case rt:case Ce:case Fe:case Ne:case $e:case qn:case fe:case Mt:case Dt:return n;case gn:if(e==="line"||e==="trail")return n;case Gn:case Si:{const r=t[i];if(v(r)||S(r))for(const s of q(r))s.aggregate||n.push(w(s,{}));return n}case ot:if(e==="trail")return n;case le:case Be:case We:case at:case St:case wt:case vt:case $t:{const r=Ke(t[i]);return r&&!r.aggregate&&n.push(w(r,{})),n}}},[])}function mm(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(v(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return v(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function Ts(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const c=i?` of ${As(t)}`:"";return{field:o+t.field,type:t.type,title:E(a)?{signal:`${a}"${escape(c)}"`}:a+c}}),s=pm(n).map(Qg);return{tooltip:[...r,...je(s,O)]}}function As(e){const{title:t,field:n}=e;return X(t,n)}function Os(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:c,positionPrefix:u,endPositionPrefix:l=void 0,extraEncoding:f={}})=>{const d=As(n);return Yc(e,a,r,{mark:c,encoding:{[t]:{field:`${u}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...N(l)?{[`${t}2`]:{field:`${l}_${n.field}`}}:{},...i,...f}})}}function Yc(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...Ve(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...jn(e[t])?{}:e[t]}}]:[]}function Kc(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],c=i[`${r}Error2`];return{continuousAxisChannelDef:Yi(s,n),continuousAxisChannelDef2:Yi(o,n),continuousAxisChannelDefError:Yi(a,n),continuousAxisChannelDefError2:Yi(c,n),continuousAxis:r}}function Yi(e,t){if(e?.aggregate){const{aggregate:n,...i}=e;return n!==t&&x(Mp(n,t)),i}else return e}function Qc(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(Ve(n)&&n.orient)return n.orient;if(Nt(r)){if(Nt(s)){const o=S(r)&&r.aggregate,a=S(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return _n(s)&&!_n(r)?"horizontal":"vertical"}return"horizontal"}else{if(Nt(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const Ki="boxplot",hm=["box","median","outliers","rule","ticks"],ym=new Vi(Ki,Jc);function Zc(e){return V(e)?"tukey":e}function Jc(e,{config:t}){e={...e,encoding:Xi(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=Ve(n)?n:{type:n};r&&x(Ia("boxplot"));const c=a.extent??t.boxplot.extent,u=z("size",a,t),l=a.invalid,f=Zc(c),{bins:d,timeUnits:p,transform:g,continuousAxisChannelDef:m,continuousAxis:h,groupby:y,aggregate:$,encodingWithoutContinuousAxis:C,ticksOrient:_,boxOrient:T,customTooltipWithoutAggregatedField:M}=bm(e,c,t),{color:he,size:ie,...Me}=C,yt=kf=>Os(a,h,m,kf,t.boxplot),tt=yt(Me),_r=yt(C),di=yt({...Me,...ie?{size:ie}:{}}),sn=Ts([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],m,C),Dn={type:"tick",color:"black",opacity:1,orient:_,invalid:l,aria:!1},on=f==="min-max"?sn:Ts([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,C),Lo=[...tt({partName:"rule",mark:{type:"rule",invalid:l,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:on}),...tt({partName:"rule",mark:{type:"rule",invalid:l,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:on}),...tt({partName:"ticks",mark:Dn,positionPrefix:"lower_whisker",extraEncoding:on}),...tt({partName:"ticks",mark:Dn,positionPrefix:"upper_whisker",extraEncoding:on})],Mo=[...f!=="tukey"?Lo:[],..._r({partName:"box",mark:{type:"bar",...u?{size:u}:{},orient:T,invalid:l,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:sn}),...di({partName:"median",mark:{type:"tick",invalid:l,...L(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...u?{size:u}:{},orient:_,aria:!1},positionPrefix:"mid_box",extraEncoding:sn})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(g),layer:Mo};const Do=`datum["lower_box_${m.field}"]`,jo=`datum["upper_box_${m.field}"]`,Uo=`(${jo} - ${Do})`,Bo=`${Do} - ${c} * ${Uo}`,Wo=`${jo} + ${c} * ${Uo}`,pi=`datum["${m.field}"]`,vf={joinaggregate:eu(m.field),groupby:y},Ho={transform:[{filter:`(${Bo} <= ${pi}) && (${pi} <= ${Wo})`},{aggregate:[{op:"min",field:m.field,as:`lower_whisker_${m.field}`},{op:"max",field:m.field,as:`upper_whisker_${m.field}`},{op:"min",field:`lower_box_${m.field}`,as:`lower_box_${m.field}`},{op:"max",field:`upper_box_${m.field}`,as:`upper_box_${m.field}`},...$],groupby:y}],layer:Lo},{tooltip:TS,...Ef}=Me,{scale:qo,axis:_f}=m,Go=As(m),Vo=ue(_f,["title"]),Xo=Yc(a,"outliers",t.boxplot,{transform:[{filter:`(${pi} < ${Bo}) || (${pi} > ${Wo})`}],mark:"point",encoding:{[h]:{field:m.field,type:m.type,...Go!==void 0?{title:Go}:{},...qo!==void 0?{scale:qo}:{},...I(Vo)?{}:{axis:Vo}},...Ef,...he?{color:he}:{},...M?{tooltip:M}:{}}})[0];let gi;const Yo=[...d,...p,vf];return Xo?gi={transform:Yo,layer:[Xo,Ho]}:(gi=Ho,gi.transform.unshift(...Yo)),{...o,layer:[gi,{transform:g,layer:Mo}]}}function eu(e){return[{op:"q1",field:e,as:`lower_box_${e}`},{op:"q3",field:e,as:`upper_box_${e}`}]}function bm(e,t,n){const i=Qc(e,Ki),{continuousAxisChannelDef:r,continuousAxis:s}=Kc(e,i,Ki),o=r.field,a=Zc(t),c=[...eu(o),{op:"median",field:o,as:`mid_box_${o}`},{op:"min",field:o,as:(a==="min-max"?"lower_whisker_":"min_")+o},{op:"max",field:o,as:(a==="min-max"?"upper_whisker_":"max_")+o}],u=a==="min-max"||a==="tukey"?[]:[{calculate:`datum["upper_box_${o}"] - datum["lower_box_${o}"]`,as:`iqr_${o}`},{calculate:`min(datum["upper_box_${o}"] + datum["iqr_${o}"] * ${t}, datum["max_${o}"])`,as:`upper_whisker_${o}`},{calculate:`max(datum["lower_box_${o}"] - datum["iqr_${o}"] * ${t}, datum["min_${o}"])`,as:`lower_whisker_${o}`}],{[s]:l,...f}=e.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:p}=mm(f),{bins:g,timeUnits:m,aggregate:h,groupby:y,encoding:$}=Vc(p,n),C=i==="vertical"?"horizontal":"vertical",_=i,T=[...g,...m,{aggregate:[...h,...c],groupby:y},...u];return{bins:g,timeUnits:m,transform:T,groupby:y,aggregate:h,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:$,ticksOrient:C,boxOrient:_,customTooltipWithoutAggregatedField:d}}const Ps="errorbar",xm=["ticks","rule"],Sm=new Vi(Ps,tu);function tu(e,{config:t}){e={...e,encoding:Xi(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:c,tooltipEncoding:u}=nu(e,Ps,t);delete s.size;const l=Os(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,p={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},g=[...l({partName:"ticks",mark:p,positionPrefix:"lower",extraEncoding:u}),...l({partName:"ticks",mark:p,positionPrefix:"upper",extraEncoding:u}),...l({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...c,transform:n,...g.length>1?{layer:g}:{...g[0]}}}function wm(e,t){const{encoding:n}=e;if($m(n))return{orient:Qc(e,t),inputType:"raw"};const i=vm(n),r=Em(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,c=n.y2;if(F(a)&&F(c))throw new Error(`${t} cannot have both x2 and y2`);if(F(a)){if(Nt(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(F(c)){if(Nt(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,c=n.xError2,u=n.yError,l=n.yError2;if(F(c)&&!F(a))throw new Error(`${t} cannot have xError2 without xError`);if(F(l)&&!F(u))throw new Error(`${t} cannot have yError2 without yError`);if(F(a)&&F(u))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(F(a)){if(Nt(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(F(u)){if(Nt(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function $m(e){return(F(e.x)||F(e.y))&&!F(e.x2)&&!F(e.y2)&&!F(e.xError)&&!F(e.xError2)&&!F(e.yError)&&!F(e.yError2)}function vm(e){return F(e.x2)||F(e.y2)}function Em(e){return F(e.xError)||F(e.xError2)||F(e.yError)||F(e.yError2)}function nu(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,c=Ve(i)?i:{type:i};s&&x(Ia(t));const{orient:u,inputType:l}=wm(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:g,continuousAxis:m}=Kc(e,u,t),{errorBarSpecificAggregate:h,postAggregateCalculates:y,tooltipSummary:$,tooltipTitleWithFieldName:C}=_m(c,f,d,p,g,l,t,n),{[m]:_,[m==="x"?"x2":"y2"]:T,[m==="x"?"xError":"yError"]:M,[m==="x"?"xError2":"yError2"]:he,...ie}=r,{bins:Me,timeUnits:yt,aggregate:tt,groupby:_r,encoding:di}=Vc(ie,n),sn=[...tt,...h],Dn=l!=="raw"?[]:_r,on=Ts($,f,di,C);return{transform:[...a.transform??[],...Me,...yt,...sn.length===0?[]:[{aggregate:sn,groupby:Dn}],...y],groupby:Dn,continuousAxisChannelDef:f,continuousAxis:m,encodingWithoutContinuousAxis:di,ticksOrient:u==="vertical"?"horizontal":"vertical",markDef:c,outerSpec:a,tooltipEncoding:on}}function _m(e,t,n,i,r,s,o,a){let c=[],u=[];const l=t.field;let f,d=!1;if(s==="raw"){const p=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,g=e.extent?e.extent:p==="mean"?"stderr":"iqr";if(p==="median"!==(g==="iqr")&&x(Lp(p,g,o)),g==="stderr"||g==="stdev")c=[{op:g,field:l,as:`extent_${l}`},{op:p,field:l,as:`center_${l}`}],u=[{calculate:`datum["center_${l}"] + datum["extent_${l}"]`,as:`upper_${l}`},{calculate:`datum["center_${l}"] - datum["extent_${l}"]`,as:`lower_${l}`}],f=[{fieldPrefix:"center_",titlePrefix:Wn(p)},{fieldPrefix:"upper_",titlePrefix:iu(p,g,"+")},{fieldPrefix:"lower_",titlePrefix:iu(p,g,"-")}],d=!0;else{let m,h,y;g==="ci"?(m="mean",h="ci0",y="ci1"):(m="median",h="q1",y="q3"),c=[{op:h,field:l,as:`lower_${l}`},{op:y,field:l,as:`upper_${l}`},{op:m,field:l,as:`center_${l}`}],f=[{fieldPrefix:"upper_",titlePrefix:vn({field:l,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:vn({field:l,aggregate:h,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:vn({field:l,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&x(Ip(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],u=[{calculate:`datum["${n.field}"]`,as:`upper_${l}`},{calculate:`datum["${l}"]`,as:`lower_${l}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:l}],u=[{calculate:`datum["${l}"] + datum["${i.field}"]`,as:`upper_${l}`}],r?u.push({calculate:`datum["${l}"] + datum["${r.field}"]`,as:`lower_${l}`}):u.push({calculate:`datum["${l}"] - datum["${i.field}"]`,as:`lower_${l}`}));for(const p of u)f.push({fieldPrefix:p.as.substring(0,6),titlePrefix:Lt(Lt(p.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:u,errorBarSpecificAggregate:c,tooltipSummary:f,tooltipTitleWithFieldName:d}}function iu(e,t,n){return`${Wn(e)} ${n} ${t}`}const zs="errorband",km=["band","borders"],Cm=new Vi(zs,ru);function ru(e,{config:t}){e={...e,encoding:Xi(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:c}=nu(e,zs,t),u=o,l=Os(u,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},p={type:f?"line":"rule"};const g={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(d={...d,...g,ariaRoleDescription:"errorband"},p={...p,...g,aria:!1}):u.interpolate?x(qa("interpolate")):u.tension&&x(qa("tension")),{...a,transform:n,layer:[...l({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c}),...l({partName:"borders",mark:p,positionPrefix:"lower",extraEncoding:c}),...l({partName:"borders",mark:p,positionPrefix:"upper",extraEncoding:c})]}}const su={};function Rs(e,t,n){const i=new Vi(e,t);su[e]={normalizer:i,parts:n}}function Fm(){return b(su)}Rs(Ki,Jc,hm),Rs(Ps,tu,xm),Rs(zs,ru,km);const Nm=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],ou={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},au={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},Tm=b(ou),Am=b(au),Om={header:1,headerRow:1,headerColumn:1,headerFacet:1},cu=b(Om),uu=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Pm={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},zm={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},ze="_vgsid_",Rm={point:{on:"click",fields:[ze],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function Is(e){return e==="legend"||!!e?.legend}function Ls(e){return Is(e)&&L(e)}function Ms(e){return!!e?.select}function lu(e){const t=[];for(const n of e||[]){if(Ms(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function Im(e){return Qi(e)||js(e)||Ds(e)}function Ds(e){return"concat"in e}function Qi(e){return"vconcat"in e}function js(e){return"hconcat"in e}function fu({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function Qe(e){return L(e)&&e.step!==void 0}function du(e){return e.view||e.width||e.height}const pu=20,Lm={align:1,bounds:1,center:1,columns:1,spacing:1},Mm=b(Lm);function Dm(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&((Mi(e)&&!Qn(e.facet)||Ds(e))&&(r.columns=o)),Qi(e)&&(r.columns=1);for(const a of Mm)if(e[a]!==void 0)if(a==="spacing"){const c=e[a];r[a]=V(c)?c:{row:c.row??s,column:c.column??s}}else r[a]=e[a];return r}function Us(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function Zi(e,t){const n=Ji(e,t);return Qe(n)?n.step:gu}function Ji(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return X(n,{step:e.step})}const gu=20,jm={continuousWidth:200,continuousHeight:200,step:gu},Um={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:jm,mark:Pg,arc:{},area:{},bar:Ig,circle:{},geoshape:{},image:{},line:{},point:{},rect:Lg,rule:{color:"black"},square:{},text:{color:"black"},tick:Mg,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:mg,projection:{},legend:Pm,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Rm,style:{},title:{},facet:{spacing:pu},concat:{spacing:pu},normalizedNumberFormat:".0%"},pt=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],mu={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},hu={blue:pt[0],orange:pt[1],red:pt[2],teal:pt[3],green:pt[4],yellow:pt[5],purple:pt[6],pink:pt[7],brown:pt[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Bm(e={}){return{signals:[{name:"color",value:L(e)?{...hu,...e}:hu}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function Wm(e){return{signals:[{name:"fontSize",value:L(e)?{...mu,...e}:mu}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function Hm(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function yu(e){const t=b(e||{}),n={};for(const i of t){const r=e[i];n[i]=ei(r)?va(r):ye(r)}return n}function qm(e){const t=b(e),n={};for(const i of t)n[i]=yu(e[i]);return n}const Gm=[...yc,...qc,...cu,"background","padding","legend","lineBreak","scale","style","title","view"];function bu(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=Ko({},k(Um),n?Hm(n):{},t?Bm(t):{},i?Wm(i):{},s||{});r&&zf(o,"selection",r,!0);const a=ue(o,Gm);for(const c of["background","lineBreak","padding"])o[c]&&(a[c]=ye(o[c]));for(const c of yc)o[c]&&(a[c]=pe(o[c]));for(const c of qc)o[c]&&(a[c]=yu(o[c]));for(const c of cu)o[c]&&(a[c]=pe(o[c]));return o.legend&&(a.legend=pe(o.legend)),o.scale&&(a.scale=pe(o.scale)),o.style&&(a.style=qm(o.style)),o.title&&(a.title=pe(o.title)),o.view&&(a.view=pe(o.view)),a}const Vm=new Set(["view",...Cg]),Xm=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Ym={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...Og};function Km(e){e=k(e);for(const t of Xm)delete e[t];if(e.axis)for(const t in e.axis)ei(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Nm)delete e.legend[t];if(e.mark){for(const t of hc)delete e.mark[t];e.mark.tooltip&&L(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(lu(e.params)),delete e.params);for(const t of Vm){for(const i of hc)delete e[t][i];const n=Ym[t];if(n)for(const i of n)delete e[t][i];Zm(e,t)}for(const t of Fm())delete e[t];Qm(e);for(const t in e)L(e[t])&&I(e[t])&&delete e[t];return I(e)?void 0:e}function Qm(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=$a(e.title);I(t)||(e.style["group-title"]={...e.style["group-title"],...t}),I(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),I(i)?delete e.title:e.title=i}function Zm(e,t,n,i){const r=i?e[t][i]:e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};I(s)||(e.style[n??t]=s),i||delete e[t]}function er(e){return"layer"in e}function Jm(e){return"repeat"in e}function eh(e){return!v(e.repeat)&&e.repeat.layer}class Bs{map(t,n){return Mi(t)?this.mapFacet(t,n):Jm(t)?this.mapRepeat(t,n):js(t)?this.mapHConcat(t,n):Qi(t)?this.mapVConcat(t,n):Ds(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(er(t))return this.mapLayer(t,n);if(dt(t))return this.mapUnit(t,n);throw new Error(Xr(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const th={zero:1,center:1,normalize:1};function nh(e){return e in th}const ih=new Set([pc,Oi,Ai,Ri,zi,gs,ms,Pi,gc,ps]),rh=new Set([Oi,Ai,pc]);function kn(e){return S(e)&&wn(e)==="quantitative"&&!e.bin}function xu(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x",o=e[t],a=e[r];if(S(o)&&S(a))if(kn(o)&&kn(a)){if(o.stack)return t;if(a.stack)return r;const c=S(o)&&!!o.aggregate,u=S(a)&&!!a.aggregate;if(c!==u)return c?t:r;if(s&&i==="bar"){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(kn(o))return t;if(kn(a))return r}else{if(kn(o))return t;if(kn(a))return r}return}function sh(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function Su(e,t){const n=Ve(e)?e:{type:e},i=n.type;if(!ih.has(i))return null;const r=xu(t,"x",n)||xu(t,"theta",n);if(!r)return null;const s=t[r],o=S(s)?w(s,{}):void 0,a=sh(r),c=[],u=new Set;if(t[a]){const d=t[a],p=S(d)?w(d,{}):void 0;p&&p!==o&&(c.push(a),u.add(p));const g=a==="x"?"xOffset":"yOffset",m=t[g],h=S(m)?w(m,{}):void 0;h&&h!==o&&(c.push(g),u.add(h))}const l=yd.reduce((d,p)=>{if(p!=="tooltip"&&Kt(t,p)){const g=t[p];for(const m of q(g)){const h=Ke(m);if(h.aggregate)continue;const y=w(h,{});(!y||!u.has(y))&&d.push({channel:p,fieldDef:h})}}return d},[]);let f;return s.stack!==void 0?jn(s.stack)?f=s.stack?"zero":null:f=s.stack:rh.has(i)&&(f="zero"),!f||!nh(f)||Fs(t)&&l.length===0?null:s?.scale?.type&&s?.scale?.type!==ge.LINEAR?(s?.stack&&x(Pp(s.scale.type)),null):F(t[He(r)])?(s.stack!==void 0&&x(Op(r)),null):(S(s)&&s.aggregate&&!Nd.has(s.aggregate)&&x(zp(s.aggregate)),{groupbyChannels:c,groupbyFields:u,fieldChannel:r,impute:s.impute===null?!1:Ft(i),stackBy:l,offset:f})}function oh(e){const{point:t,line:n,...i}=e;return b(i).length>1?i:i.type}function ah(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:ue(e[t],["point","line"])});return e}function Ws(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?L(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?L(t.point)?t.point:{}:void 0}function wu(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class ch{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(dt(t)){const{mark:i,encoding:r}=t,s=Ve(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!Ws(s,n[s.type],r);case"area":return!!Ws(s,n[s.type],r)||!!wu(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:c,encoding:u,...l}=t,f=Xi(u,r),d=Ve(a)?a:{type:a},p=Ws(d,r[d.type],f),g=d.type==="area"&&wu(d,r[d.type]),m=[{name:c,...s?{params:s}:{},mark:oh({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:ue(f,["shape"])}],h=Su(d,f);let y=f;if(h){const{fieldChannel:$,offset:C}=h;y={...f,[$]:{...f[$],...C?{stack:C}:{}}}}return y=ue(y,["y2","x2"]),g&&m.push({...o?{projection:o}:{},mark:{type:"line",...fn(d,["clip","interpolate","tension","tooltip"]),...g},encoding:y}),p&&m.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...fn(d,["clip","tooltip"]),...p},encoding:y}),i({...l,layer:m},{...n,config:ah(r)})}}function uh(e,t){return t?Qn(e)?_u(e,t):$u(e,t):e}function Hs(e,t){return t?_u(e,t):e}function qs(e,t,n){const i=t[e];if(Yg(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};x(Xd(i.repeat));return}return t}function $u(e,t){if(e=qs("field",e,t),e===void 0)return;if(e===null)return null;if(vs(e)&&Xe(e.sort)){const n=qs("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}function vu(e,t){if(S(e))return $u(e,t);{const n=qs("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function Eu(e,t){if(F(e)){const n=vu(e,t);if(n)return n;if(Di(e))return{condition:e.condition}}else{if(Zn(e)){const n=vu(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}return}function _u(e,t){const n={};for(const i in e)if(an(e,i)){const r=e[i];if(v(r))n[i]=r.map(s=>Eu(s,t)).filter(s=>s);else{const s=Eu(r,t);s!==void 0&&(n[i]=s)}}return n}class lh{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(dt(t)){const{encoding:n,mark:i}=t;if(i==="line"||Ve(i)&&i.type==="line")for(const r of md){const s=jt(r),o=n[s];if(n[r]&&(S(o)&&!ne(o.bin)||Ye(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return x(mp(!!r.x2,!!r.y2)),i({...t,mark:L(s)?{...s,type:"rule"}:"rule"},n)}}class fh extends Bs{constructor(){super(...arguments);this.nonFacetUnitNormalizers=[ym,Sm,Cm,new ch,new lh]}map(t,n){if(dt(t)){const i=Kt(t.encoding,nt),r=Kt(t.encoding,it),s=Kt(t.encoding,xi);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=Hs(t.encoding,n.repeater),o={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(c=>c).join("_")}:{},...s?{encoding:s}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(o,n);const a=this.mapLayerOrUnit.bind(this);for(const c of this.nonFacetUnitNormalizers)if(c.hasMatchingType(o,n.config))return c.run(o,n,a);return o}mapRepeat(t,n){return eh(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...s}=t,{row:o,column:a,layer:c}=i,{repeater:u={},repeaterPrefix:l=""}=n;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:c},spec:r}},n):{...s,layer:c.map(f=>{const d={...u,layer:f},p=`${(r.name?`${r.name}_`:"")+l}child__layer_${W(f)}`,g=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:p});return g.name=p,g})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...o}=t;!v(i)&&t.columns&&(t=ue(t,["columns"]),x(La("repeat")));const a=[],{repeater:c={},repeaterPrefix:u=""}=n,l=!v(i)&&i.row||[c?c.row:null],f=!v(i)&&i.column||[c?c.column:null],d=v(i)&&i||[c?c.repeat:null];for(const g of d)for(const m of l)for(const h of f){const y={repeat:g,row:m,column:h,layer:c.layer},$=(r.name?`${r.name}_`:"")+u+"child__"+(v(i)?`${W(g)}`:(i.row?`row_${W(m)}`:"")+(i.column?`column_${W(h)}`:"")),C=this.map(r,{...n,repeater:y,repeaterPrefix:$});C.name=$,a.push(ue(C,["data"]))}const p=v(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...o,columns:p,concat:a}}mapFacet(t,n){const{facet:i}=t;return Qn(i)&&t.columns&&(t=ue(t,["columns"]),x(La("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:o,config:a}=n,c=Cu({parentProjection:o,projection:r}),u=ku({parentEncoding:s,encoding:Hs(i,n.repeater)});return this.mapUnit({...t,...c?{projection:c}:{},...u?{encoding:u}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:s,...o}=t.encoding,{mark:a,width:c,projection:u,height:l,view:f,params:d,encoding:p,...g}=t,{facetMapping:m,layout:h}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=Hs(o,n.repeater);return this.mapFacet({...g,...h,facet:m,spec:{...c?{width:c}:{},...l?{height:l}:{},...f?{view:f}:{},...u?{projection:u}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:s}=t;if(i||r){s&&x(pp([...i?[nt]:[],...r?[it]:[]]));const o={},a={};for(const c of[nt,it]){const u=t[c];if(u){const{align:l,center:f,spacing:d,columns:p,...g}=u;o[c]=g;for(const m of["align","center","spacing"])u[m]!==void 0&&(a[m]??(a[m]={}),a[m][c]=u[m])}}return{facetMapping:o,layout:a}}else{const{align:o,center:a,spacing:c,columns:u,...l}=s;return{facetMapping:uh(l,n.repeater),layout:{...o?{align:o}:{},...a?{center:a}:{},...c?{spacing:c}:{},...u?{columns:u}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:s,projection:o,...a}=t,c={...r,parentEncoding:ku({parentEncoding:n,encoding:s,layer:!0}),parentProjection:Cu({parentProjection:i,projection:o})};return super.mapLayer({...a,...t.name?{name:[c.repeaterPrefix,t.name].filter(u=>u).join("_")}:{}},c)}}function ku({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...b(e),...b(t)]);for(const s of r){const o=t[s],a=e[s];if(F(o)){const c={...a,...o};i[s]=c}else Zn(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||Pe(a)||E(a)||F(a)||v(a))&&(i[s]=a)}}else i=t;return!i||I(i)?void 0:i}function Cu(e){const{parentProjection:t,projection:n}=e;return t&&n&&x(ep({parentProjection:t,projection:n})),n??t}function Gs(e){return"filter"in e}function dh(e){return e?.stop!==void 0}function Fu(e){return"lookup"in e}function ph(e){return"data"in e}function gh(e){return"param"in e}function mh(e){return"pivot"in e}function hh(e){return"density"in e}function yh(e){return"quantile"in e}function bh(e){return"regression"in e}function xh(e){return"loess"in e}function Sh(e){return"sample"in e}function wh(e){return"window"in e}function $h(e){return"joinaggregate"in e}function vh(e){return"flatten"in e}function Eh(e){return"calculate"in e}function Nu(e){return"bin"in e}function _h(e){return"impute"in e}function kh(e){return"timeUnit"in e}function Ch(e){return"aggregate"in e}function Fh(e){return"stack"in e}function Nh(e){return"fold"in e}function Th(e){return"extent"in e&&!("density"in e)}function Ah(e){return e.map(t=>Gs(t)?{filter:ln(t.filter,cg)}:t)}class Oh extends Bs{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=Tu(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=Tu(t,n),t.encoding){const i={};for(const[r,s]of bt(t.encoding))i[r]=Au(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:bt(i).map(([s,o])=>{const{init:a,bind:c,empty:u,...l}=o;l.type==="single"?(l.type="point",l.toggle=!1):l.type==="multi"&&(l.type="point"),n.emptySelections[s]=u!=="none";for(const f of te(n.selectionPredicates[s]??{}))f.empty=u!=="none";return{name:s,value:a,select:l,bind:c}})}:t}}function Tu(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(Gs(s))return{filter:Vs(s,t)};if(Nu(s)&&Ut(s.bin))return{...s,bin:Ou(s.bin)};if(Fu(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function Au(e,t){const n=k(e);if(S(n)&&Ut(n.bin)&&(n.bin=Ou(n.bin)),Yt(n)&&n.scale?.domain?.selection){const{selection:i,...r}=n.scale.domain;n.scale.domain={...r,...i?{param:i}:{}}}if(Di(n))if(Qo(n.condition))n.condition=n.condition.map(i=>{const{selection:r,param:s,test:o,...a}=i;return s?i:{...a,test:Vs(i,t)}});else{const{selection:i,param:r,test:s,...o}=Au(n.condition,t);n.condition=r?n.condition:{...o,test:Vs(n.condition,t)}}return n}function Ou(e){const t=e.extent;if(t?.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Vs(e,t){const n=i=>ln(i,r=>{var s;const o=t.emptySelections[r]??!0,a={param:r,empty:o};return(s=t.selectionPredicates)[r]??(s[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):ln(e.test||e.filter,i=>i.selection?n(i.selection):i)}class Xs extends Bs{map(t,n){const i=n.selections??[];if(t.params&&!dt(t)){const r=[];for(const s of t.params)Ms(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(mi(a)&&(a===t.name||r.includes(a))||Qo(a)&&a.map(c=>r.indexOf(c)).every((c,u,l)=>c!==-1&&(u===0||c>l[u-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=Xs.prototype[e];Xs.prototype[e]=function(n,i){return t.call(this,n,Ph(n,i))}}function Ph(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function Pu(e,t){t===void 0&&(t=bu(e.config));const n=Lh(e,t),{width:i,height:r}=e,s=Mh(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const zh=new fh,Rh=new Oh,Ih=new Xs;function Lh(e,t={}){const n={config:t};return Ih.map(zh.map(Rh.map(e,n),n),n)}function zu(e){return N(e)?{type:e}:e??{}}function Mh(e,t,n){let{width:i,height:r}=t;const s=dt(e)||er(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(x(Oa("width")),i=void 0),r=="container"&&(x(Oa("height")),r=void 0));const a={type:"pad",...o,...n?zu(n.autosize):{},...zu(e.autosize)};return a.type==="fit"&&!s&&(x(Md),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&x(Pa("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&x(Pa("height")),De(a,{type:"pad"})?void 0:a}function Dh(e){return e==="fit"||e==="fit-x"||e==="fit-y"}function jh(e){return e?`fit-${Ei(e)}`:"fit"}const Uh=["background","padding"];function Ru(e,t){const n={};for(const i of Uh)e&&e[i]!==void 0&&(n[i]=ye(e[i]));return t&&(n.params=e.params),n}class gt{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new gt(k(this.explicit),k(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return X(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of b(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function Ze(e){return{explicit:!0,value:e}}function xe(e){return{explicit:!1,value:e}}function Iu(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:tr(t,n,i,r)}}function tr(e,t,n,i){return e.explicit&&t.explicit&&x(_p(n,i,e.value,t.value)),e}function Tt(e,t,n,i,r=tr){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:De(e.value,t.value)?e:r(e,t,n,i)}class Bh extends gt{constructor(t={},n={},i=!1){super(t,n);this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function Cn(e){return"url"in e}function ti(e){return"values"in e}function Lu(e){return"name"in e&&!Cn(e)&&!ti(e)&&!At(e)}function At(e){return e&&(Mu(e)||Du(e)||Ys(e))}function Mu(e){return"sequence"in e}function Du(e){return"sphere"in e}function Ys(e){return"graticule"in e}var U;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"})(U||(U={}));function ju(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=Se(r.field),r}function Qt(e,t=!0,n=Af){if(v(e)){const i=e.map(r=>Qt(r,t,n));return t?`[${i.join(", ")}]`:i}else if(Bt(e))return n(t?Wt(e):Kp(e));return t?n(D(e)):e}function Wh(e,t){for(const n of te(e.component.selection??{})){const i=n.name;let r=`${i}${Pt}, ${n.resolve==="global"?"true":`{unit: ${Jt(e)}}`}`;for(const s of or){if(!s.defined(n))continue;s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r))}t.push({name:i+wy,on:[{events:{signal:n.name+Pt},update:`modify(${A(n.name+Zt)}, ${r})`}]})}return Ks(t)}function Hh(e,t){if(e.component.selection&&b(e.component.selection).length){const n=A(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:un("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Ks(t)}function qh(e,t){let n=!1;for(const i of te(e.component.selection??{})){const r=i.name,s=A(r+Zt),o=t.filter(a=>a.name===r);if(o.length===0){const a=i.resolve==="global"?"union":i.resolve,c=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${fl}(${s}, ${A(a)}${c}`})}n=!0;for(const a of or)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}if(n){const i=t.filter(r=>r.name==="unit");i.length===0&&t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]})}return Ks(t)}function Gh(e,t){const n=[...t],i=Jt(e,{escape:!1});for(const r of te(e.component.selection??{})){const s={name:r.name+Zt};if(r.project.hasSelectionId&&(s.transform=[{type:"collect",sort:{field:ze}}]),r.init){const a=r.project.items.map(ju);s.values=r.project.hasSelectionId?r.init.map(c=>({unit:i,[ze]:Qt(c,!1)[0]})):r.init.map(c=>({unit:i,fields:a,values:Qt(c,!1)}))}const o=n.filter(a=>a.name===r.name+Zt);o.length||n.push(s)}return n}function Uu(e,t){for(const n of te(e.component.selection??{}))for(const i of or)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function Vh(e,t){for(const n of e.children)G(n)&&(t=Uu(n,t));return t}function Xh(e,t,n,i){const r=hl(e,t.param,t);return{signal:be(n.get("type"))&&v(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function Ks(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class R{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){x(Qd);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class ce extends R{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n);this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${ia()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function Qs(e){return e.as!==void 0}function Bu(e){return`${e}_end`}class Je extends R{clone(){return new Je(null,k(this.formula))}constructor(t,n){super(t);this.formula=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s)=>{const{field:o,timeUnit:a}=s;if(a){let c;if(Ht(a)){if(G(n)){const{mark:u}=n;(hs(u)||!!s.bandPosition)&&(c={timeUnit:Z(a),field:o})}}else c={as:w(s,{forAs:!0}),field:o,timeUnit:a};c&&(r[O(c)]=c)}return r},{});return I(i)?null:new Je(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=Z(i),o={...r,timeUnit:s};return new Je(t,{[O(o)]:o})}merge(t){this.formula={...this.formula};for(const n in t.formula)this.formula[n]||(this.formula[n]=t.formula[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of bt(this.formula)){const s=Qs(r)?r.as:`${r.field}_end`;t.has(s)||(n[i]=r)}this.formula=n}producedFields(){return new Set(te(this.formula).map(t=>Qs(t)?t.as:Bu(t.field)))}dependentFields(){return new Set(te(this.formula).map(t=>t.field))}hash(){return`TimeUnit ${O(this.formula)}`}assemble(){const t=[];for(const n of te(this.formula))if(Qs(n)){const{field:i,as:r,timeUnit:s}=n,{unit:o,utc:a,...c}=Z(s);t.push({field:Se(i),type:"timeunit",...o?{units:Ti(o)}:{},...a?{timezone:"utc"}:{},...c,as:[r,`${r}_end`]})}else if(n){const{field:i,timeUnit:r}=n,s=Za(r?.unit),{part:o,step:a}=nc(s,r.step);t.push({type:"formula",expr:`timeOffset('${o}', datum['${i}'], ${a})`,as:Bu(i)})}return t}}const ni="_tuple_fields";class Yh{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const Kh={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new Yh),s={},o={},a=new Set,c=(g,m)=>{const h=m==="visual"?g.channel:g.field;let y=W(`${i}_${h}`);for(let $=1;a.has(y);$++)y=W(`${i}_${h}_${$}`);return a.add(y),{[m]:y}},u=t.type,l=e.config.selection[u],f=n.value!==void 0?q(n.value):null;let{fields:d,encodings:p}=L(n.select)?n.select:{};if(!d&&!p&&f)for(const g of f){if(!L(g))continue;for(const m of b(g))gd(m)?(p||(p=[])).push(m):u==="interval"?(x(Vd),p=l.encodings):(d??(d=[])).push(m)}!d&&!p&&(p=l.encodings,"fields"in l&&(d=l.fields));for(const g of p??[]){const m=e.fieldDef(g);if(m){let h=m.field;if(m.aggregate){x(Dd(g,m.aggregate));continue}else if(!h){x(Ra(g));continue}if(m.timeUnit&&!Ht(m.timeUnit)){h=e.vgField(g);const y={timeUnit:m.timeUnit,as:h,field:m.field};o[O(y)]=y}if(!s[h]){const y=u==="interval"&&ct(g)&&be(e.getScaleComponent(g).get("type"))?"R":m.bin?"R-RE":"E",$={field:h,channel:g,type:y,index:r.items.length};$.signals={...c($,"data"),...c($,"visual")},r.items.push(s[h]=$),r.hasField[h]=s[h],r.hasSelectionId=r.hasSelectionId||h===ze,ua(g)?($.geoChannel=g,$.channel=ca(g),r.hasChannel[$.channel]=s[h]):r.hasChannel[g]=s[h]}}else x(Ra(g))}for(const g of d??[]){if(r.hasField[g])continue;const m={type:"E",field:g,index:r.items.length};m.signals={...c(m,"data")},r.items.push(m),r.hasField[g]=m,r.hasSelectionId=r.hasSelectionId||g===ze}f&&(t.init=f.map(g=>r.items.map(m=>L(g)?g[m.geoChannel||m.channel]!==void 0?g[m.geoChannel||m.channel]:g[m.field]:g))),I(o)||(r.timeUnit=new Je(null,o))},signals:(e,t,n)=>{const i=t.name+ni,r=n.filter(s=>s.name===i);return r.length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(ju)})}},mt={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!ct(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(!s||!be(o)){x(Bd);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||Js(e)||i.length===0)return n;const r=n.filter(o=>o.name===t.name)[0];let s=r.update;if(s.indexOf(fl)>=0)r.update=`{${i.map(o=>`${A(Se(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${A(Se(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!Js(e))for(const i of t.scales){const r=n.filter(s=>s.name===i.signals.data)[0];r.push="outer",delete r.value,delete r.update}return n}};function Zs(e,t){const n=A(e.scaleName(t));return`domain(${n})`}function Js(e){return e.parent&&Ln(e.parent)&&(!e.parent.parent??Js(e.parent.parent))}const Fn="_brush",Wu="_scale_trigger",ii="geo_interval_init_tick",Hu="_init",Qh="_center",Zh={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...Cr(n.select)?n.select:{}};r.fields=[ze],r.encodings||(r.encodings=n.value?b(n.value):[Fe,Ce]),n.select={type:"interval",...r}}if(t.translate&&!mt.defined(t)){const r=`!event.item || event.item.mark.name !== ${A(t.name+Fn)}`;for(const s of t.events){if(!s.between){x(`${s} is not an ordered event stream for interval selections.`);continue}const o=q((i=s.between[0]).filter??(i.filter=[]));o.indexOf(r)<0&&o.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+Pt,s=te(t.project.hasChannel).filter(a=>a.channel===H||a.channel===K),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,c)=>a.concat(Jh(e,t,c,o&&o[c.index])),[])),e.hasProjection){const a=A(e.projectionName()),c=e.projectionName()+Qh,{x:u,y:l}=t.project.hasChannel,f=u&&u.signals.visual,d=l&&l.signals.visual,p=u?o&&o[u.index]:`${c}[0]`,g=l?o&&o[l.index]:`${c}[1]`,m=T=>e.getSizeSignalRef(T).signal,h=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":m("width")}, ${d?d+"[1]":m("height")}]]`;if(o&&(n.unshift({name:i+Hu,init:`[scale(${a}, [${u?p[0]:p}, ${l?g[0]:g}]), scale(${a}, [${u?p[1]:p}, ${l?g[1]:g}])]`}),!u||!l)){const T=n.find(M=>M.name===c);T||n.unshift({name:c,update:`invert(${a}, [${m("width")}/2, ${m("height")}/2])`})}const y=`intersect(${h}, {markname: ${A(e.getName("marks"))}}, unit.mark)`,$=`{unit: ${Jt(e)}}`,C=`vlSelectionTuples(${y}, ${$})`,_=s.map(T=>T.signals.visual);return n.concat({name:r,on:[{events:[..._.length?[{signal:_.join(" || ")}]:[],...o?[{signal:ii}]:[]],update:C}]})}else{if(!mt.defined(t)){const u=i+Wu,l=s.map(f=>{const d=f.channel,{data:p,visual:g}=f.signals,m=A(e.scaleName(d)),h=e.getScaleComponent(d).get("type"),y=be(h)?"+":"";return`(!isArray(${p}) || (${y}invert(${m}, ${g})[0] === ${y}${p}[0] && ${y}invert(${m}, ${g})[1] === ${y}${p}[1]))`});l.length&&n.push({name:u,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:l.join(" && ")+` ? ${u} : {}`}]})}const a=s.map(u=>u.signals.data),c=`unit: ${Jt(e)}, fields: ${i+ni}, values`;return n.concat({name:r,...o?{init:`{${c}: ${Qt(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${c}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>{if(G(e)&&e.hasProjection&&t.init){const i=n.filter(r=>r.name===ii);i.length||n.unshift({name:ii,value:null,on:[{events:"timer{1}",update:`${ii} === null ? {} : ${ii}`}]})}return n},marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r?.signals.visual,a=s?.signals.visual,c=`data(${A(t.name+Zt)})`;if(mt.defined(t)||!r&&!s)return n;const u={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of b(u))u[m]=[{test:`${c}.length && ${c}[0].unit === ${Jt(e)}`,...u[m]},{value:0}];const{fill:l,fillOpacity:f,cursor:d,...p}=t.mark,g=b(p).reduce((m,h)=>(m[h]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:p[h]},{value:null}],m),{});return[{name:`${i+Fn}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:l},fillOpacity:{value:f}},update:u}},...n,{name:i+Fn,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...u,...g}}}]}};function Jh(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=A(r?e.scaleName(s):e.projectionName()),c=d=>`scale(${a}, ${d})`,u=e.getSizeSignalRef(s===H?"width":"height").signal,l=`${s}(unit)`,f=t.events.reduce((d,p)=>[...d,{events:p.between[0],update:`[${l}, ${l}]`},{events:p,update:`[${o}[0], clamp(${l}, 0, ${u})]`}],[]);if(r){const d=n.signals.data,p=mt.defined(t),g=e.getScaleComponent(s),m=g?g.get("type"):void 0,h=i?{init:Qt(i,!0,c)}:{value:[]};return f.push({events:{signal:t.name+Wu},update:be(m)?`[${c(`${d}[0]`)}, ${c(`${d}[1]`)}]`:"[0, 0]"}),p?[{name:d,on:[]}]:[{name:o,...h,on:f},{name:d,...i?{init:Qt(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===H?0:1,p=t.name+Hu,g=i?{init:`[${p}[0][${d}], ${p}[1][${d}]]`}:{value:[]};return[{name:o,...g,on:f}]}}const ey={defined:e=>e.type==="point",signals:(e,t,n)=>{const i=t.name,r=i+ni,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=te(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+Fn):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),c=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let u=`unit: ${Jt(e)}, `;if(t.project.hasSelectionId)u+=`${ze}: ${o}[${A(ze)}]`;else{const f=s.items.map(d=>{const p=e.fieldDef(d.channel);return p?.bin?`[${o}[${A(e.vgField(d.channel,{}))}], ${o}[${A(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${o}[${A(d.field)}]`}).join(", ");u+=`fields: ${r}, values: [${f}]`}const l=t.events;return n.concat([{name:i+Pt,on:l?[{events:l,update:`${c} ? {${u}} : null`,force:!0}]:[]}])}};function Nn(e,t,n,i){const r=Di(t)&&t.condition,s=i(t);if(r){const o=q(r),a=o.map(c=>{const u=i(c);if(Xg(c)){const{param:l,empty:f}=c,d=ml(e,{param:l,empty:f});return{test:d,...u}}else{const l=ar(e,c.test);return{test:l,...u}}});return{[n]:[...a,...s!==void 0?[s]:[]]}}else return s!==void 0?{[n]:s}:{}}function eo(e,t="text"){const n=e.encoding[t];return Nn(e,n,t,i=>nr(i,e.config))}function nr(e,t,n="datum"){if(e){if(Pe(e))return B(e.value);if(F(e)){const{format:i,formatType:r}=Wi(e);return Ss({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}return}function qu(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(v(o))return{tooltip:Vu({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return Nn(e,o,"tooltip",c=>{const u=nr(c,r,a);if(u)return u;if(c===null)return;let l=z("tooltip",i,r);return l===!0&&(l={content:"encoding"}),N(l)?{value:l}:L(l)?E(l)?l:l.content==="encoding"?Vu(n,s,r,t):{signal:a}:void 0})}}function Gu(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s={},o=i?"datum.datum":"datum",a=[];function c(l,f){const d=jt(f),p=ae(l)?l:{...l,type:e[d].type},g=p.title||_s(p,r),m=q(g).join(", ");let h;if(Q(f)){const y=f==="x"?"x2":"y2",$=Ke(e[y]);if(ne(p.bin)&&$){const C=w(p,{expr:o}),_=w($,{expr:o}),{format:T,formatType:M}=Wi(p);h=Kn(C,_,T,M,r),s[y]=!0}}if((Q(f)||f===we||f===ke)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:$}=Wi(p);h=Ss({fieldOrDatumDef:p,format:y,formatType:$,expr:o,config:r,normalizeStack:!0}).signal}h??(h=nr(p,r,o).signal),a.push({channel:f,key:m,value:h})}Ns(e,(l,f)=>{S(l)?c(l,f):ji(l)&&c(l.condition,f)});const u={};for(const{channel:l,key:f,value:d}of a)!s[l]&&!u[f]&&(u[f]=d);return u}function Vu(e,t,n,{reactiveGeom:i}={}){const r=Gu(e,t,n,{reactiveGeom:i}),s=bt(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function ty(e){const{markDef:t,config:n}=e,i=z("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...ny(e),...iy(e)}}function ny(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=z("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:t in Rd?{}:{ariaRoleDescription:{value:t}}}function iy(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return Nn(e,s,"description",c=>nr(c,e.config));const o=z("description",n,i);if(o!=null)return{description:B(o)};if(i.aria===!1)return{};const a=Gu(t,r,i);return I(a)?void 0:{description:{signal:bt(a).map(([c,u],l)=>`"${l>0?"; ":""}${c}: " + (${u})`).join(" + ")}}}function ee(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:c}=n;a===void 0&&(c??(c=z(e,i,s,{vgChannel:o,ignoreVgConfig:!0})),c!==void 0&&(a=B(c)));const u=r[e];return Nn(t,u,o??e,l=>xs({channel:e,channelDef:l,markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:a}))}function Xu(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??z("filled",n,r),a=P(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,c=z(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,u=z(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],l=o?"fill":"stroke",f={...c?{fill:B(c)}:{},...u?{stroke:B(u)}:{}};return n.color&&(o?n.fill:n.stroke)&&x(Ua("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...ee("color",e,{vgChannel:l,defaultValue:o?c:u}),...ee("fill",e,{defaultValue:i.fill?c:void 0}),...ee("stroke",e,{defaultValue:i.stroke?u:void 0})}}function ry(e){const{encoding:t,mark:n}=e,i=t.order;return!Ft(n)&&Pe(i)?Nn(e,i,"zindex",r=>B(r.value)):{}}function Tn({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a){const u=xs({channel:s,channelDef:a,markDef:t,config:i?.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:B(o),bandPosition:r});return{offsetType:"encoding",offset:u}}const c=t[s];return c?{offsetType:"visual",offset:c}:{}}function re(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,c=r[e],u=r[He(e)],l=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:p}=Tn({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),g=to({model:t,defaultPos:n,channel:e,scaleName:l,scale:f}),m=!c&&Q(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:sy({channel:e,channelDef:c,channel2Def:u,markDef:s,config:o,scaleName:l,scale:f,stack:a,offset:d,defaultRef:g,bandPosition:p==="encoding"?0:void 0});return m?{[i||e]:m}:void 0}function sy(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(F(n)&&r&&t===r.fieldChannel){if(S(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return Ii({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return Vt(n,i,{suffix:"end"},{offset:s})}return ys(e)}function to({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=jt(n),c=Et(n),u=z(n,s,o,{vgChannel:c});if(u!==void 0)return Yn(n,u);switch(t){case"zeroOrMin":case"zeroOrMax":if(i){const l=r.get("type");if(!P([ge.LOG,ge.TIME,ge.UTC],l)){if(r.domainDefinitelyIncludesZero())return{scale:i,value:0}}}if(t==="zeroOrMin")return a==="y"?{field:{group:"height"}}:{value:0};switch(a){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":{const l=e[de(n)];return{...l,mult:.5}}}return}}const oy={left:"x",center:"xc",right:"x2"},ay={top:"y",middle:"yc",bottom:"y2"};function Yu(e,t,n,i="middle"){if(e==="radius"||e==="theta")return Et(e);const r=e==="x"?"align":"baseline",s=z(r,t,n);let o;return E(s)?(x(gp(r)),o=void 0):o=s,e==="x"?oy[o||(i==="top"?"left":"center")]:ay[o||i]}function ir(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?Ku(e,t,{defaultPos:n,defaultPos2:i}):re(e,t,{defaultPos:n})}function Ku(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=He(e),a=de(e),c=cy(t,i,o),u=c[a]?Yu(e,r,s):Et(e);return{...re(e,t,{defaultPos:n,vgChannel:u}),...c}}function cy(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,c=jt(n),u=de(n),l=Et(n),f=i[c],d=e.scaleName(c),p=e.getScaleComponent(c),{offset:g}=n in i||n in s?Tn({channel:n,markDef:s,encoding:i,model:e}):Tn({channel:c,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const h=de(n),y=e.markDef[h];return y!=null?{[h]:{value:y}}:{[l]:{field:e.getName(n)}}}const m=uy({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:p,stack:o,offset:g,defaultRef:void 0});return m!==void 0?{[l]:m}:rr(n,s)||rr(n,{[n]:Ci(n,s,a.style),[u]:Ci(u,s,a.style)})||rr(n,a[r])||rr(n,a.mark)||{[l]:to({model:e,defaultPos:t,channel:n,scaleName:d,scale:p})()}}function uy({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:c,defaultRef:u}){return F(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Vt(t,s,{suffix:"start"},{offset:c}):ys({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:c,defaultRef:u})}function rr(e,t){const n=de(e),i=Et(e);if(t[i]!==void 0)return{[i]:Yn(e,t[i])};if(t[e]!==void 0)return{[i]:Yn(e,t[e])};if(t[n]){const r=t[n];if(Gt(r))x(ap(n));else return{[n]:Yn(e,r)}}return}function Ot(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=He(t),a=de(t),c=i[t],u=i[o],l=e.getScaleComponent(t),f=l?l.get("type"):void 0,d=r.orient,p=i[a]??i.size??z("size",r,n,{vgChannel:a}),g=pa(t),m=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal");return S(c)&&(j(c.bin)||ne(c.bin)||c.timeUnit&&!u)&&!(p&&!Gt(p))&&!i[g]&&!J(f)?dy({fieldDef:c,fieldDef2:u,channel:t,model:e}):(F(c)&&J(f)||m)&&!u?fy(c,t,e):Ku(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function ly(e,t,n,i,r,s,o){if(Gt(r))if(n){const c=n.get("type");if(c==="band"){let u=`bandwidth('${t}')`;r.band!==1&&(u=`${r.band} * ${u}`);const l=ft("minBandSize",{type:o},i);return{signal:l?`max(${Te(l)}, ${u})`:u}}else r.band!==1&&(x(bp(c)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(E(r))return r;if(r)return{value:r}}if(n){const c=n.get("range");if(Ct(c)&&V(c.step))return{value:c.step-2}}if(!s){const{bandPaddingInner:c,barBandPaddingInner:u,rectBandPaddingInner:l}=i.scale,f=X(c,o==="bar"?u:l);if(E(f))return{signal:`(1 - (${f.signal})) * ${e}`};if(V(f))return{signal:`${1-f} * ${e}`}}const a=Zi(i.view,e);return{value:a-2}}function fy(e,t,n){const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,c=n.scaleName(t),u=n.getScaleComponent(t),l=de(t),f=He(t),d=pa(t),p=n.scaleName(d),g=n.getScaleComponent(Ur(t)),m=a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let h;(r.size||i.size)&&(m?h=ee("size",n,{vgChannel:l,defaultRef:B(i.size)}):x($p(i.type)));const y=!!h,$=Tc({channel:t,fieldDef:e,markDef:i,config:s,scaleType:u?.get("type"),useVlSizeChannel:m});h=h||{[l]:ly(l,p||c,g||u,s,$,!!e,i.type)};const C=u?.get("type")==="band"&&Gt($)&&!y?"top":"middle",_=Yu(t,i,s,C),T=_==="xc"||_==="yc",{offset:M,offsetType:he}=Tn({channel:t,markDef:i,encoding:r,model:n,bandPosition:T?.5:0}),ie=ys({channel:t,channelDef:e,markDef:i,config:s,scaleName:c,scale:u,stack:o,offset:M,defaultRef:to({model:n,defaultPos:"mid",channel:t,scaleName:c,scale:u}),bandPosition:T?he==="encoding"?0:.5:E($)?{signal:`(1-${$})/2`}:Gt($)?(1-$.band)/2:0});if(l)return{[_]:ie,...h};{const Me=Et(f),yt=h[l],tt=M?{...yt,offset:M}:yt;return{[_]:ie,[Me]:v(ie)?[ie[0],{...ie[1],offset:tt}]:{...ie,offset:tt}}}}function Qu(e,t,n,i,r,s,o){if(aa(e))return 0;const a=e==="x"||e==="y2",c=a?-t/2:t/2;if(E(n)||E(r)||E(i)||s){const u=Te(n),l=Te(r),f=Te(i),d=Te(s),p=a?"":"-",g=s?`(${o} < ${d} ? ${p}0.5 * (${d} - (${o})) : ${c})`:c,m=f?`${f} + `:"",h=u?`(${u} ? -1 : 1) * `:"",y=l?`(${l} + ${g})`:g;return{signal:m+h+y}}else return r=r||0,i+(n?-r-c:+r+c)}function dy({fieldDef:e,fieldDef2:t,channel:n,model:i}){const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),c=i.scaleName(n),u=a?a.get("type"):void 0,l=a.get("reverse"),f=Tc({channel:n,fieldDef:e,markDef:s,config:r,scaleType:u}),d=i.component.axes[n]?.[0],p=d?.get("translate")??.5,g=Q(n)?z("binSpacing",s,r)??0:0,m=He(n),h=Et(n),y=Et(m),$=ft("minBandSize",s,r),{offset:C}=Tn({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:_}=Tn({channel:m,markDef:s,encoding:o,model:i,bandPosition:0}),T=Wg({fieldDef:e,scaleName:c}),M=Qu(n,g,l,p,C,$,T),he=Qu(m,g,l,p,_??C,$,T),ie=E(f)?{signal:`(1-${f.signal})/2`}:Gt(f)?(1-f.band)/2:.5;if(j(e.bin)||e.timeUnit)return{[y]:Zu({fieldDef:e,scaleName:c,bandPosition:ie,offset:he}),[h]:Zu({fieldDef:e,scaleName:c,bandPosition:E(ie)?{signal:`1-${ie.signal}`}:1-ie,offset:M})};if(ne(e.bin)){const Me=Vt(e,c,{},{offset:he});if(S(t))return{[y]:Me,[h]:Vt(t,c,{},{offset:M})};if(Ut(e.bin)&&e.bin.step)return{[y]:Me,[h]:{signal:`scale("${c}", ${w(e,{expr:"datum"})} + ${e.bin.step})`,offset:M}}}x(Ga(m));return}function Zu({fieldDef:e,scaleName:t,bandPosition:n,offset:i}){return Ii({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i})}const py=new Set(["aria","width","height"]);function Ee(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?Xu(e):{};return{...gy(e.markDef,t),...Ju(e,"fill",n),...Ju(e,"stroke",i),...ee("opacity",e),...ee("fillOpacity",e),...ee("strokeOpacity",e),...ee("strokeWidth",e),...ee("strokeDash",e),...ry(e),...qu(e),...eo(e,"href"),...ty(e)}}function Ju(e,t,n){const{config:i,mark:r,markDef:s}=e,o=z("invalid",s,i);if(o==="hide"&&n&&!Ft(r)){const a=my(e,{invalid:!0,channels:_i});if(a)return{[t]:[{test:a,value:null},...q(n)]}}return n?{[t]:n}:{}}function gy(e,t){return zd.reduce((n,i)=>(!py.has(i)&&e[i]!==void 0&&t[i]!=="ignore"&&(n[i]=B(e[i])),n),{})}function my(e,{invalid:t=!1,channels:n}){const i=n.reduce((s,o)=>{const a=e.getScaleComponent(o);if(a){const c=a.get("type"),u=e.vgField(o,{expr:"datum"});u&&be(c)&&(s[u]=!0)}return s},{}),r=b(i);if(r.length>0){const s=t?"||":"&&";return r.map(o=>bs(o,t)).join(` ${s} `)}return}function no(e){const{config:t,markDef:n}=e,i=z("invalid",n,t);if(i){const r=hy(e,{channels:qe});if(r)return{defined:{signal:r}}}return{}}function hy(e,{invalid:t=!1,channels:n}){const i=n.reduce((s,o)=>{const a=e.getScaleComponent(o);if(a){const c=a.get("type"),u=e.vgField(o,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});u&&be(c)&&(s[u]=!0)}return s},{}),r=b(i);if(r.length>0){const s=t?"||":"&&";return r.map(o=>bs(o,t)).join(` ${s} `)}return}function el(e,t){return t!==void 0?{[e]:B(t)}:void 0}const io="voronoi",tl={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(io)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(Ft(s))return x(jd(s)),n;const o={name:e.getName(io),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...qu(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,c=!1;return n.forEach((u,l)=>{const f=u.name??"";f===e.component.mark[0].name?a=l:f.indexOf(io)>=0&&(c=!0)}),c||n.splice(a+1,0,o),n}},nl={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!Is(e.bind),parse:(e,t,n)=>dl(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,o=t.init&&t.init[0],a=tl.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((c,u)=>{const l=W(`${i}_${c.field}`),f=n.filter(d=>d.name===l);f.length||n.unshift({name:l,...o?{init:Qt(o[u])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${A(c.field)}] : null`}]:[],bind:s[c.field]??s[c.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.filter(u=>u.name===i+Pt)[0],o=i+ni,a=r.items.map(u=>W(`${i}_${u.field}`)),c=a.map(u=>`${u} !== null`).join(" && ");return a.length&&(s.update=`${c} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},sr="_toggle",il={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+sr,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Pt,i=t.name+sr;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Jt(e)}}, `)+`${i} ? ${n} : null`}},yy={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=N(t.clear)?un(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(nl.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===W(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+Pt);i(r,"null"),il.defined(t)&&(r=n.findIndex(s=>s.name===t.name+sr),i(r,"false"))}return n}},rl={defined:e=>{const t=e.resolve==="global"&&e.bind&&Is(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==ze;return t&&!n&&x(Wd),t&&n},parse:(e,t,n)=>{const i=k(n);if(i.select=N(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},dl(t,i),Cr(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=q(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=Ls(t.bind)?t.bind.legend:"click",s=N(r)?un(r,"view"):q(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=Ls(t.bind)&&t.bind.legend,s=o=>a=>{const c=k(a);return c.markname=o,c};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${W(o.field)}_legend`,c=`${i}_${a}`,u=n.filter(l=>l.name===c);if(u.length===0){const l=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:c,...t.init?{}:{value:null},on:[{events:l,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${c}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+Pt),o=i+ni,a=r.items.filter(d=>d.hasLegend).map(d=>W(`${i}_${W(d.field)}_legend`)),c=a.map(d=>`${d} !== null`).join(" && "),u=`${c} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:u}):a.length>0&&(s.update=u,delete s.value,delete s.on);const l=n.find(d=>d.name===i+sr),f=Ls(t.bind)&&t.bind.legend;return l&&(t.events?l.on.push({...l.on[0],events:f}):l.on[0].events=f),n}};function by(e,t,n){const i=e.fieldDef(t)?.field;for(const r of te(e.component.selection??{})){const s=r.project.hasField[i]??r.project.hasChannel[t];if(s&&rl.defined(r)){const o=n.get("selections")??[];o.push(r.name),n.set("selections",o,!1),s.hasLegend=!0}}}const sl="_translate_anchor",ol="_translate_delta",xy={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=mt.defined(t),s=i+sl,{x:o,y:a}=t.project.hasChannel;let c=un(t.translate,"scope");return r||(c=c.map(u=>(u.between[0].markname=i+Fn,u))),n.push({name:s,value:{},on:[{events:c.map(u=>u.between[0]),update:"{x: x(unit), y: y(unit)"+(o!==void 0?`, extent_x: ${r?Zs(e,H):`slice(${o.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?Zs(e,K):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+ol,value:{},on:[{events:c,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&al(e,t,o,"width",n),a!==void 0&&al(e,t,a,"height",n),n}};function al(e,t,n,i,r){const s=t.name,o=s+sl,a=s+ol,c=n.channel,u=mt.defined(t),l=r.filter(T=>T.name===n.signals[u?"data":"visual"])[0],f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(c),p=d&&d.get("type"),g=d&&d.get("reverse"),m=u?c===H?g?"":"-":g?"-":"":"",h=`${o}.extent_${c}`,y=`${m}${a}.${c} / ${u?`${f}`:`span(${h})`}`,$=!u||!d?"panLinear":p==="log"?"panLog":p==="symlog"?"panSymlog":p==="pow"?"panPow":"panLinear",C=u?p==="pow"?`, ${d.get("exponent")??1}`:p==="symlog"?`, ${d.get("constant")??1}`:"":"",_=`${$}(${h}, ${y}${C})`;l.on.push({events:{signal:a},update:u?_:`clampRange(${_}, 0, ${f})`})}const cl="_zoom_anchor",ul="_zoom_delta",Sy={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=mt.defined(t),s=i+ul,{x:o,y:a}=t.project.hasChannel,c=A(e.scaleName(H)),u=A(e.scaleName(K));let l=un(t.zoom,"scope");return r||(l=l.map(f=>(f.markname=i+Fn,f))),n.push({name:i+cl,on:[{events:l,update:r?"{"+[c?`x: invert(${c}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:l,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&ll(e,t,o,"width",n),a!==void 0&&ll(e,t,a,"height",n),n}};function ll(e,t,n,i,r){const s=t.name,o=n.channel,a=mt.defined(t),c=r.filter($=>$.name===n.signals[a?"data":"visual"])[0],u=e.getSizeSignalRef(i).signal,l=e.getScaleComponent(o),f=l&&l.get("type"),d=a?Zs(e,o):c.name,p=s+ul,g=`${s}${cl}.${o}`,m=!a||!l?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",h=a?f==="pow"?`, ${l.get("exponent")??1}`:f==="symlog"?`, ${l.get("constant")??1}`:"":"",y=`${m}(${d}, ${g}, ${p}${h})`;c.on.push({events:{signal:p},update:a?y:`clampRange(${y}, 0, ${u})`})}const Zt="_store",Pt="_tuple",wy="_modify",fl="vlSelectionResolve",or=[ey,Zh,Kh,il,nl,mt,rl,yy,xy,Sy,tl];function $y(e){let t=e.parent;for(;t&&!Le(t);)t=t.parent;return t}function Jt(e,{escape:t}={escape:!0}){let n=t?A(e.name):e.name;const i=$y(e);if(i){const{facet:r}=i;for(const s of ve)r[s]&&(n+=` + '__facet_${s}_' + (facet[${A(i.vgField(s))}])`)}return n}function ro(e){return te(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function dl(e,t){(mi(t.select)||!t.select.on)&&delete e.events,(mi(t.select)||!t.select.clear)&&delete e.clear,(mi(t.select)||!t.select.toggle)&&delete e.toggle}function so(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...so(e.object)),t.push(...so(e.property))),t)}function pl(e){return e.object.type==="MemberExpression"?pl(e.object):e.object.name==="datum"}function gl(e){const t=Rf(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&pl(i)&&n.add(so(i).slice(1).join("."))}),n}class An extends R{clone(){return new An(null,this.model,k(this.filter))}constructor(t,n,i){super(t);this.model=n,this.filter=i,this.expr=ar(this.model,this.filter,this),this._dependentFields=gl(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function vy(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const s=W(r.name),o=r.select,a=N(o)?o:o.type,c=L(o)?k(o):{type:a},u=i[a];for(const d in u){if(d==="fields"||d==="encodings")continue;d==="mark"&&(c[d]={...u[d],...c[d]}),(c[d]===void 0||c[d]===!0)&&(c[d]=k(u[d]??c[d]))}const l=n[s]={...c,name:s,type:a,init:r.value,bind:r.bind,events:N(c.on)?un(c.on,"scope"):q(k(c.on))},f=k(r);for(const d of or)d.defined(l)&&d.parse&&d.parse(e,l,f)}return n}function ml(e,t,n,i="datum"){const r=N(t)?t:t.param,s=W(r),o=A(s+Zt);let a;try{a=e.getSelectionComponent(s,r)}catch(d){return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,p=a.project.timeUnit.clone();d.parent?p.insertAsParentOf(d):d.parent=p}const c=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",u=a.resolve==="global"?")":`, ${A(a.resolve)})`,l=`${c}${o}, ${i}${u}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${l}`:`!${f} || ${l}`}function hl(e,t,n){const i=W(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch(a){return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&x(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${A(s)}.`);else if(r&&!s){const a=o.project.items.filter(c=>c.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,x((a.length?"Multiple ":"No ")+`matching ${A(r)} encoding found for selection ${A(n.param)}. Using "field": ${A(s)}.`)):s=a[0].field}return`${o.name}[${A(Se(s))}]`}function Ey(e,t){for(const[n,i]of bt(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new ce(new An(t,e,{param:n}),r,U.Lookup,e.component.data.outputNodeRefCounts)}}function ar(e,t,n){return Bn(t,i=>N(i)?i:sg(i)?ml(e,i,n):rc(i))}function _y(e,t){return e?v(e)&&!kt(e)?e.map(n=>_s(n,t)).join(", "):e:void 0}function oo(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function ri(e,t,n,i={header:!1}){const{disable:r,orient:s,scale:o,labelExpr:a,title:c,zindex:u,...l}=e.combine();if(r)return;for(const f in l){const d=cm[f],p=l[f];if(d&&d!==t&&d!=="both")delete l[f];else if(ei(p)){const{condition:g,...m}=p,h=q(g),y=Uc[f];if(y){const{vgProp:$,part:C}=y,_=[...h.map(T=>{const{test:M,...he}=T;return{test:ar(null,M),...he}}),m];oo(l,C,$,_),delete l[f]}else if(y===null){const $={signal:h.map(C=>{const{test:_,...T}=C;return`${ar(null,_)} ? ${_a(T)} : `}).join("")+_a(m)};l[f]=$}}else if(E(p)){const g=Uc[f];if(g){const{vgProp:m,part:h}=g;oo(l,h,m,p),delete l[f]}}P(["labelAlign","labelBaseline"],f)&&l[f]===null&&delete l[f]}if(t==="grid"){if(!l.grid)return;if(l.encode){const{grid:f}=l.encode;l.encode={...f?{grid:f}:{}},I(l.encode)&&delete l.encode}return{scale:o,orient:s,...l,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:X(u,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let d=a;l.encode?.labels?.update&&E(l.encode.labels.update.text)&&(d=Lt(a,"datum.label",l.encode.labels.update.text.signal)),oo(l,"labels","text",{signal:d})}if(l.labelAlign===null&&delete l.labelAlign,l.encode){for(const d of Bc)e.hasAxisPart(d)||delete l.encode[d];I(l.encode)&&delete l.encode}const f=_y(c,n);return{scale:o,orient:s,grid:!1,...f?{title:f}:{},...l,...n.aria===!1?{aria:!1}:{},zindex:X(u,0)}}}function yl(e){const{axes:t}=e.component,n=[];for(const i of qe)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function ky(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>ri(r,"grid",t)),...i.map(r=>ri(r,"grid",t)),...n.map(r=>ri(r,"main",t)),...i.map(r=>ri(r,"main",t))].filter(r=>r)}function bl(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},c=new Set([...b(o),...b(a)]),u={};for(const l of c.values())u[l]={signal:`${i.signal} === "${s}" ? ${Te(o[l])} : ${Te(a[l])}`};return u}return t[r]})])}function Cy(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:uc(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=E(n)?"axisOrient":`axis${Wn(n)}`,a=[...r,...r.map(u=>s+u.substr(4))],c=["axis",o,s];return{vlOnlyAxisConfig:bl(a,i,e,n),vgAxisConfig:bl(c,i,e,n),axisConfigStyle:Fy([...c,...a],i)}}function Fy(e,t){const n=[{}];for(const i of e){let r=t[i]?.style;if(r){r=q(r);for(const s of r)n.push(t.style[s])}}return Object.assign.apply(null,n)}function ao(e,t,n,i={}){const r=Ca(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(i[s]?.[e]!==void 0)return{configFrom:s,configValue:i[s][e]};return{}}const xl={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??Ny(n,e),gridScale:({model:e,channel:t})=>Ty(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||wl(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||Sl(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Oy(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??Py(t.type,n,S(t)&&!!t.timeUnit,S(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??Ry({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:Iy,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=$l(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return Na(r?[Fc(r)]:[],S(o)?[Fc(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>Ly(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??My(n,t)};function Ny(e,t){return!J(e)&&S(t)&&!j(t?.bin)&&!ne(t?.bin)}function Ty(e,t){const n=t==="x"?"y":"x";return e.getScaleComponent(n)?e.scaleName(n):void 0}function Ay(e,t,n,i,r){const s=t?.labelAngle;if(s!==void 0)return E(s)?s:Hn(s);{const{configValue:o}=ao("labelAngle",i,t?.style,r);return o!==void 0?Hn(o):n===H&&P([ls,us],e.type)&&!(S(e)&&e.timeUnit)?270:void 0}}function co(e){return`(((${e.signal} % 360) + 360) % 360)`}function Sl(e,t,n,i){if(e!==void 0)if(n==="x"){if(E(e)){const r=co(e),s=E(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45{if(!Yt(i))return;if(Cc(i.sort)){const{field:s,timeUnit:o}=i,a=i.sort,c=a.map((u,l)=>`${rc({field:s,timeUnit:o,equal:u})} ? ${l} : `).join("")+a.length;t=new On(t,{calculate:c,as:Pn(i,r,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${O(this.transform)}`}}function Pn(e,t,n){return w(e,{prefix:t,suffix:"sort_index",...n??{}})}function cr(e,t){return P(["top","bottom"],t)?"column":P(["left","right"],t)||e==="row"?"row":"column"}function zn(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return X((t||{})[e],r[e],n.header[e])}function ur(e,t,n,i){const r={};for(const s of e){const o=zn(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const uo=["row","column"],lo=["header","footer"];function Dy(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=ur(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),c=cr(t,a),u=Hn(o);return{name:`${t}-title`,type:"group",role:`${c}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...El(u,c),...vl(c,u,s),..._l(i,r,t,Tm,ou)}}}function vl(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=wl(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function El(e,t){const n=Sl(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function jy(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of lo)if(n[r])for(const s of n[r]){const o=By(e,t,r,n,s);o!=null&&i.push(o)}return i}function Uy(e,t){const{sort:n}=e;return Xe(n)?{field:w(n,{expr:"datum"}),order:n.order??"ascending"}:v(n)?{field:Pn(e,t,{expr:"datum"}),order:"ascending"}:{field:w(e,{expr:"datum"}),order:n??"ascending"}}function fo(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:c}=ur(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=Ss({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,l=cr(t,a);return{text:{signal:c?Lt(Lt(c,"datum.label",u),"datum.value",w(e,{expr:"parent"})):u},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...El(s,l),...vl(l,s,o),..._l(n,e,t,Am,au)}}function By(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=ur(["labelOrient"],o.header,a,t);(t==="row"&&!P(["top","bottom"],f)||t==="column"&&!P(["left","right"],f))&&(s=fo(o,t,a))}const c=Le(e)&&!Qn(e.facet),u=r.axes,l=u?.length>0;if(s||l){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:Uy(o,t)}:{},...l&&c?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...l?{axes:u}:{}}}}return null}const Wy={column:{start:0,end:1},row:{start:1,end:0}};function Hy(e,t){return Wy[t][e]}function qy(e,t){const n={};for(const i of ve){const r=e[i];if(r?.facetFieldDef){const{titleAnchor:s,titleOrient:o}=ur(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=cr(i,o),c=Hy(s,a);c!==void 0&&(n[a]=c)}}return I(n)?void 0:n}function _l(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=zn(o,t?.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function po(e){return[...lr(e,"width"),...lr(e,"height"),...lr(e,"childWidth"),...lr(e,"childHeight")]}function lr(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(J(o)&&Ct(a)){const c=e.scaleName(n);if(Le(e.parent)){const u=e.parent.component.resolve;if(u.scale[n]==="independent")return[kl(c,a)]}return[kl(c,a),{name:r,update:Cl(c,s,`domain('${c}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=Us(e.config.view,s?"width":"height"),c=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:c,on:[{update:c,events:"window:resize"}]}]}else return[{name:r,value:i}]}function kl(e,t){const n=`${e}_step`;return E(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function Cl(e,t,n){const i=t.get("type"),r=t.get("padding"),s=X(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${Te(o)}, ${Te(s)}) * ${e}_step`}function Fl(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function Nl(e,t){return b(e).reduce((n,i)=>{const r=e[i];return{...n,...Nn(t,r,i,s=>B(s.value))}},{})}function Tl(e,t){if(Le(t))return e==="theta"?"independent":"shared";if(Ln(t))return"shared";if(Fo(t))return Q(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function go(e,t){const n=e.scale[t],i=Q(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&x(Cp(t)),"independent"):e[i][t]||"shared"}const Gy={...zm,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},Al=b(Gy);class Vy extends gt{}const Ol={symbols:Xy,gradient:Yy,labels:Ky,entries:Qy};function Xy(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:c,mark:u}=n,l=o.filled&&u!=="trail";let f={...Ld({},n,Tg),...Xu(n,{filled:l})};const d=r.get("symbolOpacity")??c.legend.symbolOpacity,p=r.get("symbolFillColor")??c.legend.symbolFillColor,g=r.get("symbolStrokeColor")??c.legend.symbolStrokeColor,m=d===void 0?Pl(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||l&&i===le)delete f.fill;else if(f.fill.field)p?delete f.fill:(f.fill=B(c.legend.symbolBaseFillColor??"black"),f.fillOpacity=B(m??1));else if(v(f.fill)){const h=mo(a.fill??a.color)??o.fill??(l&&o.color);h&&(f.fill=B(h))}}if(f.stroke){if(i==="stroke"||!l&&i===le)delete f.stroke;else if(f.stroke.field||g)delete f.stroke;else if(v(f.stroke)){const h=X(mo(a.stroke||a.color),o.stroke,l?o.color:void 0);h&&(f.stroke={value:h})}}if(i!==at){const h=S(t)&&Rl(n,r,t);h?f.opacity=[{test:h,...B(m??1)},B(c.legend.unselectedOpacity)]:m&&(f.opacity=B(m))}return f={...f,...e},I(f)?void 0:f}function Yy(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const c=i.get("gradientOpacity")??r.legend.gradientOpacity,u=c===void 0?Pl(o.opacity)||s.opacity:void 0;return u&&(a.opacity=B(u)),a={...a,...e},I(a)?void 0:a}function Ky(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=S(t)?Rl(n,r,t):void 0,c=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:u,formatType:l}=s;let f;Xt(l)?f=Oe({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:l,config:o}):u===void 0&&l===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=Oe({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&S(t)&&t.timeUnit===void 0&&(f=Oe({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...c?{opacity:c}:{},...f?{text:f}:{},...e};return I(d)?void 0:d}function Qy(e,{legendCmpt:t}){const n=t.get("selections");return n?.length?{...e,fill:{value:"transparent"}}:e}function Pl(e){return zl(e,(t,n)=>Math.max(t,n.value))}function mo(e){return zl(e,(t,n)=>X(t,n.value))}function zl(e,t){return Kg(e)?q(e.condition).reduce(t,e.value):Pe(e)?e.value:void 0}function Rl(e,t,n){const i=t.get("selections");if(!i?.length)return;const r=A(n.field);return i.map(s=>{const o=A(W(s)+Zt);return`(!length(data(${o})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`}).join(" || ")}const Il={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return wc(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return $c(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??rb(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??sb(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??Jy(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>vn(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(mn(n)&&Ae(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>Zy(t,e)};function Zy(e,t){const n=e.values;return v(n)?jc(t,n):E(n)?n:void 0}function Jy(e,t,n,i){if(t!=="shape"){const r=mo(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function eb(e){const{legend:t}=e;return X(t.type,tb(e))}function tb({channel:e,timeUnit:t,scaleType:n}){if(mn(e)){if(P(["quarter","month","day"],t))return"symbol";if(Ae(n))return"gradient"}return"symbol"}function nb({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??ib(n,t)}function ib(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function rb({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:c}=e;return Ae(r)?n==="horizontal"?i==="top"||i==="bottom"?Ll(t,"width",o,s):o:Ll(t,"height",c,a):void 0}function Ll(e,t,n,i){const r=e.getSizeSignalRef(t).signal;return{signal:`clamp(${r}, ${n}, ${i})`}}function sb(e){return P(["quantile","threshold","log","symlog"],e)?"greedy":void 0}function Ml(e){const t=G(e)?ob(e):lb(e);return e.component.legends=t,t}function ob(e){const{encoding:t}=e,n={};for(const i of[le,...uu]){const r=Y(t[i]);if(!r||!e.getScaleComponent(i))continue;if(i===fe&&S(r)&&r.type===xn)continue;n[i]=ub(e,i)}return n}function ab(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function cb(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!n?.values;case"title":if(t==="title"&&e===i?.title)return!0}return e===(n||{})[t]}function ub(e,t){let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new Vy({},ab(e,t));by(e,t,a);const c=n!==void 0?!n:o.disable;if(a.set("disable",c,n!==void 0),c)return a;n=n||{};const u=e.getScaleComponent(t).get("type"),l=Y(r[t]),f=S(l)?Z(l.timeUnit)?.unit:void 0,d=n.orient||s.legend.orient||"right",p=eb({legend:n,channel:t,timeUnit:f,scaleType:u}),g=nb({legend:n,legendType:p,orient:d,legendConfig:o}),m={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:l,legendConfig:o,config:s,scaleType:u,orient:d,legendType:p,direction:g};for(const _ of Al){if(p==="gradient"&&_.startsWith("symbol")||p==="symbol"&&_.startsWith("gradient"))continue;const T=_ in Il?Il[_](m):n[_];if(T!==void 0){const M=cb(T,_,n,e.fieldDef(t));(M||s.legend[_]===void 0)&&a.set(_,T,M)}}const h=n?.encoding??{},y=a.get("selections"),$={},C={fieldOrDatumDef:l,model:e,channel:t,legendCmpt:a,legendType:p};for(const _ of["labels","legend","title","symbols","gradient","entries"]){const T=Nl(h[_]??{},e),M=_ in Ol?Ol[_](T,C):T;M!==void 0&&!I(M)&&($[_]={...y?.length&&S(l)?{name:`${W(l.field)}_legend_${_}`}:{},...y?.length?{interactive:!!y}:{},update:M})}return I($)||a.set("encode",$,!!n?.encoding),a}function lb(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){Ml(i);for(const r of b(i.component.legends))n.legend[r]=go(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=Dl(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of b(t))for(const r of e.children){if(!r.component.legends[i])continue;n.legend[i]==="shared"&&delete r.component.legends[i]}return t}function Dl(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const s of Al){const o=Tt(e.getWithExplicit(s),t.getWithExplicit(s),s,"legend",(a,c)=>{switch(s){case"symbolType":return fb(a,c);case"title":return Aa(a,c);case"type":return r=!0,xe("symbol")}return tr(a,c,s,"legend")});e.setWithExplicit(s,o)}return r&&(e.implicit?.encode?.gradient&&yi(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&yi(e.explicit,["encode","gradient"])),e}function fb(e,t){return t.value==="circle"?t:e}function db(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function jl(e){const t=e.component.legends,n={};for(const r of b(t)){const s=e.getScaleComponent(r),o=D(s.get("domains"));if(n[o])for(const a of n[o]){const c=Dl(a,t[r]);c||n[o].push(t[r])}else n[o]=[t[r].clone()]}const i=te(n).flat().map(r=>pb(r,e.config)).filter(r=>r!==void 0);return i}function pb(e,t){const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(n)return;if(t.aria===!1&&s.aria==null&&(s.aria=!1),s.encode?.symbols){const o=s.encode.symbols.update;o.fill&&o.fill.value!=="transparent"&&!o.stroke&&!s.stroke&&(o.stroke={value:"transparent"});for(const a of uu)s[a]&&delete o[a]}if(s.title||delete s.title,i!==void 0){let o=i;s.encode?.labels?.update&&E(s.encode.labels.update.text)&&(o=Lt(i,"datum.label",s.encode.labels.update.text.signal)),db(s,"labels","text",{signal:o})}return s}function gb(e){return Ln(e)||Fo(e)?mb(e):Ul(e)}function mb(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),Ul(e))}function Ul(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const c=E(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return P(o,c)||o.push(c),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const hb=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class Bl extends gt{constructor(t,n,i,r){super({...n},{name:t});this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function Wl(e){e.component.projection=G(e)?yb(e):Sb(e)}function yb(e){if(e.hasProjection){const t=pe(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?bb(e):void 0,s=new Bl(e.projectionName(!0),{...pe(e.config.projection)??{},...t??{}},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}return}function bb(e){const t=[],{encoding:n}=e;for(const i of[[Fe,Ce],[$e,Ne]])(Y(n[i[0]])||Y(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(fe)&&e.typedFieldDef(fe).type===xn&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(U.Main)),t}function xb(e,t){const n=Or(hb,r=>!an(e.explicit,r)&&!an(t.explicit,r)?!0:!!(an(e.explicit,r)&&an(t.explicit,r)&&De(e.get(r),t.get(r)))),i=De(e.size,t.size);if(i){if(n)return e;if(De(e.explicit,{}))return t;if(De(t.explicit,{}))return e}return null}function Sb(e){if(e.children.length===0)return;let t;for(const i of e.children)Wl(i);const n=Or(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=xb(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new Bl(i,t.specifiedProjection,t.size,k(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}return}function wb(e,t,n,i){if(Jn(t,n)){const r=G(e)?e.axis(n)??e.legend(n)??{}:{},s=w(t,{expr:"datum"}),o=w(t,{expr:"datum",binSuffix:"end"});return{formulaAs:w(t,{binSuffix:"range",forAs:!0}),formula:Kn(s,o,r.format,r.formatType,i)}}return{}}function Hl(e,t){return`${Sa(e)}_${t}`}function $b(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function ho(e,t,n){const i=qi(n,void 0)??{},r=Hl(i,t);return e.getName(`${r}_bins`)}function vb(e){return"as"in e}function ql(e,t,n){let i,r;vb(e)?i=N(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[w(e,{forAs:!0}),w(e,{binSuffix:"end",forAs:!0})];const s={...qi(t,void 0)},o=Hl(s,e.field),{signal:a,extentSignal:c}=$b(n,o);if(ki(s.extent)){const l=s.extent;r=hl(n,l.param,l),delete s.extent}const u={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...c?{extentSignal:c}:{},...r?{span:r}:{}};return{key:o,binComponent:u}}class et extends R{clone(){return new et(null,k(this.bins))}constructor(t,n){super(t);this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{if(ae(s)&&j(s.bin)){const{key:a,binComponent:c}=ql(s,s.bin,n);r[a]={...c,...r[a],...wb(n,s,o,n.config)}}return r},{});return I(i)?null:new et(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=ql(n,n.bin,i);return new et(t,{[r]:s})}merge(t,n){for(const i of b(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=je([...this.bins[i].as,...t.bins[i].as],O)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(te(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(te(this.bins).map(t=>t.field))}hash(){return`Bin ${O(this.bins)}`}assemble(){return te(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...o}=t.bin,a={type:"bin",field:Se(t.field),as:i,signal:t.signal,...ki(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!s&&t.extentSignal&&(n.push({type:"extent",field:Se(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const c of r)for(let u=0;u<2;u++)n.push({type:"formula",expr:w({field:i[u]},{expr:"datum"}),as:c[u]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function Eb(e,t,n,i){const r=G(i)?i.encoding[He(t)]:void 0;if(ae(n)&&G(i)&&Ac(n,r,i.markDef,i.config))e.add(w(n,{})),e.add(w(n,{suffix:"end"})),n.bin&&Jn(n,t)&&e.add(w(n,{binSuffix:"range"}));else if(ua(t)){const s=ca(t);e.add(i.getName(s))}else e.add(w(n));return Yt(n)&&bg(n.scale?.range)&&e.add(n.scale.range.field),e}function _b(e,t){for(const n of b(t)){const i=t[n];for(const r of b(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class Re extends R{clone(){return new Re(null,new Set(this.dimensions),k(this.measures))}constructor(t,n,i){super(t);this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(o=>{o.aggregate&&(i=!0)});const r={},s=new Set;return i?(n.forEachFieldDef((o,a)=>{const{aggregate:c,field:u}=o;if(c)if(c==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([w(o,{forAs:!0})]);else{if(ut(c)||_t(c)){const l=ut(c)?"argmin":"argmax",f=c[l];r[f]??(r[f]={}),r[f][l]=new Set([w({op:l,field:f},{forAs:!0})])}else r[u]??(r[u]={}),r[u][c]=new Set([w(o,{forAs:!0})]);ct(a)&&n.scaleDomain(a)==="unaggregated"&&(r[u]??(r[u]={}),r[u].min=new Set([w({field:u,aggregate:"min"},{forAs:!0})]),r[u].max=new Set([w({field:u,aggregate:"max"},{forAs:!0})]))}else Eb(s,a,o,n)}),s.size+b(r).length===0?null:new Re(t,s,r)):null}static makeFromTransform(t,n){const i=new Set,r={};for(const s of n.aggregate){const{op:o,field:a,as:c}=s;o&&(o==="count"?(r["*"]??(r["*"]={}),r["*"].count=new Set([c||w(s,{forAs:!0})])):(r[a]??(r[a]={}),r[a][o]=new Set([c||w(s,{forAs:!0})])))}for(const s of n.groupby??[])i.add(s);return i.size+b(r).length===0?null:new Re(t,i,r)}merge(t){return ea(this.dimensions,t.dimensions)?(_b(this.measures,t.measures),!0):(Wp("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...b(this.measures)])}producedFields(){const t=new Set;for(const n of b(this.measures))for(const i of b(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${O({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of b(this.measures))for(const o of b(this.measures[s]))for(const a of this.measures[s][o])i.push(a),t.push(o),n.push(s==="*"?null:Se(s));const r={type:"aggregate",groupby:[...this.dimensions].map(Se),ops:t,fields:n,as:i};return r}}class Rn extends R{constructor(t,n,i,r){super(t);this.model=n,this.name=i,this.data=r;for(const s of ve){const o=n.facet[s];if(o){const{bin:a,sort:c}=o;this[s]={name:n.getName(`${s}_domain`),fields:[w(o),...j(a)?[w(o,{binSuffix:"end"})]:[]],...Xe(c)?{sortField:c}:v(c)?{sortIndexField:Pn(o,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of ve)this[n]&&(t+=` ${n.charAt(0)}:${O(this[n])}`);return t}get fields(){const t=[];for(const n of ve)this[n]?.fields&&t.push(...this[n].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of ve)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of qe){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(J(r)&&Ct(s)){const o=dr(this.childModel,n),a=ko(o);a?t[n]=a:x(Yr(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],s=[],o=[],a=[];r&&i&&i[r]&&(n?(s.push(`distinct_${i[r]}`),o.push("max")):(s.push(i[r]),o.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:c,sortIndexField:u}=this[t];if(c){const{op:l=Li,field:f}=c;s.push(f),o.push(l),a.push(w(c,{forAs:!0}))}else u&&(s.push(u),o.push("max"),a.push(u));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...s.length?{fields:s,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const c of uo){for(const u of lo){const l=(i[c]&&i[c][u])??[];for(const f of l)if(f.axes?.length>0){s[c]=!0;break}}if(s[c]){const u=`length(data("${this.facet.name}"))`,l=c==="row"?n?{signal:`ceil(${u} / ${n})`}:1:n?{signal:`min(${u}, ${n})`}:{signal:u};r.push({name:`${this.facet.name}_${c}`,transform:[{type:"sequence",start:0,stop:l}]})}}const{row:o,column:a}=s;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:s,facet:o}=this;if(r&&s&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),c=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:c}]})}for(const a of[it,nt])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(o){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function Gl(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function kb(e,t){const n=Ir(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=Gl(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=Gl(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return x(Kd(t)),null}function Cb(e){const t={};return hi(e.filter,n=>{if(ic(n)){let i=null;ts(n)?i=ye(n.equal):is(n)?i=ye(n.lte):ns(n)?i=ye(n.lt):rs(n)?i=ye(n.gt):ss(n)?i=ye(n.gte):os(n)?i=n.range[0]:as(n)&&(i=(n.oneOf??n.in)[0]),i&&(Bt(i)?t[n.field]="date":V(i)?t[n.field]="number":N(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function Fb(e){const t={};function n(i){_n(i)?t[i.field]="date":i.type==="quantitative"&&Fd(i.aggregate)?t[i.field]="number":dn(i.field)>1?i.field in t||(t[i.field]="flatten"):Yt(i)&&Xe(i.sort)&&dn(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((G(e)||Le(e))&&e.forEachFieldDef((i,r)=>{if(ae(i))n(i);else{const s=jt(r),o=e.fieldDef(s);n({...i,type:o.type})}}),G(e)){const{mark:i,markDef:r,encoding:s}=e;if(Ft(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];S(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function Nb(e){const t={};if(G(e)&&e.component.selection)for(const n of b(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&dn(r.field)>1&&(t[r.field]="flatten")}return t}class se extends R{clone(){return new se(null,k(this._parse))}constructor(t,n){super(t);this._parse=n}hash(){return`Parse ${O(this._parse)}`}static makeExplicit(t,n,i){let r={};const s=n.data;return!At(s)&&s?.format?.parse&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of b(i)){const c=r.getWithExplicit(a);c.value!==void 0&&(c.explicit||c.value===i[a]||c.value==="derived"||i[a]==="flatten"?delete i[a]:x(Ma(a,i[a],c.value)))}for(const a of b(n)){const c=r.get(a);c!==void 0&&(c===n[a]?delete n[a]:x(Ma(a,n[a],c)))}const s=new gt(n,i);r.copyAll(s);const o={};for(const a of b(s.combine())){const c=s.get(a);c!==null&&(o[a]=c)}return b(o).length===0||r.parseNothing?null:new se(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of b(this._parse)){const i=this._parse[n];dn(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(b(this._parse))}dependentFields(){return new Set(b(this._parse))}assembleTransforms(t=!1){return b(this._parse).filter(n=>t?dn(n)>1:!0).map(n=>{const i=kb(n,this._parse[n]);if(!i)return null;const r={type:"formula",expr:i,as:Lr(n)};return r}).filter(n=>n!==null)}}class zt extends R{clone(){return new zt(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([ze])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:ze}}}class si extends R{clone(){return new si(null,this.params)}constructor(t,n){super(t);this.params=n}dependentFields(){return new Set}producedFields(){return}hash(){return`Graticule ${O(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class oi extends R{clone(){return new oi(null,this.params)}constructor(t,n){super(t);this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${O(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class en extends R{constructor(t){super(null);t??(t={name:"source"});let n;if(At(t)||(n=t.format?{...ue(t.format,["parse"])}:{}),ti(t))this._data={values:t.values};else if(Cn(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];P(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else Du(t)?this._data={values:[{type:"Sphere"}]}:(Lu(t)||At(t))&&(this._data={});this._generator=At(t),t.name&&(this._name=t.name),n&&!I(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){return}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var Vl=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},Tb=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},ai;function yo(e){return e instanceof en||e instanceof si||e instanceof oi}class bo{constructor(){ai.set(this,void 0),Vl(this,ai,!1,"f")}setModified(){Vl(this,ai,!0,"f")}get modifiedFlag(){return Tb(this,ai,"f")}}ai=new WeakMap;class tn extends bo{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const n=this.getNodeDepths(t,0,new Map),i=[...n.entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class xo extends bo{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Ab extends xo{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Ob extends xo{constructor(t){super();this.requiresSelectionId=t&&ro(t)}run(t){t instanceof zt&&(this.requiresSelectionId&&(yo(t.parent)||t.parent instanceof Re||t.parent instanceof se)||(this.setModified(),t.remove()))}}class Pb extends bo{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Je&&(i=t.producedFields(),Pr(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class zb extends xo{constructor(){super()}run(t){t instanceof ce&&!t.isRequired()&&(this.setModified(),t.remove())}}class Rb extends tn{run(t){if(yo(t))return;if(t.numChildren()>1)return;for(const n of t.children)if(n instanceof se)if(t instanceof se)this.setModified(),t.merge(n);else{if(Rr(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}return}}class Ib extends tn{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof se);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const c of b(a))c in r?r[c]!==a[c]&&s.add(c):r[c]=a[c]}for(const o of s)delete r[o];if(!I(r)){this.setModified();const o=new se(t,r);for(const a of n){if(a instanceof se)for(const c of b(r))delete a.parse[c];t.removeChild(a),a.parent=o,a instanceof se&&b(a.parse).length===0&&a.remove()}}}}}class Lb extends tn{run(t){t instanceof ce||t.numChildren()>0||t instanceof Rn||(t instanceof en||(this.setModified(),t.remove()))}}class Mb extends tn{run(t){const n=t.children.filter(r=>r instanceof Je),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class Db extends tn{run(t){const n=t.children.filter(r=>r instanceof Re),i={};for(const r of n){const s=O(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of b(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class jb extends tn{constructor(t){super();this.model=t}run(t){const n=!(yo(t)||t instanceof An||t instanceof se||t instanceof zt),i=[],r=[];for(const s of t.children)s instanceof et&&(n&&!Rr(t.producedFields(),s.dependentFields())?i.push(s):r.push(s));if(i.length>0){const s=i.pop();for(const o of i)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof et?t.merge(s,this.model.renameSignal.bind(this.model)):s.swapWithParent()}if(r.length>1){const s=r.pop();for(const o of r)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified()}}}class Ub extends tn{run(t){const n=[...t.children],i=It(n,o=>o instanceof ce);if(!i||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof ce){let a=o;for(;a.numChildren()===1;){const[c]=a.children;if(c instanceof ce)a=c;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class nn extends R{clone(){return new nn(null,k(this.transform))}constructor(t,n){super(t);this.transform=n}addDimensions(t){this.transform.groupby=je(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??w(t)}hash(){return`JoinAggregateTransform ${O(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const s of this.transform.joinaggregate)n.push(s.op),i.push(this.getDefaultName(s)),t.push(s.field===void 0?null:s.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}function Bb(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=w(i);return r&&t.push(r),t},[])}function Wb(e){return v(e)&&e.every(t=>N(t))&&e.length>1}class ht extends R{clone(){return new ht(null,k(this._stack))}constructor(t,n){super(t);this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:s,offset:o="zero"}=n,a=[],c=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),c.push(X(f.order,"ascending"));const u={field:a,order:c};let l;return Wb(s)?l=s:N(s)?l=[s,`${s}_end`]:l=[`${n.stack}_start`,`${n.stack}_end`],new ht(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:o,sort:u,facetby:[],as:l})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:s,fieldChannel:o,offset:a,impute:c}=i,u=s.map(p=>{const g=r[p];return Ke(g)}).filter(p=>!!p),l=Bb(n),f=n.encoding.order;let d;if(v(f)||S(f))d=Fa(f);else{const p=Oc(f)?f.sort:o==="y"?"descending":"ascending";d=l.reduce((g,m)=>(g.field.push(m),g.order.push(p),g),{field:[],order:[]})}return new ht(t,{dimensionFieldDefs:u,stackField:n.vgField(o),facetby:[],stackby:l,sort:d,offset:a,impute:c,as:[n.vgField(o,{suffix:"start",forAs:!0}),n.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${O(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[w(r,{binSuffix:"mid"})]:[w(r,{}),w(r,{binSuffix:"end"})]:[w(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:s,sort:o,offset:a,impute:c,as:u}=this._stack;if(c)for(const l of i){const{bandPosition:f=.5,bin:d}=l;if(d){const p=w(l,{expr:"datum"}),g=w(l,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${f}*${p}+${1-f}*${g}`,as:w(l,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...s,...n],key:w(l,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:o,as:u,offset:a}),t}}class In extends R{clone(){return new In(null,k(this.transform))}constructor(t,n){super(t);this.transform=n}addDimensions(t){this.transform.groupby=je(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??w(t)}hash(){return`WindowTransform ${O(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const s=this.transform.frame,o=this.transform.groupby;if(s&&s[0]===null&&s[1]===null&&n.every(f=>Gr(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...o!==void 0?{groupby:o}:{}};const a=[],c=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),c.push(f.order??"ascending");const u={field:a,order:c},l=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:u,...l!==void 0?{ignorePeers:l}:{},...o!==void 0?{groupby:o}:{},...s!==void 0?{frame:s}:{}}}}function Hb(e){function t(n){if(!(n instanceof Rn)){const i=n.clone();if(i instanceof ce){const r=wo+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof Re||i instanceof ht||i instanceof In||i instanceof nn)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function So(e){if(e instanceof Rn)if(e.numChildren()===1&&!(e.children[0]instanceof ce)){const t=e.children[0];(t instanceof Re||t instanceof ht||t instanceof In||t instanceof nn)&&t.addDimensions(e.fields),t.swapWithParent(),So(e)}else{const t=e.model.component.data.main;Xl(t);const n=Hb(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(So)}function Xl(e){if(e instanceof ce&&e.type===U.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Rn||(t.swapWithParent(),Xl(e))}}const wo="scale_",fr=5;function $o(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!$o(t.children))return!1}return!0}function Ie(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function Yl(e,t,n){let i=e.sources,r=!1;return r=Ie(new zb,i)||r,r=Ie(new Ob(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=Ie(new Lb,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=Ie(new Rb,i)||r,r=Ie(new jb(t),i)||r,r=Ie(new Pb,i)||r,r=Ie(new Ib,i)||r,r=Ie(new Db,i)||r,r=Ie(new Mb,i)||r,r=Ie(new Ab,i)||r,r=Ie(new Ub,i)||r),e.sources=i,r}function qb(e,t){$o(e.sources);let n=0,i=0;for(let r=0;rt(n))}}function Kl(e){G(e)?Gb(e):Vb(e)}function Gb(e){const t=e.component.scales;for(const n of b(t)){const i=Yb(e,n),r=t[n];if(r.setWithExplicit("domains",i),Qb(e,n),e.component.data.isFaceted){let s=e;for(;!Le(s)&&s.parent;)s=s.parent;const o=s.component.resolve.scale[n];if(o==="shared")for(const a of i.value)lt(a)&&(a.data=wo+a.data.replace(wo,""))}}}function Vb(e){for(const n of e.children)Kl(n);const t=e.component.scales;for(const n of b(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=Tt(i,o.getWithExplicit("domains"),"domains","scale",_o);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&x(Gd),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function Xb(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=Ql(t,n);if(!r){x(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=Ql(t,n);if(r)return"unaggregated"}return e}function Yb(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=Xb(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&Y(i.x2)?Y(i.x)?Tt(Rt(n,r,e,"x"),Rt(n,r,e,"x2"),"domain","scale",_o):Rt(n,r,e,"x2"):t==="y"&&Y(i.y2)?Y(i.y)?Tt(Rt(n,r,e,"y"),Rt(n,r,e,"y2"),"domain","scale",_o):Rt(n,r,e,"y2"):Rt(n,r,e,t)}function Kb(e,t,n){return e.map(i=>{const r=Gi(i,{timeUnit:n,type:t});return{signal:`{data: ${r}}`}})}function vo(e,t,n){const i=Z(n)?.unit;return t==="temporal"||i?Kb(e,t,i):[e]}function Rt(e,t,n,i){const{encoding:r}=n,s=Y(r[i]),{type:o}=s,a=s.timeUnit;if(yg(t)){const f=Rt(e,void 0,n,i),d=vo(t.unionWith,o,a);return Ze([...d,...f.value])}else{if(E(t))return Ze([t]);if(t&&t!=="unaggregated"&&!fc(t))return Ze(vo(t,o,a))}const c=n.stack;if(c&&i===c.fieldChannel){if(c.offset==="normalize")return xe([[0,1]]);const f=n.requestDataName(U.Main);return xe([{data:f,field:n.vgField(i,{suffix:"start"})},{data:f,field:n.vgField(i,{suffix:"end"})}])}const u=ct(i)&&S(s)?Zb(n,i,e):void 0;if(Ye(s)){const f=vo([s.datum],o,a);return xe(f)}const l=s;if(t==="unaggregated"){const f=n.requestDataName(U.Main),{field:d}=s;return xe([{data:f,field:w({field:d,aggregate:"min"})},{data:f,field:w({field:d,aggregate:"max"})}])}else if(j(l.bin)){if(J(e))return e==="bin-ordinal"?xe([]):xe([{data:Un(u)?n.requestDataName(U.Main):n.requestDataName(U.Raw),field:n.vgField(i,Jn(l,i)?{binSuffix:"range"}:{}),sort:u===!0||!L(u)?{field:n.vgField(i,{}),op:"min"}:u}]);{const{bin:f}=l;if(j(f)){const d=ho(n,l.field,f);return xe([new me(()=>{const p=n.getSignalName(d);return`[${p}.start, ${p}.stop]`})])}else return xe([{data:n.requestDataName(U.Main),field:n.vgField(i,{})}])}}else if(l.timeUnit&&P(["time","utc"],e)&&Ac(l,G(n)?n.encoding[He(i)]:void 0,n.markDef,n.config)){const f=n.requestDataName(U.Main);return xe([{data:f,field:n.vgField(i)},{data:f,field:n.vgField(i,{suffix:"end"})}])}else return xe(u?[{data:Un(u)?n.requestDataName(U.Main):n.requestDataName(U.Raw),field:n.vgField(i),sort:u}]:[{data:n.requestDataName(U.Main),field:n.vgField(i)}])}function Eo(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":Li),...i?{field:Se(i)}:{},...r?{order:r}:{}}}function Qb(e,t){const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=e.fieldDef(t)?.bin,s=fc(i)&&i,o=Ut(r)&&ki(r.extent)&&r.extent;(s||o)&&n.set("selectionExtent",s??o,!0)}function Zb(e,t,n){if(!J(n))return;const i=e.fieldDef(t),r=i.sort;if(Cc(r))return{op:"min",field:Pn(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if(Xe(r)){const a=s&&!o.has(r.field);return Eo(r,a)}else if(kc(r)){const{encoding:a,order:c}=r,u=e.fieldDef(a),{aggregate:l,field:f}=u,d=s&&!o.has(f);if(ut(l)||_t(l))return Eo({field:w(u),order:c},d);if(Gr(l)||!l)return Eo({op:l,field:f,order:c},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(P(["ascending",void 0],r))return!0}return}function Ql(e,t){const{aggregate:n,type:i}=e;return n?N(n)&&!Td.has(n)?{valid:!1,reason:Sp(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:wp(e)}:{valid:!0}:{valid:!1,reason:xp(e)}}function _o(e,t,n,i){return e.explicit&&t.explicit&&x(kp(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Jb(e){const t=je(e.map(o=>{if(lt(o)){const{sort:a,...c}=o;return c}return o}),O),n=je(e.map(o=>{if(lt(o)){const a=o.sort;return a!==void 0&&!Un(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}return}).filter(o=>o!==void 0),O);if(t.length===0)return;if(t.length===1){const o=e[0];if(lt(o)&&n.length>0){let a=n[0];if(n.length>1){x(Ha);const c=n.filter(u=>L(u)&&"op"in u&&u.op!=="min");n.every(u=>L(u)&&"op"in u)&&c.length===1?a=c[0]:a=!0}else if(L(a)&&"field"in a){const c=a.field;o.field===c&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=je(n.map(o=>Un(o)||!("op"in o)||N(o.op)&&o.op in kd?o:(x(Fp(o)),!0)),O);let r;i.length===1?r=i[0]:i.length>1&&(x(Ha),r=!0);const s=je(e.map(o=>lt(o)?o.data:null),o=>o);if(s.length===1&&s[0]!==null){const o={data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}};return o}return{fields:t,...r?{sort:r}:{}}}function ko(e){if(lt(e)&&N(e.field))return e.field;if(Ad(e)){let t;for(const n of e.fields)if(lt(n)&&N(n.field)){if(!t)t=n.field;else if(t!==n.field)return x(Np),t}return x(Tp),t}else if(Od(e)){x(Ap);const t=e.fields[0];return N(t)?t:void 0}return}function dr(e,t){const n=e.component.scales[t],i=n.get("domains").map(r=>(lt(r)&&(r.data=e.lookupDataSource(r.data)),r));return Jb(i)}function Zl(e){return Ln(e)||Fo(e)?e.children.reduce((t,n)=>t.concat(Zl(n)),Jl(e)):Jl(e)}function Jl(e){return b(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:c,range:u,reverse:l,...f}=r,d=ex(r.range,s,n,e),p=dr(e,n),g=a?Xh(e,a,i,p):null;return t.push({name:s,type:o,...p?{domain:p}:{},...g?{domainRaw:g}:{},range:d,...l!==void 0?{reverse:l}:{},...f}),t},[])}function ex(e,t,n,i){if(Q(n)){if(Ct(e))return{step:{signal:`${t}_step`}}}else if(L(e)&<(e))return{...e,data:i.lookupDataSource(e.data)};return e}class ef extends gt{constructor(t,n){super({},{name:t});this.merged=!1,this.setWithExplicit("type",n)}domainDefinitelyIncludesZero(){return this.get("zero")!==!1?!0:It(this.get("domains"),t=>v(t)&&t.length===2&&t[0]<=0&&t[1]>=0)}}const tx=["range","scheme"];function nx(e){const t=e.component.scales;for(const n of _i){const i=t[n];if(!i)continue;const r=ix(n,e);i.setWithExplicit("range",r)}}function tf(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:i,field:r}=n,s=de(t),o=e.getName(s);if(L(i)&&i.binned&&i.step!==void 0)return new me(()=>{const a=e.scaleName(t),c=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${c})`});if(j(i)){const a=ho(e,r,i);return new me(()=>{const c=e.getSignalName(a),u=`(${c}.stop - ${c}.start) / ${c}.step`;return`${e.getSignalName(o)} / (${u})`})}}return}function ix(e,t){const n=t.specifiedScales[e],{size:i}=t,r=t.getScaleComponent(e),s=r.get("type");for(const f of tx)if(n[f]!==void 0){const d=ds(s,f),p=dc(e,f);if(!d)x(Ba(s,f,e));else if(p)x(p);else switch(f){case"range":{const g=n.range;if(v(g)){if(Q(e))return Ze(g.map(m=>{if(m==="width"||m==="height"){const h=t.getName(m),y=t.getSignalName.bind(t);return me.fromName(y,h)}return m}))}else if(L(g))return Ze({data:t.requestDataName(U.Main),field:g.field,sort:{op:"min",field:t.vgField(e)}});return Ze(g)}case"scheme":return Ze(rx(n[f]))}}const o=e===H||e==="xOffset"?"width":"height",a=i[o];if(Qe(a)){if(Q(e))if(J(s)){const f=nf(a,t,e);if(f)return Ze({step:f})}else x(Wa(o));else if(hn(e)){const f=e===xt?"x":"y",d=t.getScaleComponent(f),p=d.get("type");if(p==="band"){const g=rf(a,s);if(g)return Ze(g)}}}const{rangeMin:c,rangeMax:u}=n,l=sx(e,t);return(c!==void 0||u!==void 0)&&ds(s,"rangeMin")&&v(l)&&l.length===2?Ze([c??l[0],u??l[1]]):xe(l)}function rx(e){return hg(e)?{scheme:e.name,...ue(e,["name"])}:{scheme:e}}function sx(e,t){const{size:n,config:i,mark:r,encoding:s}=t,o=t.getSignalName.bind(t),{type:a}=Y(s[e]),c=t.getScaleComponent(e),u=c.get("type"),{domain:l,domainMid:f}=t.specifiedScales[e];switch(e){case H:case K:{if(P(["point","band"],u)){const g=sf(e,n,i.view);if(Qe(g)){const m=nf(g,t,e);return{step:m}}}const d=de(e),p=t.getName(d);return e===K&&be(u)?[me.fromName(o,p),0]:[0,me.fromName(o,p)]}case xt:case pn:return ox(e,t,u);case ot:{const d=t.component.scales[e].get("zero"),p=of(r,d,i),g=ux(r,n,t,i);return Sn(u)?cx(p,g,ax(u,i,l,e)):[p,g]}case we:return[0,Math.PI*2];case Mt:return[0,360];case ke:return[0,new me(()=>{const d=t.getSignalName("width"),p=t.getSignalName("height");return`min(${d},${p})/2`})];case $t:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case vt:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case fe:return"symbol";case le:case Be:case We:return u==="ordinal"?a==="nominal"?"category":"ordinal":f!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case at:case St:case wt:return[i.scale.minOpacity,i.scale.maxOpacity]}}function nf(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=Ur(n),o=i[s],a=fu({step:e,offsetIsDiscrete:F(o)&&sc(o.type)});if(a==="offset"&&Gc(i,s)){const c=t.getScaleComponent(s),u=t.scaleName(s);let l=`domain('${u}').length`;if(c.get("type")==="band"){const d=c.get("paddingInner")??c.get("padding")??0,p=c.get("paddingOuter")??c.get("padding")??0;l=`bandspace(${l}, ${d}, ${p})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${l} / (1-${Id(f)})`}}else return e.step}function rf(e,t){const n=fu({step:e,offsetIsDiscrete:J(t)});return n==="offset"?{step:e.step}:void 0}function ox(e,t,n){const i=e===xt?"x":"y",r=t.getScaleComponent(i),s=r.get("type"),o=t.scaleName(i);if(s==="band"){const a=sf(i,t.size,t.config.view);if(Qe(a)){const c=rf(a,n);if(c)return c}return[0,{signal:`bandwidth('${o}')`}]}else{const a=t.encoding[i];if(S(a)&&a.timeUnit){const c=tc(a.timeUnit,l=>`scale('${o}', ${l})`),u=t.config.scale.bandWithNestedOffsetPaddingInner;if(u){const l=E(u)?`${u.signal}/2`:`${u/2}`,f=E(u)?`(1 - ${u.signal}/2)`:`${1-u/2}`;return[{signal:`${l} * (${c})`},{signal:`${f} * (${c})`}]}return[0,{signal:c}]}return Zo(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function sf(e,t,n){const i=e===H?"width":"height",r=t[i];return r||Ji(n,i)}function ax(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&v(n)?n.length+1:(x(jp(i)),3)}}function cx(e,t,n){const i=()=>{const r=Te(t),s=Te(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return E(t)?new me(i):{signal:i()}}function of(e,t,n){if(t)return E(t)?{signal:`${t.signal} ? 0 : ${of(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(Fi("size",e))}const af=.95;function ux(e,t,n,i){const r={x:tf(n,"x"),y:tf(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=cf(t,r,i.view);return V(s)?s-1:new me(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=cf(t,r,i.view);return V(s)?Math.pow(af*s,2):new me(()=>`pow(${af} * ${s.signal}, 2)`)}}throw new Error(Fi("size",e))}function cf(e,t,n){const i=Qe(e.width)?e.width.step:Zi(n,"width"),r=Qe(e.height)?e.height.step:Zi(n,"height");return t.x||t.y?new me(()=>{const s=[t.x?t.x.signal:i,t.y?t.y.signal:r];return`min(${s.join(", ")})`}):Math.min(i,r)}function uf(e,t){G(e)?lx(e,t):df(e,t)}function lx(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of b(n)){const c=o[a],u=n[a],l=e.getScaleComponent(a),f=Y(r[a]),d=c[t],p=l.get("type"),g=l.get("padding"),m=l.get("paddingInner"),h=ds(p,t),y=dc(a,t);if(d!==void 0&&(h?y&&x(y):x(Ba(p,t,a))),h&&y===void 0)if(d!==void 0){const $=f.timeUnit,C=f.type;switch(t){case"domainMax":case"domainMin":Bt(c[t])||C==="temporal"||$?u.set(t,{signal:Gi(c[t],{type:C,timeUnit:$})},!0):u.set(t,c[t],!0);break;default:u.copyKeyFromObject(t,c)}}else{const $=t in lf?lf[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:p,scalePadding:g,scalePaddingInner:m,domain:c.domain,domainMin:c.domainMin,domainMax:c.domainMax,markDef:s,config:i,hasNestedOffsetScale:Cs(r,a),hasSecondaryRangeChannel:!!r[He(a)]}):i.scale[t];$!==void 0&&u.set(t,$,!1)}}}const lf={bins:({model:e,fieldOrDatumDef:t})=>S(t)?fx(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>dx(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>px(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>gx(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>mx(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>hx(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=S(e)?e.sort:void 0;return yx(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>bx(e,t,n,i,r,s.scale,o)};function ff(e){G(e)?nx(e):df(e,"range")}function df(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?ff(i):uf(i,t);for(const i of b(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=Tt(r,a,t,"scale",Iu((c,u)=>{switch(t){case"range":return c.step&&u.step?c.step-u.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function fx(e,t){const n=t.bin;if(j(n)){const i=ho(e,t.field,n);return new me(()=>e.getSignalName(i))}else if(ne(n)&&Ut(n)&&n.step!==void 0)return{step:n.step};return}function dx(e,t){return P([le,Be,We],e)&&t!=="nominal"?"hcl":void 0}function px(e,t,n,i,r,s){return Ke(s)?.bin||v(n)||r!=null||i!=null||P([ge.TIME,ge.UTC],e)?void 0:Q(t)?!0:void 0}function gx(e,t,n,i,r,s){if(Q(e)){if(Ae(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(S(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===ge.POINT)return n.pointPadding}return}function mx(e,t,n,i,r,s=!1){if(e!==void 0)return;if(Q(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:c,bandWithNestedOffsetPaddingInner:u}=r;return s?u:X(o,n==="bar"?a:c)}else if(hn(t)&&i===ge.BAND)return r.offsetBandPaddingInner;return}function hx(e,t,n,i,r,s=!1){if(e!==void 0)return;if(Q(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===ge.BAND)return X(o,E(i)?{signal:`${i.signal}/2`}:i/2)}else if(hn(t)){if(n===ge.POINT)return .5;if(n===ge.BAND)return r.offsetBandPaddingOuter}return}function yx(e,t,n,i){return n==="x"&&i.xReverse!==void 0?be(e)&&t==="descending"?E(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse:be(e)&&t==="descending"?!0:void 0}function bx(e,t,n,i,r,s,o){const a=!!n&&n!=="unaggregated";if(a&&be(r)){if(v(n)){const c=n[0],u=n[n.length-1];if(c<=0&&u>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!Sn(r))return!0;if(!(S(t)&&t.bin)&&P([...qe,...bd],e)){const{orient:c,type:u}=i;return P(["bar","area","line","trail"],u)&&(c==="horizontal"&&e==="y"||c==="vertical"&&e==="x")?!1:P(["bar","area"],u)&&!o?!0:s?.zero}return!1}function xx(e,t,n,i,r=!1){const s=Sx(t,n,i,r),{type:o}=e;return ct(t)?o!==void 0?vg(t,o)?S(n)&&!$g(o,n.type)?(x(Ep(o,s)),s):o:(x(vp(t,o,s)),s):s:null}function Sx(e,t,n,i){switch(t.type){case"nominal":case"ordinal":{if(mn(e)||qr(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&x(Qr(e,"ordinal")),"ordinal";if(Q(e)||hn(e)){if(P(["rect","bar","image","rule"],n.type))return"band";if(i)return"band"}else if(n.type==="arc"&&e in Hr)return"band";const r=n[de(e)];return Gt(r)||$n(t)&&t.axis?.tickBand?"band":"point"}case"temporal":return mn(e)?"time":qr(e)==="discrete"?(x(Qr(e,"temporal")),"ordinal"):S(t)&&t.timeUnit&&Z(t.timeUnit).utc?"utc":"time";case"quantitative":return mn(e)?S(t)&&j(t.bin)?"bin-ordinal":"linear":qr(e)==="discrete"?(x(Qr(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(ja(t.type))}function wx(e,{ignoreRange:t}={}){pf(e),Kl(e);for(const n of wg)uf(e,n);t||ff(e)}function pf(e){G(e)?e.component.scales=$x(e):e.component.scales=Ex(e)}function $x(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of _i){const o=Y(t[s]);if(o&&n===mc&&s===fe&&o.type===xn)continue;let a=o&&o.scale;if(hn(s)){const c=ga(s);if(!Cs(t,c)){a&&x(up(s));continue}}if(o&&a!==null&&a!==!1){a??(a={});const c=Cs(t,s),u=xx(a,s,o,i,c);r[s]=new ef(e.scaleName(`${s}`,!0),{value:u,explicit:a.type===u})}}return r}const vx=Iu((e,t)=>oc(e)-oc(t));function Ex(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const s of e.children){pf(s);for(const o of b(s.component.scales))if((t=r.scale)[o]??(t[o]=Tl(o,e)),r.scale[o]==="shared"){const a=i[o],c=s.component.scales[o].getWithExplicit("type");a?fg(a.value,c.value)?i[o]=Tt(a,c,"type","scale",vx):(r.scale[o]="independent",delete i[o]):i[o]=c}}for(const s of b(i)){const o=e.scaleName(s,!0),a=i[s];n[s]=new ef(o,a);for(const c of e.children){const u=c.component.scales[s];u&&(c.renameScale(u.get("name"),o),u.merged=!0)}}return n}class Co{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function G(e){return e?.type==="unit"}function Le(e){return e?.type==="facet"}function Fo(e){return e?.type==="concat"}function Ln(e){return e?.type==="layer"}class No{constructor(t,n,i,r,s,o,a){this.type=n,this.parent=i,this.config=s,this.correctDataNames=c=>(c.from?.data&&(c.from.data=this.lookupDataSource(c.from.data)),c.from?.facet?.data&&(c.from.facet.data=this.lookupDataSource(c.from.facet.data)),c),this.parent=i,this.config=s,this.view=pe(a),this.name=t.name??r,this.title=kt(t.title)?{text:t.title}:t.title?pe(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new Co,this.projectionNameMap=i?i.projectionNameMap:new Co,this.signalNameMap=i?i.signalNameMap:new Co,this.data=t.data,this.description=t.description,this.transforms=Ah(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:Dm(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:Mi(t)||i?.component.data.isFaceted&&t.data===void 0},layoutSize:new gt,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?k(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){wx(this)}parseProjection(){Wl(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Ml(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of b(i)){const o=i[s];o!==void 0&&(r[s]=B(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=B(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n??{}}:I(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=qy(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of ve)t[i].title&&n.push(Dy(this,i));for(const i of uo)n=n.concat(jy(this,i));return n}assembleAxes(){return ky(this.component.axes,this.config)}assembleLegends(){return jl(this)}assembleProjections(){return gb(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...$a(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};return i.text?(P(["unit","layer"],this.type)?P(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),I(i)?void 0:i):void 0}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Le(this.parent)?Zl(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return W((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(U[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Le(this.parent)){const n=Fl(t),i=Ei(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(J(s)&&Ct(o)){const a=r.get("name"),c=dr(this,i),u=ko(c);if(u){const l=w({aggregate:"distinct",field:u},{expr:"datum"});return{signal:Cl(a,r,l)}}else return x(Yr(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){return n?this.getName(t):fa(t)&&ct(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t))?this.scaleNameMap.get(this.getName(t)):void 0}projectionName(t){return t?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(Ud(n));return i}hasAxisOrientSignalRef(){return this.component.axes.x?.some(t=>t.hasOrientSignalRef())||this.component.axes.y?.some(t=>t.hasOrientSignalRef())}}class gf extends No{vgField(t,n={}){const i=this.fieldDef(t);return i?w(i,n):void 0}reduceFieldDef(t,n){return gm(this.getMapping(),(i,r,s)=>{const o=Ke(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){Ns(this.getMapping(),(i,r)=>{const s=Ke(i);s&&t(s,r)},n)}}class pr extends R{clone(){return new pr(null,k(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=k(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"],n.groupby&&n.minsteps==null&&n.maxsteps==null&&n.steps==null&&(this.transform.steps=200)}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${O(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i}}class gr extends R{clone(){return new gr(null,k(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=k(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${O(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform,i={type:"extent",field:t,signal:n};return i}}class ci extends R{clone(){return new ci(null,{...this.filter})}constructor(t,n){super(t);this.filter=n}static make(t,n){const{config:i,mark:r,markDef:s}=n,o=z("invalid",s,i);if(o!=="filter")return null;const a=n.reduceFieldDef((c,u,l)=>{const f=ct(l)&&n.getScaleComponent(l);if(f){const d=f.get("type");be(d)&&u.aggregate!=="count"&&!Ft(r)&&(c[u.field]=u)}return c},{});return b(a).length?new ci(t,a):null}dependentFields(){return new Set(b(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${O(this.filter)}`}assemble(){const t=b(this.filter).reduce((n,i)=>{const r=this.filter[i],s=w(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (isValid(${s}) && isFinite(+${s})))`):r.type==="quantitative"&&(n.push(`isValid(${s})`),n.push(`isFinite(+${s})`))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class mr extends R{clone(){return new mr(this.parent,k(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=k(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((s,o)=>r[o]??s)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${O(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform,i={type:"flatten",fields:t,as:n};return i}}class hr extends R{clone(){return new hr(null,k(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=k(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${O(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform,i={type:"fold",fields:t,as:n};return i}}class Mn extends R{clone(){return new Mn(null,k(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[Fe,Ce],[$e,Ne]]){const s=r.map(o=>{const a=Y(n.encoding[o]);return S(a)?a.field:Ye(a)?{expr:`${a.datum}`}:Pe(a)?{expr:`${a.value}`}:void 0});(s[0]||s[1])&&(t=new Mn(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(fe)){const r=n.typedFieldDef(fe);r.type===xn&&(t=new Mn(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t);this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(N);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${O(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class ui extends R{clone(){return new ui(null,this.projection,k(this.fields),k(this.as))}constructor(t,n,i,r){super(t);this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[Fe,Ce],[$e,Ne]]){const r=i.map(o=>{const a=Y(n.encoding[o]);return S(a)?a.field:Ye(a)?{expr:`${a.datum}`}:Pe(a)?{expr:`${a.value}`}:void 0}),s=i[0]===$e?"2":"";(r[0]||r[1])&&(t=new ui(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(N))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${O(this.fields)} ${O(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class rn extends R{clone(){return new rn(null,k(this.transform))}constructor(t,n){super(t);this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t,s=[n,i,...r?[r]:[]].join(",");return{signal:`sequence(${s})`}}static makeFromTransform(t,n){return new rn(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(S(r)&&S(s)){const o=r.impute?r:s.impute?s:void 0;if(o===void 0)return;const a=r.impute?s:s.impute?r:void 0,{method:c,value:u,frame:l,keyvals:f}=o.impute,d=Xc(n.mark,i);return new rn(t,{impute:o.field,key:a.field,...c?{method:c}:{},...u!==void 0?{value:u}:{},...l?{frame:l}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${O(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:s,value:o,frame:a=[null,null]}=this.transform,c={type:"impute",field:t,key:n,...i?{keyvals:dh(i)?this.processSequence(i):i}:{},method:"value",...s?{groupby:s}:{},value:!r||r==="value"?o:null};if(r&&r!=="value"){const u={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...s?{groupby:s}:{}},l={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[c,u,l]}else return[c]}}class yr extends R{clone(){return new yr(null,k(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=k(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${O(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform,r={type:"loess",x:n,y:t,...i};return r}}class li extends R{clone(){return new li(null,k(this.transform),this.secondary)}constructor(t,n,i){super(t);this.transform=n,this.secondary=i}static make(t,n,i,r){const s=n.component.data.sources,{from:o}=i;let a=null;if(ph(o)){let c=bf(o.data,s);c||(c=new en(o.data),s.push(c));const u=n.getName(`lookup_${r}`);a=new ce(c,u,U.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[u]=a}else if(gh(o)){const c=o.param;i={as:c,...i};let u;try{u=n.getSelectionComponent(W(c),c)}catch(l){throw new Error(Hd(c))}if(a=u.materialized,!a)throw new Error(qd(c))}return new li(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?q(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${O({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:q(this.transform.as)}:{}};else{let n=this.transform.as;N(n)||(x(Jd),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class br extends R{clone(){return new br(null,k(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=k(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${O(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform,i={type:"quantile",field:t,...n};return i}}class xr extends R{clone(){return new xr(null,k(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=k(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${O(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform,r={type:"regression",x:n,y:t,...i};return r}}class Sr extends R{clone(){return new Sr(null,k(this.transform))}constructor(t,n){super(t);this.transform=n}addDimensions(t){this.transform.groupby=je((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){return}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${O(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:s}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...s!==void 0?{op:s}:{},...i!==void 0?{groupby:i}:{}}}}class wr extends R{clone(){return new wr(null,k(this.transform))}constructor(t,n){super(t);this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${O(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function mf(e){let t=0;function n(i,r){if(i instanceof en&&(!i.isGenerator&&!Cn(i.data))){e.push(r);const s={name:null,source:r.name,transform:[]};r=s}if(i instanceof se&&(i.parent instanceof en&&!r.source?(r.format={...r.format??{},parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Rn){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}if((i instanceof si||i instanceof oi||i instanceof ci||i instanceof An||i instanceof On||i instanceof ui||i instanceof Re||i instanceof li||i instanceof In||i instanceof nn||i instanceof hr||i instanceof mr||i instanceof pr||i instanceof yr||i instanceof br||i instanceof xr||i instanceof zt||i instanceof wr||i instanceof Sr||i instanceof gr)&&r.transform.push(i.assemble()),(i instanceof et||i instanceof Je||i instanceof rn||i instanceof ht||i instanceof Mn)&&r.transform.push(...i.assemble()),i instanceof ce){if(r.source&&r.transform.length===0)i.setSource(r.source);else if(i.parent instanceof ce)i.setSource(r.name);else if(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1){e.push(r);const s={name:null,source:r.name,transform:[]};r=s}}switch(i.numChildren()){case 0:i instanceof ce&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children){const a={name:null,source:s,transform:[]};n(o,a)}break}}}return n}function _x(e){const t=[],n=mf(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function kx(e,t){const n=[],i=mf(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function Cx(e){return e==="top"||e==="left"||E(e)?"header":"footer"}function Fx(e){for(const t of ve)Nx(e,t);yf(e,"x"),yf(e,"y")}function Nx(e,t){const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const o=n[t],a=zn("title",null,i,t);let c=vn(o,i,{allowDisabling:!0,includeDefault:a===void 0||!!a});r.component.layoutHeaders[t].title&&(c=v(c)?c.join(", "):c,c+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const u=zn("labelOrient",o.header,i,t),l=o.header!==null?X(o.header?.labels,i.header.labels,!0):!1,f=P(["bottom","right"],u)?"footer":"header";s.layoutHeaders[t]={title:o.header!==null?c:null,facetFieldDef:o,[f]:t==="facet"?[]:[hf(e,t,l)]}}}function hf(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function yf(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=go(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const c=Cx(a.get("orient"));o[c]??(o[c]=[hf(e,s,!1)]);const u=ri(a,"main",e.config,{header:!0});u&&o[c][0].axes.push(u),a.mainExtracted=!0}}}}function Tx(e){To(e),$r(e,"width"),$r(e,"height")}function Ax(e){To(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";$r(e,t),$r(e,n)}function To(e){for(const t of e.children)t.parseLayoutSize()}function $r(e,t){const n=Fl(t),i=Ei(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const c=a.component.layoutSize.getWithExplicit(n),u=r.scale[i]??Tl(i,e);if(u==="independent"&&c.value==="step"){o=void 0;break}if(o){if(u==="independent"&&o.value!==c.value){o=void 0;break}o=Tt(o,c,n,"")}else o=c}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function Ox(e){const{size:t,component:n}=e;for(const i of qe){const r=de(i);if(t[r]){const s=t[r];n.layoutSize.set(r,Qe(s)?"step":s,!0)}else{const s=Px(e,r);n.layoutSize.set(r,s,!1)}}}function Px(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(J(s)){const a=Ji(i.view,t);return Ct(o)||Qe(a)?"step":a}else return Us(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return Us(i.view,t);{const s=Ji(i.view,t);return Qe(s)?s.step:s}}}function Ao(e,t,n){return w(t,{suffix:`by_${w(e)}`,...n??{}})}class fi extends gf{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve);this.child=Io(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Qn(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=b(t),i={};for(const r of n){if(![nt,it].includes(r)){x(Fi(r,"facet"));break}const s=t[r];if(s.field===void 0){x(Kr(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=ks(t,n);return i.header?i.header=pe(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=vr(this),this.child.parseData()}parseLayoutSize(){To(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Fx(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of ve)for(const i of lo){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:o}=r;if(o){const a=zn("titleOrient",o.header,this.config,n);if(["right","bottom"].includes(a)){const c=cr(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[c]="end"}}if(s?.[0]){const a=n==="row"?"height":"width",c=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[c]??(t[c]={}),t[c][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(this.parent&&this.parent instanceof fi)return;{const t=this.getName("column_domain");return{signal:`length(data('${t}'))`}}}assembleGroupStyle(){return}assembleGroup(t){return this.parent&&this.parent instanceof fi?{...this.channelHasField("column")?{encode:{update:{columns:{field:w(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof fi){if(this.child.channelHasField("column")){const r=w(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of qe){const s=this.child.component.scales[r];if(s&&!s.merged){const o=s.get("type"),a=s.get("range");if(J(o)&&Ct(a)){const c=dr(this.child,r),u=ko(c);u?(t.push(u),n.push("distinct"),i.push(`distinct_${u}`)):x(Yr(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:s,ops:o,as:a}=this.getCardinalityAggregateForChild(),c=[];for(const l of ve){const f=this.facet[l];if(f){c.push(w(f));const{bin:d,sort:p}=f;if(j(d)&&c.push(w(f,{binSuffix:"end"})),Xe(p)){const{field:g,op:m=Li}=p,h=Ao(f,p);i&&r?(s.push(h),o.push("max"),a.push(h)):(s.push(g),o.push(m),a.push(h))}else if(v(p)){const g=Pn(f,l);s.push(g),o.push("max"),a.push(g)}}}const u=!!i&&!!r;return{name:t,data:n,groupby:c,...u||s.length>0?{aggregate:{...u?{cross:u}:{},...s.length?{fields:s,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?Xe(i.sort)?[Ao(i,i.sort,{expr:"datum"})]:v(i.sort)?[Pn(i,t,{expr:"datum"})]:[w(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i,s=(Xe(r)?r.order:!v(r)&&r)||"ascending";return[s]}return[]}assembleLabelTitle(){const{facet:t,config:n}=this;if(t.facet)return fo(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const r of uo)if(t[r]){const s=zn("labelOrient",t[r]?.header,n,r);if(i[r].includes(s))return fo(t[r],r,n)}return}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=_x(n),r=t.assembleGroupEncodeEntry(!1),s=this.assembleLabelTitle()||t.assembleTitle(),o=t.assembleGroupStyle(),a={name:this.getName("cell"),type:"group",...s?{title:s}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:ve.map(c=>this.facetSortFields(c)).flat(),order:ve.map(c=>this.facetSortOrder(c)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(Hh(this,[]))};return[a]}getMapping(){return this.facet}}function zx(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(Xe(s.sort)){const{field:o,op:a=Li}=s.sort;e=r=new nn(e,{joinaggregate:[{op:a,field:o,as:Ao(s,s.sort,{forAs:!0})}],groupby:[w(s)]})}return r}return null}function bf(e,t){for(const n of t){const i=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;const r=e.format?.mesh,s=i.format?.feature;if(r&&s)continue;const o=e.format?.feature;if((o||s)&&o!==s)continue;const a=i.format?.mesh;if((r||a)&&r!==a)continue;if(ti(e)&&ti(i)){if(De(e.values,i.values))return n}else if(Cn(e)&&Cn(i)){if(e.url===i.url)return n}else if(Lu(e)&&e.name===n.dataName)return n}return null}function Rx(e,t){if(e.data||!e.parent){if(e.data===null){const i=new en({values:[]});return t.push(i),i}const n=bf(e.data,t);if(n)return At(e.data)||(n.data.format=Jo({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new en(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function Ix(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(Eh(r))o=e=new On(e,r),s="derived";else if(Gs(r)){const a=Cb(r);o=e=se.makeWithAncestors(e,{},a,n)??e,e=new An(e,t,r.filter)}else if(Nu(r))o=e=et.makeFromTransform(e,r,t),s="number";else if(kh(r)){s="date";const a=n.getWithExplicit(r.field);a.value===void 0&&(e=new se(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=Je.makeFromTransform(e,r)}else if(Ch(r))o=e=Re.makeFromTransform(e,r),s="number",ro(t)&&(e=new zt(e));else if(Fu(r))o=e=li.make(e,t,r,i++),s="derived";else if(wh(r))o=e=new In(e,r),s="number";else if($h(r))o=e=new nn(e,r),s="number";else if(Fh(r))o=e=ht.makeFromTransform(e,r),s="derived";else if(Nh(r))o=e=new hr(e,r),s="derived";else if(Th(r))o=e=new gr(e,r),s="derived";else if(vh(r))o=e=new mr(e,r),s="derived";else if(mh(r))o=e=new Sr(e,r),s="derived";else if(Sh(r))e=new wr(e,r);else if(_h(r))o=e=rn.makeFromTransform(e,r),s="derived";else if(hh(r))o=e=new pr(e,r),s="derived";else if(yh(r))o=e=new br(e,r),s="derived";else if(bh(r))o=e=new xr(e,r),s="derived";else if(xh(r))o=e=new yr(e,r),s="derived";else{x(Zd(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function vr(e){let t=Rx(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,s=r&&(At(r)||Cn(r)||ti(r)),o=!s&&e.parent?e.parent.component.data.ancestorParse.clone():new Bh;At(r)?(Mu(r)?t=new oi(t,r.sequence):Ys(r)&&(t=new si(t,r.graticule)),o.parseNothing=!0):r?.format?.parse===null&&(o.parseNothing=!0),t=se.makeExplicit(t,e,o)??t,t=new zt(t);const a=e.parent&&Ln(e.parent);(G(e)||Le(e))&&(a&&(t=et.makeFromEncoding(t,e)??t)),e.transforms.length>0&&(t=Ix(t,e,o));const c=Nb(e),u=Fb(e);t=se.makeWithAncestors(t,{},{...c,...u},o)??t,G(e)&&(t=Mn.parseAll(t,e),t=ui.parseAll(t,e)),(G(e)||Le(e))&&(a||(t=et.makeFromEncoding(t,e)??t),t=Je.makeFromEncoding(t,e)??t,t=On.parseAllForSortIndex(t,e));const l=e.getDataName(U.Raw),f=new ce(t,l,U.Raw,i);if(n[l]=f,t=f,G(e)){const m=Re.makeFromEncoding(t,e);m&&(t=m,ro(e)&&(t=new zt(t))),t=rn.makeFromEncoding(t,e)??t,t=ht.makeFromEncoding(t,e)??t}G(e)&&(t=ci.make(t,e)??t);const d=e.getDataName(U.Main),p=new ce(t,d,U.Main,i);n[d]=p,t=p,G(e)&&Ey(e,p);let g=null;if(Le(e)){const m=e.getName("facet");t=zx(t,e.facet)??t,g=new Rn(t,e,m,p.getSource()),n[m]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:f,main:p,facetRoot:g,ancestorParse:o}}class Lx extends No{constructor(t,n,i,r){super(t,"concat",n,i,r,t.resolve);(t.resolve?.axis?.x==="shared"||t.resolve?.axis?.y==="shared")&&x(Yd),this.children=this.getChildren(t).map((s,o)=>Io(s,this,this.getName(`concat_${o}`),void 0,r))}parseData(){this.component.data=vr(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of b(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return Qi(t)?t.vconcat:js(t)?t.hconcat:t.concat}parseLayoutSize(){Ax(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=po(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){return}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function Mx(e){return e===!1||e===null}const Dx={disable:1,gridScale:1,scale:1,...Wc,labelExpr:1,encode:1},xf=b(Dx);class Oo extends gt{constructor(t={},n={},i=!1){super();this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new Oo(k(this.explicit),k(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Mx(this.get(t))}hasOrientSignalRef(){return E(this.explicit.orient)}}function jx(e,t,n){const{encoding:i,config:r}=e,s=Y(i[t])??Y(i[He(t)]),o=e.axis(t)||{},{format:a,formatType:c}=o;if(Xt(c))return{text:Oe({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:c,config:r}),...n};if(a===void 0&&c===void 0&&r.customFormatTypes){if(wn(s)==="quantitative"){if($n(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Oe({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Oe({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(wn(s)==="temporal"&&r.timeFormatType&&S(s)&&!s.timeUnit)return{text:Oe({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function Ux(e){return qe.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[Xx(n,e)]),t),{})}const Bx={bottom:"top",top:"bottom",left:"right",right:"left"};function Wx(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of b(r.component.axes))n.axis[s]=go(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=Hx(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of qe){for(const s of e.children){if(!s.component.axes[r])continue;if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:c}=o.getWithExplicit("orient");if(E(a))continue;if(i[a]>0&&!c){const u=Bx[a];i[a]>i[u]&&o.set("orient",u,!1)}i[a]++}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&!!o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function Hx(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;in.clone());return e}function qx(e,t){for(const n of xf){const i=Tt(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return Aa(r,s);case"gridScale":return{explicit:r.explicit,value:X(r.value,s.value)}}return tr(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function Gx(e,t,n,i,r){if(t==="disable")return n!==void 0;n=n||{};switch(t){case"titleAngle":case"labelAngle":return e===(E(n.labelAngle)?n.labelAngle:Hn(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===$l(i,r))return!0}return e===n[t]}const Vx=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Xx(e,t){let n=t.axis(e);const i=new Oo,r=Y(t.encoding[e]),{mark:s,config:o}=t,a=n?.orient||o[e==="x"?"axisX":"axisY"]?.orient||o.axis?.orient||zy(e),c=t.getScaleComponent(e).get("type"),u=Cy(e,c,a,t.config),l=n!==void 0?!n:ao("disable",o.style,n?.style,u).configValue;if(i.set("disable",l,n!==void 0),l)return i;n=n||{};const f=Ay(r,n,e,o.style,u),d=$c(n.formatType,r,c),p=wc(r,r.type,n.format,n.formatType,o,!0),g={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:c,orient:a,labelAngle:f,format:p,formatType:d,mark:s,config:o};for(const y of xf){const $=y in xl?xl[y](g):Hc(y)?n[y]:void 0,C=$!==void 0,_=Gx($,y,n,t,e);if(C&&_)i.set(y,$,_);else{const{configValue:T=void 0,configFrom:M=void 0}=Hc(y)&&y!=="values"?ao(y,o.style,n.style,u):{},he=T!==void 0;C&&!he?i.set(y,$,_):(!(M==="vgAxisConfig")||Vx.has(y)&&he||ei(T)||E(T))&&i.set(y,T,!1)}}const m=n.encoding??{},h=Bc.reduce((y,$)=>{if(!i.hasAxisPart($))return y;const C=Nl(m[$]??{},t),_=$==="labels"?jx(t,e,C):C;return _!==void 0&&!I(_)&&(y[$]={update:_}),y},{});return I(h)||i.set("encode",h,!!n.encoding||n.labelAngle!==void 0),i}function Yx({encoding:e,size:t}){for(const n of qe){const i=de(n);Qe(t[i])&&(Nt(e[n])&&(delete t[i],x(Wa(i))))}return t}function Kx(e,t,n){const i=pe(e),r=z("orient",i,n);if(i.orient=eS(i.type,t,r),r!==void 0&&r!==i.orient&&x(hp(i.orient,r)),i.type==="bar"&&i.orient){const a=z("cornerRadiusEnd",i,n);if(a!==void 0){const c=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:Rg[i.orient];for(const u of c)i[u]=a;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=z("opacity",i,n);s===void 0&&(i.opacity=Zx(i.type,t));const o=z("cursor",i,n);return o===void 0&&(i.cursor=Qx(i,t,n)),i}function Qx(e,t,n){return t.href||e.href||z("href",e,n)?"pointer":e.cursor}function Zx(e,t){return P([zi,ps,gs,ms],e)&&!Fs(t)?.7:void 0}function Jx(e,t,{graticule:n}){if(n)return!1;const i=ft("filled",e,t),r=e.type;return X(i,r!==zi&&r!==Pi&&r!==Ri)}function eS(e,t,n){switch(e){case zi:case gs:case ms:case gc:case _g:case Eg:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case Oi:if(S(i)&&(ne(i.bin)||S(r)&&r.aggregate&&!i.aggregate))return"vertical";if(S(r)&&(ne(r.bin)||S(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(S(i)&&i.type===qt&&!j(i.bin)||Ui(i))&&(S(r)&&ne(r.bin))?"horizontal":"vertical";if(!o)return(S(r)&&r.type===qt&&!j(r.bin)||Ui(r))&&(S(i)&&ne(i.bin))?"vertical":"horizontal"}case Ri:if(s&&!(S(i)&&ne(i.bin))&&o&&!(S(r)&&ne(r.bin)))return;case Ai:if(o)return S(r)&&ne(r.bin)?"horizontal":"vertical";if(s)return S(i)&&ne(i.bin)?"vertical":"horizontal";if(e===Ri){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case Pi:case ps:{const a=Pc(i),c=Pc(r);if(n)return n;if(a&&!c)return e!=="tick"?"horizontal":"vertical";if(!a&&c)return e!=="tick"?"vertical":"horizontal";if(a&&c)return"vertical";{const u=ae(i)&&i.type===bn,l=ae(r)&&r.type===bn;if(u&&!l)return"vertical";if(!u&&l)return"horizontal"}return}}return"vertical"}const tS={vgMark:"arc",encodeEntry:e=>({...Ee(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...re("x",e,{defaultPos:"mid"}),...re("y",e,{defaultPos:"mid"}),...Ot(e,"radius"),...Ot(e,"theta")})},nS={vgMark:"area",encodeEntry:e=>({...Ee(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...ir("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...ir("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...no(e)})},iS={vgMark:"rect",encodeEntry:e=>({...Ee(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Ot(e,"x"),...Ot(e,"y")})},rS={vgMark:"shape",encodeEntry:e=>({...Ee(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape,i={type:"geoshape",projection:e.projectionName(),...n&&S(n)&&n.type===xn?{field:w(n,{expr:"datum"})}:{}};return[i]}},sS={vgMark:"image",encodeEntry:e=>({...Ee(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Ot(e,"x"),...Ot(e,"y"),...eo(e,"url")})},oS={vgMark:"line",encodeEntry:e=>({...Ee(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...re("x",e,{defaultPos:"mid"}),...re("y",e,{defaultPos:"mid"}),...ee("size",e,{vgChannel:"strokeWidth"}),...no(e)})},aS={vgMark:"trail",encodeEntry:e=>({...Ee(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...re("x",e,{defaultPos:"mid"}),...re("y",e,{defaultPos:"mid"}),...ee("size",e),...no(e)})};function Po(e,t){const{config:n}=e;return{...Ee(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...re("x",e,{defaultPos:"mid"}),...re("y",e,{defaultPos:"mid"}),...ee("size",e),...ee("angle",e),...cS(e,n,t)}}function cS(e,t,n){return n?{shape:{value:n}}:ee("shape",e)}const uS={vgMark:"symbol",encodeEntry:e=>Po(e)},lS={vgMark:"symbol",encodeEntry:e=>Po(e,"circle")},fS={vgMark:"symbol",encodeEntry:e=>Po(e,"square")},dS={vgMark:"rect",encodeEntry:e=>({...Ee(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Ot(e,"x"),...Ot(e,"y")})},pS={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...Ee(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ir("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...ir("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...ee("size",e,{vgChannel:"strokeWidth"})}}},gS={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...Ee(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...re("x",e,{defaultPos:"mid"}),...re("y",e,{defaultPos:"mid"}),...eo(e),...ee("size",e,{vgChannel:"fontSize"}),...ee("angle",e),...el("align",mS(e.markDef,n,t)),...el("baseline",hS(e.markDef,n,t)),...re("radius",e,{defaultPos:null}),...re("theta",e,{defaultPos:null})}}};function mS(e,t,n){const i=z("align",e,n);return i===void 0?"center":void 0}function hS(e,t,n){const i=z("baseline",e,n);return i===void 0?"middle":void 0}const yS={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"width":"height",s=i==="horizontal"?"height":"width";return{...Ee(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...re("x",e,{defaultPos:"mid",vgChannel:"xc"}),...re("y",e,{defaultPos:"mid",vgChannel:"yc"}),...ee("size",e,{defaultValue:bS(e),vgChannel:r}),[s]:B(z("thickness",n,t))}}};function bS(e){const{config:t,markDef:n}=e,{orient:i}=n,r=i==="horizontal"?"width":"height",s=e.getScaleComponent(i==="horizontal"?"x":"y"),o=z("size",n,t,{vgChannel:r})??t.tick.bandSize;if(o!==void 0)return o;{const a=s?s.get("range"):void 0;if(a&&Ct(a)&&V(a.step))return a.step*3/4;const c=Zi(t.view,r);return c*3/4}}const Er={arc:tS,area:nS,bar:iS,circle:lS,geoshape:rS,image:sS,line:oS,point:uS,rect:dS,rule:pS,square:fS,text:gS,tick:yS,trail:aS};function xS(e){if(P([Pi,Ai,kg],e.mark)){const t=Xc(e.mark,e.encoding);if(t.length>0)return SS(e,t)}else if(e.mark===Oi){const t=Vr.some(n=>z(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return wS(e)}return zo(e)}const Sf="faceted_path_";function SS(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:Sf+e.requestDataName(U.Main),data:e.requestDataName(U.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:zo(e,{fromPrefix:Sf})}]}const wf="stack_group_";function wS(e){const[t]=zo(e,{fromPrefix:wf}),n=e.scaleName(e.stack.fieldChannel),i=(u={})=>e.vgField(e.stack.fieldChannel,u),r=(u,l)=>{const f=[i({prefix:"min",suffix:"start",expr:l}),i({prefix:"max",suffix:"start",expr:l}),i({prefix:"min",suffix:"end",expr:l}),i({prefix:"max",suffix:"end",expr:l})];return`${u}(${f.map(d=>`scale('${n}',${d})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...fn(t.encode.update,["y","yc","y2","height",...Vr]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...ue(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...fn(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...ue(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const u of Vr){const l=ft(u,e.markDef,e.config);t.encode.update[u]?(s[u]=t.encode.update[u],delete t.encode.update[u]):l&&(s[u]=B(l)),l&&(t.encode.update[u]={value:0})}const a=[];if(e.stack.groupbyChannels?.length>0)for(const u of e.stack.groupbyChannels){const l=e.fieldDef(u),f=w(l);f&&a.push(f),(l?.bin||l?.timeUnit)&&a.push(w(l,{binSuffix:"end"}))}const c=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"];return s=c.reduce((u,l)=>{if(t.encode.update[l])return{...u,[l]:t.encode.update[l]};{const f=ft(l,e.markDef,e.config);return f!==void 0?{...u,[l]:B(f)}:u}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(U.Main),name:wf+e.requestDataName(U.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function $S(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!v(o)&&Pe(o)&&Ar(o.value)||!o&&Ar(z("order",r,s)))return;if((v(o)||S(o))&&!n)return Fa(o,{expr:"datum"});if(Ft(i)){const a=r.orient==="horizontal"?"y":"x",c=t[a];if(S(c)){const u=c.sort;if(v(u))return{field:w(c,{prefix:a,suffix:"sort_index",expr:"datum"})};if(Xe(u))return{field:w({aggregate:Fs(e.encoding)?u.op:void 0,field:u.field},{expr:"datum"})};if(kc(u)){const l=e.fieldDef(u.encoding);return{field:w(l,{expr:"datum"}),order:u.order}}else return u===null?void 0:{field:w(c,{binSuffix:e.stack?.impute?"mid":void 0,expr:"datum"})}}return}return}function zo(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,o=X(i.clip,vS(e),ES(e)),a=ka(i),c=r.key,u=$S(e),l=_S(e),f=z("aria",i,s),d=Er[n].postEncodingTransform?Er[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:Er[n].vgMark,...o?{clip:!0}:{},...a?{style:a}:{},...c?{key:c.field}:{},...u?{sort:u}:{},...l||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(U.Main)},encode:{update:Er[n].encodeEntry(e)},...d?{transform:d}:{}}]}function vS(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t?.get("selectionExtent")||n?.get("selectionExtent")?!0:void 0}function ES(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function _S(e){if(!e.component.selection)return null;const t=b(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=b(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip}:null}class $f extends gf{constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,du(t)?t.view:void 0);this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=Ve(t.mark)?{...t.mark}:{type:t.mark},a=o.type;o.filled===void 0&&(o.filled=Jx(o,s,{graticule:t.data&&Ys(t.data)}));const c=this.encoding=dm(t.encoding||{},a,o.filled,s);this.markDef=Kx(o,c,s),this.size=Yx({encoding:c,size:du(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=Su(this.markDef,c),this.specifiedScales=this.initScales(a,c),this.specifiedAxes=this.initAxes(c),this.specifiedLegends=this.initLegends(c),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(u=>Ms(u))}get hasProjection(){const{encoding:t}=this,n=this.mark===mc,i=t&&ld.some(r=>F(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return _i.reduce((i,r)=>{const s=Y(n[r]);return s&&(i[r]=this.initScale(s.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=pe(t);return v(n)&&(r.domain=n.map(ye)),v(i)&&(r.range=i.map(ye)),r}initAxes(t){return qe.reduce((n,i)=>{const r=t[i];if(F(r)||i===H&&F(t.x2)||i===K&&F(t.y2)){const s=F(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=b(t),i={};for(const r of n){const s=t[r];i[r]=ei(s)?va(s):ye(s)}return i}initLegends(t){return xd.reduce((n,i)=>{const r=Y(t[i]);if(r&&wd(i)){const s=r.legend;n[i]=s&&pe(s)}return n},{})}parseData(){this.component.data=vr(this)}parseLayoutSize(){Ox(this)}parseSelections(){this.component.selection=vy(this,this.selection)}parseMarkGroup(){this.component.mark=xS(this)}parseAxesAndHeaders(){this.component.axes=Ux(this)}assembleSelectionTopLevelSignals(t){return qh(this,t)}assembleSignals(){return[...yl(this),...Wh(this,[])]}assembleSelectionData(t){return Gh(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return po(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Ln(this.parent))&&(t=Uu(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return Kt(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Ke(n)}typedFieldDef(t){const n=this.fieldDef(t);return ae(n)?n:null}}class Ro extends No{constructor(t,n,i,r,s){super(t,"layer",n,i,s,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,c)=>{if(er(a))return new Ro(a,this,this.getName(`layer_${c}`),o,s);if(dt(a))return new $f(a,this,this.getName(`layer_${c}`),o,s);throw new Error(Xr(a))})}parseData(){this.component.data=vr(this);for(const t of this.children)t.parseData()}parseLayoutSize(){Tx(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of b(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){Wx(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),yl(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),po(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of q(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t;return}assembleLayout(){return null}assembleMarks(){return Vh(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),jl(this))}}function Io(e,t,n,i,r){if(Mi(e))return new fi(e,t,n,r);if(er(e))return new Ro(e,t,n,i,r);if(dt(e))return new $f(e,t,n,i,r);if(Im(e))return new Lx(e,t,n,r);throw new Error(Xr(e))}function kS(e,t={}){t.logger&&Up(t.logger),t.fieldTitle&&Mc(t.fieldTitle);try{const n=bu(Ko(t.config,e.config)),i=Pu(e,n),r=Io(i,null,"",void 0,n);r.parse(),qb(r.component.data,r);const s=FS(r,CS(e,i.autosize,n,r),e.datasets,e.usermeta);return{spec:s,normalized:i}}finally{t.logger&&Bp(),t.fieldTitle&&im()}}function CS(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):N(t)&&(t={type:t}),r&&s&&Dh(t.type)){if(r==="step"&&s==="step")x(za()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";x(za(Ei(o)));const a=o==="width"?"height":"width";t.type=jh(a)}}return{...b(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...Ru(n,!1),...Ru(e,!0)}}function FS(e,t,n={},i){const r=e.config?Km(e.config):void 0,s=[].concat(e.assembleSelectionData([]),kx(e.component.data,n)),o=e.assembleProjections(),a=e.assembleTitle(),c=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let l=e.assembleLayoutSignals();l=l.filter(p=>(p.name==="width"||p.name==="height")&&p.value!==void 0?(t[p.name]=+p.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...c?{style:c}:{},...u?{encode:{update:u}}:{},data:s,...o.length>0?{projections:o}:{},...e.assembleGroup([...l,...e.assembleSelectionTopLevelSignals([]),...lu(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const NS=rd.version;export{dn as accessPathDepth,Ir as accessPathWithDatum,kS as compile,P as contains,De as deepEqual,yi as deleteNestedProperty,k as duplicate,bt as entries,Or as every,Rr as fieldIntersection,ta as flatAccessWithDatum,X as getFirstDefined,Pr as hasIntersection,O as hash,ra as internalField,Un as isBoolean,I as isEmpty,od as isEqual,sa as isInternalField,Ar as isNullOrFalse,bi as isNumeric,b as keys,Bn as logicalExpr,Jo as mergeDeep,Zo as never,Pu as normalize,Hn as normalizeAngle,ue as omit,fn as pick,zr as prefixGenerator,Lr as removePathFromField,Lt as replaceAll,Se as replacePathInField,cd as resetIdCounter,ea as setEqual,It as some,D as stringify,Wn as titleCase,je as unique,ia as uniqueId,te as vals,W as varName,NS as version};export default null; diff --git a/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-lite@v5.18.0-FtLrd9Ks5cFttxoTAph7/dist=es2020,mode=imports,min/optimized/vega-lite.js b/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-lite@v5.18.0-FtLrd9Ks5cFttxoTAph7/dist=es2020,mode=imports,min/optimized/vega-lite.js deleted file mode 100644 index f2ed2523..00000000 --- a/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-lite@v5.18.0-FtLrd9Ks5cFttxoTAph7/dist=es2020,mode=imports,min/optimized/vega-lite.js +++ /dev/null @@ -1 +0,0 @@ -import{hasOwnProperty as an,isNumber as B,isString as N,writeConfig as Rf,splitAccessPath as cn,stringValue as A,isObject as L,isBoolean as jn,isArray as E,array as G,logger as If,Warn as Lf,isFunction as Mf,mergeConfig as Zo,identity as Df}from"/-/vega-util@v1.17.2-LUfkDhormMyfWqy3Ts6U/dist=es2020,mode=imports,min/optimized/vega-util.js";import{isObject as Or,writeConfig as jf,isArray as ea,isString as Si}from"/-/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/dist=es2020,mode=imports,min/optimized/vega.js";import{parseSelector as un}from"/-/vega-event-selector@v3.0.1-UgiEAWJA4WQL4DTKnV4R/dist=es2020,mode=imports,min/optimized/vega-event-selector.js";import{parseExpression as Uf}from"/-/vega-expression@v5.1.1-K4clrYr2THuj5KncykTn/dist=es2020,mode=imports,min/optimized/vega-expression.js";const Bf="vega-lite",Wf='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',Hf="5.18.0",qf=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],Gf="https://vega.github.io/vega-lite/",Vf="Vega-Lite is a concise high-level language for interactive visualization.",Xf=["vega","chart","visualization"],Yf="build/vega-lite.js",Kf="build/vega-lite.min.js",Qf="build/vega-lite.min.js",Jf="build/src/index",Zf="build/src/index.d.ts",ed={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},td=["bin","build","src","vega-lite*","tsconfig.json"],nd={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data","build-editor-preview":"scripts/build-editor-preview.sh",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},id={type:"git",url:"https://github.com/vega/vega-lite.git"},rd="BSD-3-Clause",sd={url:"https://github.com/vega/vega-lite/issues"},od={"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","@babel/preset-typescript":"^7.23.3","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-alias":"^5.1.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@types/d3":"^7.4.3","@types/jest":"^29.5.11","@types/pako":"^2.0.3","@typescript-eslint/eslint-plugin":"^6.20.0","@typescript-eslint/parser":"^6.20.0",ajv:"^8.12.0","ajv-formats":"^2.1.1",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^4.1.0",d3:"^7.8.5","del-cli":"^5.1.0",eslint:"^8.56.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^27.6.3","eslint-plugin-prettier":"^5.1.3","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.9.0",jest:"^29.7.0","jest-dev-server":"^9.0.2",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.2.4",puppeteer:"^15.0.0","release-it":"^17.0.3",rollup:"^4.9.6","rollup-plugin-bundle-size":"^1.0.3",serve:"^14.2.1",terser:"^5.27.0","ts-jest":"^29.1.2","ts-json-schema-generator":"^1.5.0",typescript:"~5.3.3","vega-cli":"^5.27.0","vega-datasets":"^2.8.0","vega-embed":"^6.24.0","vega-tooltip":"^0.34.0","yaml-front-matter":"^4.1.1"},ad={"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.2","vega-event-selector":"~3.0.1","vega-expression":"~5.1.0","vega-util":"~1.17.2",yargs:"~17.7.2"},cd={vega:"^5.24.0"},ud={node:">=18"},ld="yarn@1.22.19";var fd={name:Bf,author:Wf,version:Hf,collaborators:qf,homepage:Gf,description:Vf,keywords:Xf,main:Yf,unpkg:Kf,jsdelivr:Qf,module:Jf,types:Zf,bin:ed,files:td,scripts:nd,repository:id,license:rd,bugs:sd,devDependencies:od,dependencies:ad,peerDependencies:cd,engines:ud,packageManager:ld};function Pr(e){return!!e.or}function zr(e){return!!e.and}function Rr(e){return!!e.not}function wi(e,t){if(Rr(e))wi(e.not,t);else if(zr(e))for(const n of e.and)wi(n,t);else if(Pr(e))for(const n of e.or)wi(n,t);else t(e)}function ln(e,t){return Rr(e)?{not:ln(e.not,t)}:zr(e)?{and:e.and.map(n=>ln(n,t))}:Pr(e)?{or:e.or.map(n=>ln(n,t))}:t(e)}const C=structuredClone;function ta(e){throw new Error(e)}function fn(e,t){const n={};for(const i of t)an(e,i)&&(n[i]=e[i]);return n}function de(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>D(e)).join(",")})`};function O(e){if(B(e))return e;const t=N(e)?e:D(e);if(t.length<250)return t;let n=0;for(let i=0;ia===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function jr(e,t){return e===void 0||t===void 0?!0:Mr(Dr(e),Dr(t))}function M(e){return b(e).length===0}const b=Object.keys,ie=Object.values,bt=Object.entries;function Un(e){return e===!0||e===!1}function H(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Bn(e,t){return Rr(e)?`!(${Bn(e.not,t)})`:zr(e)?`(${e.and.map(n=>Bn(n,t)).join(") && (")})`:Pr(e)?`(${e.or.map(n=>Bn(n,t)).join(") || (")})`:t(e)}function $i(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&$i(e[n],t)&&delete e[n],M(e)}function Wn(e){return e.charAt(0).toUpperCase()+e.substr(1)}function Ur(e,t="datum"){const n=cn(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(A).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function ra(e,t="datum"){return`${t}[${A(cn(e).join("."))}]`}function gd(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function ve(e){return`${cn(e).map(gd).join("\\.")}`}function Mt(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function dn(e){return`${cn(e).join(".")}`}function pn(e){return e?cn(e).length:0}function X(...e){for(const t of e)if(t!==void 0)return t;return}let sa=42;function oa(e){const t=++sa;return e?String(e)+t:t}function md(){sa=42}function aa(e){return ca(e)?e:`__${e}`}function ca(e){return e.startsWith("__")}function Hn(e){return e===void 0?void 0:(e%360+360)%360}function vi(e){return B(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const ua=Object.getPrototypeOf(structuredClone({}));function be(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!be(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;for(i of e.entries())if(!be(i[1],t.get(i[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==ua.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==ua.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!be(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function D(e){const t=[];return function n(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let r,s;if(Array.isArray(i)){for(s="[",r=0;rAi(e[t])?H(`_${t}_${bt(e[t])}`):H(`_${t}_${e[t]}`)).join("")}function j(e){return e===!0||Bt(e)&&!e.binned}function re(e){return e==="binned"||Bt(e)&&e.binned===!0}function Bt(e){return L(e)}function Ai(e){return e?.param}function Ea(e){switch(e){case tt:case nt:case st:case pe:case Be:case We:case $t:case ot:case St:case wt:case ge:return 6;case vt:return 4;default:return 10}}function Xn(e){return!!e?.expr}function he(e){const t=b(e||{}),n={};for(const i of t)n[i]=xe(e[i]);return n}function _a(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:c,subtitleFont:u,subtitleFontSize:l,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:p,subtitlePadding:g,...m}=e,h={...m,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},w={...c?{subtitleColor:c}:{},...u?{subtitleFont:u}:{},...l?{subtitleFontSize:l}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...p?{subtitleLineHeight:p}:{},...g?{subtitlePadding:g}:{}},k=fn(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:h,subtitleMarkConfig:k,nonMarkTitleProperties:y,subtitle:w}}function kt(e){return N(e)||E(e)&&N(e[0])}function v(e){return!!e?.signal}function Ct(e){return!!e.step}function Dd(e){return E(e)?!1:"fields"in e&&!("data"in e)}function jd(e){return E(e)?!1:"fields"in e&&"data"in e}function ut(e){return E(e)?!1:"field"in e&&"data"in e}const Ud={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},Bd=b(Ud),Wd={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Qr=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function ka(e){const t=E(e.condition)?e.condition.map(Ca):Ca(e.condition);return{...xe(e),condition:t}}function xe(e){if(Xn(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Ca(e){if(Xn(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function W(e){if(Xn(e)){const{expr:t,...n}=e;return{signal:t,...n}}return v(e)?e:e!==void 0?{value:e}:void 0}function Hd(e){return v(e)?e.signal:A(e)}function Fa(e){return v(e)?e.signal:A(e.value)}function Pe(e){return v(e)?e.signal:e==null?null:A(e)}function qd(e,t,n){for(const i of n){const r=lt(i,t.markDef,t.config);r!==void 0&&(e[i]=W(r))}return e}function Na(e){return[].concat(e.type,e.style??[])}function z(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&t[r]!==void 0?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:lt(e,t,n,i)}function lt(e,t,n,{vgChannel:i}={}){return X(i?Oi(e,t,n.style):void 0,Oi(e,t,n.style),i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function Oi(e,t,n){return Ta(e,Na(t),n)}function Ta(e,t,n){t=G(t);let i;for(const r of t){const s=n[r];s&&s[e]!==void 0&&(i=s[e])}return i}function Aa(e,t){return G(e).reduce((n,i)=>(n.field.push($(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function Oa(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(be(r,i))return;n.push(i)}),n}function Pa(e,t){return be(e,t)||!t?e:e?[...G(e),...G(t)].join(", "):t}function za(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((kt(n)||v(n))&&(kt(i)||v(i)))return{explicit:e.explicit,value:Pa(n,i)};if(kt(n)||v(n))return{explicit:e.explicit,value:n};if(kt(i)||v(i))return{explicit:e.explicit,value:i};if(!kt(n)&&!v(n)&&!kt(i)&&!v(i))return{explicit:e.explicit,value:Oa(n,i)};throw new Error("It should never reach here")}function Jr(e){return`Invalid specification ${D(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Gd='Autosize "fit" only works for single views and layered views.';function Ra(e){const t=e=="width"?"Width":"Height";return`${t} "container" only works for single views and layered views.`}function Ia(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function La(e){return e?`Dropping "fit-${e}" because spec has discrete ${me(e)}.`:'Dropping "fit" because spec has discrete size.'}function Zr(e){return`Unknown field for ${e}. Cannot calculate view size.`}function Ma(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Vd(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Xd(e){return`The "nearest" transform is not supported for ${e} marks.`}function Da(e){return`Selection not supported for ${e} yet.`}function Yd(e){return`Cannot find a selection named "${e}".`}const Kd="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Qd="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",Jd="Legend bindings are only supported for selections over an individual field or encoding channel.";function Zd(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function ep(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const tp="The same selection must be used to override scale domains in a layered view.",np='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function ip(e){return`Unknown repeated value "${e}".`}function ja(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const rp="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function sp(e){return`Unrecognized parse "${e}".`}function Ua(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const op="Attempt to add the same child twice.";function ap(e){return`Ignoring an invalid transform: ${D(e)}.`}const cp='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function Ba(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function up(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${D(t)} is overridden by a child projection ${D(n)}.`}const lp="Arc marks uses theta channel rather than angle, replacing angle with theta.";function fp(e){return`${e}Offset dropped because ${e} is continuous`}function dp(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${D(n)}}.`}function Wa(e){return`Invalid field type "${e}".`}function pp(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function gp(e){return`Invalid aggregation operator "${e}".`}function Ha(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function mp(e){return`Position range does not support relative band size for ${e}.`}function es(e,t){return`Dropping ${D(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const hp="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function Pi(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function yp(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function bp(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function xp(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Sp(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function ts(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function wp(e){return`The ${e} for range marks cannot be an expression`}function $p(e,t){const n=e&&t?"x2 and y2":e?"x2":"y2";return`Line mark is for continuous lines and thus cannot be used with ${n}. We will use the rule mark (line segments) instead.`}function vp(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Ep(e){return`Cannot use the scale property "${e}" with non-color channel.`}function _p(e){return`Cannot use the relative band size with ${e} scale.`}function kp(e){return`Using unaggregated domain with raw field has no effect (${D(e)}).`}function Cp(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Fp(e){return`Unaggregated domain is currently unsupported for log scale (${D(e)}).`}function Np(e){return`Cannot apply size to non-oriented mark "${e}".`}function Tp(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Ap(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function qa(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function Ga(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Op(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${D(n)} and ${D(i)}). Using ${D(n)}.`}function Pp(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${D(n)} and ${D(i)}). Using the union of the two domains.`}function zp(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function Rp(e){return`Dropping sort property ${D(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const Va="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Ip="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",Lp="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",Mp="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function Dp(e){return`Cannot stack "${e}" if there is already "${e}2".`}function jp(e){return`Cannot stack non-linear scale (${e}).`}function Up(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function zi(e,t){return`Invalid ${e}: ${D(t)}.`}function Bp(e){return`Dropping day from datetime ${D(e)} as day cannot be combined with other units.`}function Wp(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Hp(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function qp(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function Xa(e){return`1D error band does not support ${e}.`}function Ya(e){return`Channel ${e} is required for "binned" bin.`}function Gp(e){return`Channel ${e} should not be used with "binned" bin.`}function Vp(e){return`Domain for ${e} is required for threshold scale.`}var hw=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},yw=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)};const Ka=If(Lf);let yn=Ka;function Xp(e){return yn=e,yn}function Yp(){return yn=Ka,yn}function x(...e){yn.warn(...e)}function Kp(...e){yn.debug(...e)}function Wt(e){if(e&&L(e)){for(const t of is)if(t in e)return!0}return!1}const Qa=["january","february","march","april","may","june","july","august","september","october","november","december"],Qp=Qa.map(e=>e.substr(0,3)),Ja=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Jp=Ja.map(e=>e.substr(0,3));function Zp(e){if(vi(e)&&(e=+e),B(e))return e>4&&x(zi("quarter",e)),e-1;throw new Error(zi("quarter",e))}function eg(e){if(vi(e)&&(e=+e),B(e))return e-1;{const t=e.toLowerCase(),n=Qa.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Qp.indexOf(i);if(r!==-1)return r;throw new Error(zi("month",e))}}function tg(e){if(vi(e)&&(e=+e),B(e))return e%7;{const t=e.toLowerCase(),n=Ja.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Jp.indexOf(i);if(r!==-1)return r;throw new Error(zi("day",e))}}function ns(e,t){const n=[];if(t&&e.day!==void 0&&(b(e).length>1&&(x(Bp(e)),e=C(e),delete e.day)),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?eg(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?Zp(e.quarter):e.quarter;n.push(B(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?tg(e.day):e.day;n.push(B(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r=="undefined"?0:r)}return n}function Ht(e){const t=ns(e,!0),n=t.join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function ng(e){const t=ns(e,!1),n=t.join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function ig(e){const t=ns(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const Za={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},is=b(Za);function rg(e){return!!Za[e]}function qt(e){return L(e)?e.binned:ec(e)}function ec(e){return e&&e.startsWith("binned")}function rs(e){return e.startsWith("utc")}function sg(e){return e.substring(3)}const og={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Ri(e){return is.filter(t=>nc(e,t))}function tc(e){const t=Ri(e);return t[t.length-1]}function nc(e,t){const n=e.indexOf(t);return n<0||(n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o")?!1:!(n>0&&t==="year"&&e.charAt(n-1)==="f")}function ag(e,t,{end:n}={end:!1}){const i=Ur(t),r=rs(e)?"utc":"";function s(c){return c==="quarter"?`(${r}quarter(${i})-1)`:`${r}${c}(${i})`}let o;const a={};for(const c of is)nc(e,c)&&(a[c]=s(c),o=c);return n&&(a[o]+="+1"),ng(a)}function ic(e){if(!e)return;const t=Ri(e);return`timeUnitSpecifier(${D(t)}, ${D(og)})`}function cg(e,t,n){if(!e)return;const i=ic(e),r=n||rs(e);return`${r?"utc":"time"}Format(${t}, ${i})`}function J(e){if(!e)return;let t;return N(e)?ec(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:L(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),rs(t.unit)&&(t.utc=!0,t.unit=sg(t.unit)),t}function ug(e){const{utc:t,...n}=J(e);return n.unit?(t?"utc":"")+b(n).map(i=>H(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+b(n).map(i=>H(`_${i}_${n[i]}`)).join("")}function rc(e,t=n=>n){const n=J(e),i=tc(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:o}=sc(i,n.step),a={...r,[o]:+r[o]+s};return`${t(Ht(a))} - ${t(Ht(r))}`}return}const lg={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function fg(e){return!!lg[e]}function sc(e,t=1){if(fg(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function dg(e){return e?.param}function ss(e){return!!e?.field&&e.equal!==void 0}function os(e){return!!e?.field&&e.lt!==void 0}function as(e){return!!e?.field&&e.lte!==void 0}function cs(e){return!!e?.field&&e.gt!==void 0}function us(e){return!!e?.field&&e.gte!==void 0}function ls(e){if(e?.field){if(E(e.range)&&e.range.length===2)return!0;if(v(e.range))return!0}return!1}function fs(e){return!!e?.field&&(E(e.oneOf)||E(e.in))}function pg(e){return!!e?.field&&e.valid!==void 0}function oc(e){return fs(e)||ss(e)||ls(e)||os(e)||cs(e)||as(e)||us(e)}function Ge(e,t){return Qi(e,{timeUnit:t,wrapTime:!0})}function gg(e,t){return e.map(n=>Ge(n,t))}function ac(e,t=!0){const{field:n}=e,i=J(e.timeUnit),{unit:r,binned:s}=i||{},o=$(e,{expr:"datum"}),a=r?`time(${s?o:ag(r,n)})`:o;if(ss(e))return`${a}===${Ge(e.equal,r)}`;if(os(e)){const c=e.lt;return`${a}<${Ge(c,r)}`}else if(cs(e)){const c=e.gt;return`${a}>${Ge(c,r)}`}else if(as(e)){const c=e.lte;return`${a}<=${Ge(c,r)}`}else if(us(e)){const c=e.gte;return`${a}>=${Ge(c,r)}`}else{if(fs(e))return`indexof([${gg(e.oneOf,r).join(",")}], ${a}) !== -1`;if(pg(e))return ds(a,e.valid);if(ls(e)){const{range:c}=e,u=v(c)?{signal:`${c.signal}[0]`}:c[0],l=v(c)?{signal:`${c.signal}[1]`}:c[1];if(u!==null&&l!==null&&t)return"inrange("+a+", ["+Ge(u,r)+", "+Ge(l,r)+"])";const f=[];return u!==null&&f.push(`${a} >= ${Ge(u,r)}`),l!==null&&f.push(`${a} <= ${Ge(l,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${D(e)}`)}function ds(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function mg(e){return oc(e)&&e.timeUnit?{...e,timeUnit:J(e.timeUnit)}:e}const Yn={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function hg(e){return e==="quantitative"||e==="temporal"}function cc(e){return e==="ordinal"||e==="nominal"}const Gt=Yn.quantitative,ps=Yn.ordinal,bn=Yn.temporal,gs=Yn.nominal,xn=Yn.geojson;function yg(e){if(e){e=e.toLowerCase();switch(e){case"q":case Gt:return"quantitative";case"t":case bn:return"temporal";case"o":case ps:return"ordinal";case"n":case gs:return"nominal";case xn:return"geojson"}}return}const ye={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},ms={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function bg(e,t){const n=ms[e],i=ms[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const xg={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function uc(e){return xg[e]}const lc=new Set(["linear","log","pow","sqrt","symlog"]),fc=new Set([...lc,"time","utc"]);function dc(e){return lc.has(e)}const pc=new Set(["quantile","quantize","threshold"]),Sg=new Set([...fc,...pc,"sequential","identity"]),wg=new Set(["ordinal","bin-ordinal","point","band"]);function Z(e){return wg.has(e)}function Se(e){return Sg.has(e)}function ze(e){return fc.has(e)}function Sn(e){return pc.has(e)}const $g={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function vg(e){return!N(e)&&!!e.name}function gc(e){return e?.param}function Eg(e){return e?.unionWith}function _g(e){return Or(e)&&"field"in e}const kg={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:bw,domain:xw,range:Sw,rangeMax:ww,rangeMin:$w,scheme:vw,...Cg}=kg,Fg=b(Cg);function hs(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return ze(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return ze(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return ze(e);case"nice":return ze(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Se(e)&&!P(["log","time","utc","threshold","quantile"],e)}}function mc(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return hn(e)?void 0:Ep(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function Ng(e,t){return P([ps,gs],t)?e===void 0||Z(e):t===bn?P([ye.TIME,ye.UTC,void 0],e):t===Gt?dc(e)||Sn(e)||e===void 0:!0}function Tg(e,t,n=!1){if(!at(e))return!1;switch(e){case q:case Q:case xt:case gn:case Ee:case Ne:return ze(t)||t==="band"?!0:t==="point"?!n:!1;case st:case $t:case ot:case St:case wt:case Dt:return ze(t)||Sn(t)||P(["band","point","ordinal"],t);case pe:case Be:case We:return t!=="band";case vt:case ge:return t==="ordinal"||Sn(t)}}const ce={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},hc=ce.arc,Ii=ce.area,Li=ce.bar,Ag=ce.image,Mi=ce.line,Di=ce.point,Og=ce.rect,ji=ce.rule,yc=ce.text,ys=ce.tick,Pg=ce.trail,bs=ce.circle,xs=ce.square,bc=ce.geoshape;function Ft(e){return["line","area","trail"].includes(e)}function Kn(e){return["rect","bar","image","arc"].includes(e)}const zg=new Set(b(ce));function Ve(e){return e.type}const Rg=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],Ig=["fill","fillOpacity"],Lg=[...Rg,...Ig],Mg={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},xc=b(Mg),Dg={area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]},jg={color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},Ug={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},Sc=b(Ug);function Vt(e){return e&&e.band!=null}const Bg={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},wc=5,Wg={binSpacing:1,continuousBandSize:wc,minBandSize:.25,timeUnitBandPosition:.5},Hg={binSpacing:0,continuousBandSize:wc,minBandSize:.25,timeUnitBandPosition:.5},qg={thickness:1};function Gg(e){return Ve(e)?e.type:e}function Ss(e){const{channel:t,channelDef:n,markDef:i,scale:r,config:s}=e,o=$s(e);return S(n)&&!$a(n.aggregate)&&r&&ze(r.get("type"))?Vg({fieldDef:n,channel:t,markDef:i,ref:o,config:s}):o}function Vg({fieldDef:e,channel:t,markDef:n,ref:i,config:r}){if(Ft(n.type))return i;const s=z("invalid",n,r);return s===null?[Xg(e,t),i]:i}function Xg(e,t){const n=ws(e,!0),i=Ut(t),r=i==="y"?{field:{group:"height"}}:{value:0};return{test:n,...r}}function ws(e,t=!0){return ds(N(e)?e:$(e,{expr:"datum"}),!t)}function Yg(e){const{datum:t}=e;return Wt(t)?Ht(t):`${D(t)}`}function Xt(e,t,n,i){const r={};if(t&&(r.scale=t),Ye(e)){const{datum:s}=e;Wt(s)?r.signal=Ht(s):v(s)?r.signal=s.signal:Xn(s)?r.signal=s.expr:r.value=s}else r.field=$(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function Ui({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:o=.5}){const a=!v(o)&&0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return um(e);default:return cm(e,t)}};let Dc=Mc;function jc(e){Dc=e}function lm(){jc(Mc)}function vn(e,t,{allowDisabling:n,includeDefault:i=!0}){const r=Cs(e)?.title;if(!S(e))return r??e.title;const s=e,o=i?Fs(s,t):void 0;return n?X(r,s.title,o):r??s.title??o}function Cs(e){return $n(e)&&e.axis?e.axis:Ic(e)&&e.legend?e.legend:_s(e)&&e.header?e.header:void 0}function Fs(e,t){return Dc(e,t)}function Xi(e){if(Lc(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=Cs(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function fm(e,t){switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(ks(e)&&E(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!_t(n)&&!ct(n))return"quantitative";if(Kt(e)&&e.scale?.type)switch(ms[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Ke(e){return S(e)?e:qi(e)?e.condition:void 0}function K(e){return F(e)?e:ei(e)?e.condition:void 0}function Uc(e,t,n,i={}){if(N(e)||B(e)||jn(e)){const r=N(e)?"string":B(e)?"number":"boolean";return x(dp(t,r,e)),{value:e}}return F(e)?Yi(e,t,n,i):ei(e)?{...e,condition:Yi(e.condition,t,n,i)}:e}function Yi(e,t,n,i){if(Lc(e)){const{format:r,formatType:s,...o}=e;if(Yt(s)&&!n.customFormatTypes)return x(Ba(t)),Yi(o,t,n,i)}else{const r=$n(e)?"axis":Ic(e)?"legend":_s(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(Yt(o)&&!n.customFormatTypes)return x(Ba(t)),Yi({...e,[r]:a},t,n,i)}}return S(e)?Ns(e,t,i):dm(e)}function dm(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=B(n)?"quantitative":N(n)?"nominal":Wt(n)?"temporal":void 0,{...e,type:t}}function Ns(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!Kr(i)&&!_t(i)&&!ct(i)&&(x(gp(i)),delete a.aggregate),r&&(a.timeUnit=J(r)),o&&(a.field=`${o}`),j(s)&&(a.bin=Ki(s,t)),re(s)&&!Y(t)&&x(Gp(t)),ue(a)){const{type:c}=a,u=yg(c);c!==u&&(a.type=u),c!=="quantitative"&&($a(i)&&(x(pp(c,i)),a.type="quantitative"))}else if(!ha(t)){const c=fm(a,t);a.type=c}if(ue(a)){const{compatible:c,warning:u}=pm(a,t)||{};c===!1&&x(u)}if(ks(a)&&N(a.sort)){const{sort:c}=a;if(Fc(c))return{...a,sort:{encoding:c}};const u=c.substr(1);if(c.charAt(0)==="-"&&Fc(u))return{...a,sort:{encoding:u,order:"descending"}}}if(_s(a)){const{header:c}=a;if(c){const{orient:u,...l}=c;if(u)return{...a,header:{...l,labelOrient:c.labelOrient||u,titleOrient:c.titleOrient||u}}}}return a}function Ki(e,t){return jn(e)?{maxbins:Ea(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:Ea(t)}:e}const En={compatible:!0};function pm(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case tt:case nt:case Ei:return Vi(e)?En:{compatible:!1,warning:bp(t)};case q:case Q:case xt:case gn:case pe:case Be:case We:case qn:case Gn:case _i:case jt:case ki:case Ci:case Dt:case Ee:case Ne:case Fi:return En;case Ae:case _e:case Te:case Oe:return n!==Gt?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:En;case ot:case St:case wt:case $t:case st:case rt:case it:case Fe:case Ue:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:En;case ge:case vt:return!Vi(e)&&!om(e)?{compatible:!1,warning:xp(t)}:En;case mn:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:En}}function _n(e){const{formatType:t}=Xi(e);return t==="time"||!t&&gm(e)}function gm(e){return e&&(e.type==="temporal"||S(e)&&!!e.timeUnit)}function Qi(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){const s=t&&J(t)?.unit;let o=s||n==="temporal",a;return Xn(e)?a=e.expr:v(e)?a=e.signal:Wt(e)?(o=!0,a=Ht(e)):(N(e)||B(e))&&(o&&(a=`datetime(${D(e)})`,rg(s)&&((B(e)&&e<1e4||N(e)&&isNaN(Date.parse(e)))&&(a=Ht({[s]:e}))))),a?i&&o?`time(${a})`:a:r?void 0:D(e)}function Bc(e,t){const{type:n}=e;return t.map(i=>{const r=S(e)&&!qt(e.timeUnit)?e.timeUnit:void 0,s=Qi(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function ti(e,t){return j(e.bin)?at(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const Wc={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function ni(e){return e?.condition}const Hc=["domain","grid","labels","ticks","title"],mm={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},qc={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},hm={...qc,style:1,labelExpr:1,encoding:1};function Gc(e){return!!hm[e]}const ym={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},Vc=b(ym);function ft(e){return"mark"in e}class Ji{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return ft(t)?Gg(t.mark)===this.name:!1}}function Qt(e,t){const n=e&&e[t];return n?E(n)?Lt(n,i=>!!i.field):S(n)||qi(n):!1}function Xc(e,t){const n=e&&e[t];return n?E(n)?Lt(n,i=>!!i.field):S(n)||Ye(n)||ei(n):!1}function Yc(e,t){if(Y(t)){const n=e[t];if((S(n)||Ye(n))&&(cc(n.type)||S(n)&&n.timeUnit)){const i=qr(t);return Xc(e,i)}}return!1}function Ts(e){return Lt(bd,t=>{if(Qt(e,t)){const n=e[t];if(E(n))return Lt(n,i=>!!i.aggregate);{const i=Ke(n);return i&&!!i.aggregate}}return!1})}function Kc(e,t){const n=[],i=[],r=[],s=[],o={};return As(e,(a,c)=>{if(S(a)){const{field:u,aggregate:l,bin:f,timeUnit:d,...p}=a;if(l||d||f){const g=Cs(a),m=g?.title;let h=$(a,{forAs:!0});const y={...m?[]:{title:vn(a,t,{allowDisabling:!0})},...p,field:h};if(l){let w;if(_t(l)?(w="argmax",h=$({op:"argmax",field:l.argmax},{forAs:!0}),y.field=`${h}.${u}`):ct(l)?(w="argmin",h=$({op:"argmin",field:l.argmin},{forAs:!0}),y.field=`${h}.${u}`):l!=="boxplot"&&l!=="errorbar"&&l!=="errorband"&&(w=l),w){const k={op:w,as:h};u&&(k.field=u),s.push(k)}}else if(n.push(h),ue(a)&&j(f)){if(i.push({bin:f,field:u,as:h}),n.push($(a,{binSuffix:"end"})),ti(a,c)&&n.push($(a,{binSuffix:"range"})),Y(c)){const w={field:`${h}_end`};o[`${c}2`]=w}y.bin="binned",ha(c)||(y.type=Gt)}else if(d&&!qt(d)){r.push({timeUnit:d,field:u,as:h});const w=ue(a)&&a.type!==bn&&"time";w&&(c===qn||c===jt?y.formatType=w:Fd(c)?y.legend={formatType:w,...y.legend}:Y(c)&&(y.axis={formatType:w,...y.axis}))}o[c]=y}else n.push(u),o[c]=e[c]}else o[c]=e[c]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function bm(e,t,n){const i=Td(t,n);if(i){if(i==="binned"){const r=e[t===Fe?q:Q];return!!(S(r)&&S(e[t])&&re(r.bin))}}else return!1;return!0}function xm(e,t,n,i){const r={};for(const s of b(e))ma(s)||x(yp(s));for(let s of Ed){if(!e[s])continue;const o=e[s];if(Vn(s)){const a=vd(s),c=r[a];if(S(c)&&(hg(c.type)&&(S(o)&&!c.timeUnit))){x(fp(a));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(x(lp),s=Ee),!bm(e,s,t)){x(Pi(s,t));continue}if(s===st&&t==="line"){const a=Ke(e[s]);if(a?.aggregate){x(hp);continue}}if(s===pe&&(n?"fill"in e:"stroke"in e)){x(Ha("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===Gn||s===mn&&!E(o)&&!Ie(o)||s===jt&&E(o)){if(o){if(s===mn){const a=e[s];if(zc(a)){r[s]=a;continue}}r[s]=G(o).reduce((a,c)=>(S(c)?a.push(Ns(c,s)):x(es(c,s)),a),[])}}else{if(s===jt&&o===null)r[s]=null;else if(!S(o)&&!Ye(o)&&!Ie(o)&&!Hi(o)&&!v(o)){x(es(o,s));continue}r[s]=Uc(o,s,i)}}return r}function Zi(e,t){const n={};for(const i of b(e)){const r=Uc(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Sm(e){const t=[];for(const n of b(e))if(Qt(e,n)){const i=e[n],r=G(i);for(const s of r)S(s)?t.push(s):qi(s)&&t.push(s.condition)}return t}function As(e,t,n){if(!e)return;for(const i of b(e)){const r=e[i];if(E(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function wm(e,t,n,i){return e?b(e).reduce((r,s)=>{const o=e[s];return E(o)?o.reduce((a,c)=>t.call(i,a,c,s),r):t.call(i,r,o,s)},n):n}function Qc(e,t){return b(t).reduce((n,i)=>{switch(i){case q:case Q:case ki:case Fi:case Ci:case Fe:case Ue:case xt:case gn:case Ee:case rt:case Ne:case it:case Te:case Ae:case Oe:case _e:case qn:case ge:case Dt:case jt:return n;case mn:if(e==="line"||e==="trail")return n;case Gn:case _i:{const r=t[i];if(E(r)||S(r))for(const s of G(r))s.aggregate||n.push($(s,{}));return n}case st:if(e==="trail")return n;case pe:case Be:case We:case ot:case St:case wt:case vt:case $t:{const r=Ke(t[i]);return r&&!r.aggregate&&n.push($(r,{})),n}}},[])}function $m(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(E(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return E(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function Os(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const c=i?` of ${Ps(t)}`:"";return{field:o+t.field,type:t.type,title:v(a)?{signal:`${a}"${escape(c)}"`}:a+c}}),s=Sm(n).map(rm);return{tooltip:[...r,...je(s,O)]}}function Ps(e){const{title:t,field:n}=e;return X(t,n)}function zs(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:c,positionPrefix:u,endPositionPrefix:l=void 0,extraEncoding:f={}})=>{const d=Ps(n);return Jc(e,a,r,{mark:c,encoding:{[t]:{field:`${u}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...N(l)?{[`${t}2`]:{field:`${l}_${n.field}`}}:{},...i,...f}})}}function Jc(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...Ve(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...jn(e[t])?{}:e[t]}}]:[]}function Zc(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],c=i[`${r}Error2`];return{continuousAxisChannelDef:er(s,n),continuousAxisChannelDef2:er(o,n),continuousAxisChannelDefError:er(a,n),continuousAxisChannelDefError2:er(c,n),continuousAxis:r}}function er(e,t){if(e?.aggregate){const{aggregate:n,...i}=e;return n!==t&&x(qp(n,t)),i}else return e}function eu(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(Ve(n)&&n.orient)return n.orient;if(Tt(r)){if(Tt(s)){const o=S(r)&&r.aggregate,a=S(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return _n(s)&&!_n(r)?"horizontal":"vertical"}return"horizontal"}else{if(Tt(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const tr="boxplot",vm=["box","median","outliers","rule","ticks"],Em=new Ji(tr,nu);function tu(e){return B(e)?"tukey":e}function nu(e,{config:t}){e={...e,encoding:Zi(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=Ve(n)?n:{type:n};r&&x(Da("boxplot"));const c=a.extent??t.boxplot.extent,u=z("size",a,t),l=a.invalid,f=tu(c),{bins:d,timeUnits:p,transform:g,continuousAxisChannelDef:m,continuousAxis:h,groupby:y,aggregate:w,encodingWithoutContinuousAxis:k,ticksOrient:_,boxOrient:T,customTooltipWithoutAggregatedField:I}=_m(e,c,t),ae=dn(m.field),{color:ne,size:ht,...fe}=k,yt=zf=>zs(a,h,m,zf,t.boxplot),on=yt(fe),gi=yt(k),mi=(L(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",hi=yt({...fe,...ht?{size:ht}:{},color:{condition:{test:`datum['lower_box_${m.field}'] >= datum['upper_box_${m.field}']`,...ne||{value:mi}}}}),Dn=Os([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],m,k),Do={type:"tick",color:"black",opacity:1,orient:_,invalid:l,aria:!1},yi=f==="min-max"?Dn:Os([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,k),jo=[...on({partName:"rule",mark:{type:"rule",invalid:l,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:yi}),...on({partName:"rule",mark:{type:"rule",invalid:l,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:yi}),...on({partName:"ticks",mark:Do,positionPrefix:"lower_whisker",extraEncoding:yi}),...on({partName:"ticks",mark:Do,positionPrefix:"upper_whisker",extraEncoding:yi})],Uo=[...f!=="tukey"?jo:[],...gi({partName:"box",mark:{type:"bar",...u?{size:u}:{},orient:T,invalid:l,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:Dn}),...hi({partName:"median",mark:{type:"tick",invalid:l,...L(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...u?{size:u}:{},orient:_,aria:!1},positionPrefix:"mid_box",extraEncoding:Dn})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(g),layer:Uo};const Bo=`datum["lower_box_${m.field}"]`,Wo=`datum["upper_box_${m.field}"]`,Ho=`(${Wo} - ${Bo})`,qo=`${Bo} - ${c} * ${Ho}`,Go=`${Wo} + ${c} * ${Ho}`,bi=`datum["${m.field}"]`,Af={joinaggregate:iu(m.field),groupby:y},Vo={transform:[{filter:`(${qo} <= ${bi}) && (${bi} <= ${Go})`},{aggregate:[{op:"min",field:m.field,as:`lower_whisker_${ae}`},{op:"max",field:m.field,as:`upper_whisker_${ae}`},{op:"min",field:`lower_box_${m.field}`,as:`lower_box_${ae}`},{op:"max",field:`upper_box_${m.field}`,as:`upper_box_${ae}`},...w],groupby:y}],layer:jo},{tooltip:IS,...Of}=fe,{scale:Xo,axis:Pf}=m,Yo=Ps(m),Ko=de(Pf,["title"]),Qo=Jc(a,"outliers",t.boxplot,{transform:[{filter:`(${bi} < ${qo}) || (${bi} > ${Go})`}],mark:"point",encoding:{[h]:{field:m.field,type:m.type,...Yo!==void 0?{title:Yo}:{},...Xo!==void 0?{scale:Xo}:{},...M(Ko)?{}:{axis:Ko}},...Of,...ne?{color:ne}:{},...I?{tooltip:I}:{}}})[0];let xi;const Jo=[...d,...p,Af];return Qo?xi={transform:Jo,layer:[Qo,Vo]}:(xi=Vo,xi.transform.unshift(...Jo)),{...o,layer:[xi,{transform:g,layer:Uo}]}}function iu(e){const t=dn(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function _m(e,t,n){const i=eu(e,tr),{continuousAxisChannelDef:r,continuousAxis:s}=Zc(e,i,tr),o=r.field,a=dn(o),c=tu(t),u=[...iu(o),{op:"median",field:o,as:`mid_box_${a}`},{op:"min",field:o,as:(c==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:o,as:(c==="min-max"?"upper_whisker_":"max_")+a}],l=c==="min-max"||c==="tukey"?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:`iqr_${a}`},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${t}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${t}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],{[s]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:p,filteredEncoding:g}=$m(d),{bins:m,timeUnits:h,aggregate:y,groupby:w,encoding:k}=Kc(g,n),_=i==="vertical"?"horizontal":"vertical",T=i,I=[...m,...h,{aggregate:[...y,...u],groupby:w},...l];return{bins:m,timeUnits:h,transform:I,groupby:w,aggregate:y,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:k,ticksOrient:_,boxOrient:T,customTooltipWithoutAggregatedField:p}}const Rs="errorbar",km=["ticks","rule"],Cm=new Ji(Rs,ru);function ru(e,{config:t}){e={...e,encoding:Zi(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:c,tooltipEncoding:u}=su(e,Rs,t);delete s.size;const l=zs(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,p={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},g=[...l({partName:"ticks",mark:p,positionPrefix:"lower",extraEncoding:u}),...l({partName:"ticks",mark:p,positionPrefix:"upper",extraEncoding:u}),...l({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...c,transform:n,...g.length>1?{layer:g}:{...g[0]}}}function Fm(e,t){const{encoding:n}=e;if(Nm(n))return{orient:eu(e,t),inputType:"raw"};const i=Tm(n),r=Am(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,c=n.y2;if(F(a)&&F(c))throw new Error(`${t} cannot have both x2 and y2`);if(F(a)){if(Tt(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(F(c)){if(Tt(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,c=n.xError2,u=n.yError,l=n.yError2;if(F(c)&&!F(a))throw new Error(`${t} cannot have xError2 without xError`);if(F(l)&&!F(u))throw new Error(`${t} cannot have yError2 without yError`);if(F(a)&&F(u))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(F(a)){if(Tt(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(F(u)){if(Tt(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function Nm(e){return(F(e.x)||F(e.y))&&!F(e.x2)&&!F(e.y2)&&!F(e.xError)&&!F(e.xError2)&&!F(e.yError)&&!F(e.yError2)}function Tm(e){return F(e.x2)||F(e.y2)}function Am(e){return F(e.xError)||F(e.xError2)||F(e.yError)||F(e.yError2)}function su(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,c=Ve(i)?i:{type:i};s&&x(Da(t));const{orient:u,inputType:l}=Fm(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:g,continuousAxis:m}=Zc(e,u,t),{errorBarSpecificAggregate:h,postAggregateCalculates:y,tooltipSummary:w,tooltipTitleWithFieldName:k}=Om(c,f,d,p,g,l,t,n),{[m]:_,[m==="x"?"x2":"y2"]:T,[m==="x"?"xError":"yError"]:I,[m==="x"?"xError2":"yError2"]:ae,...ne}=r,{bins:ht,timeUnits:fe,aggregate:yt,groupby:on,encoding:gi}=Kc(ne,n),mi=[...yt,...h],hi=l!=="raw"?[]:on,Dn=Os(w,f,gi,k);return{transform:[...a.transform??[],...ht,...fe,...mi.length===0?[]:[{aggregate:mi,groupby:hi}],...y],groupby:hi,continuousAxisChannelDef:f,continuousAxis:m,encodingWithoutContinuousAxis:gi,ticksOrient:u==="vertical"?"horizontal":"vertical",markDef:c,outerSpec:a,tooltipEncoding:Dn}}function Om(e,t,n,i,r,s,o,a){let c=[],u=[];const l=t.field;let f,d=!1;if(s==="raw"){const p=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,g=e.extent?e.extent:p==="mean"?"stderr":"iqr";if(p==="median"!==(g==="iqr")&&x(Hp(p,g,o)),g==="stderr"||g==="stdev")c=[{op:g,field:l,as:`extent_${l}`},{op:p,field:l,as:`center_${l}`}],u=[{calculate:`datum["center_${l}"] + datum["extent_${l}"]`,as:`upper_${l}`},{calculate:`datum["center_${l}"] - datum["extent_${l}"]`,as:`lower_${l}`}],f=[{fieldPrefix:"center_",titlePrefix:Wn(p)},{fieldPrefix:"upper_",titlePrefix:ou(p,g,"+")},{fieldPrefix:"lower_",titlePrefix:ou(p,g,"-")}],d=!0;else{let m,h,y;g==="ci"?(m="mean",h="ci0",y="ci1"):(m="median",h="q1",y="q3"),c=[{op:h,field:l,as:`lower_${l}`},{op:y,field:l,as:`upper_${l}`},{op:m,field:l,as:`center_${l}`}],f=[{fieldPrefix:"upper_",titlePrefix:vn({field:l,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:vn({field:l,aggregate:h,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:vn({field:l,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&x(Wp(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],u=[{calculate:`datum["${n.field}"]`,as:`upper_${l}`},{calculate:`datum["${l}"]`,as:`lower_${l}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:l}],u=[{calculate:`datum["${l}"] + datum["${i.field}"]`,as:`upper_${l}`}],r?u.push({calculate:`datum["${l}"] + datum["${r.field}"]`,as:`lower_${l}`}):u.push({calculate:`datum["${l}"] - datum["${i.field}"]`,as:`lower_${l}`}));for(const p of u)f.push({fieldPrefix:p.as.substring(0,6),titlePrefix:Mt(Mt(p.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:u,errorBarSpecificAggregate:c,tooltipSummary:f,tooltipTitleWithFieldName:d}}function ou(e,t,n){return`${Wn(e)} ${n} ${t}`}const Is="errorband",Pm=["band","borders"],zm=new Ji(Is,au);function au(e,{config:t}){e={...e,encoding:Zi(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:c}=su(e,Is,t),u=o,l=zs(u,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},p={type:f?"line":"rule"};const g={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(d={...d,...g,ariaRoleDescription:"errorband"},p={...p,...g,aria:!1}):u.interpolate?x(Xa("interpolate")):u.tension&&x(Xa("tension")),{...a,transform:n,layer:[...l({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c}),...l({partName:"borders",mark:p,positionPrefix:"lower",extraEncoding:c}),...l({partName:"borders",mark:p,positionPrefix:"upper",extraEncoding:c})]}}const cu={};function Ls(e,t,n){const i=new Ji(e,t);cu[e]={normalizer:i,parts:n}}function Rm(){return b(cu)}Ls(tr,nu,vm),Ls(Rs,ru,km),Ls(Is,au,Pm);const Im=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],uu={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},lu={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},Lm=b(uu),Mm=b(lu),Dm={header:1,headerRow:1,headerColumn:1,headerFacet:1},fu=b(Dm),du=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],jm={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Um={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Le="_vgsid_",Bm={point:{on:"click",fields:[Le],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function Ms(e){return e==="legend"||!!e?.legend}function Ds(e){return Ms(e)&&L(e)}function js(e){return!!e?.select}function pu(e){const t=[];for(const n of e||[]){if(js(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function Wm(e){return nr(e)||Bs(e)||Us(e)}function Us(e){return"concat"in e}function nr(e){return"vconcat"in e}function Bs(e){return"hconcat"in e}function gu({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function Qe(e){return L(e)&&e.step!==void 0}function mu(e){return e.view||e.width||e.height}const hu=20,Hm={align:1,bounds:1,center:1,columns:1,spacing:1},qm=b(Hm);function Gm(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&((Wi(e)&&!Zn(e.facet)||Us(e))&&(r.columns=o)),nr(e)&&(r.columns=1);for(const a of qm)if(e[a]!==void 0)if(a==="spacing"){const c=e[a];r[a]=B(c)?c:{row:c.row??s,column:c.column??s}}else r[a]=e[a];return r}function Ws(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function ir(e,t){const n=rr(e,t);return Qe(n)?n.step:yu}function rr(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return X(n,{step:e.step})}const yu=20,Vm={continuousWidth:200,continuousHeight:200,step:yu},Xm={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:Vm,mark:jg,arc:{},area:{},bar:Wg,circle:{},geoshape:{},image:{},line:{},point:{},rect:Hg,rule:{color:"black"},square:{},text:{color:"black"},tick:qg,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:$g,projection:{},legend:jm,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Bm,style:{},title:{},facet:{spacing:hu},concat:{spacing:hu},normalizedNumberFormat:".0%"},dt=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],bu={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},xu={blue:dt[0],orange:dt[1],red:dt[2],teal:dt[3],green:dt[4],yellow:dt[5],purple:dt[6],pink:dt[7],brown:dt[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Ym(e={}){return{signals:[{name:"color",value:L(e)?{...xu,...e}:xu}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function Km(e){return{signals:[{name:"fontSize",value:L(e)?{...bu,...e}:bu}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function Qm(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function Su(e){const t=b(e||{}),n={};for(const i of t){const r=e[i];n[i]=ni(r)?ka(r):xe(r)}return n}function Jm(e){const t=b(e),n={};for(const i of t)n[i]=Su(e[i]);return n}const Zm=[...Sc,...Vc,...fu,"background","padding","legend","lineBreak","scale","style","title","view"];function wu(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=Zo({},C(Xm),n?Qm(n):{},t?Ym(t):{},i?Km(i):{},s||{});r&&jf(o,"selection",r,!0);const a=de(o,Zm);for(const c of["background","lineBreak","padding"])o[c]&&(a[c]=xe(o[c]));for(const c of Sc)o[c]&&(a[c]=he(o[c]));for(const c of Vc)o[c]&&(a[c]=Su(o[c]));for(const c of fu)o[c]&&(a[c]=he(o[c]));return o.legend&&(a.legend=he(o.legend)),o.scale&&(a.scale=he(o.scale)),o.style&&(a.style=Jm(o.style)),o.title&&(a.title=he(o.title)),o.view&&(a.view=he(o.view)),a}const eh=new Set(["view",...zg]),th=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],nh={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...Dg};function ih(e){e=C(e);for(const t of th)delete e[t];if(e.axis)for(const t in e.axis)ni(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Im)delete e.legend[t];if(e.mark){for(const t of xc)delete e.mark[t];e.mark.tooltip&&L(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(pu(e.params)),delete e.params);for(const t of eh){for(const i of xc)delete e[t][i];const n=nh[t];if(n)for(const i of n)delete e[t][i];sh(e,t)}for(const t of Rm())delete e[t];rh(e);for(const t in e)L(e[t])&&M(e[t])&&delete e[t];return M(e)?void 0:e}function rh(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=_a(e.title);M(t)||(e.style["group-title"]={...e.style["group-title"],...t}),M(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),M(i)?delete e.title:e.title=i}function sh(e,t,n,i){const r=i?e[t][i]:e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};M(s)||(e.style[n??t]=s),i||delete e[t]}function sr(e){return"layer"in e}function oh(e){return"repeat"in e}function ah(e){return!E(e.repeat)&&e.repeat.layer}class Hs{map(t,n){return Wi(t)?this.mapFacet(t,n):oh(t)?this.mapRepeat(t,n):Bs(t)?this.mapHConcat(t,n):nr(t)?this.mapVConcat(t,n):Us(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(sr(t))return this.mapLayer(t,n);if(ft(t))return this.mapUnit(t,n);throw new Error(Jr(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const ch={zero:1,center:1,normalize:1};function uh(e){return e in ch}const lh=new Set([hc,Li,Ii,ji,Di,bs,xs,Mi,yc,ys]),fh=new Set([Li,Ii,hc]);function kn(e){return S(e)&&wn(e)==="quantitative"&&!e.bin}function $u(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),o=e[t],a=e[r];if(S(o)&&S(a))if(kn(o)&&kn(a)){if(o.stack)return t;if(a.stack)return r;const c=S(o)&&!!o.aggregate,u=S(a)&&!!a.aggregate;if(c!==u)return c?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(kn(o))return t;if(kn(a))return r}else{if(kn(o))return s&&n==="vertical"?void 0:t;if(kn(a))return s&&n==="horizontal"?void 0:r}return}function dh(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function vu(e,t){const n=Ve(e)?e:{type:e},i=n.type;if(!lh.has(i))return null;const r=$u(t,"x",n)||$u(t,"theta",n);if(!r)return null;const s=t[r],o=S(s)?$(s,{}):void 0,a=dh(r),c=[],u=new Set;if(t[a]){const m=t[a],h=S(m)?$(m,{}):void 0;h&&h!==o&&(c.push(a),u.add(h))}const l=a==="x"?"xOffset":"yOffset",f=t[l],d=S(f)?$(f,{}):void 0;d&&d!==o&&(c.push(l),u.add(d));const p=_d.reduce((m,h)=>{if(h!=="tooltip"&&Qt(t,h)){const y=t[h];for(const w of G(y)){const k=Ke(w);if(k.aggregate)continue;const _=$(k,{});(!_||!u.has(_))&&m.push({channel:h,fieldDef:k})}}return m},[]);let g;return s.stack!==void 0?jn(s.stack)?g=s.stack?"zero":null:g=s.stack:fh.has(i)&&(g="zero"),!g||!uh(g)||Ts(t)&&p.length===0?null:s?.scale?.type&&s?.scale?.type!==ye.LINEAR?(s?.stack&&x(jp(s.scale.type)),null):F(t[He(r)])?(s.stack!==void 0&&x(Dp(r)),null):(S(s)&&s.aggregate&&!Ld.has(s.aggregate)&&x(Up(s.aggregate)),{groupbyChannels:c,groupbyFields:u,fieldChannel:r,impute:s.impute===null?!1:Ft(i),stackBy:p,offset:g})}function Eu(e,t,n){const i=he(e),r=z("orient",i,n);if(i.orient=hh(i.type,t,r),r!==void 0&&r!==i.orient&&x(vp(i.orient,r)),i.type==="bar"&&i.orient){const c=z("cornerRadiusEnd",i,n);if(c!==void 0){const u=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:Bg[i.orient];for(const l of u)i[l]=c;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=z("opacity",i,n),o=z("fillOpacity",i,n);s===void 0&&o===void 0&&(i.opacity=gh(i.type,t));const a=z("cursor",i,n);return a===void 0&&(i.cursor=ph(i,t,n)),i}function ph(e,t,n){return t.href||e.href||z("href",e,n)?"pointer":e.cursor}function gh(e,t){return P([Di,ys,bs,xs],e)&&!Ts(t)?.7:void 0}function mh(e,t,{graticule:n}){if(n)return!1;const i=lt("filled",e,t),r=e.type;return X(i,r!==Di&&r!==Mi&&r!==ji)}function hh(e,t,n){switch(e){case Di:case bs:case xs:case yc:case Og:case Ag:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case Li:if(S(i)&&(re(i.bin)||S(r)&&r.aggregate&&!i.aggregate))return"vertical";if(S(r)&&(re(r.bin)||S(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(S(i)&&i.type===Gt&&!j(i.bin)||Gi(i))&&(S(r)&&re(r.bin))?"horizontal":"vertical";if(!o)return(S(r)&&r.type===Gt&&!j(r.bin)||Gi(r))&&(S(i)&&re(i.bin))?"vertical":"horizontal"}case ji:if(s&&!(S(i)&&re(i.bin))&&o&&!(S(r)&&re(r.bin)))return;case Ii:if(o)return S(r)&&re(r.bin)?"horizontal":"vertical";if(s)return S(i)&&re(i.bin)?"vertical":"horizontal";if(e===ji){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case Mi:case ys:{const a=Rc(i),c=Rc(r);if(n)return n;if(a&&!c)return e!=="tick"?"horizontal":"vertical";if(!a&&c)return e!=="tick"?"vertical":"horizontal";if(a&&c)return"vertical";{const u=ue(i)&&i.type===bn,l=ue(r)&&r.type===bn;if(u&&!l)return"vertical";if(!u&&l)return"horizontal"}return}}return"vertical"}function yh(e){const{point:t,line:n,...i}=e;return b(i).length>1?i:i.type}function bh(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:de(e[t],["point","line"])});return e}function qs(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?L(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?L(t.point)?t.point:{}:void 0}function _u(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class xh{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(ft(t)){const{mark:i,encoding:r}=t,s=Ve(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!qs(s,n[s.type],r);case"area":return!!qs(s,n[s.type],r)||!!_u(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:c,encoding:u,...l}=t,f=Zi(u,r),d=Ve(a)?a:{type:a},p=qs(d,r[d.type],f),g=d.type==="area"&&_u(d,r[d.type]),m=[{name:c,...s?{params:s}:{},mark:yh({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:de(f,["shape"])}],h=vu(Eu(d,f,r),f);let y=f;if(h){const{fieldChannel:w,offset:k}=h;y={...f,[w]:{...f[w],...k?{stack:k}:{}}}}return y=de(y,["y2","x2"]),g&&m.push({...o?{projection:o}:{},mark:{type:"line",...fn(d,["clip","interpolate","tension","tooltip"]),...g},encoding:y}),p&&m.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...fn(d,["clip","tooltip"]),...p},encoding:y}),i({...l,layer:m},{...n,config:bh(r)})}}function Sh(e,t){return t?Zn(e)?Nu(e,t):ku(e,t):e}function Gs(e,t){return t?Nu(e,t):e}function Vs(e,t,n){const i=t[e];if(nm(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};x(ip(i.repeat));return}return t}function ku(e,t){if(e=Vs("field",e,t),e===void 0)return;if(e===null)return null;if(ks(e)&&Xe(e.sort)){const n=Vs("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}function Cu(e,t){if(S(e))return ku(e,t);{const n=Vs("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function Fu(e,t){if(F(e)){const n=Cu(e,t);if(n)return n;if(Hi(e))return{condition:e.condition}}else{if(ei(e)){const n=Cu(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}return}function Nu(e,t){const n={};for(const i in e)if(an(e,i)){const r=e[i];if(E(r))n[i]=r.map(s=>Fu(s,t)).filter(s=>s);else{const s=Fu(r,t);s!==void 0&&(n[i]=s)}}return n}class wh{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(ft(t)){const{encoding:n,mark:i}=t;if(i==="line"||Ve(i)&&i.type==="line")for(const r of $d){const s=Ut(r),o=n[s];if(n[r]&&(S(o)&&!re(o.bin)||Ye(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return x($p(!!r.x2,!!r.y2)),i({...t,mark:L(s)?{...s,type:"rule"}:"rule"},n)}}class $h extends Hs{constructor(){super(...arguments);this.nonFacetUnitNormalizers=[Em,Cm,zm,new xh,new wh]}map(t,n){if(ft(t)){const i=Qt(t.encoding,tt),r=Qt(t.encoding,nt),s=Qt(t.encoding,Ei);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=Gs(t.encoding,n.repeater),o={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(c=>c).join("_")}:{},...s?{encoding:s}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(o,n);const a=this.mapLayerOrUnit.bind(this);for(const c of this.nonFacetUnitNormalizers)if(c.hasMatchingType(o,n.config))return c.run(o,n,a);return o}mapRepeat(t,n){return ah(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...s}=t,{row:o,column:a,layer:c}=i,{repeater:u={},repeaterPrefix:l=""}=n;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:c},spec:r}},n):{...s,layer:c.map(f=>{const d={...u,layer:f},p=`${(r.name?`${r.name}_`:"")+l}child__layer_${H(f)}`,g=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:p});return g.name=p,g})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...o}=t;!E(i)&&t.columns&&(t=de(t,["columns"]),x(ja("repeat")));const a=[],{repeater:c={},repeaterPrefix:u=""}=n,l=!E(i)&&i.row||[c?c.row:null],f=!E(i)&&i.column||[c?c.column:null],d=E(i)&&i||[c?c.repeat:null];for(const g of d)for(const m of l)for(const h of f){const y={repeat:g,row:m,column:h,layer:c.layer},w=(r.name?`${r.name}_`:"")+u+"child__"+(E(i)?`${H(g)}`:(i.row?`row_${H(m)}`:"")+(i.column?`column_${H(h)}`:"")),k=this.map(r,{...n,repeater:y,repeaterPrefix:w});k.name=w,a.push(de(k,["data"]))}const p=E(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...o,columns:p,concat:a}}mapFacet(t,n){const{facet:i}=t;return Zn(i)&&t.columns&&(t=de(t,["columns"]),x(ja("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:o,config:a}=n,c=Au({parentProjection:o,projection:r}),u=Tu({parentEncoding:s,encoding:Gs(i,n.repeater)});return this.mapUnit({...t,...c?{projection:c}:{},...u?{encoding:u}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:s,...o}=t.encoding,{mark:a,width:c,projection:u,height:l,view:f,params:d,encoding:p,...g}=t,{facetMapping:m,layout:h}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=Gs(o,n.repeater);return this.mapFacet({...g,...h,facet:m,spec:{...c?{width:c}:{},...l?{height:l}:{},...f?{view:f}:{},...u?{projection:u}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:s}=t;if(i||r){s&&x(Sp([...i?[tt]:[],...r?[nt]:[]]));const o={},a={};for(const c of[tt,nt]){const u=t[c];if(u){const{align:l,center:f,spacing:d,columns:p,...g}=u;o[c]=g;for(const m of["align","center","spacing"])u[m]!==void 0&&(a[m]??(a[m]={}),a[m][c]=u[m])}}return{facetMapping:o,layout:a}}else{const{align:o,center:a,spacing:c,columns:u,...l}=s;return{facetMapping:Sh(l,n.repeater),layout:{...o?{align:o}:{},...a?{center:a}:{},...c?{spacing:c}:{},...u?{columns:u}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:s,projection:o,...a}=t,c={...r,parentEncoding:Tu({parentEncoding:n,encoding:s,layer:!0}),parentProjection:Au({parentProjection:i,projection:o})};return super.mapLayer({...a,...t.name?{name:[c.repeaterPrefix,t.name].filter(u=>u).join("_")}:{}},c)}}function Tu({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...b(e),...b(t)]);for(const s of r){const o=t[s],a=e[s];if(F(o)){const c={...a,...o};i[s]=c}else ei(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||Ie(a)||v(a)||F(a)||E(a))&&(i[s]=a)}}else i=t;return!i||M(i)?void 0:i}function Au(e){const{parentProjection:t,projection:n}=e;return t&&n&&x(up({parentProjection:t,projection:n})),n??t}function Xs(e){return"filter"in e}function vh(e){return e?.stop!==void 0}function Ou(e){return"lookup"in e}function Eh(e){return"data"in e}function _h(e){return"param"in e}function kh(e){return"pivot"in e}function Ch(e){return"density"in e}function Fh(e){return"quantile"in e}function Nh(e){return"regression"in e}function Th(e){return"loess"in e}function Ah(e){return"sample"in e}function Oh(e){return"window"in e}function Ph(e){return"joinaggregate"in e}function zh(e){return"flatten"in e}function Rh(e){return"calculate"in e}function Pu(e){return"bin"in e}function Ih(e){return"impute"in e}function Lh(e){return"timeUnit"in e}function Mh(e){return"aggregate"in e}function Dh(e){return"stack"in e}function jh(e){return"fold"in e}function Uh(e){return"extent"in e&&!("density"in e)}function Bh(e){return e.map(t=>Xs(t)?{filter:ln(t.filter,mg)}:t)}class Wh extends Hs{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=zu(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=zu(t,n),t.encoding){const i={};for(const[r,s]of bt(t.encoding))i[r]=Ru(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:bt(i).map(([s,o])=>{const{init:a,bind:c,empty:u,...l}=o;l.type==="single"?(l.type="point",l.toggle=!1):l.type==="multi"&&(l.type="point"),n.emptySelections[s]=u!=="none";for(const f of ie(n.selectionPredicates[s]??{}))f.empty=u!=="none";return{name:s,value:a,select:l,bind:c}})}:t}}function zu(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(Xs(s))return{filter:Ys(s,t)};if(Pu(s)&&Bt(s.bin))return{...s,bin:Iu(s.bin)};if(Ou(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function Ru(e,t){const n=C(e);if(S(n)&&Bt(n.bin)&&(n.bin=Iu(n.bin)),Kt(n)&&n.scale?.domain?.selection){const{selection:i,...r}=n.scale.domain;n.scale.domain={...r,...i?{param:i}:{}}}if(Hi(n))if(ea(n.condition))n.condition=n.condition.map(i=>{const{selection:r,param:s,test:o,...a}=i;return s?i:{...a,test:Ys(i,t)}});else{const{selection:i,param:r,test:s,...o}=Ru(n.condition,t);n.condition=r?n.condition:{...o,test:Ys(n.condition,t)}}return n}function Iu(e){const t=e.extent;if(t?.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Ys(e,t){const n=i=>ln(i,r=>{var s;const o=t.emptySelections[r]??!0,a={param:r,empty:o};return(s=t.selectionPredicates)[r]??(s[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):ln(e.test||e.filter,i=>i.selection?n(i.selection):i)}class Ks extends Hs{map(t,n){const i=n.selections??[];if(t.params&&!ft(t)){const r=[];for(const s of t.params)js(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(Si(a)&&(a===t.name||r.includes(a))||ea(a)&&a.map(c=>r.indexOf(c)).every((c,u,l)=>c!==-1&&(u===0||c>l[u-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=Ks.prototype[e];Ks.prototype[e]=function(n,i){return t.call(this,n,Hh(n,i))}}function Hh(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function Lu(e,t){t===void 0&&(t=wu(e.config));const n=Xh(e,t),{width:i,height:r}=e,s=Yh(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const qh=new $h,Gh=new Wh,Vh=new Ks;function Xh(e,t={}){const n={config:t};return Vh.map(qh.map(Gh.map(e,n),n),n)}function Mu(e){return N(e)?{type:e}:e??{}}function Yh(e,t,n){let{width:i,height:r}=t;const s=ft(e)||sr(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(x(Ra("width")),i=void 0),r=="container"&&(x(Ra("height")),r=void 0));const a={type:"pad",...o,...n?Mu(n.autosize):{},...Mu(e.autosize)};return a.type==="fit"&&!s&&(x(Gd),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&x(Ia("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&x(Ia("height")),be(a,{type:"pad"})?void 0:a}function Kh(e){return e==="fit"||e==="fit-x"||e==="fit-y"}function Qh(e){return e?`fit-${Ni(e)}`:"fit"}const Jh=["background","padding"];function Du(e,t){const n={};for(const i of Jh)e&&e[i]!==void 0&&(n[i]=xe(e[i]));return t&&(n.params=e.params),n}class pt{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new pt(C(this.explicit),C(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return X(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of b(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function Je(e){return{explicit:!0,value:e}}function we(e){return{explicit:!1,value:e}}function ju(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:or(t,n,i,r)}}function or(e,t,n,i){return e.explicit&&t.explicit&&x(Op(n,i,e.value,t.value)),e}function At(e,t,n,i,r=or){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:be(e.value,t.value)?e:r(e,t,n,i)}class Zh extends pt{constructor(t={},n={},i=!1){super(t,n);this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function Cn(e){return"url"in e}function ii(e){return"values"in e}function Uu(e){return"name"in e&&!Cn(e)&&!ii(e)&&!Ot(e)}function Ot(e){return e&&(Bu(e)||Wu(e)||Qs(e))}function Bu(e){return"sequence"in e}function Wu(e){return"sphere"in e}function Qs(e){return"graticule"in e}var U;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"})(U||(U={}));function Hu(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=ve(r.field),r}function Jt(e,t=!0,n=Df){if(E(e)){const i=e.map(r=>Jt(r,t,n));return t?`[${i.join(", ")}]`:i}else if(Wt(e))return n(t?Ht(e):ig(e));return t?n(D(e)):e}function ey(e,t){for(const n of ie(e.component.selection??{})){const i=n.name;let r=`${i}${zt}, ${n.resolve==="global"?"true":`{unit: ${en(e)}}`}`;for(const s of pr){if(!s.defined(n))continue;s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r))}t.push({name:i+Oy,on:[{events:{signal:n.name+zt},update:`modify(${A(n.name+Zt)}, ${r})`}]})}return Js(t)}function ty(e,t){if(e.component.selection&&b(e.component.selection).length){const n=A(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:un("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Js(t)}function ny(e,t){let n=!1;for(const i of ie(e.component.selection??{})){const r=i.name,s=A(r+Zt),o=t.filter(a=>a.name===r);if(o.length===0){const a=i.resolve==="global"?"union":i.resolve,c=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${bl}(${s}, ${A(a)}${c}`})}n=!0;for(const a of pr)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}if(n){const i=t.filter(r=>r.name==="unit");i.length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]})}return Js(t)}function iy(e,t){const n=[...t],i=en(e,{escape:!1});for(const r of ie(e.component.selection??{})){const s={name:r.name+Zt};if(r.project.hasSelectionId&&(s.transform=[{type:"collect",sort:{field:Le}}]),r.init){const a=r.project.items.map(Hu);s.values=r.project.hasSelectionId?r.init.map(c=>({unit:i,[Le]:Jt(c,!1)[0]})):r.init.map(c=>({unit:i,fields:a,values:Jt(c,!1)}))}const o=n.filter(a=>a.name===r.name+Zt);o.length||n.push(s)}return n}function qu(e,t){for(const n of ie(e.component.selection??{}))for(const i of pr)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function ry(e,t){for(const n of e.children)V(n)&&(t=qu(n,t));return t}function sy(e,t,n,i){const r=vl(e,t.param,t);return{signal:Se(n.get("type"))&&E(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function Js(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class R{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){x(op);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class le extends R{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n);this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${oa()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function Zs(e){return e.as!==void 0}function Gu(e){return`${e}_end`}class Ze extends R{clone(){return new Ze(null,C(this.timeUnits))}constructor(t,n){super(t);this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{const{field:a,timeUnit:c}=s;if(c){let u;if(qt(c)){if(V(n)){const{mark:l,markDef:f,config:d}=n,p=Nt({fieldDef:s,markDef:f,config:d});(Kn(l)||!!p)&&(u={timeUnit:J(c),field:a})}}else u={as:$(s,{forAs:!0}),field:a,timeUnit:c};if(V(n)){const{mark:l,markDef:f,config:d}=n,p=Nt({fieldDef:s,markDef:f,config:d});Kn(l)&&Y(o)&&p!==.5&&(u.rectBandPosition=p)}u&&(r[O(u)]=u)}return r},{});return M(i)?null:new Ze(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=J(i),o={...r,timeUnit:s};return new Ze(t,{[O(o)]:o})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of bt(this.timeUnits)){const s=Zs(r)?r.as:`${r.field}_end`;t.has(s)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(ie(this.timeUnits).map(t=>Zs(t)?t.as:Gu(t.field)))}dependentFields(){return new Set(ie(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${O(this.timeUnits)}`}assemble(){const t=[];for(const n of ie(this.timeUnits)){const{rectBandPosition:i}=n,r=J(n.timeUnit);if(Zs(n)){const{field:s,as:o}=n,{unit:a,utc:c,...u}=r,l=[o,`${o}_end`];t.push({field:ve(s),type:"timeunit",...a?{units:Ri(a)}:{},...c?{timezone:"utc"}:{},...u,as:l}),t.push(...Xu(l,i,r))}else if(n){const{field:s}=n,o=s.replaceAll("\\.","."),a=Vu({timeUnit:r,field:o}),c=Gu(o);t.push({type:"formula",expr:a,as:c}),t.push(...Xu([o,c],i,r))}}return t}}const ar="offsetted_rect_start",cr="offsetted_rect_end";function Vu({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=tc(i),{part:o,step:a}=sc(s,e.step),c=r?"utcOffset":"timeOffset",u=`${c}('${o}', datum['${t}'], ${n?-a:a})`;return u}function Xu([e,t],n,i){if(n!==void 0&&n!==.5){const r=`datum['${e}']`,s=`datum['${t}']`;return[{type:"formula",expr:Yu([Vu({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${ar}`},{type:"formula",expr:Yu([r,s],n+.5),as:`${e}_${cr}`}]}return[]}function Yu([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const ri="_tuple_fields";class oy{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const ay={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new oy),s={},o={},a=new Set,c=(g,m)=>{const h=m==="visual"?g.channel:g.field;let y=H(`${i}_${h}`);for(let w=1;a.has(y);w++)y=H(`${i}_${h}_${w}`);return a.add(y),{[m]:y}},u=t.type,l=e.config.selection[u],f=n.value!==void 0?G(n.value):null;let{fields:d,encodings:p}=L(n.select)?n.select:{};if(!d&&!p&&f)for(const g of f){if(!L(g))continue;for(const m of b(g))wd(m)?(p||(p=[])).push(m):u==="interval"?(x(np),p=l.encodings):(d??(d=[])).push(m)}!d&&!p&&(p=l.encodings,"fields"in l&&(d=l.fields));for(const g of p??[]){const m=e.fieldDef(g);if(m){let h=m.field;if(m.aggregate){x(Vd(g,m.aggregate));continue}else if(!h){x(Ma(g));continue}if(m.timeUnit&&!qt(m.timeUnit)){h=e.vgField(g);const y={timeUnit:m.timeUnit,as:h,field:m.field};o[O(y)]=y}if(!s[h]){const y=u==="interval"&&at(g)&&Se(e.getScaleComponent(g).get("type"))?"R":m.bin?"R-RE":"E",w={field:h,channel:g,type:y,index:r.items.length};w.signals={...c(w,"data"),...c(w,"visual")},r.items.push(s[h]=w),r.hasField[h]=s[h],r.hasSelectionId=r.hasSelectionId||h===Le,pa(g)?(w.geoChannel=g,w.channel=da(g),r.hasChannel[w.channel]=s[h]):r.hasChannel[g]=s[h]}}else x(Ma(g))}for(const g of d??[]){if(r.hasField[g])continue;const m={type:"E",field:g,index:r.items.length};m.signals={...c(m,"data")},r.items.push(m),r.hasField[g]=m,r.hasSelectionId=r.hasSelectionId||g===Le}f&&(t.init=f.map(g=>r.items.map(m=>L(g)?g[m.geoChannel||m.channel]!==void 0?g[m.geoChannel||m.channel]:g[m.field]:g))),M(o)||(r.timeUnit=new Ze(null,o))},signals:(e,t,n)=>{const i=t.name+ri,r=n.filter(s=>s.name===i);return r.length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(Hu)})}},gt={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!at(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(o=="sequential"&&x(Qd),!s||!Se(o)){x(Kd);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||to(e)||i.length===0)return n;const r=n.filter(o=>o.name===t.name)[0];let s=r.update;if(s.indexOf(bl)>=0)r.update=`{${i.map(o=>`${A(ve(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${A(ve(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!to(e))for(const i of t.scales){const r=n.find(s=>s.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function eo(e,t){const n=A(e.scaleName(t));return`domain(${n})`}function to(e){return e.parent&&Ln(e.parent)&&(!e.parent.parent??to(e.parent.parent))}const Fn="_brush",Ku="_scale_trigger",si="geo_interval_init_tick",Qu="_init",cy="_center",uy={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...Or(n.select)?n.select:{}};r.fields=[Le],r.encodings||(r.encodings=n.value?b(n.value):[Ae,Te]),n.select={type:"interval",...r}}if(t.translate&&!gt.defined(t)){const r=`!event.item || event.item.mark.name !== ${A(t.name+Fn)}`;for(const s of t.events){if(!s.between){x(`${s} is not an ordered event stream for interval selections.`);continue}const o=G((i=s.between[0]).filter??(i.filter=[]));o.indexOf(r)<0&&o.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+zt,s=ie(t.project.hasChannel).filter(a=>a.channel===q||a.channel===Q),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,c)=>a.concat(ly(e,t,c,o&&o[c.index])),[])),e.hasProjection){const a=A(e.projectionName()),c=e.projectionName()+cy,{x:u,y:l}=t.project.hasChannel,f=u&&u.signals.visual,d=l&&l.signals.visual,p=u?o&&o[u.index]:`${c}[0]`,g=l?o&&o[l.index]:`${c}[1]`,m=T=>e.getSizeSignalRef(T).signal,h=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":m("width")}, ${d?d+"[1]":m("height")}]]`;if(o&&(n.unshift({name:i+Qu,init:`[scale(${a}, [${u?p[0]:p}, ${l?g[0]:g}]), scale(${a}, [${u?p[1]:p}, ${l?g[1]:g}])]`}),!u||!l)){const T=n.find(I=>I.name===c);T||n.unshift({name:c,update:`invert(${a}, [${m("width")}/2, ${m("height")}/2])`})}const y=`intersect(${h}, {markname: ${A(e.getName("marks"))}}, unit.mark)`,w=`{unit: ${en(e)}}`,k=`vlSelectionTuples(${y}, ${w})`,_=s.map(T=>T.signals.visual);return n.concat({name:r,on:[{events:[..._.length?[{signal:_.join(" || ")}]:[],...o?[{signal:si}]:[]],update:k}]})}else{if(!gt.defined(t)){const u=i+Ku,l=s.map(f=>{const d=f.channel,{data:p,visual:g}=f.signals,m=A(e.scaleName(d)),h=e.getScaleComponent(d).get("type"),y=Se(h)?"+":"";return`(!isArray(${p}) || (${y}invert(${m}, ${g})[0] === ${y}${p}[0] && ${y}invert(${m}, ${g})[1] === ${y}${p}[1]))`});l.length&&n.push({name:u,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:l.join(" && ")+` ? ${u} : {}`}]})}const a=s.map(u=>u.signals.data),c=`unit: ${en(e)}, fields: ${i+ri}, values`;return n.concat({name:r,...o?{init:`{${c}: ${Jt(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${c}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>{if(V(e)&&e.hasProjection&&t.init){const i=n.filter(r=>r.name===si);i.length||n.unshift({name:si,value:null,on:[{events:"timer{1}",update:`${si} === null ? {} : ${si}`}]})}return n},marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r?.signals.visual,a=s?.signals.visual,c=`data(${A(t.name+Zt)})`;if(gt.defined(t)||!r&&!s)return n;const u={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const h of b(u))u[h]=[{test:`${c}.length && ${c}[0].unit === ${en(e)}`,...u[h]},{value:0}];const{fill:l,fillOpacity:f,cursor:d,...p}=t.mark,g=b(p).reduce((h,y)=>(h[y]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(w=>w).join(" && "),value:p[y]},{value:null}],h),{}),m=d??(t.translate?"move":null);return[{name:`${i+Fn}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:l},fillOpacity:{value:f}},update:u}},...n,{name:i+Fn,type:"rect",clip:!0,encode:{enter:{...m?{cursor:{value:m}}:{},fill:{value:"transparent"}},update:{...u,...g}}}]}};function ly(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=A(r?e.scaleName(s):e.projectionName()),c=d=>`scale(${a}, ${d})`,u=e.getSizeSignalRef(s===q?"width":"height").signal,l=`${s}(unit)`,f=t.events.reduce((d,p)=>[...d,{events:p.between[0],update:`[${l}, ${l}]`},{events:p,update:`[${o}[0], clamp(${l}, 0, ${u})]`}],[]);if(r){const d=n.signals.data,p=gt.defined(t),g=e.getScaleComponent(s),m=g?g.get("type"):void 0,h=i?{init:Jt(i,!0,c)}:{value:[]};return f.push({events:{signal:t.name+Ku},update:Se(m)?`[${c(`${d}[0]`)}, ${c(`${d}[1]`)}]`:"[0, 0]"}),p?[{name:d,on:[]}]:[{name:o,...h,on:f},{name:d,...i?{init:Jt(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===q?0:1,p=t.name+Qu,g=i?{init:`[${p}[0][${d}], ${p}[1][${d}]]`}:{value:[]};return[{name:o,...g,on:f}]}}const fy={defined:e=>e.type==="point",signals:(e,t,n)=>{const i=t.name,r=i+ri,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=ie(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+Fn):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),c=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let u=`unit: ${en(e)}, `;if(t.project.hasSelectionId)u+=`${Le}: ${o}[${A(Le)}]`;else{const f=s.items.map(d=>{const p=e.fieldDef(d.channel);return p?.bin?`[${o}[${A(e.vgField(d.channel,{}))}], ${o}[${A(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${o}[${A(d.field)}]`}).join(", ");u+=`fields: ${r}, values: [${f}]`}const l=t.events;return n.concat([{name:i+zt,on:l?[{events:l,update:`${c} ? {${u}} : null`,force:!0}]:[]}])}};function Nn(e,t,n,i){const r=Hi(t)&&t.condition,s=i(t);if(r){const o=G(r),a=o.map(c=>{const u=i(c);if(tm(c)){const{param:l,empty:f}=c,d=$l(e,{param:l,empty:f});return{test:d,...u}}else{const l=gr(e,c.test);return{test:l,...u}}});return{[n]:[...a,...s!==void 0?[s]:[]]}}else return s!==void 0?{[n]:s}:{}}function no(e,t="text"){const n=e.encoding[t];return Nn(e,n,t,i=>ur(i,e.config))}function ur(e,t,n="datum"){if(e){if(Ie(e))return W(e.value);if(F(e)){const{format:i,formatType:r}=Xi(e);return vs({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}return}function Ju(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(E(o))return{tooltip:el({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return Nn(e,o,"tooltip",c=>{const u=ur(c,r,a);if(u)return u;if(c===null)return;let l=z("tooltip",i,r);return l===!0&&(l={content:"encoding"}),N(l)?{value:l}:L(l)?v(l)?l:l.content==="encoding"?el(n,s,r,t):{signal:a}:void 0})}}function Zu(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s={},o=i?"datum.datum":"datum",a=[];function c(l,f){const d=Ut(f),p=ue(l)?l:{...l,type:e[d].type},g=p.title||Fs(p,r),m=G(g).join(", ").replaceAll(/"/g,'\\"');let h;if(Y(f)){const y=f==="x"?"x2":"y2",w=Ke(e[y]);if(re(p.bin)&&w){const k=$(p,{expr:o}),_=$(w,{expr:o}),{format:T,formatType:I}=Xi(p);h=Jn(k,_,T,I,r),s[y]=!0}}if((Y(f)||f===Ee||f===Ne)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:w}=Xi(p);h=vs({fieldOrDatumDef:p,format:y,formatType:w,expr:o,config:r,normalizeStack:!0}).signal}h??(h=ur(p,r,o).signal),a.push({channel:f,key:m,value:h})}As(e,(l,f)=>{S(l)?c(l,f):qi(l)&&c(l.condition,f)});const u={};for(const{channel:l,key:f,value:d}of a)!s[l]&&!u[f]&&(u[f]=d);return u}function el(e,t,n,{reactiveGeom:i}={}){const r=Zu(e,t,n,{reactiveGeom:i}),s=bt(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function dy(e){const{markDef:t,config:n}=e,i=z("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...py(e),...gy(e)}}function py(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=z("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:t in Wd?{}:{ariaRoleDescription:{value:t}}}function gy(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return Nn(e,s,"description",c=>ur(c,e.config));const o=z("description",n,i);if(o!=null)return{description:W(o)};if(i.aria===!1)return{};const a=Zu(t,r,i);return M(a)?void 0:{description:{signal:bt(a).map(([c,u],l)=>`"${l>0?"; ":""}${c}: " + (${u})`).join(" + ")}}}function ee(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:c}=n;a===void 0&&(c??(c=z(e,i,s,{vgChannel:o,ignoreVgConfig:!0})),c!==void 0&&(a=W(c)));const u=r[e];return Nn(t,u,o??e,l=>$s({channel:e,channelDef:l,markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:a}))}function tl(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??z("filled",n,r),a=P(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,c=z(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,u=z(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],l=o?"fill":"stroke",f={...c?{fill:W(c)}:{},...u?{stroke:W(u)}:{}};return n.color&&(o?n.fill:n.stroke)&&x(Ha("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...ee("color",e,{vgChannel:l,defaultValue:o?c:u}),...ee("fill",e,{defaultValue:i.fill?c:void 0}),...ee("stroke",e,{defaultValue:i.stroke?u:void 0})}}function my(e){const{encoding:t,mark:n}=e,i=t.order;return!Ft(n)&&Ie(i)?Nn(e,i,"zindex",r=>W(r.value)):{}}function Tn({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a){const u=$s({channel:s,channelDef:a,markDef:t,config:i?.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:W(o),bandPosition:r});return{offsetType:"encoding",offset:u}}const c=t[s];return c?{offsetType:"visual",offset:c}:{}}function se(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,c=r[e],u=r[He(e)],l=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:p}=Tn({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),g=io({model:t,defaultPos:n,channel:e,scaleName:l,scale:f}),m=!c&&Y(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:hy({channel:e,channelDef:c,channel2Def:u,markDef:s,config:o,scaleName:l,scale:f,stack:a,offset:d,defaultRef:g,bandPosition:p==="encoding"?0:void 0});return m?{[i||e]:m}:void 0}function hy(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(F(n)&&r&&t===r.fieldChannel){if(S(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return Ui({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return Xt(n,i,{suffix:"end"},{offset:s})}return Ss(e)}function io({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=Ut(n),c=Et(n),u=z(n,s,o,{vgChannel:c});if(u!==void 0)return Qn(n,u);switch(t){case"zeroOrMin":case"zeroOrMax":if(i){const l=r.get("type");if(!P([ye.LOG,ye.TIME,ye.UTC],l)){if(r.domainDefinitelyIncludesZero())return{scale:i,value:0}}}if(t==="zeroOrMin")return a==="y"?{field:{group:"height"}}:{value:0};switch(a){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":{const l=e[me(n)];return{...l,mult:.5}}}return}}const yy={left:"x",center:"xc",right:"x2"},by={top:"y",middle:"yc",bottom:"y2"};function nl(e,t,n,i="middle"){if(e==="radius"||e==="theta")return Et(e);const r=e==="x"?"align":"baseline",s=z(r,t,n);let o;return v(s)?(x(wp(r)),o=void 0):o=s,e==="x"?yy[o||(i==="top"?"left":"center")]:by[o||i]}function lr(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?il(e,t,{defaultPos:n,defaultPos2:i}):se(e,t,{defaultPos:n})}function il(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=He(e),a=me(e),c=xy(t,i,o),u=c[a]?nl(e,r,s):Et(e);return{...se(e,t,{defaultPos:n,vgChannel:u}),...c}}function xy(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,c=Ut(n),u=me(n),l=Et(n),f=i[c],d=e.scaleName(c),p=e.getScaleComponent(c),{offset:g}=n in i||n in s?Tn({channel:n,markDef:s,encoding:i,model:e}):Tn({channel:c,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const h=me(n),y=e.markDef[h];return y!=null?{[h]:{value:y}}:{[l]:{field:e.getName(n)}}}const m=Sy({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:p,stack:o,offset:g,defaultRef:void 0});return m!==void 0?{[l]:m}:fr(n,s)||fr(n,{[n]:Oi(n,s,a.style),[u]:Oi(u,s,a.style)})||fr(n,a[r])||fr(n,a.mark)||{[l]:io({model:e,defaultPos:t,channel:n,scaleName:d,scale:p})()}}function Sy({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:c,defaultRef:u}){return F(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Xt(t,s,{suffix:"start"},{offset:c}):Ss({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:c,defaultRef:u})}function fr(e,t){const n=me(e),i=Et(e);if(t[i]!==void 0)return{[i]:Qn(e,t[i])};if(t[e]!==void 0)return{[i]:Qn(e,t[e])};if(t[n]){const r=t[n];if(Vt(r))x(mp(n));else return{[n]:Qn(e,r)}}return}function Pt(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=He(t),a=me(t),c=i[t],u=i[o],l=e.getScaleComponent(t),f=l?l.get("type"):void 0,d=r.orient,p=i[a]??i.size??z("size",r,n,{vgChannel:a}),g=ya(t),m=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal");return S(c)&&(j(c.bin)||re(c.bin)||c.timeUnit&&!u)&&!(p&&!Vt(p))&&!i[g]&&!Z(f)?vy({fieldDef:c,fieldDef2:u,channel:t,model:e}):(F(c)&&Z(f)||m)&&!u?$y(c,t,e):il(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function wy(e,t,n,i,r,s,o){if(Vt(r))if(n){const c=n.get("type");if(c==="band"){let u=`bandwidth('${t}')`;r.band!==1&&(u=`${r.band} * ${u}`);const l=lt("minBandSize",{type:o},i);return{signal:l?`max(${Pe(l)}, ${u})`:u}}else r.band!==1&&(x(_p(c)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(v(r))return r;if(r)return{value:r}}if(n){const c=n.get("range");if(Ct(c)&&B(c.step))return{value:c.step-2}}if(!s){const{bandPaddingInner:c,barBandPaddingInner:u,rectBandPaddingInner:l}=i.scale,f=X(c,o==="bar"?u:l);if(v(f))return{signal:`(1 - (${f.signal})) * ${e}`};if(B(f))return{signal:`${1-f} * ${e}`}}const a=ir(i.view,e);return{value:a-2}}function $y(e,t,n){const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,c=n.scaleName(t),u=n.getScaleComponent(t),l=me(t),f=He(t),d=ya(t),p=n.scaleName(d),g=n.getScaleComponent(qr(t)),m=a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let h;(r.size||i.size)&&(m?h=ee("size",n,{vgChannel:l,defaultRef:W(i.size)}):x(Np(i.type)));const y=!!h,w=Oc({channel:t,fieldDef:e,markDef:i,config:s,scaleType:(u||g)?.get("type"),useVlSizeChannel:m});h=h||{[l]:wy(l,p||c,g||u,s,w,!!e,i.type)};const k=(u||g)?.get("type")==="band"&&Vt(w)&&!y?"top":"middle",_=nl(t,i,s,k),T=_==="xc"||_==="yc",{offset:I,offsetType:ae}=Tn({channel:t,markDef:i,encoding:r,model:n,bandPosition:T?.5:0}),ne=Ss({channel:t,channelDef:e,markDef:i,config:s,scaleName:c,scale:u,stack:o,offset:I,defaultRef:io({model:n,defaultPos:"mid",channel:t,scaleName:c,scale:u}),bandPosition:T?ae==="encoding"?0:.5:v(w)?{signal:`(1-${w})/2`}:Vt(w)?(1-w.band)/2:0});if(l)return{[_]:ne,...h};{const ht=Et(f),fe=h[l],yt=I?{...fe,offset:I}:fe;return{[_]:ne,[ht]:E(ne)?[ne[0],{...ne[1],offset:yt}]:{...ne,offset:yt}}}}function rl(e,t,n,i,r,s,o){if(fa(e))return 0;const a=e==="x"||e==="y2",c=a?-t/2:t/2;if(v(n)||v(r)||v(i)||s){const u=Pe(n),l=Pe(r),f=Pe(i),d=Pe(s),p=a?"":"-",g=s?`(${o} < ${d} ? ${p}0.5 * (${d} - (${o})) : ${c})`:c,m=f?`${f} + `:"",h=u?`(${u} ? -1 : 1) * `:"",y=l?`(${l} + ${g})`:g;return{signal:m+h+y}}else return r=r||0,i+(n?-r-c:+r+c)}function vy({fieldDef:e,fieldDef2:t,channel:n,model:i}){const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),c=i.scaleName(n),u=a?a.get("type"):void 0,l=a.get("reverse"),f=Oc({channel:n,fieldDef:e,markDef:s,config:r,scaleType:u}),d=i.component.axes[n]?.[0],p=d?.get("translate")??.5,g=Y(n)?z("binSpacing",s,r)??0:0,m=He(n),h=Et(n),y=Et(m),w=lt("minBandSize",s,r),{offset:k}=Tn({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:_}=Tn({channel:m,markDef:s,encoding:o,model:i,bandPosition:0}),T=Kg({fieldDef:e,scaleName:c}),I=rl(n,g,l,p,k,w,T),ae=rl(m,g,l,p,_??k,w,T),ne=v(f)?{signal:`(1-${f.signal})/2`}:Vt(f)?(1-f.band)/2:.5,ht=Nt({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(j(e.bin)||e.timeUnit){const fe=e.timeUnit&&ht!==.5;return{[y]:sl({fieldDef:e,scaleName:c,bandPosition:ne,offset:ae,useRectOffsetField:fe}),[h]:sl({fieldDef:e,scaleName:c,bandPosition:v(ne)?{signal:`1-${ne.signal}`}:1-ne,offset:I,useRectOffsetField:fe})}}else if(re(e.bin)){const fe=Xt(e,c,{},{offset:ae});if(S(t))return{[y]:fe,[h]:Xt(t,c,{},{offset:I})};if(Bt(e.bin)&&e.bin.step)return{[y]:fe,[h]:{signal:`scale("${c}", ${$(e,{expr:"datum"})} + ${e.bin.step})`,offset:I}}}x(Ya(m));return}function sl({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return Ui({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:ar,endSuffix:cr}:{}})}const Ey=new Set(["aria","width","height"]);function Ce(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?tl(e):{};return{..._y(e.markDef,t),...ol(e,"fill",n),...ol(e,"stroke",i),...ee("opacity",e),...ee("fillOpacity",e),...ee("strokeOpacity",e),...ee("strokeWidth",e),...ee("strokeDash",e),...my(e),...Ju(e),...no(e,"href"),...dy(e)}}function ol(e,t,n){const{config:i,mark:r,markDef:s}=e,o=z("invalid",s,i);if(o==="hide"&&n&&!Ft(r)){const a=ky(e,{invalid:!0,channels:Ti});if(a)return{[t]:[{test:a,value:null},...G(n)]}}return n?{[t]:n}:{}}function _y(e,t){return Bd.reduce((n,i)=>(!Ey.has(i)&&e[i]!==void 0&&t[i]!=="ignore"&&(n[i]=W(e[i])),n),{})}function ky(e,{invalid:t=!1,channels:n}){const i=n.reduce((s,o)=>{const a=e.getScaleComponent(o);if(a){const c=a.get("type"),u=e.vgField(o,{expr:"datum"});u&&Se(c)&&(s[u]=!0)}return s},{}),r=b(i);if(r.length>0){const s=t?"||":"&&";return r.map(o=>ws(o,t)).join(` ${s} `)}return}function ro(e){const{config:t,markDef:n}=e,i=z("invalid",n,t);if(i){const r=Cy(e,{channels:qe});if(r)return{defined:{signal:r}}}return{}}function Cy(e,{invalid:t=!1,channels:n}){const i=n.reduce((s,o)=>{const a=e.getScaleComponent(o);if(a){const c=a.get("type"),u=e.vgField(o,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});u&&Se(c)&&(s[u]=!0)}return s},{}),r=b(i);if(r.length>0){const s=t?"||":"&&";return r.map(o=>ws(o,t)).join(` ${s} `)}return}function al(e,t){return t!==void 0?{[e]:W(t)}:void 0}const so="voronoi",cl={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(so)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(Ft(s))return x(Xd(s)),n;const o={name:e.getName(so),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...Ju(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,c=!1;return n.forEach((u,l)=>{const f=u.name??"";f===e.component.mark[0].name?a=l:f.indexOf(so)>=0&&(c=!0)}),c||n.splice(a+1,0,o),n}},ul={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!Ms(e.bind),parse:(e,t,n)=>xl(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,o=t.init&&t.init[0],a=cl.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((c,u)=>{const l=H(`${i}_${c.field}`),f=n.filter(d=>d.name===l);f.length||n.unshift({name:l,...o?{init:Jt(o[u])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${A(c.field)}] : null`}]:[],bind:s[c.field]??s[c.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.filter(u=>u.name===i+zt)[0],o=i+ri,a=r.items.map(u=>H(`${i}_${u.field}`)),c=a.map(u=>`${u} !== null`).join(" && ");return a.length&&(s.update=`${c} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},dr="_toggle",ll={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+dr,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+zt,i=t.name+dr;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${en(e)}}, `)+`${i} ? ${n} : null`}},Fy={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=N(t.clear)?un(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(ul.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===H(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+zt);i(r,"null"),ll.defined(t)&&(r=n.findIndex(s=>s.name===t.name+dr),i(r,"false"))}return n}},fl={defined:e=>{const t=e.resolve==="global"&&e.bind&&Ms(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Le;return t&&!n&&x(Jd),t&&n},parse:(e,t,n)=>{const i=C(n);if(i.select=N(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},xl(t,i),Or(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=G(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=Ds(t.bind)?t.bind.legend:"click",s=N(r)?un(r,"view"):G(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=Ds(t.bind)&&t.bind.legend,s=o=>a=>{const c=C(a);return c.markname=o,c};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${H(o.field)}_legend`,c=`${i}_${a}`,u=n.filter(l=>l.name===c);if(u.length===0){const l=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:c,...t.init?{}:{value:null},on:[{events:l,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${c}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+zt),o=i+ri,a=r.items.filter(d=>d.hasLegend).map(d=>H(`${i}_${H(d.field)}_legend`)),c=a.map(d=>`${d} !== null`).join(" && "),u=`${c} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:u}):a.length>0&&(s.update=u,delete s.value,delete s.on);const l=n.find(d=>d.name===i+dr),f=Ds(t.bind)&&t.bind.legend;return l&&(t.events?l.on.push({...l.on[0],events:f}):l.on[0].events=f),n}};function Ny(e,t,n){const i=e.fieldDef(t)?.field;for(const r of ie(e.component.selection??{})){const s=r.project.hasField[i]??r.project.hasChannel[t];if(s&&fl.defined(r)){const o=n.get("selections")??[];o.push(r.name),n.set("selections",o,!1),s.hasLegend=!0}}}const dl="_translate_anchor",pl="_translate_delta",Ty={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=gt.defined(t),s=i+dl,{x:o,y:a}=t.project.hasChannel;let c=un(t.translate,"scope");return r||(c=c.map(u=>(u.between[0].markname=i+Fn,u))),n.push({name:s,value:{},on:[{events:c.map(u=>u.between[0]),update:"{x: x(unit), y: y(unit)"+(o!==void 0?`, extent_x: ${r?eo(e,q):`slice(${o.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?eo(e,Q):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+pl,value:{},on:[{events:c,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&gl(e,t,o,"width",n),a!==void 0&&gl(e,t,a,"height",n),n}};function gl(e,t,n,i,r){const s=t.name,o=s+dl,a=s+pl,c=n.channel,u=gt.defined(t),l=r.filter(T=>T.name===n.signals[u?"data":"visual"])[0],f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(c),p=d&&d.get("type"),g=d&&d.get("reverse"),m=u?c===q?g?"":"-":g?"-":"":"",h=`${o}.extent_${c}`,y=`${m}${a}.${c} / ${u?`${f}`:`span(${h})`}`,w=!u||!d?"panLinear":p==="log"?"panLog":p==="symlog"?"panSymlog":p==="pow"?"panPow":"panLinear",k=u?p==="pow"?`, ${d.get("exponent")??1}`:p==="symlog"?`, ${d.get("constant")??1}`:"":"",_=`${w}(${h}, ${y}${k})`;l.on.push({events:{signal:a},update:u?_:`clampRange(${_}, 0, ${f})`})}const ml="_zoom_anchor",hl="_zoom_delta",Ay={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=gt.defined(t),s=i+hl,{x:o,y:a}=t.project.hasChannel,c=A(e.scaleName(q)),u=A(e.scaleName(Q));let l=un(t.zoom,"scope");return r||(l=l.map(f=>(f.markname=i+Fn,f))),n.push({name:i+ml,on:[{events:l,update:r?"{"+[c?`x: invert(${c}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:l,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&yl(e,t,o,"width",n),a!==void 0&&yl(e,t,a,"height",n),n}};function yl(e,t,n,i,r){const s=t.name,o=n.channel,a=gt.defined(t),c=r.filter(w=>w.name===n.signals[a?"data":"visual"])[0],u=e.getSizeSignalRef(i).signal,l=e.getScaleComponent(o),f=l&&l.get("type"),d=a?eo(e,o):c.name,p=s+hl,g=`${s}${ml}.${o}`,m=!a||!l?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",h=a?f==="pow"?`, ${l.get("exponent")??1}`:f==="symlog"?`, ${l.get("constant")??1}`:"":"",y=`${m}(${d}, ${g}, ${p}${h})`;c.on.push({events:{signal:p},update:a?y:`clampRange(${y}, 0, ${u})`})}const Zt="_store",zt="_tuple",Oy="_modify",bl="vlSelectionResolve",pr=[fy,uy,ay,ll,ul,gt,fl,Fy,Ty,Ay,cl];function Py(e){let t=e.parent;for(;t&&!$e(t);)t=t.parent;return t}function en(e,{escape:t}={escape:!0}){let n=t?A(e.name):e.name;const i=Py(e);if(i){const{facet:r}=i;for(const s of ke)r[s]&&(n+=` + '__facet_${s}_' + (facet[${A(i.vgField(s))}])`)}return n}function oo(e){return ie(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function xl(e,t){(Si(t.select)||!t.select.on)&&delete e.events,(Si(t.select)||!t.select.clear)&&delete e.clear,(Si(t.select)||!t.select.toggle)&&delete e.toggle}function ao(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...ao(e.object)),t.push(...ao(e.property))),t)}function Sl(e){return e.object.type==="MemberExpression"?Sl(e.object):e.object.name==="datum"}function wl(e){const t=Uf(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&Sl(i)&&n.add(ao(i).slice(1).join("."))}),n}class An extends R{clone(){return new An(null,this.model,C(this.filter))}constructor(t,n,i){super(t);this.model=n,this.filter=i,this.expr=gr(this.model,this.filter,this),this._dependentFields=wl(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function zy(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const s=H(r.name),o=r.select,a=N(o)?o:o.type,c=L(o)?C(o):{type:a},u=i[a];for(const d in u){if(d==="fields"||d==="encodings")continue;d==="mark"&&(c[d]={...u[d],...c[d]}),(c[d]===void 0||c[d]===!0)&&(c[d]=C(u[d]??c[d]))}const l=n[s]={...c,name:s,type:a,init:r.value,bind:r.bind,events:N(c.on)?un(c.on,"scope"):G(C(c.on))},f=C(r);for(const d of pr)d.defined(l)&&d.parse&&d.parse(e,l,f)}return n}function $l(e,t,n,i="datum"){const r=N(t)?t:t.param,s=H(r),o=A(s+Zt);let a;try{a=e.getSelectionComponent(s,r)}catch(d){return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,p=a.project.timeUnit.clone();d.parent?p.insertAsParentOf(d):d.parent=p}const c=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",u=a.resolve==="global"?")":`, ${A(a.resolve)})`,l=`${c}${o}, ${i}${u}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${l}`:`!${f} || ${l}`}function vl(e,t,n){const i=H(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch(a){return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&x(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${A(s)}.`);else if(r&&!s){const a=o.project.items.filter(c=>c.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,x((a.length?"Multiple ":"No ")+`matching ${A(r)} encoding found for selection ${A(n.param)}. Using "field": ${A(s)}.`)):s=a[0].field}return`${o.name}[${A(ve(s))}]`}function Ry(e,t){for(const[n,i]of bt(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new le(new An(t,e,{param:n}),r,U.Lookup,e.component.data.outputNodeRefCounts)}}function gr(e,t,n){return Bn(t,i=>N(i)?i:dg(i)?$l(e,i,n):ac(i))}function Iy(e,t){return e?E(e)&&!kt(e)?e.map(n=>Fs(n,t)).join(", "):e:void 0}function co(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function oi(e,t,n,i={header:!1}){const{disable:r,orient:s,scale:o,labelExpr:a,title:c,zindex:u,...l}=e.combine();if(r)return;for(const f in l){const d=mm[f],p=l[f];if(d&&d!==t&&d!=="both")delete l[f];else if(ni(p)){const{condition:g,...m}=p,h=G(g),y=Wc[f];if(y){const{vgProp:w,part:k}=y,_=[...h.map(T=>{const{test:I,...ae}=T;return{test:gr(null,I),...ae}}),m];co(l,k,w,_),delete l[f]}else if(y===null){const w={signal:h.map(k=>{const{test:_,...T}=k;return`${gr(null,_)} ? ${Fa(T)} : `}).join("")+Fa(m)};l[f]=w}}else if(v(p)){const g=Wc[f];if(g){const{vgProp:m,part:h}=g;co(l,h,m,p),delete l[f]}}P(["labelAlign","labelBaseline"],f)&&l[f]===null&&delete l[f]}if(t==="grid"){if(!l.grid)return;if(l.encode){const{grid:f}=l.encode;l.encode={...f?{grid:f}:{}},M(l.encode)&&delete l.encode}return{scale:o,orient:s,...l,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:X(u,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let d=a;l.encode?.labels?.update&&v(l.encode.labels.update.text)&&(d=Mt(a,"datum.label",l.encode.labels.update.text.signal)),co(l,"labels","text",{signal:d})}if(l.labelAlign===null&&delete l.labelAlign,l.encode){for(const d of Hc)e.hasAxisPart(d)||delete l.encode[d];M(l.encode)&&delete l.encode}const f=Iy(c,n);return{scale:o,orient:s,grid:!1,...f?{title:f}:{},...l,...n.aria===!1?{aria:!1}:{},zindex:X(u,0)}}}function El(e){const{axes:t}=e.component,n=[];for(const i of qe)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function Ly(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>oi(r,"grid",t)),...i.map(r=>oi(r,"grid",t)),...n.map(r=>oi(r,"main",t)),...i.map(r=>oi(r,"main",t))].filter(r=>r)}function _l(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},c=new Set([...b(o),...b(a)]),u={};for(const l of c.values())u[l]={signal:`${i.signal} === "${s}" ? ${Pe(o[l])} : ${Pe(a[l])}`};return u}return t[r]})])}function My(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:dc(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=v(n)?"axisOrient":`axis${Wn(n)}`,a=[...r,...r.map(u=>s+u.substr(4))],c=["axis",o,s];return{vlOnlyAxisConfig:_l(a,i,e,n),vgAxisConfig:_l(c,i,e,n),axisConfigStyle:Dy([...c,...a],i)}}function Dy(e,t){const n=[{}];for(const i of e){let r=t[i]?.style;if(r){r=G(r);for(const s of r)n.push(t.style[s])}}return Object.assign.apply(null,n)}function uo(e,t,n,i={}){const r=Ta(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(i[s]?.[e]!==void 0)return{configFrom:s,configValue:i[s][e]};return{}}const kl={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??jy(n,e),gridScale:({model:e,channel:t})=>Uy(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||Fl(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||Cl(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Wy(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??Hy(t.type,n,S(t)&&!!t.timeUnit,S(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??Gy({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:Vy,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=Nl(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return Oa(r?[Ac(r)]:[],S(o)?[Ac(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>Xy(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??Yy(n,t)};function jy(e,t){return!Z(e)&&S(t)&&!j(t?.bin)&&!re(t?.bin)}function Uy(e,t){const n=t==="x"?"y":"x";return e.getScaleComponent(n)?e.scaleName(n):void 0}function By(e,t,n,i,r){const s=t?.labelAngle;if(s!==void 0)return v(s)?s:Hn(s);{const{configValue:o}=uo("labelAngle",i,t?.style,r);return o!==void 0?Hn(o):n===q&&P([gs,ps],e.type)&&!(S(e)&&e.timeUnit)?270:void 0}}function lo(e){return`(((${e.signal} % 360) + 360) % 360)`}function Cl(e,t,n,i){if(e!==void 0)if(n==="x"){if(v(e)){const r=lo(e),s=v(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45{if(!Kt(i))return;if(Tc(i.sort)){const{field:s,timeUnit:o}=i,a=i.sort,c=a.map((u,l)=>`${ac({field:s,timeUnit:o,equal:u})} ? ${l} : `).join("")+a.length;t=new On(t,{calculate:c,as:Pn(i,r,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${O(this.transform)}`}}function Pn(e,t,n){return $(e,{prefix:t,suffix:"sort_index",...n})}function mr(e,t){return P(["top","bottom"],t)?"column":P(["left","right"],t)||e==="row"?"row":"column"}function zn(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return X((t||{})[e],r[e],n.header[e])}function hr(e,t,n,i){const r={};for(const s of e){const o=zn(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const fo=["row","column"],po=["header","footer"];function Ky(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=hr(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),c=mr(t,a),u=Hn(o);return{name:`${t}-title`,type:"group",role:`${c}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...Al(u,c),...Tl(c,u,s),...Ol(i,r,t,Lm,uu)}}}function Tl(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=Fl(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function Al(e,t){const n=Cl(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Qy(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of po)if(n[r])for(const s of n[r]){const o=Zy(e,t,r,n,s);o!=null&&i.push(o)}return i}function Jy(e,t){const{sort:n}=e;return Xe(n)?{field:$(n,{expr:"datum"}),order:n.order??"ascending"}:E(n)?{field:Pn(e,t,{expr:"datum"}),order:"ascending"}:{field:$(e,{expr:"datum"}),order:n??"ascending"}}function go(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:c}=hr(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=vs({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,l=mr(t,a);return{text:{signal:c?Mt(Mt(c,"datum.label",u),"datum.value",$(e,{expr:"parent"})):u},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...Al(s,l),...Tl(l,s,o),...Ol(n,e,t,Mm,lu)}}function Zy(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=hr(["labelOrient"],o.header,a,t);(t==="row"&&!P(["top","bottom"],f)||t==="column"&&!P(["left","right"],f))&&(s=go(o,t,a))}const c=$e(e)&&!Zn(e.facet),u=r.axes,l=u?.length>0;if(s||l){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:Jy(o,t)}:{},...l&&c?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...l?{axes:u}:{}}}}return null}const eb={column:{start:0,end:1},row:{start:1,end:0}};function tb(e,t){return eb[t][e]}function nb(e,t){const n={};for(const i of ke){const r=e[i];if(r?.facetFieldDef){const{titleAnchor:s,titleOrient:o}=hr(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=mr(i,o),c=tb(s,a);c!==void 0&&(n[a]=c)}}return M(n)?void 0:n}function Ol(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=zn(o,t?.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function mo(e){return[...yr(e,"width"),...yr(e,"height"),...yr(e,"childWidth"),...yr(e,"childHeight")]}function yr(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(Z(o)&&Ct(a)){const c=e.scaleName(n);if($e(e.parent)){const u=e.parent.component.resolve;if(u.scale[n]==="independent")return[Pl(c,a)]}return[Pl(c,a),{name:r,update:zl(c,s,`domain('${c}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=Ws(e.config.view,s?"width":"height"),c=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:c,on:[{update:c,events:"window:resize"}]}]}else return[{name:r,value:i}]}function Pl(e,t){const n=`${e}_step`;return v(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function zl(e,t,n){const i=t.get("type"),r=t.get("padding"),s=X(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${Pe(o)}, ${Pe(s)}) * ${e}_step`}function Rl(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function Il(e,t){return b(e).reduce((n,i)=>{const r=e[i];return{...n,...Nn(t,r,i,s=>W(s.value))}},{})}function Ll(e,t){if($e(t))return e==="theta"?"independent":"shared";if(Ln(t))return"shared";if(To(t))return Y(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function ho(e,t){const n=e.scale[t],i=Y(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&x(zp(t)),"independent"):e[i][t]||"shared"}const ib={...Um,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},Ml=b(ib);class rb extends pt{}const Dl={symbols:sb,gradient:ob,labels:ab,entries:cb};function sb(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:c,mark:u}=n,l=o.filled&&u!=="trail";let f={...qd({},n,Lg),...tl(n,{filled:l})};const d=r.get("symbolOpacity")??c.legend.symbolOpacity,p=r.get("symbolFillColor")??c.legend.symbolFillColor,g=r.get("symbolStrokeColor")??c.legend.symbolStrokeColor,m=d===void 0?jl(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||l&&i===pe)delete f.fill;else if(f.fill.field)p?delete f.fill:(f.fill=W(c.legend.symbolBaseFillColor??"black"),f.fillOpacity=W(m??1));else if(E(f.fill)){const h=yo(a.fill??a.color)??o.fill??(l&&o.color);h&&(f.fill=W(h))}}if(f.stroke){if(i==="stroke"||!l&&i===pe)delete f.stroke;else if(f.stroke.field||g)delete f.stroke;else if(E(f.stroke)){const h=X(yo(a.stroke||a.color),o.stroke,l?o.color:void 0);h&&(f.stroke={value:h})}}if(i!==ot){const h=S(t)&&Bl(n,r,t);h?f.opacity=[{test:h,...W(m??1)},W(c.legend.unselectedOpacity)]:m&&(f.opacity=W(m))}return f={...f,...e},M(f)?void 0:f}function ob(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const c=i.get("gradientOpacity")??r.legend.gradientOpacity,u=c===void 0?jl(o.opacity)||s.opacity:void 0;return u&&(a.opacity=W(u)),a={...a,...e},M(a)?void 0:a}function ab(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=S(t)?Bl(n,r,t):void 0,c=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:u,formatType:l}=s;let f;Yt(l)?f=Re({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:l,config:o}):u===void 0&&l===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=Re({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&S(t)&&t.timeUnit===void 0&&(f=Re({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...c?{opacity:c}:{},...f?{text:f}:{},...e};return M(d)?void 0:d}function cb(e,{legendCmpt:t}){const n=t.get("selections");return n?.length?{...e,fill:{value:"transparent"}}:e}function jl(e){return Ul(e,(t,n)=>Math.max(t,n.value))}function yo(e){return Ul(e,(t,n)=>X(t,n.value))}function Ul(e,t){return im(e)?G(e.condition).reduce(t,e.value):Ie(e)?e.value:void 0}function Bl(e,t,n){const i=t.get("selections");if(!i?.length)return;const r=A(n.field);return i.map(s=>{const o=A(H(s)+Zt);return`(!length(data(${o})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`}).join(" || ")}const Wl={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return Ec(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return _c(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??mb(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??hb(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??lb(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>vn(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(hn(n)&&ze(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>ub(t,e)};function ub(e,t){const n=e.values;return E(n)?Bc(t,n):v(n)?n:void 0}function lb(e,t,n,i){if(t!=="shape"){const r=yo(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function fb(e){const{legend:t}=e;return X(t.type,db(e))}function db({channel:e,timeUnit:t,scaleType:n}){if(hn(e)){if(P(["quarter","month","day"],t))return"symbol";if(ze(n))return"gradient"}return"symbol"}function pb({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??gb(n,t)}function gb(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function mb({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:c}=e;return ze(r)?n==="horizontal"?i==="top"||i==="bottom"?Hl(t,"width",o,s):o:Hl(t,"height",c,a):void 0}function Hl(e,t,n,i){const r=e.getSizeSignalRef(t).signal;return{signal:`clamp(${r}, ${n}, ${i})`}}function hb(e){return P(["quantile","threshold","log","symlog"],e)?"greedy":void 0}function ql(e){const t=V(e)?yb(e):wb(e);return e.component.legends=t,t}function yb(e){const{encoding:t}=e,n={};for(const i of[pe,...du]){const r=K(t[i]);if(!r||!e.getScaleComponent(i))continue;if(i===ge&&S(r)&&r.type===xn)continue;n[i]=Sb(e,i)}return n}function bb(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function xb(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!n?.values;case"title":if(t==="title"&&e===i?.title)return!0}return e===(n||{})[t]}function Sb(e,t){let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new rb({},bb(e,t));Ny(e,t,a);const c=n!==void 0?!n:o.disable;if(a.set("disable",c,n!==void 0),c)return a;n=n||{};const u=e.getScaleComponent(t).get("type"),l=K(r[t]),f=S(l)?J(l.timeUnit)?.unit:void 0,d=n.orient||s.legend.orient||"right",p=fb({legend:n,channel:t,timeUnit:f,scaleType:u}),g=pb({legend:n,legendType:p,orient:d,legendConfig:o}),m={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:l,legendConfig:o,config:s,scaleType:u,orient:d,legendType:p,direction:g};for(const _ of Ml){if(p==="gradient"&&_.startsWith("symbol")||p==="symbol"&&_.startsWith("gradient"))continue;const T=_ in Wl?Wl[_](m):n[_];if(T!==void 0){const I=xb(T,_,n,e.fieldDef(t));(I||s.legend[_]===void 0)&&a.set(_,T,I)}}const h=n?.encoding??{},y=a.get("selections"),w={},k={fieldOrDatumDef:l,model:e,channel:t,legendCmpt:a,legendType:p};for(const _ of["labels","legend","title","symbols","gradient","entries"]){const T=Il(h[_]??{},e),I=_ in Dl?Dl[_](T,k):T;I!==void 0&&!M(I)&&(w[_]={...y?.length&&S(l)?{name:`${H(l.field)}_legend_${_}`}:{},...y?.length?{interactive:!!y}:{},update:I})}return M(w)||a.set("encode",w,!!n?.encoding),a}function wb(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){ql(i);for(const r of b(i.component.legends))n.legend[r]=ho(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=Gl(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of b(t))for(const r of e.children){if(!r.component.legends[i])continue;n.legend[i]==="shared"&&delete r.component.legends[i]}return t}function Gl(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const s of Ml){const o=At(e.getWithExplicit(s),t.getWithExplicit(s),s,"legend",(a,c)=>{switch(s){case"symbolType":return $b(a,c);case"title":return za(a,c);case"type":return r=!0,we("symbol")}return or(a,c,s,"legend")});e.setWithExplicit(s,o)}return r&&(e.implicit?.encode?.gradient&&$i(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&$i(e.explicit,["encode","gradient"])),e}function $b(e,t){return t.value==="circle"?t:e}function vb(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function Vl(e){const t=e.component.legends,n={};for(const r of b(t)){const s=e.getScaleComponent(r),o=D(s.get("domains"));if(n[o])for(const a of n[o]){const c=Gl(a,t[r]);c||n[o].push(t[r])}else n[o]=[t[r].clone()]}const i=ie(n).flat().map(r=>Eb(r,e.config)).filter(r=>r!==void 0);return i}function Eb(e,t){const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(n)return;if(t.aria===!1&&s.aria==null&&(s.aria=!1),s.encode?.symbols){const o=s.encode.symbols.update;o.fill&&o.fill.value!=="transparent"&&!o.stroke&&!s.stroke&&(o.stroke={value:"transparent"});for(const a of du)s[a]&&delete o[a]}if(s.title||delete s.title,i!==void 0){let o=i;s.encode?.labels?.update&&v(s.encode.labels.update.text)&&(o=Mt(i,"datum.label",s.encode.labels.update.text.signal)),vb(s,"labels","text",{signal:o})}return s}function _b(e){return Ln(e)||To(e)?kb(e):Xl(e)}function kb(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),Xl(e))}function Xl(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const c=v(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return P(o,c)||o.push(c),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const Cb=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class Yl extends pt{constructor(t,n,i,r){super({...n},{name:t});this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function Kl(e){e.component.projection=V(e)?Fb(e):Ab(e)}function Fb(e){if(e.hasProjection){const t=he(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?Nb(e):void 0,s=new Yl(e.projectionName(!0),{...he(e.config.projection),...t},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}return}function Nb(e){const t=[],{encoding:n}=e;for(const i of[[Ae,Te],[_e,Oe]])(K(n[i[0]])||K(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(ge)&&e.typedFieldDef(ge).type===xn&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(U.Main)),t}function Tb(e,t){const n=Lr(Cb,r=>!an(e.explicit,r)&&!an(t.explicit,r)?!0:!!(an(e.explicit,r)&&an(t.explicit,r)&&be(e.get(r),t.get(r)))),i=be(e.size,t.size);if(i){if(n)return e;if(be(e.explicit,{}))return t;if(be(t.explicit,{}))return e}return null}function Ab(e){if(e.children.length===0)return;let t;for(const i of e.children)Kl(i);const n=Lr(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=Tb(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new Yl(i,t.specifiedProjection,t.size,C(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}return}function Ob(e,t,n,i){if(ti(t,n)){const r=V(e)?e.axis(n)??e.legend(n)??{}:{},s=$(t,{expr:"datum"}),o=$(t,{expr:"datum",binSuffix:"end"});return{formulaAs:$(t,{binSuffix:"range",forAs:!0}),formula:Jn(s,o,r.format,r.formatType,i)}}return{}}function Ql(e,t){return`${va(e)}_${t}`}function Pb(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function bo(e,t,n){const i=Ki(n,void 0)??{},r=Ql(i,t);return e.getName(`${r}_bins`)}function zb(e){return"as"in e}function Jl(e,t,n){let i,r;zb(e)?i=N(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[$(e,{forAs:!0}),$(e,{binSuffix:"end",forAs:!0})];const s={...Ki(t,void 0)},o=Ql(s,e.field),{signal:a,extentSignal:c}=Pb(n,o);if(Ai(s.extent)){const l=s.extent;r=vl(n,l.param,l),delete s.extent}const u={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...c?{extentSignal:c}:{},...r?{span:r}:{}};return{key:o,binComponent:u}}class et extends R{clone(){return new et(null,C(this.bins))}constructor(t,n){super(t);this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{if(ue(s)&&j(s.bin)){const{key:a,binComponent:c}=Jl(s,s.bin,n);r[a]={...c,...r[a],...Ob(n,s,o,n.config)}}return r},{});return M(i)?null:new et(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=Jl(n,n.bin,i);return new et(t,{[r]:s})}merge(t,n){for(const i of b(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=je([...this.bins[i].as,...t.bins[i].as],O)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(ie(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(ie(this.bins).map(t=>t.field))}hash(){return`Bin ${O(this.bins)}`}assemble(){return ie(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...o}=t.bin,a={type:"bin",field:ve(t.field),as:i,signal:t.signal,...Ai(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!s&&t.extentSignal&&(n.push({type:"extent",field:ve(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const c of r)for(let u=0;u<2;u++)n.push({type:"formula",expr:$({field:i[u]},{expr:"datum"}),as:c[u]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function Rb(e,t,n,i){const r=V(i)?i.encoding[He(t)]:void 0;if(ue(n)&&V(i)&&Pc(n,r,i.markDef,i.config)){e.add($(n,{})),e.add($(n,{suffix:"end"}));const{mark:s,markDef:o,config:a}=i,c=Nt({fieldDef:n,markDef:o,config:a});Kn(s)&&c!==.5&&Y(t)&&(e.add($(n,{suffix:ar})),e.add($(n,{suffix:cr}))),n.bin&&ti(n,t)&&e.add($(n,{binSuffix:"range"}))}else if(pa(t)){const s=da(t);e.add(i.getName(s))}else e.add($(n));return Kt(n)&&_g(n.scale?.range)&&e.add(n.scale.range.field),e}function Ib(e,t){for(const n of b(t)){const i=t[n];for(const r of b(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class Me extends R{clone(){return new Me(null,new Set(this.dimensions),C(this.measures))}constructor(t,n,i){super(t);this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(o=>{o.aggregate&&(i=!0)});const r={},s=new Set;return i?(n.forEachFieldDef((o,a)=>{const{aggregate:c,field:u}=o;if(c)if(c==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([$(o,{forAs:!0})]);else{if(ct(c)||_t(c)){const l=ct(c)?"argmin":"argmax",f=c[l];r[f]??(r[f]={}),r[f][l]=new Set([$({op:l,field:f},{forAs:!0})])}else r[u]??(r[u]={}),r[u][c]=new Set([$(o,{forAs:!0})]);at(a)&&n.scaleDomain(a)==="unaggregated"&&(r[u]??(r[u]={}),r[u].min=new Set([$({field:u,aggregate:"min"},{forAs:!0})]),r[u].max=new Set([$({field:u,aggregate:"max"},{forAs:!0})]))}else Rb(s,a,o,n)}),s.size+b(r).length===0?null:new Me(t,s,r)):null}static makeFromTransform(t,n){const i=new Set,r={};for(const s of n.aggregate){const{op:o,field:a,as:c}=s;o&&(o==="count"?(r["*"]??(r["*"]={}),r["*"].count=new Set([c||$(s,{forAs:!0})])):(r[a]??(r[a]={}),r[a][o]=new Set([c||$(s,{forAs:!0})])))}for(const s of n.groupby??[])i.add(s);return i.size+b(r).length===0?null:new Me(t,i,r)}merge(t){return ia(this.dimensions,t.dimensions)?(Ib(this.measures,t.measures),!0):(Kp("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...b(this.measures)])}producedFields(){const t=new Set;for(const n of b(this.measures))for(const i of b(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${O({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of b(this.measures))for(const o of b(this.measures[s]))for(const a of this.measures[s][o])i.push(a),t.push(o),n.push(s==="*"?null:ve(s));const r={type:"aggregate",groupby:[...this.dimensions].map(ve),ops:t,fields:n,as:i};return r}}class Rn extends R{constructor(t,n,i,r){super(t);this.model=n,this.name=i,this.data=r;for(const s of ke){const o=n.facet[s];if(o){const{bin:a,sort:c}=o;this[s]={name:n.getName(`${s}_domain`),fields:[$(o),...j(a)?[$(o,{binSuffix:"end"})]:[]],...Xe(c)?{sortField:c}:E(c)?{sortIndexField:Pn(o,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of ke)this[n]&&(t+=` ${n.charAt(0)}:${O(this[n])}`);return t}get fields(){const t=[];for(const n of ke)this[n]?.fields&&t.push(...this[n].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of ke)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of qe){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(Z(r)&&Ct(s)){const o=xr(this.childModel,n),a=Fo(o);a?t[n]=a:x(Zr(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],s=[],o=[],a=[];r&&i&&i[r]&&(n?(s.push(`distinct_${i[r]}`),o.push("max")):(s.push(i[r]),o.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:c,sortIndexField:u}=this[t];if(c){const{op:l=Bi,field:f}=c;s.push(f),o.push(l),a.push($(c,{forAs:!0}))}else u&&(s.push(u),o.push("max"),a.push(u));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...s.length?{fields:s,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const c of fo){for(const u of po){const l=(i[c]&&i[c][u])??[];for(const f of l)if(f.axes?.length>0){s[c]=!0;break}}if(s[c]){const u=`length(data("${this.facet.name}"))`,l=c==="row"?n?{signal:`ceil(${u} / ${n})`}:1:n?{signal:`min(${u}, ${n})`}:{signal:u};r.push({name:`${this.facet.name}_${c}`,transform:[{type:"sequence",start:0,stop:l}]})}}const{row:o,column:a}=s;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:s,facet:o}=this;if(r&&s&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),c=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:c}]})}for(const a of[nt,tt])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(o){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function Zl(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Lb(e,t){const n=Ur(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=Zl(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=Zl(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return x(sp(t)),null}function Mb(e){const t={};return wi(e.filter,n=>{if(oc(n)){let i=null;ss(n)?i=xe(n.equal):as(n)?i=xe(n.lte):os(n)?i=xe(n.lt):cs(n)?i=xe(n.gt):us(n)?i=xe(n.gte):ls(n)?i=n.range[0]:fs(n)&&(i=(n.oneOf??n.in)[0]),i&&(Wt(i)?t[n.field]="date":B(i)?t[n.field]="number":N(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function Db(e){const t={};function n(i){_n(i)?t[i.field]="date":i.type==="quantitative"&&Id(i.aggregate)?t[i.field]="number":pn(i.field)>1?i.field in t||(t[i.field]="flatten"):Kt(i)&&Xe(i.sort)&&pn(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((V(e)||$e(e))&&e.forEachFieldDef((i,r)=>{if(ue(i))n(i);else{const s=Ut(r),o=e.fieldDef(s);n({...i,type:o.type})}}),V(e)){const{mark:i,markDef:r,encoding:s}=e;if(Ft(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];S(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function jb(e){const t={};if(V(e)&&e.component.selection)for(const n of b(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&pn(r.field)>1&&(t[r.field]="flatten")}return t}class oe extends R{clone(){return new oe(null,C(this._parse))}constructor(t,n){super(t);this._parse=n}hash(){return`Parse ${O(this._parse)}`}static makeExplicit(t,n,i){let r={};const s=n.data;return!Ot(s)&&s?.format?.parse&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of b(i)){const c=r.getWithExplicit(a);c.value!==void 0&&(c.explicit||c.value===i[a]||c.value==="derived"||i[a]==="flatten"?delete i[a]:x(Ua(a,i[a],c.value)))}for(const a of b(n)){const c=r.get(a);c!==void 0&&(c===n[a]?delete n[a]:x(Ua(a,n[a],c)))}const s=new pt(n,i);r.copyAll(s);const o={};for(const a of b(s.combine())){const c=s.get(a);c!==null&&(o[a]=c)}return b(o).length===0||r.parseNothing?null:new oe(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of b(this._parse)){const i=this._parse[n];pn(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(b(this._parse))}dependentFields(){return new Set(b(this._parse))}assembleTransforms(t=!1){return b(this._parse).filter(n=>t?pn(n)>1:!0).map(n=>{const i=Lb(n,this._parse[n]);if(!i)return null;const r={type:"formula",expr:i,as:dn(n)};return r}).filter(n=>n!==null)}}class Rt extends R{clone(){return new Rt(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Le])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Le}}}class ai extends R{clone(){return new ai(null,this.params)}constructor(t,n){super(t);this.params=n}dependentFields(){return new Set}producedFields(){return}hash(){return`Graticule ${O(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class ci extends R{clone(){return new ci(null,this.params)}constructor(t,n){super(t);this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${O(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class tn extends R{constructor(t){super(null);t??(t={name:"source"});let n;if(Ot(t)||(n=t.format?{...de(t.format,["parse"])}:{}),ii(t))this._data={values:t.values};else if(Cn(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];P(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else Wu(t)?this._data={values:[{type:"Sphere"}]}:(Uu(t)||Ot(t))&&(this._data={});this._generator=Ot(t),t.name&&(this._name=t.name),n&&!M(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){return}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var ef=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},Ub=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},ui;function xo(e){return e instanceof tn||e instanceof ai||e instanceof ci}class So{constructor(){ui.set(this,void 0),ef(this,ui,!1,"f")}setModified(){ef(this,ui,!0,"f")}get modifiedFlag(){return Ub(this,ui,"f")}}ui=new WeakMap;class nn extends So{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const n=this.getNodeDepths(t,0,new Map),i=[...n.entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class wo extends So{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Bb extends wo{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Wb extends wo{constructor(t){super();this.requiresSelectionId=t&&oo(t)}run(t){t instanceof Rt&&(this.requiresSelectionId&&(xo(t.parent)||t.parent instanceof Me||t.parent instanceof oe)||(this.setModified(),t.remove()))}}class Hb extends So{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Ze&&(i=t.producedFields(),Mr(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class qb extends wo{constructor(){super()}run(t){t instanceof le&&!t.isRequired()&&(this.setModified(),t.remove())}}class Gb extends nn{run(t){if(xo(t))return;if(t.numChildren()>1)return;for(const n of t.children)if(n instanceof oe)if(t instanceof oe)this.setModified(),t.merge(n);else{if(jr(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}return}}class Vb extends nn{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof oe);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const c of b(a))c in r?r[c]!==a[c]&&s.add(c):r[c]=a[c]}for(const o of s)delete r[o];if(!M(r)){this.setModified();const o=new oe(t,r);for(const a of n){if(a instanceof oe)for(const c of b(r))delete a.parse[c];t.removeChild(a),a.parent=o,a instanceof oe&&b(a.parse).length===0&&a.remove()}}}}}class Xb extends nn{run(t){t instanceof le||t.numChildren()>0||t instanceof Rn||(t instanceof tn||(this.setModified(),t.remove()))}}class Yb extends nn{run(t){const n=t.children.filter(r=>r instanceof Ze),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class Kb extends nn{run(t){const n=t.children.filter(r=>r instanceof Me),i={};for(const r of n){const s=O(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of b(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class Qb extends nn{constructor(t){super();this.model=t}run(t){const n=!(xo(t)||t instanceof An||t instanceof oe||t instanceof Rt),i=[],r=[];for(const s of t.children)s instanceof et&&(n&&!jr(t.producedFields(),s.dependentFields())?i.push(s):r.push(s));if(i.length>0){const s=i.pop();for(const o of i)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof et?t.merge(s,this.model.renameSignal.bind(this.model)):s.swapWithParent()}if(r.length>1){const s=r.pop();for(const o of r)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified()}}}class Jb extends nn{run(t){const n=[...t.children],i=Lt(n,o=>o instanceof le);if(!i||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof le){let a=o;for(;a.numChildren()===1;){const[c]=a.children;if(c instanceof le)a=c;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class rn extends R{clone(){return new rn(null,C(this.transform))}constructor(t,n){super(t);this.transform=n}addDimensions(t){this.transform.groupby=je(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??$(t)}hash(){return`JoinAggregateTransform ${O(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const s of this.transform.joinaggregate)n.push(s.op),i.push(this.getDefaultName(s)),t.push(s.field===void 0?null:s.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}function Zb(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=$(i);return r&&t.push(r),t},[])}function ex(e){return E(e)&&e.every(t=>N(t))&&e.length>1}class mt extends R{clone(){return new mt(null,C(this._stack))}constructor(t,n){super(t);this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:s,offset:o="zero"}=n,a=[],c=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),c.push(X(f.order,"ascending"));const u={field:a,order:c};let l;return ex(s)?l=s:N(s)?l=[s,`${s}_end`]:l=[`${n.stack}_start`,`${n.stack}_end`],new mt(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:o,sort:u,facetby:[],as:l})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:s,fieldChannel:o,offset:a,impute:c}=i,u=s.map(p=>{const g=r[p];return Ke(g)}).filter(p=>!!p),l=Zb(n),f=n.encoding.order;let d;if(E(f)||S(f))d=Aa(f);else{const p=zc(f)?f.sort:o==="y"?"descending":"ascending";d=l.reduce((g,m)=>(g.field.includes(m)||(g.field.push(m),g.order.push(p)),g),{field:[],order:[]})}return new mt(t,{dimensionFieldDefs:u,stackField:n.vgField(o),facetby:[],stackby:l,sort:d,offset:a,impute:c,as:[n.vgField(o,{suffix:"start",forAs:!0}),n.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${O(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[$(r,{binSuffix:"mid"})]:[$(r,{}),$(r,{binSuffix:"end"})]:[$(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:s,sort:o,offset:a,impute:c,as:u}=this._stack;if(c)for(const l of i){const{bandPosition:f=.5,bin:d}=l;if(d){const p=$(l,{expr:"datum"}),g=$(l,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${f}*${p}+${1-f}*${g}`,as:$(l,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...s,...n],key:$(l,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:o,as:u,offset:a}),t}}class In extends R{clone(){return new In(null,C(this.transform))}constructor(t,n){super(t);this.transform=n}addDimensions(t){this.transform.groupby=je(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??$(t)}hash(){return`WindowTransform ${O(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const s=this.transform.frame,o=this.transform.groupby;if(s&&s[0]===null&&s[1]===null&&n.every(f=>Kr(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...o!==void 0?{groupby:o}:{}};const a=[],c=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),c.push(f.order??"ascending");const u={field:a,order:c},l=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:u,...l!==void 0?{ignorePeers:l}:{},...o!==void 0?{groupby:o}:{},...s!==void 0?{frame:s}:{}}}}function tx(e){function t(n){if(!(n instanceof Rn)){const i=n.clone();if(i instanceof le){const r=vo+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof Me||i instanceof mt||i instanceof In||i instanceof rn)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function $o(e){if(e instanceof Rn)if(e.numChildren()===1&&!(e.children[0]instanceof le)){const t=e.children[0];(t instanceof Me||t instanceof mt||t instanceof In||t instanceof rn)&&t.addDimensions(e.fields),t.swapWithParent(),$o(e)}else{const t=e.model.component.data.main;tf(t);const n=tx(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map($o)}function tf(e){if(e instanceof le&&e.type===U.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Rn||(t.swapWithParent(),tf(e))}}const vo="scale_",br=5;function Eo(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!Eo(t.children))return!1}return!0}function De(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function nf(e,t,n){let i=e.sources,r=!1;return r=De(new qb,i)||r,r=De(new Wb(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=De(new Xb,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=De(new Gb,i)||r,r=De(new Qb(t),i)||r,r=De(new Hb,i)||r,r=De(new Vb,i)||r,r=De(new Kb,i)||r,r=De(new Yb,i)||r,r=De(new Bb,i)||r,r=De(new Jb,i)||r),e.sources=i,r}function nx(e,t){Eo(e.sources);let n=0,i=0;for(let r=0;rt(n))}}function rf(e){V(e)?ix(e):rx(e)}function ix(e){const t=e.component.scales;for(const n of b(t)){const i=ox(e,n),r=t[n];if(r.setWithExplicit("domains",i),cx(e,n),e.component.data.isFaceted){let s=e;for(;!$e(s)&&s.parent;)s=s.parent;const o=s.component.resolve.scale[n];if(o==="shared")for(const a of i.value)ut(a)&&(a.data=vo+a.data.replace(vo,""))}}}function rx(e){for(const n of e.children)rf(n);const t=e.component.scales;for(const n of b(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=At(i,o.getWithExplicit("domains"),"domains","scale",Co);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&x(tp),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function sx(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=sf(t,n);if(!r){x(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=sf(t,n);if(r)return"unaggregated"}return e}function ox(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=sx(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&K(i.x2)?K(i.x)?At(It(n,r,e,"x"),It(n,r,e,"x2"),"domain","scale",Co):It(n,r,e,"x2"):t==="y"&&K(i.y2)?K(i.y)?At(It(n,r,e,"y"),It(n,r,e,"y2"),"domain","scale",Co):It(n,r,e,"y2"):It(n,r,e,t)}function ax(e,t,n){return e.map(i=>{const r=Qi(i,{timeUnit:n,type:t});return{signal:`{data: ${r}}`}})}function _o(e,t,n){const i=J(n)?.unit;return t==="temporal"||i?ax(e,t,i):[e]}function It(e,t,n,i){const{encoding:r,markDef:s,mark:o,config:a,stack:c}=n,u=K(r[i]),{type:l}=u,f=u.timeUnit;if(Eg(t)){const g=It(e,void 0,n,i),m=_o(t.unionWith,l,f);return Je([...m,...g.value])}else{if(v(t))return Je([t]);if(t&&t!=="unaggregated"&&!gc(t))return Je(_o(t,l,f))}if(c&&i===c.fieldChannel){if(c.offset==="normalize")return we([[0,1]]);const g=n.requestDataName(U.Main);return we([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const d=at(i)&&S(u)?ux(n,i,e):void 0;if(Ye(u)){const g=_o([u.datum],l,f);return we(g)}const p=u;if(t==="unaggregated"){const g=n.requestDataName(U.Main),{field:m}=u;return we([{data:g,field:$({field:m,aggregate:"min"})},{data:g,field:$({field:m,aggregate:"max"})}])}else if(j(p.bin)){if(Z(e))return e==="bin-ordinal"?we([]):we([{data:Un(d)?n.requestDataName(U.Main):n.requestDataName(U.Raw),field:n.vgField(i,ti(p,i)?{binSuffix:"range"}:{}),sort:d===!0||!L(d)?{field:n.vgField(i,{}),op:"min"}:d}]);{const{bin:g}=p;if(j(g)){const m=bo(n,p.field,g);return we([new te(()=>{const h=n.getSignalName(m);return`[${h}.start, ${h}.stop]`})])}else return we([{data:n.requestDataName(U.Main),field:n.vgField(i,{})}])}}else if(p.timeUnit&&P(["time","utc"],e)){const g=r[He(i)];if(Pc(p,g,s,a)){const m=n.requestDataName(U.Main),h=Nt({fieldDef:p,fieldDef2:g,markDef:s,config:a}),y=Kn(o)&&h!==.5&&Y(i);return we([{data:m,field:n.vgField(i,y?{suffix:ar}:{})},{data:m,field:n.vgField(i,{suffix:y?cr:"end"})}])}}return we(d?[{data:Un(d)?n.requestDataName(U.Main):n.requestDataName(U.Raw),field:n.vgField(i),sort:d}]:[{data:n.requestDataName(U.Main),field:n.vgField(i)}])}function ko(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":Bi),...i?{field:ve(i)}:{},...r?{order:r}:{}}}function cx(e,t){const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=e.fieldDef(t)?.bin,s=gc(i)&&i,o=Bt(r)&&Ai(r.extent)&&r.extent;(s||o)&&n.set("selectionExtent",s??o,!0)}function ux(e,t,n){if(!Z(n))return;const i=e.fieldDef(t),r=i.sort;if(Tc(r))return{op:"min",field:Pn(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if(Xe(r)){const a=s&&!o.has(r.field);return ko(r,a)}else if(Nc(r)){const{encoding:a,order:c}=r,u=e.fieldDef(a),{aggregate:l,field:f}=u,d=s&&!o.has(f);if(ct(l)||_t(l))return ko({field:$(u),order:c},d);if(Kr(l)||!l)return ko({op:l,field:f,order:c},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(P(["ascending",void 0],r))return!0}return}function sf(e,t){const{aggregate:n,type:i}=e;return n?N(n)&&!Md.has(n)?{valid:!1,reason:Cp(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:Fp(e)}:{valid:!0}:{valid:!1,reason:kp(e)}}function Co(e,t,n,i){return e.explicit&&t.explicit&&x(Pp(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function lx(e){const t=je(e.map(o=>{if(ut(o)){const{sort:a,...c}=o;return c}return o}),O),n=je(e.map(o=>{if(ut(o)){const a=o.sort;return a!==void 0&&!Un(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}return}).filter(o=>o!==void 0),O);if(t.length===0)return;if(t.length===1){const o=e[0];if(ut(o)&&n.length>0){let a=n[0];if(n.length>1){x(Va);const c=n.filter(u=>L(u)&&"op"in u&&u.op!=="min");n.every(u=>L(u)&&"op"in u)&&c.length===1?a=c[0]:a=!0}else if(L(a)&&"field"in a){const c=a.field;o.field===c&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=je(n.map(o=>Un(o)||!("op"in o)||N(o.op)&&o.op in zd?o:(x(Rp(o)),!0)),O);let r;i.length===1?r=i[0]:i.length>1&&(x(Va),r=!0);const s=je(e.map(o=>ut(o)?o.data:null),o=>o);if(s.length===1&&s[0]!==null){const o={data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}};return o}return{fields:t,...r?{sort:r}:{}}}function Fo(e){if(ut(e)&&N(e.field))return e.field;if(Dd(e)){let t;for(const n of e.fields)if(ut(n)&&N(n.field)){if(!t)t=n.field;else if(t!==n.field)return x(Ip),t}return x(Lp),t}else if(jd(e)){x(Mp);const t=e.fields[0];return N(t)?t:void 0}return}function xr(e,t){const n=e.component.scales[t],i=n.get("domains").map(r=>(ut(r)&&(r.data=e.lookupDataSource(r.data)),r));return lx(i)}function of(e){return Ln(e)||To(e)?e.children.reduce((t,n)=>t.concat(of(n)),af(e)):af(e)}function af(e){return b(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:c,range:u,reverse:l,...f}=r,d=fx(r.range,s,n,e),p=xr(e,n),g=a?sy(e,a,i,p):null;return t.push({name:s,type:o,...p?{domain:p}:{},...g?{domainRaw:g}:{},range:d,...l!==void 0?{reverse:l}:{},...f}),t},[])}function fx(e,t,n,i){if(Y(n)){if(Ct(e))return{step:{signal:`${t}_step`}}}else if(L(e)&&ut(e))return{...e,data:i.lookupDataSource(e.data)};return e}class cf extends pt{constructor(t,n){super({},{name:t});this.merged=!1,this.setWithExplicit("type",n)}domainDefinitelyIncludesZero(){return this.get("zero")!==!1?!0:Lt(this.get("domains"),t=>E(t)&&t.length===2&&B(t[0])&&t[0]<=0&&B(t[1])&&t[1]>=0)}}const dx=["range","scheme"];function px(e){const t=e.component.scales;for(const n of Ti){const i=t[n];if(!i)continue;const r=gx(n,e);i.setWithExplicit("range",r)}}function uf(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:i,field:r}=n,s=me(t),o=e.getName(s);if(L(i)&&i.binned&&i.step!==void 0)return new te(()=>{const a=e.scaleName(t),c=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${c})`});if(j(i)){const a=bo(e,r,i);return new te(()=>{const c=e.getSignalName(a),u=`(${c}.stop - ${c}.start) / ${c}.step`;return`${e.getSignalName(o)} / (${u})`})}}return}function gx(e,t){const n=t.specifiedScales[e],{size:i}=t,r=t.getScaleComponent(e),s=r.get("type");for(const f of dx)if(n[f]!==void 0){const d=hs(s,f),p=mc(e,f);if(!d)x(qa(s,f,e));else if(p)x(p);else switch(f){case"range":{const g=n.range;if(E(g)){if(Y(e))return Je(g.map(m=>{if(m==="width"||m==="height"){const h=t.getName(m),y=t.getSignalName.bind(t);return te.fromName(y,h)}return m}))}else if(L(g))return Je({data:t.requestDataName(U.Main),field:g.field,sort:{op:"min",field:t.vgField(e)}});return Je(g)}case"scheme":return Je(mx(n[f]))}}const o=e===q||e==="xOffset"?"width":"height",a=i[o];if(Qe(a)){if(Y(e))if(Z(s)){const f=ff(a,t,e);if(f)return Je({step:f})}else x(Ga(o));else if(Vn(e)){const f=e===xt?"x":"y",d=t.getScaleComponent(f),p=d.get("type");if(p==="band"){const g=df(a,s);if(g)return Je(g)}}}const{rangeMin:c,rangeMax:u}=n,l=hx(e,t);return(c!==void 0||u!==void 0)&&hs(s,"rangeMin")&&E(l)&&l.length===2?Je([c??l[0],u??l[1]]):we(l)}function mx(e){return vg(e)?{scheme:e.name,...de(e,["name"])}:{scheme:e}}function lf(e,t,n,{center:i}={}){const r=me(e),s=t.getName(r),o=t.getSignalName.bind(t);return e===Q&&Se(n)?i?[te.fromName(a=>`${o(a)}/2`,s),te.fromName(a=>`-${o(a)}/2`,s)]:[te.fromName(o,s),0]:i?[te.fromName(a=>`-${o(a)}/2`,s),te.fromName(a=>`${o(a)}/2`,s)]:[0,te.fromName(o,s)]}function hx(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:o}=K(s[e]),a=t.getScaleComponent(e),c=a.get("type"),{domain:u,domainMid:l}=t.specifiedScales[e];switch(e){case q:case Q:{if(P(["point","band"],c)){const f=pf(e,n,i.view);if(Qe(f)){const d=ff(f,t,e);return{step:d}}}return lf(e,t,c)}case xt:case gn:return yx(e,t,c);case st:{const f=t.component.scales[e].get("zero"),d=gf(r,f,i),p=Sx(r,n,t,i);return Sn(c)?xx(d,p,bx(c,i,u,e)):[d,p]}case Ee:return[0,Math.PI*2];case Dt:return[0,360];case Ne:return[0,new te(()=>{const f=t.getSignalName($e(t.parent)?"child_width":"width"),d=t.getSignalName($e(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case $t:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case vt:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case ge:return"symbol";case pe:case Be:case We:return c==="ordinal"?o==="nominal"?"category":"ordinal":l!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case ot:case St:case wt:return[i.scale.minOpacity,i.scale.maxOpacity]}}function ff(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=qr(n),o=i[s],a=gu({step:e,offsetIsDiscrete:F(o)&&cc(o.type)});if(a==="offset"&&Xc(i,s)){const c=t.getScaleComponent(s),u=t.scaleName(s);let l=`domain('${u}').length`;if(c.get("type")==="band"){const d=c.get("paddingInner")??c.get("padding")??0,p=c.get("paddingOuter")??c.get("padding")??0;l=`bandspace(${l}, ${d}, ${p})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${l} / (1-${Hd(f)})`}}else return e.step}function df(e,t){const n=gu({step:e,offsetIsDiscrete:Z(t)});return n==="offset"?{step:e.step}:void 0}function yx(e,t,n){const i=e===xt?"x":"y",r=t.getScaleComponent(i);if(!r)return lf(i,t,n,{center:!0});const s=r.get("type"),o=t.scaleName(i),{markDef:a,config:c}=t;if(s==="band"){const u=pf(i,t.size,t.config.view);if(Qe(u)){const l=df(u,n);if(l)return l}return[0,{signal:`bandwidth('${o}')`}]}else{const u=t.encoding[i];if(S(u)&&u.timeUnit){const l=rc(u.timeUnit,g=>`scale('${o}', ${g})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=Nt({fieldDef:u,markDef:a,config:c})-.5,p=d!==0?` + ${d}`:"";if(f){const g=v(f)?`${f.signal}/2`+p:`${f/2+d}`,m=v(f)?`(1 - ${f.signal}/2)`+p:`${1-f/2+d}`;return[{signal:`${g} * (${l})`},{signal:`${m} * (${l})`}]}return[0,{signal:l}]}return ta(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function pf(e,t,n){const i=e===q?"width":"height",r=t[i];return r||rr(n,i)}function bx(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&E(n)?n.length+1:(x(Vp(i)),3)}}function xx(e,t,n){const i=()=>{const r=Pe(t),s=Pe(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return v(t)?new te(i):{signal:i()}}function gf(e,t,n){if(t)return v(t)?{signal:`${t.signal} ? 0 : ${gf(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(Pi("size",e))}const mf=.95;function Sx(e,t,n,i){const r={x:uf(n,"x"),y:uf(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=hf(t,r,i.view);return B(s)?s-1:new te(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=hf(t,r,i.view);return B(s)?Math.pow(mf*s,2):new te(()=>`pow(${mf} * ${s.signal}, 2)`)}}throw new Error(Pi("size",e))}function hf(e,t,n){const i=Qe(e.width)?e.width.step:ir(n,"width"),r=Qe(e.height)?e.height.step:ir(n,"height");return t.x||t.y?new te(()=>{const s=[t.x?t.x.signal:i,t.y?t.y.signal:r];return`min(${s.join(", ")})`}):Math.min(i,r)}function yf(e,t){V(e)?wx(e,t):Sf(e,t)}function wx(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of b(n)){const c=o[a],u=n[a],l=e.getScaleComponent(a),f=K(r[a]),d=c[t],p=l.get("type"),g=l.get("padding"),m=l.get("paddingInner"),h=hs(p,t),y=mc(a,t);if(d!==void 0&&(h?y&&x(y):x(qa(p,t,a))),h&&y===void 0)if(d!==void 0){const w=f.timeUnit,k=f.type;switch(t){case"domainMax":case"domainMin":Wt(c[t])||k==="temporal"||w?u.set(t,{signal:Qi(c[t],{type:k,timeUnit:w})},!0):u.set(t,c[t],!0);break;default:u.copyKeyFromObject(t,c)}}else{const w=t in bf?bf[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:p,scalePadding:g,scalePaddingInner:m,domain:c.domain,domainMin:c.domainMin,domainMax:c.domainMax,markDef:s,config:i,hasNestedOffsetScale:Yc(r,a),hasSecondaryRangeChannel:!!r[He(a)]}):i.scale[t];w!==void 0&&u.set(t,w,!1)}}}const bf={bins:({model:e,fieldOrDatumDef:t})=>S(t)?$x(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>vx(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>Ex(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>_x(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>kx(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>Cx(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=S(e)?e.sort:void 0;return Fx(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>Nx(e,t,n,i,r,s.scale,o)};function xf(e){V(e)?px(e):Sf(e,"range")}function Sf(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?xf(i):yf(i,t);for(const i of b(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=At(r,a,t,"scale",ju((c,u)=>{switch(t){case"range":return c.step&&u.step?c.step-u.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function $x(e,t){const n=t.bin;if(j(n)){const i=bo(e,t.field,n);return new te(()=>e.getSignalName(i))}else if(re(n)&&Bt(n)&&n.step!==void 0)return{step:n.step};return}function vx(e,t){return P([pe,Be,We],e)&&t!=="nominal"?"hcl":void 0}function Ex(e,t,n,i,r,s){return Ke(s)?.bin||E(n)||r!=null||i!=null||P([ye.TIME,ye.UTC],e)?void 0:Y(t)?!0:void 0}function _x(e,t,n,i,r,s){if(Y(e)){if(ze(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(S(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===ye.POINT)return n.pointPadding}return}function kx(e,t,n,i,r,s=!1){if(e!==void 0)return;if(Y(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:c,bandWithNestedOffsetPaddingInner:u}=r;return s?u:X(o,n==="bar"?a:c)}else if(Vn(t)&&i===ye.BAND)return r.offsetBandPaddingInner;return}function Cx(e,t,n,i,r,s=!1){if(e!==void 0)return;if(Y(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===ye.BAND)return X(o,v(i)?{signal:`${i.signal}/2`}:i/2)}else if(Vn(t)){if(n===ye.POINT)return .5;if(n===ye.BAND)return r.offsetBandPaddingOuter}return}function Fx(e,t,n,i){return n==="x"&&i.xReverse!==void 0?Se(e)&&t==="descending"?v(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse:Se(e)&&t==="descending"?!0:void 0}function Nx(e,t,n,i,r,s,o){const a=!!n&&n!=="unaggregated";if(a&&Se(r)){if(E(n)){const c=n[0],u=n[n.length-1];if(B(c)&&c<=0&&B(u)&&u>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!Sn(r))return!0;if(!(S(t)&&t.bin)&&P([...qe,...kd],e)){const{orient:c,type:u}=i;return P(["bar","area","line","trail"],u)&&(c==="horizontal"&&e==="y"||c==="vertical"&&e==="x")?!1:P(["bar","area"],u)&&!o?!0:s?.zero}return!1}function Tx(e,t,n,i,r=!1){const s=Ax(t,n,i,r),{type:o}=e;return at(t)?o!==void 0?Tg(t,o)?S(n)&&!Ng(o,n.type)?(x(Ap(o,s)),s):o:(x(Tp(t,o,s)),s):s:null}function Ax(e,t,n,i){switch(t.type){case"nominal":case"ordinal":{if(hn(e)||Yr(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&x(ts(e,"ordinal")),"ordinal";if(Y(e)||Vn(e)){if(P(["rect","bar","image","rule"],n.type))return"band";if(i)return"band"}else if(n.type==="arc"&&e in Xr)return"band";const r=n[me(e)];return Vt(r)||$n(t)&&t.axis?.tickBand?"band":"point"}case"temporal":return hn(e)?"time":Yr(e)==="discrete"?(x(ts(e,"temporal")),"ordinal"):S(t)&&t.timeUnit&&J(t.timeUnit).utc?"utc":"time";case"quantitative":return hn(e)?S(t)&&j(t.bin)?"bin-ordinal":"linear":Yr(e)==="discrete"?(x(ts(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Wa(t.type))}function Ox(e,{ignoreRange:t}={}){wf(e),rf(e);for(const n of Fg)yf(e,n);t||xf(e)}function wf(e){V(e)?e.component.scales=Px(e):e.component.scales=Rx(e)}function Px(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of Ti){const o=K(t[s]);if(o&&n===bc&&s===ge&&o.type===xn)continue;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??(a={});const c=Yc(t,s),u=Tx(a,s,o,i,c);r[s]=new cf(e.scaleName(`${s}`,!0),{value:u,explicit:a.type===u})}}return r}const zx=ju((e,t)=>uc(e)-uc(t));function Rx(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const s of e.children){wf(s);for(const o of b(s.component.scales))if((t=r.scale)[o]??(t[o]=Ll(o,e)),r.scale[o]==="shared"){const a=i[o],c=s.component.scales[o].getWithExplicit("type");a?bg(a.value,c.value)?i[o]=At(a,c,"type","scale",zx):(r.scale[o]="independent",delete i[o]):i[o]=c}}for(const s of b(i)){const o=e.scaleName(s,!0),a=i[s];n[s]=new cf(o,a);for(const c of e.children){const u=c.component.scales[s];u&&(c.renameScale(u.get("name"),o),u.merged=!0)}}return n}class No{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function V(e){return e?.type==="unit"}function $e(e){return e?.type==="facet"}function To(e){return e?.type==="concat"}function Ln(e){return e?.type==="layer"}class Ao{constructor(t,n,i,r,s,o,a){this.type=n,this.parent=i,this.config=s,this.correctDataNames=c=>(c.from?.data&&(c.from.data=this.lookupDataSource(c.from.data)),c.from?.facet?.data&&(c.from.facet.data=this.lookupDataSource(c.from.facet.data)),c),this.parent=i,this.config=s,this.view=he(a),this.name=t.name??r,this.title=kt(t.title)?{text:t.title}:t.title?he(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new No,this.projectionNameMap=i?i.projectionNameMap:new No,this.signalNameMap=i?i.signalNameMap:new No,this.data=t.data,this.description=t.description,this.transforms=Bh(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:Gm(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:Wi(t)||i?.component.data.isFaceted&&t.data===void 0},layoutSize:new pt,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?C(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){Ox(this)}parseProjection(){Kl(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){ql(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of b(i)){const o=i[s];o!==void 0&&(r[s]=W(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=W(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:M(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=nb(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of ke)t[i].title&&n.push(Ky(this,i));for(const i of fo)n=n.concat(Qy(this,i));return n}assembleAxes(){return Ly(this.component.axes,this.config)}assembleLegends(){return Vl(this)}assembleProjections(){return _b(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={..._a(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};return i.text?(P(["unit","layer"],this.type)?P(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),M(i)?void 0:i):void 0}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||$e(this.parent)?of(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return H((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(U[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if($e(this.parent)){const n=Rl(t),i=Ni(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(Z(s)&&Ct(o)){const a=r.get("name"),c=xr(this,i),u=Fo(c);if(u){const l=$({aggregate:"distinct",field:u},{expr:"datum"});return{signal:zl(a,r,l)}}else return x(Zr(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){return n?this.getName(t):ma(t)&&at(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t))?this.scaleNameMap.get(this.getName(t)):void 0}projectionName(t){return t?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(Yd(n));return i}hasAxisOrientSignalRef(){return this.component.axes.x?.some(t=>t.hasOrientSignalRef())||this.component.axes.y?.some(t=>t.hasOrientSignalRef())}}class $f extends Ao{vgField(t,n={}){const i=this.fieldDef(t);return i?$(i,n):void 0}reduceFieldDef(t,n){return wm(this.getMapping(),(i,r,s)=>{const o=Ke(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){As(this.getMapping(),(i,r)=>{const s=Ke(i);s&&t(s,r)},n)}}class Sr extends R{clone(){return new Sr(null,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"];const r=this.transform.resolve??"shared";this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${O(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class wr extends R{clone(){return new wr(null,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${O(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform,i={type:"extent",field:t,signal:n};return i}}class li extends R{clone(){return new li(null,{...this.filter})}constructor(t,n){super(t);this.filter=n}static make(t,n){const{config:i,mark:r,markDef:s}=n,o=z("invalid",s,i);if(o!=="filter")return null;const a=n.reduceFieldDef((c,u,l)=>{const f=at(l)&&n.getScaleComponent(l);if(f){const d=f.get("type");Se(d)&&u.aggregate!=="count"&&!Ft(r)&&(c[u.field]=u)}return c},{});return b(a).length?new li(t,a):null}dependentFields(){return new Set(b(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${O(this.filter)}`}assemble(){const t=b(this.filter).reduce((n,i)=>{const r=this.filter[i],s=$(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (isValid(${s}) && isFinite(+${s})))`):r.type==="quantitative"&&(n.push(`isValid(${s})`),n.push(`isFinite(+${s})`))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class $r extends R{clone(){return new $r(this.parent,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((s,o)=>r[o]??s)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${O(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform,i={type:"flatten",fields:t,as:n};return i}}class vr extends R{clone(){return new vr(null,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${O(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform,i={type:"fold",fields:t,as:n};return i}}class Mn extends R{clone(){return new Mn(null,C(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[Ae,Te],[_e,Oe]]){const s=r.map(o=>{const a=K(n.encoding[o]);return S(a)?a.field:Ye(a)?{expr:`${a.datum}`}:Ie(a)?{expr:`${a.value}`}:void 0});(s[0]||s[1])&&(t=new Mn(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(ge)){const r=n.typedFieldDef(ge);r.type===xn&&(t=new Mn(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t);this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(N);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${O(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class fi extends R{clone(){return new fi(null,this.projection,C(this.fields),C(this.as))}constructor(t,n,i,r){super(t);this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[Ae,Te],[_e,Oe]]){const r=i.map(o=>{const a=K(n.encoding[o]);return S(a)?a.field:Ye(a)?{expr:`${a.datum}`}:Ie(a)?{expr:`${a.value}`}:void 0}),s=i[0]===_e?"2":"";(r[0]||r[1])&&(t=new fi(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(N))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${O(this.fields)} ${O(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class sn extends R{clone(){return new sn(null,C(this.transform))}constructor(t,n){super(t);this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t,s=[n,i,...r?[r]:[]].join(",");return{signal:`sequence(${s})`}}static makeFromTransform(t,n){return new sn(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(S(r)&&S(s)){const o=r.impute?r:s.impute?s:void 0;if(o===void 0)return;const a=r.impute?s:s.impute?r:void 0,{method:c,value:u,frame:l,keyvals:f}=o.impute,d=Qc(n.mark,i);return new sn(t,{impute:o.field,key:a.field,...c?{method:c}:{},...u!==void 0?{value:u}:{},...l?{frame:l}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${O(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:s,value:o,frame:a=[null,null]}=this.transform,c={type:"impute",field:t,key:n,...i?{keyvals:vh(i)?this.processSequence(i):i}:{},method:"value",...s?{groupby:s}:{},value:!r||r==="value"?o:null};if(r&&r!=="value"){const u={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...s?{groupby:s}:{}},l={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[c,u,l]}else return[c]}}class Er extends R{clone(){return new Er(null,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${O(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform,r={type:"loess",x:n,y:t,...i};return r}}class di extends R{clone(){return new di(null,C(this.transform),this.secondary)}constructor(t,n,i){super(t);this.transform=n,this.secondary=i}static make(t,n,i,r){const s=n.component.data.sources,{from:o}=i;let a=null;if(Eh(o)){let c=kf(o.data,s);c||(c=new tn(o.data),s.push(c));const u=n.getName(`lookup_${r}`);a=new le(c,u,U.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[u]=a}else if(_h(o)){const c=o.param;i={as:c,...i};let u;try{u=n.getSelectionComponent(H(c),c)}catch(l){throw new Error(Zd(c))}if(a=u.materialized,!a)throw new Error(ep(c))}return new di(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?G(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${O({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:G(this.transform.as)}:{}};else{let n=this.transform.as;N(n)||(x(cp),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class _r extends R{clone(){return new _r(null,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${O(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform,i={type:"quantile",field:t,...n};return i}}class kr extends R{clone(){return new kr(null,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${O(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform,r={type:"regression",x:n,y:t,...i};return r}}class Cr extends R{clone(){return new Cr(null,C(this.transform))}constructor(t,n){super(t);this.transform=n}addDimensions(t){this.transform.groupby=je((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){return}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${O(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:s}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...s!==void 0?{op:s}:{},...i!==void 0?{groupby:i}:{}}}}class Fr extends R{clone(){return new Fr(null,C(this.transform))}constructor(t,n){super(t);this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${O(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function vf(e){let t=0;function n(i,r){if(i instanceof tn&&(!i.isGenerator&&!Cn(i.data))){e.push(r);const s={name:null,source:r.name,transform:[]};r=s}if(i instanceof oe&&(i.parent instanceof tn&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Rn){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}if((i instanceof ai||i instanceof ci||i instanceof li||i instanceof An||i instanceof On||i instanceof fi||i instanceof Me||i instanceof di||i instanceof In||i instanceof rn||i instanceof vr||i instanceof $r||i instanceof Sr||i instanceof Er||i instanceof _r||i instanceof kr||i instanceof Rt||i instanceof Fr||i instanceof Cr||i instanceof wr)&&r.transform.push(i.assemble()),(i instanceof et||i instanceof Ze||i instanceof sn||i instanceof mt||i instanceof Mn)&&r.transform.push(...i.assemble()),i instanceof le){if(r.source&&r.transform.length===0)i.setSource(r.source);else if(i.parent instanceof le)i.setSource(r.name);else if(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1){e.push(r);const s={name:null,source:r.name,transform:[]};r=s}}switch(i.numChildren()){case 0:i instanceof le&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children){const a={name:null,source:s,transform:[]};n(o,a)}break}}}return n}function Ix(e){const t=[],n=vf(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function Lx(e,t){const n=[],i=vf(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function Mx(e){return e==="top"||e==="left"||v(e)?"header":"footer"}function Dx(e){for(const t of ke)jx(e,t);_f(e,"x"),_f(e,"y")}function jx(e,t){const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const o=n[t],a=zn("title",null,i,t);let c=vn(o,i,{allowDisabling:!0,includeDefault:a===void 0||!!a});r.component.layoutHeaders[t].title&&(c=E(c)?c.join(", "):c,c+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const u=zn("labelOrient",o.header,i,t),l=o.header!==null?X(o.header?.labels,i.header.labels,!0):!1,f=P(["bottom","right"],u)?"footer":"header";s.layoutHeaders[t]={title:o.header!==null?c:null,facetFieldDef:o,[f]:t==="facet"?[]:[Ef(e,t,l)]}}}function Ef(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function _f(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=ho(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const c=Mx(a.get("orient"));o[c]??(o[c]=[Ef(e,s,!1)]);const u=oi(a,"main",e.config,{header:!0});u&&o[c][0].axes.push(u),a.mainExtracted=!0}}}}function Ux(e){Oo(e),Nr(e,"width"),Nr(e,"height")}function Bx(e){Oo(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";Nr(e,t),Nr(e,n)}function Oo(e){for(const t of e.children)t.parseLayoutSize()}function Nr(e,t){const n=Rl(t),i=Ni(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const c=a.component.layoutSize.getWithExplicit(n),u=r.scale[i]??Ll(i,e);if(u==="independent"&&c.value==="step"){o=void 0;break}if(o){if(u==="independent"&&o.value!==c.value){o=void 0;break}o=At(o,c,n,"")}else o=c}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function Wx(e){const{size:t,component:n}=e;for(const i of qe){const r=me(i);if(t[r]){const s=t[r];n.layoutSize.set(r,Qe(s)?"step":s,!0)}else{const s=Hx(e,r);n.layoutSize.set(r,s,!1)}}}function Hx(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(Z(s)){const a=rr(i.view,t);return Ct(o)||Qe(a)?"step":a}else return Ws(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return Ws(i.view,t);{const s=rr(i.view,t);return Qe(s)?s.step:s}}}function Po(e,t,n){return $(t,{suffix:`by_${$(e)}`,...n})}class pi extends $f{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve);this.child=Mo(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Zn(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=b(t),i={};for(const r of n){if(![tt,nt].includes(r)){x(Pi(r,"facet"));break}const s=t[r];if(s.field===void 0){x(es(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=Ns(t,n);return i.header?i.header=he(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=Tr(this),this.child.parseData()}parseLayoutSize(){Oo(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Dx(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of ke)for(const i of po){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:o}=r;if(o){const a=zn("titleOrient",o.header,this.config,n);if(["right","bottom"].includes(a)){const c=mr(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[c]="end"}}if(s?.[0]){const a=n==="row"?"height":"width",c=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[c]??(t[c]={}),t[c][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(this.parent&&this.parent instanceof pi)return;{const t=this.getName("column_domain");return{signal:`length(data('${t}'))`}}}assembleGroupStyle(){return}assembleGroup(t){return this.parent&&this.parent instanceof pi?{...this.channelHasField("column")?{encode:{update:{columns:{field:$(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof pi){if(this.child.channelHasField("column")){const r=$(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of qe){const s=this.child.component.scales[r];if(s&&!s.merged){const o=s.get("type"),a=s.get("range");if(Z(o)&&Ct(a)){const c=xr(this.child,r),u=Fo(c);u?(t.push(u),n.push("distinct"),i.push(`distinct_${u}`)):x(Zr(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:s,ops:o,as:a}=this.getCardinalityAggregateForChild(),c=[];for(const l of ke){const f=this.facet[l];if(f){c.push($(f));const{bin:d,sort:p}=f;if(j(d)&&c.push($(f,{binSuffix:"end"})),Xe(p)){const{field:g,op:m=Bi}=p,h=Po(f,p);i&&r?(s.push(h),o.push("max"),a.push(h)):(s.push(g),o.push(m),a.push(h))}else if(E(p)){const g=Pn(f,l);s.push(g),o.push("max"),a.push(g)}}}const u=!!i&&!!r;return{name:t,data:n,groupby:c,...u||s.length>0?{aggregate:{...u?{cross:u}:{},...s.length?{fields:s,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?Xe(i.sort)?[Po(i,i.sort,{expr:"datum"})]:E(i.sort)?[Pn(i,t,{expr:"datum"})]:[$(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i,s=(Xe(r)?r.order:!E(r)&&r)||"ascending";return[s]}return[]}assembleLabelTitle(){const{facet:t,config:n}=this;if(t.facet)return go(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const r of fo)if(t[r]){const s=zn("labelOrient",t[r]?.header,n,r);if(i[r].includes(s))return go(t[r],r,n)}return}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=Ix(n),r=t.assembleGroupEncodeEntry(!1),s=this.assembleLabelTitle()||t.assembleTitle(),o=t.assembleGroupStyle(),a={name:this.getName("cell"),type:"group",...s?{title:s}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:ke.map(c=>this.facetSortFields(c)).flat(),order:ke.map(c=>this.facetSortOrder(c)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(ty(this,[]))};return[a]}getMapping(){return this.facet}}function qx(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(Xe(s.sort)){const{field:o,op:a=Bi}=s.sort;e=r=new rn(e,{joinaggregate:[{op:a,field:o,as:Po(s,s.sort,{forAs:!0})}],groupby:[$(s)]})}return r}return null}function kf(e,t){for(const n of t){const i=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;const r=e.format?.mesh,s=i.format?.feature;if(r&&s)continue;const o=e.format?.feature;if((o||s)&&o!==s)continue;const a=i.format?.mesh;if((r||a)&&r!==a)continue;if(ii(e)&&ii(i)){if(be(e.values,i.values))return n}else if(Cn(e)&&Cn(i)){if(e.url===i.url)return n}else if(Uu(e)&&e.name===n.dataName)return n}return null}function Gx(e,t){if(e.data||!e.parent){if(e.data===null){const i=new tn({values:[]});return t.push(i),i}const n=kf(e.data,t);if(n)return Ot(e.data)||(n.data.format=na({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new tn(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function Vx(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(Rh(r))o=e=new On(e,r),s="derived";else if(Xs(r)){const a=Mb(r);o=e=oe.makeWithAncestors(e,{},a,n)??e,e=new An(e,t,r.filter)}else if(Pu(r))o=e=et.makeFromTransform(e,r,t),s="number";else if(Lh(r)){s="date";const a=n.getWithExplicit(r.field);a.value===void 0&&(e=new oe(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=Ze.makeFromTransform(e,r)}else if(Mh(r))o=e=Me.makeFromTransform(e,r),s="number",oo(t)&&(e=new Rt(e));else if(Ou(r))o=e=di.make(e,t,r,i++),s="derived";else if(Oh(r))o=e=new In(e,r),s="number";else if(Ph(r))o=e=new rn(e,r),s="number";else if(Dh(r))o=e=mt.makeFromTransform(e,r),s="derived";else if(jh(r))o=e=new vr(e,r),s="derived";else if(Uh(r))o=e=new wr(e,r),s="derived";else if(zh(r))o=e=new $r(e,r),s="derived";else if(kh(r))o=e=new Cr(e,r),s="derived";else if(Ah(r))e=new Fr(e,r);else if(Ih(r))o=e=sn.makeFromTransform(e,r),s="derived";else if(Ch(r))o=e=new Sr(e,r),s="derived";else if(Fh(r))o=e=new _r(e,r),s="derived";else if(Nh(r))o=e=new kr(e,r),s="derived";else if(Th(r))o=e=new Er(e,r),s="derived";else{x(ap(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function Tr(e){let t=Gx(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,s=r&&(Ot(r)||Cn(r)||ii(r)),o=!s&&e.parent?e.parent.component.data.ancestorParse.clone():new Zh;Ot(r)?(Bu(r)?t=new ci(t,r.sequence):Qs(r)&&(t=new ai(t,r.graticule)),o.parseNothing=!0):r?.format?.parse===null&&(o.parseNothing=!0),t=oe.makeExplicit(t,e,o)??t,t=new Rt(t);const a=e.parent&&Ln(e.parent);(V(e)||$e(e))&&(a&&(t=et.makeFromEncoding(t,e)??t)),e.transforms.length>0&&(t=Vx(t,e,o));const c=jb(e),u=Db(e);t=oe.makeWithAncestors(t,{},{...c,...u},o)??t,V(e)&&(t=Mn.parseAll(t,e),t=fi.parseAll(t,e)),(V(e)||$e(e))&&(a||(t=et.makeFromEncoding(t,e)??t),t=Ze.makeFromEncoding(t,e)??t,t=On.parseAllForSortIndex(t,e));const l=e.getDataName(U.Raw),f=new le(t,l,U.Raw,i);if(n[l]=f,t=f,V(e)){const m=Me.makeFromEncoding(t,e);m&&(t=m,oo(e)&&(t=new Rt(t))),t=sn.makeFromEncoding(t,e)??t,t=mt.makeFromEncoding(t,e)??t}V(e)&&(t=li.make(t,e)??t);const d=e.getDataName(U.Main),p=new le(t,d,U.Main,i);n[d]=p,t=p,V(e)&&Ry(e,p);let g=null;if($e(e)){const m=e.getName("facet");t=qx(t,e.facet)??t,g=new Rn(t,e,m,p.getSource()),n[m]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:f,main:p,facetRoot:g,ancestorParse:o}}class Xx extends Ao{constructor(t,n,i,r){super(t,"concat",n,i,r,t.resolve);(t.resolve?.axis?.x==="shared"||t.resolve?.axis?.y==="shared")&&x(rp),this.children=this.getChildren(t).map((s,o)=>Mo(s,this,this.getName(`concat_${o}`),void 0,r))}parseData(){this.component.data=Tr(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of b(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return nr(t)?t.vconcat:Bs(t)?t.hconcat:t.concat}parseLayoutSize(){Bx(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=mo(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){return}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function Yx(e){return e===!1||e===null}const Kx={disable:1,gridScale:1,scale:1,...qc,labelExpr:1,encode:1},Cf=b(Kx);class zo extends pt{constructor(t={},n={},i=!1){super();this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new zo(C(this.explicit),C(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Yx(this.get(t))}hasOrientSignalRef(){return v(this.explicit.orient)}}function Qx(e,t,n){const{encoding:i,config:r}=e,s=K(i[t])??K(i[He(t)]),o=e.axis(t)||{},{format:a,formatType:c}=o;if(Yt(c))return{text:Re({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:c,config:r}),...n};if(a===void 0&&c===void 0&&r.customFormatTypes){if(wn(s)==="quantitative"){if($n(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Re({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Re({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(wn(s)==="temporal"&&r.timeFormatType&&S(s)&&!s.timeUnit)return{text:Re({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function Jx(e){return qe.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[sS(n,e)]),t),{})}const Zx={bottom:"top",top:"bottom",left:"right",right:"left"};function eS(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of b(r.component.axes))n.axis[s]=ho(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=tS(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of qe){for(const s of e.children){if(!s.component.axes[r])continue;if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:c}=o.getWithExplicit("orient");if(v(a))continue;if(i[a]>0&&!c){const u=Zx[a];i[a]>i[u]&&o.set("orient",u,!1)}i[a]++}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&!!o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function tS(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;in.clone());return e}function nS(e,t){for(const n of Cf){const i=At(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return za(r,s);case"gridScale":return{explicit:r.explicit,value:X(r.value,s.value)}}return or(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function iS(e,t,n,i,r){if(t==="disable")return n!==void 0;n=n||{};switch(t){case"titleAngle":case"labelAngle":return e===(v(n.labelAngle)?n.labelAngle:Hn(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===Nl(i,r))return!0}return e===n[t]}const rS=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function sS(e,t){let n=t.axis(e);const i=new zo,r=K(t.encoding[e]),{mark:s,config:o}=t,a=n?.orient||o[e==="x"?"axisX":"axisY"]?.orient||o.axis?.orient||qy(e),c=t.getScaleComponent(e).get("type"),u=My(e,c,a,t.config),l=n!==void 0?!n:uo("disable",o.style,n?.style,u).configValue;if(i.set("disable",l,n!==void 0),l)return i;n=n||{};const f=By(r,n,e,o.style,u),d=_c(n.formatType,r,c),p=Ec(r,r.type,n.format,n.formatType,o,!0),g={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:c,orient:a,labelAngle:f,format:p,formatType:d,mark:s,config:o};for(const y of Cf){const w=y in kl?kl[y](g):Gc(y)?n[y]:void 0,k=w!==void 0,_=iS(w,y,n,t,e);if(k&&_)i.set(y,w,_);else{const{configValue:T=void 0,configFrom:I=void 0}=Gc(y)&&y!=="values"?uo(y,o.style,n.style,u):{},ae=T!==void 0;k&&!ae?i.set(y,w,_):(!(I==="vgAxisConfig")||rS.has(y)&&ae||ni(T)||v(T))&&i.set(y,T,!1)}}const m=n.encoding??{},h=Hc.reduce((y,w)=>{if(!i.hasAxisPart(w))return y;const k=Il(m[w]??{},t),_=w==="labels"?Qx(t,e,k):k;return _!==void 0&&!M(_)&&(y[w]={update:_}),y},{});return M(h)||i.set("encode",h,!!n.encoding||n.labelAngle!==void 0),i}function oS({encoding:e,size:t}){for(const n of qe){const i=me(n);Qe(t[i])&&(Tt(e[n])&&(delete t[i],x(Ga(i))))}return t}const aS={vgMark:"arc",encodeEntry:e=>({...Ce(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...se("x",e,{defaultPos:"mid"}),...se("y",e,{defaultPos:"mid"}),...Pt(e,"radius"),...Pt(e,"theta")})},cS={vgMark:"area",encodeEntry:e=>({...Ce(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...lr("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...lr("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...ro(e)})},uS={vgMark:"rect",encodeEntry:e=>({...Ce(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Pt(e,"x"),...Pt(e,"y")})},lS={vgMark:"shape",encodeEntry:e=>({...Ce(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape,i={type:"geoshape",projection:e.projectionName(),...n&&S(n)&&n.type===xn?{field:$(n,{expr:"datum"})}:{}};return[i]}},fS={vgMark:"image",encodeEntry:e=>({...Ce(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Pt(e,"x"),...Pt(e,"y"),...no(e,"url")})},dS={vgMark:"line",encodeEntry:e=>({...Ce(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...se("x",e,{defaultPos:"mid"}),...se("y",e,{defaultPos:"mid"}),...ee("size",e,{vgChannel:"strokeWidth"}),...ro(e)})},pS={vgMark:"trail",encodeEntry:e=>({...Ce(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...se("x",e,{defaultPos:"mid"}),...se("y",e,{defaultPos:"mid"}),...ee("size",e),...ro(e)})};function Ro(e,t){const{config:n}=e;return{...Ce(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...se("x",e,{defaultPos:"mid"}),...se("y",e,{defaultPos:"mid"}),...ee("size",e),...ee("angle",e),...gS(e,n,t)}}function gS(e,t,n){return n?{shape:{value:n}}:ee("shape",e)}const mS={vgMark:"symbol",encodeEntry:e=>Ro(e)},hS={vgMark:"symbol",encodeEntry:e=>Ro(e,"circle")},yS={vgMark:"symbol",encodeEntry:e=>Ro(e,"square")},bS={vgMark:"rect",encodeEntry:e=>({...Ce(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Pt(e,"x"),...Pt(e,"y")})},xS={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...Ce(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...lr("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...lr("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...ee("size",e,{vgChannel:"strokeWidth"})}}},SS={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...Ce(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...se("x",e,{defaultPos:"mid"}),...se("y",e,{defaultPos:"mid"}),...no(e),...ee("size",e,{vgChannel:"fontSize"}),...ee("angle",e),...al("align",wS(e.markDef,n,t)),...al("baseline",$S(e.markDef,n,t)),...se("radius",e,{defaultPos:null}),...se("theta",e,{defaultPos:null})}}};function wS(e,t,n){const i=z("align",e,n);return i===void 0?"center":void 0}function $S(e,t,n){const i=z("baseline",e,n);return i===void 0?"middle":void 0}const vS={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"width":"height",s=i==="horizontal"?"height":"width";return{...Ce(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...se("x",e,{defaultPos:"mid",vgChannel:"xc"}),...se("y",e,{defaultPos:"mid",vgChannel:"yc"}),...ee("size",e,{defaultValue:ES(e),vgChannel:r}),[s]:W(z("thickness",n,t))}}};function ES(e){const{config:t,markDef:n}=e,{orient:i}=n,r=i==="horizontal"?"width":"height",s=e.getScaleComponent(i==="horizontal"?"x":"y"),o=z("size",n,t,{vgChannel:r})??t.tick.bandSize;if(o!==void 0)return o;{const a=s?s.get("range"):void 0;if(a&&Ct(a)&&B(a.step))return a.step*3/4;const c=ir(t.view,r);return c*3/4}}const Ar={arc:aS,area:cS,bar:uS,circle:hS,geoshape:lS,image:fS,line:dS,point:mS,rect:bS,rule:xS,square:yS,text:SS,tick:vS,trail:pS};function _S(e){if(P([Mi,Ii,Pg],e.mark)){const t=Qc(e.mark,e.encoding);if(t.length>0)return kS(e,t)}else if(e.mark===Li){const t=Qr.some(n=>z(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return CS(e)}return Io(e)}const Ff="faceted_path_";function kS(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:Ff+e.requestDataName(U.Main),data:e.requestDataName(U.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Io(e,{fromPrefix:Ff})}]}const Nf="stack_group_";function CS(e){const[t]=Io(e,{fromPrefix:Nf}),n=e.scaleName(e.stack.fieldChannel),i=(u={})=>e.vgField(e.stack.fieldChannel,u),r=(u,l)=>{const f=[i({prefix:"min",suffix:"start",expr:l}),i({prefix:"max",suffix:"start",expr:l}),i({prefix:"min",suffix:"end",expr:l}),i({prefix:"max",suffix:"end",expr:l})];return`${u}(${f.map(d=>`scale('${n}',${d})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...fn(t.encode.update,["y","yc","y2","height",...Qr]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...de(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...fn(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...de(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const u of Qr){const l=lt(u,e.markDef,e.config);t.encode.update[u]?(s[u]=t.encode.update[u],delete t.encode.update[u]):l&&(s[u]=W(l)),l&&(t.encode.update[u]={value:0})}const a=[];if(e.stack.groupbyChannels?.length>0)for(const u of e.stack.groupbyChannels){const l=e.fieldDef(u),f=$(l);f&&a.push(f),(l?.bin||l?.timeUnit)&&a.push($(l,{binSuffix:"end"}))}const c=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"];return s=c.reduce((u,l)=>{if(t.encode.update[l])return{...u,[l]:t.encode.update[l]};{const f=lt(l,e.markDef,e.config);return f!==void 0?{...u,[l]:W(f)}:u}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(U.Main),name:Nf+e.requestDataName(U.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function FS(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!E(o)&&Ie(o)&&Ir(o.value)||!o&&Ir(z("order",r,s)))return;if((E(o)||S(o))&&!n)return Aa(o,{expr:"datum"});if(Ft(i)){const a=r.orient==="horizontal"?"y":"x",c=t[a];if(S(c)){const u=c.sort;if(E(u))return{field:$(c,{prefix:a,suffix:"sort_index",expr:"datum"})};if(Xe(u))return{field:$({aggregate:Ts(e.encoding)?u.op:void 0,field:u.field},{expr:"datum"})};if(Nc(u)){const l=e.fieldDef(u.encoding);return{field:$(l,{expr:"datum"}),order:u.order}}else return u===null?void 0:{field:$(c,{binSuffix:e.stack?.impute?"mid":void 0,expr:"datum"})}}return}return}function Io(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,o=X(i.clip,NS(e),TS(e)),a=Na(i),c=r.key,u=FS(e),l=AS(e),f=z("aria",i,s),d=Ar[n].postEncodingTransform?Ar[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:Ar[n].vgMark,...o?{clip:o}:{},...a?{style:a}:{},...c?{key:c.field}:{},...u?{sort:u}:{},...l||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(U.Main)},encode:{update:Ar[n].encodeEntry(e)},...d?{transform:d}:{}}]}function NS(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t?.get("selectionExtent")||n?.get("selectionExtent")?!0:void 0}function TS(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function AS(e){if(!e.component.selection)return null;const t=b(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=b(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class Tf extends $f{constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,mu(t)?t.view:void 0);this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=Ve(t.mark)?{...t.mark}:{type:t.mark},a=o.type;o.filled===void 0&&(o.filled=mh(o,s,{graticule:t.data&&Qs(t.data)}));const c=this.encoding=xm(t.encoding||{},a,o.filled,s);this.markDef=Eu(o,c,s),this.size=oS({encoding:c,size:mu(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=vu(this.markDef,c),this.specifiedScales=this.initScales(a,c),this.specifiedAxes=this.initAxes(c),this.specifiedLegends=this.initLegends(c),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(u=>js(u))}get hasProjection(){const{encoding:t}=this,n=this.mark===bc,i=t&&yd.some(r=>F(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return Ti.reduce((i,r)=>{const s=K(n[r]);return s&&(i[r]=this.initScale(s.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=he(t);return E(n)&&(r.domain=n.map(xe)),E(i)&&(r.range=i.map(xe)),r}initAxes(t){return qe.reduce((n,i)=>{const r=t[i];if(F(r)||i===q&&F(t.x2)||i===Q&&F(t.y2)){const s=F(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=b(t),i={};for(const r of n){const s=t[r];i[r]=ni(s)?ka(s):xe(s)}return i}initLegends(t){return Cd.reduce((n,i)=>{const r=K(t[i]);if(r&&Nd(i)){const s=r.legend;n[i]=s&&he(s)}return n},{})}parseData(){this.component.data=Tr(this)}parseLayoutSize(){Wx(this)}parseSelections(){this.component.selection=zy(this,this.selection)}parseMarkGroup(){this.component.mark=_S(this)}parseAxesAndHeaders(){this.component.axes=Jx(this)}assembleSelectionTopLevelSignals(t){return ny(this,t)}assembleSignals(){return[...El(this),...ey(this,[])]}assembleSelectionData(t){return iy(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return mo(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Ln(this.parent))&&(t=qu(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return Qt(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Ke(n)}typedFieldDef(t){const n=this.fieldDef(t);return ue(n)?n:null}}class Lo extends Ao{constructor(t,n,i,r,s){super(t,"layer",n,i,s,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,c)=>{if(sr(a))return new Lo(a,this,this.getName(`layer_${c}`),o,s);if(ft(a))return new Tf(a,this,this.getName(`layer_${c}`),o,s);throw new Error(Jr(a))})}parseData(){this.component.data=Tr(this);for(const t of this.children)t.parseData()}parseLayoutSize(){Ux(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of b(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){eS(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),El(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),mo(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of G(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t;return}assembleLayout(){return null}assembleMarks(){return ry(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),Vl(this))}}function Mo(e,t,n,i,r){if(Wi(e))return new pi(e,t,n,r);if(sr(e))return new Lo(e,t,n,i,r);if(ft(e))return new Tf(e,t,n,i,r);if(Wm(e))return new Xx(e,t,n,r);throw new Error(Jr(e))}function OS(e,t={}){t.logger&&Xp(t.logger),t.fieldTitle&&jc(t.fieldTitle);try{const n=wu(Zo(t.config,e.config)),i=Lu(e,n),r=Mo(i,null,"",void 0,n);r.parse(),nx(r.component.data,r);const s=zS(r,PS(e,i.autosize,n,r),e.datasets,e.usermeta);return{spec:s,normalized:i}}finally{t.logger&&Yp(),t.fieldTitle&&lm()}}function PS(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):N(t)&&(t={type:t}),r&&s&&Kh(t.type)){if(r==="step"&&s==="step")x(La()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";x(La(Ni(o)));const a=o==="width"?"height":"width";t.type=Qh(a)}}return{...b(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...Du(n,!1),...Du(e,!0)}}function zS(e,t,n={},i){const r=e.config?ih(e.config):void 0,s=[].concat(e.assembleSelectionData([]),Lx(e.component.data,n)),o=e.assembleProjections(),a=e.assembleTitle(),c=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let l=e.assembleLayoutSignals();l=l.filter(p=>(p.name==="width"||p.name==="height")&&p.value!==void 0?(t[p.name]=+p.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...c?{style:c}:{},...u?{encode:{update:u}}:{},data:s,...o.length>0?{projections:o}:{},...e.assembleGroup([...l,...e.assembleSelectionTopLevelSignals([]),...pu(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const RS=fd.version;export{pn as accessPathDepth,Ur as accessPathWithDatum,OS as compile,P as contains,be as deepEqual,$i as deleteNestedProperty,C as duplicate,bt as entries,Lr as every,jr as fieldIntersection,ra as flatAccessWithDatum,X as getFirstDefined,Mr as hasIntersection,O as hash,aa as internalField,Un as isBoolean,M as isEmpty,pd as isEqual,ca as isInternalField,Ir as isNullOrFalse,vi as isNumeric,b as keys,Bn as logicalExpr,na as mergeDeep,ta as never,Lu as normalize,Hn as normalizeAngle,de as omit,fn as pick,Dr as prefixGenerator,dn as removePathFromField,Mt as replaceAll,ve as replacePathInField,md as resetIdCounter,ia as setEqual,Lt as some,D as stringify,Wn as titleCase,je as unique,oa as uniqueId,ie as vals,H as varName,RS as version};export default null; diff --git a/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/dist=es2020,mode=imports,min/optimized/vega-lite.js b/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/dist=es2020,mode=imports,min/optimized/vega-lite.js new file mode 100644 index 00000000..a7fd9dfe --- /dev/null +++ b/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/dist=es2020,mode=imports,min/optimized/vega-lite.js @@ -0,0 +1 @@ +import{hasOwnProperty as on,isNumber as j,isString as N,writeConfig as Uf,splitAccessPath as an,stringValue as O,isObject as z,isBoolean as Un,isArray as E,array as V,logger as Bf,Warn as Wf,isFunction as Hf,mergeConfig as na,identity as qf}from"/-/vega-util@v1.17.2-LUfkDhormMyfWqy3Ts6U/dist=es2020,mode=imports,min/optimized/vega-util.js";import{isObject as Rr,writeConfig as Gf,isArray as ia,isString as vi}from"/-/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/dist=es2020,mode=imports,min/optimized/vega.js";import{parseSelector as cn}from"/-/vega-event-selector@v3.0.1-UgiEAWJA4WQL4DTKnV4R/dist=es2020,mode=imports,min/optimized/vega-event-selector.js";import{parseExpression as Vf}from"/-/vega-expression@v5.1.1-K4clrYr2THuj5KncykTn/dist=es2020,mode=imports,min/optimized/vega-expression.js";const Xf="vega-lite",Yf='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',Kf="5.20.1",Qf=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],Zf="https://vega.github.io/vega-lite/",Jf="Vega-Lite is a concise high-level language for interactive visualization.",ed=["vega","chart","visualization"],td="build/vega-lite.js",nd="build/vega-lite.min.js",id="build/vega-lite.min.js",rd="build/src/index",sd="build/src/index.d.ts",od={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},ad=["bin","build","src","vega-lite*","tsconfig.json"],cd={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data","build-editor-preview":"scripts/build-editor-preview.sh",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},ud={type:"git",url:"https://github.com/vega/vega-lite.git"},ld="BSD-3-Clause",fd={url:"https://github.com/vega/vega-lite/issues"},dd={"@babel/core":"^7.24.7","@babel/preset-env":"^7.24.7","@babel/preset-typescript":"^7.24.7","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-alias":"^5.1.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@types/d3":"^7.4.3","@types/jest":"^29.5.12","@types/pako":"^2.0.3","@typescript-eslint/eslint-plugin":"^7.13.0","@typescript-eslint/parser":"^7.13.0",ajv:"^8.16.0","ajv-formats":"^2.1.1",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^4.1.0",d3:"^7.9.0","del-cli":"^5.1.0",eslint:"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^27.9.0","eslint-plugin-prettier":"^5.1.3","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.9.0",jest:"^29.7.0","jest-dev-server":"^10.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.3.2",puppeteer:"^15.0.0","release-it":"17.2.1",rollup:"^4.18.0","rollup-plugin-bundle-size":"^1.0.3",serve:"^14.2.3",terser:"^5.31.1","ts-jest":"^29.1.4","ts-json-schema-generator":"^1.5.0",typescript:"~5.4.5","vega-cli":"^5.28.0","vega-datasets":"^2.8.1","vega-embed":"^6.25.0","vega-tooltip":"^0.34.0","yaml-front-matter":"^4.1.1"},pd={"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.3","vega-event-selector":"~3.0.1","vega-expression":"~5.1.0","vega-util":"~1.17.2",yargs:"~17.7.2"},gd={vega:"^5.24.0"},hd={node:">=18"},md="yarn@1.22.19";var yd={name:Xf,author:Yf,version:Kf,collaborators:Qf,homepage:Zf,description:Jf,keywords:ed,main:td,unpkg:nd,jsdelivr:id,module:rd,types:sd,bin:od,files:ad,scripts:cd,repository:ud,license:ld,bugs:fd,devDependencies:dd,dependencies:pd,peerDependencies:gd,engines:hd,packageManager:md};function Ir(e){return!!e.or}function Lr(e){return!!e.and}function Mr(e){return!!e.not}function wi(e,t){if(Mr(e))wi(e.not,t);else if(Lr(e))for(const n of e.and)wi(n,t);else if(Ir(e))for(const n of e.or)wi(n,t);else t(e)}function un(e,t){return Mr(e)?{not:un(e.not,t)}:Lr(e)?{and:e.and.map(n=>un(n,t))}:Ir(e)?{or:e.or.map(n=>un(n,t))}:t(e)}const C=structuredClone;function ra(e){throw new Error(e)}function ln(e,t){const n={};for(const i of t)on(e,i)&&(n[i]=e[i]);return n}function pe(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>D(e)).join(",")})`};function P(e){if(j(e))return e;const t=N(e)?e:D(e);if(t.length<250)return t;let n=0;for(let i=0;ia===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function Wr(e,t){return e===void 0||t===void 0?!0:Ur(Br(e),Br(t))}function M(e){return b(e).length===0}const b=Object.keys,ie=Object.values,bt=Object.entries;function Bn(e){return e===!0||e===!1}function W(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Wn(e,t){return Mr(e)?`!(${Wn(e.not,t)})`:Lr(e)?`(${e.and.map(n=>Wn(n,t)).join(") && (")})`:Ir(e)?`(${e.or.map(n=>Wn(n,t)).join(") || (")})`:t(e)}function $i(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&$i(e[n],t)&&delete e[n],M(e)}function Hn(e){return e.charAt(0).toUpperCase()+e.substr(1)}function Hr(e,t="datum"){const n=an(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(O).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function aa(e,t="datum"){return`${t}[${O(an(e).join("."))}]`}function Sd(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function we(e){return`${an(e).map(Sd).join("\\.")}`}function Lt(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function dn(e){return`${an(e).join(".")}`}function pn(e){return e?an(e).length:0}function X(...e){for(const t of e)if(t!==void 0)return t;return}let ca=42;function ua(e){const t=++ca;return e?String(e)+t:t}function vd(){ca=42}function la(e){return fa(e)?e:`__${e}`}function fa(e){return e.startsWith("__")}function qn(e){return e===void 0?void 0:(e%360+360)%360}function Ei(e){return j(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const da=Object.getPrototypeOf(structuredClone({}));function be(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!be(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;for(i of e.entries())if(!be(i[1],t.get(i[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==da.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==da.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!be(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function D(e){const t=[];return function n(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let r,s;if(Array.isArray(i)){for(s="[",r=0;rPi(e[t])?W(`_${t}_${bt(e[t])}`):W(`_${t}_${e[t]}`)).join("")}function U(e){return e===!0||Ut(e)&&!e.binned}function re(e){return e==="binned"||Ut(e)&&e.binned===!0}function Ut(e){return z(e)}function Pi(e){return e?.param}function ka(e){switch(e){case tt:case nt:case st:case ge:case Be:case We:case wt:case ot:case St:case vt:case he:return 6;case $t:return 4;default:return 10}}function Yn(e){return!!e?.expr}function oe(e,{level:t}={level:0}){const n=b(e||{}),i={};for(const r of n)i[r]=t===0?xe(e[r]):oe(e[r],{level:t-1});return i}function Ca(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:c,subtitleFont:u,subtitleFontSize:l,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:p,subtitlePadding:h,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},v={...c?{subtitleColor:c}:{},...u?{subtitleFont:u}:{},...l?{subtitleFontSize:l}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...p?{subtitleLineHeight:p}:{},...h?{subtitlePadding:h}:{}},k=ln(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:k,nonMarkTitleProperties:y,subtitle:v}}function kt(e){return N(e)||E(e)&&N(e[0])}function $(e){return!!e?.signal}function Ct(e){return!!e.step}function qd(e){return E(e)?!1:"fields"in e&&!("data"in e)}function Gd(e){return E(e)?!1:"fields"in e&&"data"in e}function ut(e){return E(e)?!1:"field"in e&&"data"in e}const Vd={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},Xd=b(Vd),Yd={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},es=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function Fa(e){const t=E(e.condition)?e.condition.map(Na):Na(e.condition);return{...xe(e),condition:t}}function xe(e){if(Yn(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Na(e){if(Yn(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function B(e){if(Yn(e)){const{expr:t,...n}=e;return{signal:t,...n}}return $(e)?e:e!==void 0?{value:e}:void 0}function ts(e){return $(e)?e.signal:O(e)}function Ta(e){return $(e)?e.signal:O(e.value)}function Oe(e){return $(e)?e.signal:e==null?null:O(e)}function Kd(e,t,n){for(const i of n){const r=Ge(i,t.markDef,t.config);r!==void 0&&(e[i]=B(r))}return e}function Aa(e){return[].concat(e.type,e.style??[])}function R(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&t[r]!==void 0?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:Ge(e,t,n,i)}function Ge(e,t,n,{vgChannel:i}={}){return X(i?zi(e,t,n.style):void 0,zi(e,t,n.style),i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function zi(e,t,n){return Oa(e,Aa(t),n)}function Oa(e,t,n){t=V(t);let i;for(const r of t){const s=n[r];s&&s[e]!==void 0&&(i=s[e])}return i}function Pa(e,t){return V(e).reduce((n,i)=>(n.field.push(w(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function za(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(be(r,i))return;n.push(i)}),n}function Ra(e,t){return be(e,t)||!t?e:e?[...V(e),...V(t)].join(", "):t}function Ia(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((kt(n)||$(n))&&(kt(i)||$(i)))return{explicit:e.explicit,value:Ra(n,i)};if(kt(n)||$(n))return{explicit:e.explicit,value:n};if(kt(i)||$(i))return{explicit:e.explicit,value:i};if(!kt(n)&&!$(n)&&!kt(i)&&!$(i))return{explicit:e.explicit,value:za(n,i)};throw new Error("It should never reach here")}function ns(e){return`Invalid specification ${D(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Qd='Autosize "fit" only works for single views and layered views.';function La(e){const t=e=="width"?"Width":"Height";return`${t} "container" only works for single views and layered views.`}function Ma(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function Da(e){return e?`Dropping "fit-${e}" because spec has discrete ${me(e)}.`:'Dropping "fit" because spec has discrete size.'}function is(e){return`Unknown field for ${e}. Cannot calculate view size.`}function ja(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Zd(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Jd(e){return`The "nearest" transform is not supported for ${e} marks.`}function Ua(e){return`Selection not supported for ${e} yet.`}function ep(e){return`Cannot find a selection named "${e}".`}const tp="Scale bindings are currently only supported for scales with unbinned, continuous domains.",np="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",ip="Legend bindings are only supported for selections over an individual field or encoding channel.";function rp(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function sp(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const op="The same selection must be used to override scale domains in a layered view.",ap='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function cp(e){return`Unknown repeated value "${e}".`}function Ba(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const up="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function lp(e){return`Unrecognized parse "${e}".`}function Wa(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const fp="Attempt to add the same child twice.";function dp(e){return`Ignoring an invalid transform: ${D(e)}.`}const pp='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function Ha(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function gp(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${D(t)} is overridden by a child projection ${D(n)}.`}const hp="Arc marks uses theta channel rather than angle, replacing angle with theta.";function mp(e){return`${e}Offset dropped because ${e} is continuous`}function yp(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${D(n)}}.`}function qa(e){return`Invalid field type "${e}".`}function bp(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function xp(e){return`Invalid aggregation operator "${e}".`}function Ga(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function Sp(e){return`Position range does not support relative band size for ${e}.`}function rs(e,t){return`Dropping ${D(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const vp="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function Ri(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function wp(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function $p(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Ep(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function _p(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function ss(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function kp(e){return`The ${e} for range marks cannot be an expression`}function Cp(e,t){const n=e&&t?"x2 and y2":e?"x2":"y2";return`Line mark is for continuous lines and thus cannot be used with ${n}. We will use the rule mark (line segments) instead.`}function Fp(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Np(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Tp(e){return`Cannot use the relative band size with ${e} scale.`}function Ap(e){return`Using unaggregated domain with raw field has no effect (${D(e)}).`}function Op(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Pp(e){return`Unaggregated domain is currently unsupported for log scale (${D(e)}).`}function zp(e){return`Cannot apply size to non-oriented mark "${e}".`}function Rp(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Ip(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function Va(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function Xa(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Lp(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${D(n)} and ${D(i)}). Using ${D(n)}.`}function Mp(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${D(n)} and ${D(i)}). Using the union of the two domains.`}function Dp(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function jp(e){return`Dropping sort property ${D(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const Ya="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Up="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",Bp="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",Wp="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function Hp(e){return`Cannot stack "${e}" if there is already "${e}2".`}function qp(e){return`Stack is applied to a non-linear scale (${e}).`}function Gp(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function Ii(e,t){return`Invalid ${e}: ${D(t)}.`}function Vp(e){return`Dropping day from datetime ${D(e)} as day cannot be combined with other units.`}function Xp(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Yp(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Kp(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function Ka(e){return`1D error band does not support ${e}.`}function Qa(e){return`Channel ${e} is required for "binned" bin.`}function Qp(e){return`Channel ${e} should not be used with "binned" bin.`}function Zp(e){return`Domain for ${e} is required for threshold scale.`}var $v=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},Ev=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)};const Za=Bf(Wf);let yn=Za;function Jp(e){return yn=e,yn}function eg(){return yn=Za,yn}function x(...e){yn.warn(...e)}function tg(...e){yn.debug(...e)}function Bt(e){if(e&&z(e)){for(const t of as)if(t in e)return!0}return!1}const Ja=["january","february","march","april","may","june","july","august","september","october","november","december"],ng=Ja.map(e=>e.substr(0,3)),ec=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],ig=ec.map(e=>e.substr(0,3));function rg(e){if(Ei(e)&&(e=+e),j(e))return e>4&&x(Ii("quarter",e)),e-1;throw new Error(Ii("quarter",e))}function sg(e){if(Ei(e)&&(e=+e),j(e))return e-1;{const t=e.toLowerCase(),n=Ja.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=ng.indexOf(i);if(r!==-1)return r;throw new Error(Ii("month",e))}}function og(e){if(Ei(e)&&(e=+e),j(e))return e%7;{const t=e.toLowerCase(),n=ec.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=ig.indexOf(i);if(r!==-1)return r;throw new Error(Ii("day",e))}}function os(e,t){const n=[];if(t&&e.day!==void 0&&(b(e).length>1&&(x(Vp(e)),e=C(e),delete e.day)),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?sg(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?rg(e.quarter):e.quarter;n.push(j(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?og(e.day):e.day;n.push(j(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r=="undefined"?0:r)}return n}function Wt(e){const t=os(e,!0),n=t.join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function ag(e){const t=os(e,!1),n=t.join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function cg(e){const t=os(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const tc={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},as=b(tc);function ug(e){return!!tc[e]}function Ht(e){return z(e)?e.binned:nc(e)}function nc(e){return e&&e.startsWith("binned")}function cs(e){return e.startsWith("utc")}function lg(e){return e.substring(3)}const fg={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Li(e){return as.filter(t=>rc(e,t))}function ic(e){const t=Li(e);return t[t.length-1]}function rc(e,t){const n=e.indexOf(t);return n<0||(n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o")?!1:!(n>0&&t==="year"&&e.charAt(n-1)==="f")}function dg(e,t,{end:n}={end:!1}){const i=Hr(t),r=cs(e)?"utc":"";function s(c){return c==="quarter"?`(${r}quarter(${i})-1)`:`${r}${c}(${i})`}let o;const a={};for(const c of as)rc(e,c)&&(a[c]=s(c),o=c);return n&&(a[o]+="+1"),ag(a)}function sc(e){if(!e)return;const t=Li(e);return`timeUnitSpecifier(${D(t)}, ${D(fg)})`}function pg(e,t,n){if(!e)return;const i=sc(e),r=n||cs(e);return`${r?"utc":"time"}Format(${t}, ${i})`}function Z(e){if(!e)return;let t;return N(e)?nc(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:z(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),cs(t.unit)&&(t.utc=!0,t.unit=lg(t.unit)),t}function gg(e){const{utc:t,...n}=Z(e);return n.unit?(t?"utc":"")+b(n).map(i=>W(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+b(n).map(i=>W(`_${i}_${n[i]}`)).join("")}function oc(e,t=n=>n){const n=Z(e),i=ic(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:o}=ac(i,n.step),a={...r,[o]:+r[o]+s};return`${t(Wt(a))} - ${t(Wt(r))}`}return}const hg={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function mg(e){return!!hg[e]}function ac(e,t=1){if(mg(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function yg(e){return e?.param}function us(e){return!!e?.field&&e.equal!==void 0}function ls(e){return!!e?.field&&e.lt!==void 0}function fs(e){return!!e?.field&&e.lte!==void 0}function ds(e){return!!e?.field&&e.gt!==void 0}function ps(e){return!!e?.field&&e.gte!==void 0}function gs(e){if(e?.field){if(E(e.range)&&e.range.length===2)return!0;if($(e.range))return!0}return!1}function hs(e){return!!e?.field&&(E(e.oneOf)||E(e.in))}function bg(e){return!!e?.field&&e.valid!==void 0}function cc(e){return hs(e)||us(e)||gs(e)||ls(e)||ds(e)||fs(e)||ps(e)}function Ve(e,t){return Ji(e,{timeUnit:t,wrapTime:!0})}function xg(e,t){return e.map(n=>Ve(n,t))}function uc(e,t=!0){const{field:n}=e,i=Z(e.timeUnit),{unit:r,binned:s}=i||{},o=w(e,{expr:"datum"}),a=r?`time(${s?o:dg(r,n)})`:o;if(us(e))return`${a}===${Ve(e.equal,r)}`;if(ls(e)){const c=e.lt;return`${a}<${Ve(c,r)}`}else if(ds(e)){const c=e.gt;return`${a}>${Ve(c,r)}`}else if(fs(e)){const c=e.lte;return`${a}<=${Ve(c,r)}`}else if(ps(e)){const c=e.gte;return`${a}>=${Ve(c,r)}`}else{if(hs(e))return`indexof([${xg(e.oneOf,r).join(",")}], ${a}) !== -1`;if(bg(e))return Mi(a,e.valid);if(gs(e)){const{range:c}=e,u=$(c)?{signal:`${c.signal}[0]`}:c[0],l=$(c)?{signal:`${c.signal}[1]`}:c[1];if(u!==null&&l!==null&&t)return"inrange("+a+", ["+Ve(u,r)+", "+Ve(l,r)+"])";const f=[];return u!==null&&f.push(`${a} >= ${Ve(u,r)}`),l!==null&&f.push(`${a} <= ${Ve(l,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${D(e)}`)}function Mi(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Sg(e){return cc(e)&&e.timeUnit?{...e,timeUnit:Z(e.timeUnit)}:e}const Kn={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function vg(e){return e==="quantitative"||e==="temporal"}function lc(e){return e==="ordinal"||e==="nominal"}const qt=Kn.quantitative,ms=Kn.ordinal,bn=Kn.temporal,ys=Kn.nominal,xn=Kn.geojson;function wg(e){if(e){e=e.toLowerCase();switch(e){case"q":case qt:return"quantitative";case"t":case bn:return"temporal";case"o":case ms:return"ordinal";case"n":case ys:return"nominal";case xn:return"geojson"}}return}const se={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},bs={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function $g(e,t){const n=bs[e],i=bs[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const Eg={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function fc(e){return Eg[e]}const dc=new Set(["linear","log","pow","sqrt","symlog"]),pc=new Set([...dc,"time","utc"]);function gc(e){return dc.has(e)}const hc=new Set(["quantile","quantize","threshold"]),_g=new Set([...pc,...hc,"sequential","identity"]),kg=new Set(["ordinal","bin-ordinal","point","band"]);function J(e){return kg.has(e)}function Pe(e){return _g.has(e)}function Xe(e){return pc.has(e)}function Sn(e){return hc.has(e)}const Cg={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function Fg(e){return!N(e)&&!!e.name}function mc(e){return e?.param}function Ng(e){return e?.unionWith}function Tg(e){return Rr(e)&&"field"in e}const Ag={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:_v,domain:kv,range:Cv,rangeMax:Fv,rangeMin:Nv,scheme:Tv,...Og}=Ag,Pg=b(Og);function xs(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return Xe(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return Xe(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return Xe(e);case"nice":return Xe(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Pe(e)&&!A(["log","time","utc","threshold","quantile"],e)}}function yc(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return mn(e)?void 0:Np(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function zg(e,t){return A([ms,ys],t)?e===void 0||J(e):t===bn?A([se.TIME,se.UTC,void 0],e):t===qt?gc(e)||Sn(e)||e===void 0:!0}function Rg(e,t,n=!1){if(!qe(e))return!1;switch(e){case H:case Q:case xt:case gn:case $e:case Fe:return Xe(t)||t==="band"?!0:t==="point"?!n:!1;case st:case wt:case ot:case St:case vt:case Mt:return Xe(t)||Sn(t)||A(["band","point","ordinal"],t);case ge:case Be:case We:return t!=="band";case $t:case he:return t==="ordinal"||Sn(t)}}function Ig(e){return z(e)&&"value"in e}const le={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},bc=le.arc,Di=le.area,ji=le.bar,Lg=le.image,Ui=le.line,Bi=le.point,Mg=le.rect,Wi=le.rule,xc=le.text,Ss=le.tick,Dg=le.trail,vs=le.circle,ws=le.square,Sc=le.geoshape;function Ft(e){return["line","area","trail"].includes(e)}function Qn(e){return["rect","bar","image","arc"].includes(e)}const jg=new Set(b(le));function Ye(e){return e.type}const Ug=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],Bg=["fill","fillOpacity"],Wg=[...Ug,...Bg],Hg={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},vc=b(Hg),qg={area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]},Gg={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},Vg={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},wc=b(Vg);function Gt(e){return e&&e.band!=null}const Xg={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},$c=5,Yg={binSpacing:1,continuousBandSize:$c,minBandSize:.25,timeUnitBandPosition:.5},Kg={binSpacing:0,continuousBandSize:$c,minBandSize:.25,timeUnitBandPosition:.5},Qg={thickness:1};function Zg(e){return Ye(e)?e.type:e}function Ec(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function $s({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){if(!i||!Pe(i)||r)return"always-valid";const s=Ec(R("invalid",e,t),{isPath:Ft(e.type)}),o=t.scale?.invalid?.[n];return o!==void 0?"show":s}function Jg(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function _c({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,s=`peek(${i})`,o=t.domainHasZero();if(o==="definitely")return{scale:e,value:0};if(o==="maybe"){const a=n==="zeroOrMin"?r:s;return{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${a})`}}else return{signal:`scale('${e}', ${n==="zeroOrMin"?r:s})`}}function kc({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:s}){const o=n?.get("type"),a=Ie(t),c=Oi(a?.aggregate),u=$s({scaleChannel:e,markDef:r,config:s,scaleType:o,isCountAggregate:c});if(a&&u==="show"){const l=s.scale.invalid?.[e]??"zero-or-min";return{test:Mi(w(a,{expr:"datum"}),!1),...eh(l,n,i)}}return}function eh(e,t,n){if(Ig(e)){const{value:i}=e;return $(i)?{signal:i.signal}:{value:i}}return _c({scale:t,scaleName:n,mode:"zeroOrMin"})}function Es(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:s,config:o}=e,a=jt(t),c=_s(e),u=kc({scaleChannel:a,channelDef:n,scale:r,scaleName:s,markDef:i,config:o});return u!==void 0?[u,c]:c}function th(e){const{datum:t}=e;return Bt(t)?Wt(t):`${D(t)}`}function Vt(e,t,n,i){const r={};if(t&&(r.scale=t),Ke(e)){const{datum:s}=e;Bt(s)?r.signal=Wt(s):$(s)?r.signal=s.signal:Yn(s)?r.signal=s.expr:r.value=s}else r.field=w(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function Hi({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:o=.5}){const a=!$(o)&&0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return mh(e);default:return hh(e,t)}};let Wc=Bc;function Hc(e){Wc=e}function yh(){Hc(Bc)}function $n(e,t,{allowDisabling:n,includeDefault:i=!0}){const r=Ts(e)?.title;if(!S(e))return r??e.title;const s=e,o=i?As(s,t):void 0;return n?X(r,s.title,o):r??s.title??o}function Ts(e){return wn(e)&&e.axis?e.axis:jc(e)&&e.legend?e.legend:Fs(e)&&e.header?e.header:void 0}function As(e,t){return Wc(e,t)}function Ki(e){if(Uc(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=Ts(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function bh(e,t){switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Ns(e)&&E(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!_t(n)&&!ct(n))return"quantitative";if(Yt(e)&&e.scale?.type)switch(bs[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Ie(e){return S(e)?e:Vi(e)?e.condition:void 0}function K(e){return F(e)?e:ni(e)?e.condition:void 0}function qc(e,t,n,i={}){if(N(e)||j(e)||Un(e)){const r=N(e)?"string":j(e)?"number":"boolean";return x(yp(t,r,e)),{value:e}}return F(e)?Qi(e,t,n,i):ni(e)?{...e,condition:Qi(e.condition,t,n,i)}:e}function Qi(e,t,n,i){if(Uc(e)){const{format:r,formatType:s,...o}=e;if(Xt(s)&&!n.customFormatTypes)return x(Ha(t)),Qi(o,t,n,i)}else{const r=wn(e)?"axis":jc(e)?"legend":Fs(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(Xt(o)&&!n.customFormatTypes)return x(Ha(t)),Qi({...e,[r]:a},t,n,i)}}return S(e)?Os(e,t,i):xh(e)}function xh(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=j(n)?"quantitative":N(n)?"nominal":Bt(n)?"temporal":void 0,{...e,type:t}}function Os(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!Jr(i)&&!_t(i)&&!ct(i)&&(x(xp(i)),delete a.aggregate),r&&(a.timeUnit=Z(r)),o&&(a.field=`${o}`),U(s)&&(a.bin=Zi(s,t)),re(s)&&!Y(t)&&x(Qp(t)),fe(a)){const{type:c}=a,u=wg(c);c!==u&&(a.type=u),c!=="quantitative"&&(Oi(i)&&(x(bp(c,i)),a.type="quantitative"))}else if(!xa(t)){const c=bh(a,t);a.type=c}if(fe(a)){const{compatible:c,warning:u}=Sh(a,t)||{};c===!1&&x(u)}if(Ns(a)&&N(a.sort)){const{sort:c}=a;if(Pc(c))return{...a,sort:{encoding:c}};const u=c.substr(1);if(c.charAt(0)==="-"&&Pc(u))return{...a,sort:{encoding:u,order:"descending"}}}if(Fs(a)){const{header:c}=a;if(c){const{orient:u,...l}=c;if(u)return{...a,header:{...l,labelOrient:c.labelOrient||u,titleOrient:c.titleOrient||u}}}}return a}function Zi(e,t){return Un(e)?{maxbins:ka(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:ka(t)}:e}const En={compatible:!0};function Sh(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case tt:case nt:case _i:return Yi(e)?En:{compatible:!1,warning:$p(t)};case H:case Q:case xt:case gn:case ge:case Be:case We:case Gn:case Vn:case ki:case Dt:case Ci:case Fi:case Mt:case $e:case Fe:case Ni:return En;case Te:case Ee:case Ne:case Ae:return n!==qt?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:En;case ot:case St:case vt:case wt:case st:case rt:case it:case Ce:case Ue:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:En;case he:case $t:return!Yi(e)&&!ph(e)?{compatible:!1,warning:Ep(t)}:En;case hn:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:En}}function _n(e){const{formatType:t}=Ki(e);return t==="time"||!t&&vh(e)}function vh(e){return e&&(e.type==="temporal"||S(e)&&!!e.timeUnit)}function Ji(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){const s=t&&Z(t)?.unit;let o=s||n==="temporal",a;return Yn(e)?a=e.expr:$(e)?a=e.signal:Bt(e)?(o=!0,a=Wt(e)):(N(e)||j(e))&&(o&&(a=`datetime(${D(e)})`,ug(s)&&((j(e)&&e<1e4||N(e)&&isNaN(Date.parse(e)))&&(a=Wt({[s]:e}))))),a?i&&o?`time(${a})`:a:r?void 0:D(e)}function Gc(e,t){const{type:n}=e;return t.map(i=>{const r=S(e)&&!Ht(e.timeUnit)?e.timeUnit:void 0,s=Ji(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function ii(e,t){return U(e.bin)?qe(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const Vc={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function ri(e){return e?.condition}const Xc=["domain","grid","labels","ticks","title"],wh={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},Yc={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},$h={...Yc,style:1,labelExpr:1,encoding:1};function Kc(e){return!!$h[e]}const Eh={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},Qc=b(Eh);function ft(e){return"mark"in e}class er{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return ft(t)?Zg(t.mark)===this.name:!1}}function Kt(e,t){const n=e&&e[t];return n?E(n)?fn(n,i=>!!i.field):S(n)||Vi(n):!1}function Zc(e,t){const n=e&&e[t];return n?E(n)?fn(n,i=>!!i.field):S(n)||Ke(n)||ni(n):!1}function Jc(e,t){if(Y(t)){const n=e[t];if((S(n)||Ke(n))&&(lc(n.type)||S(n)&&n.timeUnit)){const i=Ti(t);return Zc(e,i)}}return!1}function eu(e){return fn(Ed,t=>{if(Kt(e,t)){const n=e[t];if(E(n))return fn(n,i=>!!i.aggregate);{const i=Ie(n);return i&&!!i.aggregate}}return!1})}function tu(e,t){const n=[],i=[],r=[],s=[],o={};return Ps(e,(a,c)=>{if(S(a)){const{field:u,aggregate:l,bin:f,timeUnit:d,...p}=a;if(l||d||f){const h=Ts(a),g=h?.title;let m=w(a,{forAs:!0});const y={...g?[]:{title:$n(a,t,{allowDisabling:!0})},...p,field:m};if(l){let v;if(_t(l)?(v="argmax",m=w({op:"argmax",field:l.argmax},{forAs:!0}),y.field=`${m}.${u}`):ct(l)?(v="argmin",m=w({op:"argmin",field:l.argmin},{forAs:!0}),y.field=`${m}.${u}`):l!=="boxplot"&&l!=="errorbar"&&l!=="errorband"&&(v=l),v){const k={op:v,as:m};u&&(k.field=u),s.push(k)}}else if(n.push(m),fe(a)&&U(f)){if(i.push({bin:f,field:u,as:m}),n.push(w(a,{binSuffix:"end"})),ii(a,c)&&n.push(w(a,{binSuffix:"range"})),Y(c)){const v={field:`${m}_end`};o[`${c}2`]=v}y.bin="binned",xa(c)||(y.type=qt)}else if(d&&!Ht(d)){r.push({timeUnit:d,field:u,as:m});const v=fe(a)&&a.type!==bn&&"time";v&&(c===Gn||c===Dt?y.formatType=v:zd(c)?y.legend={formatType:v,...y.legend}:Y(c)&&(y.axis={formatType:v,...y.axis}))}o[c]=y}else n.push(u),o[c]=e[c]}else o[c]=e[c]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function _h(e,t,n){const i=Id(t,n);if(i){if(i==="binned"){const r=e[t===Ce?H:Q];return!!(S(r)&&S(e[t])&&re(r.bin))}}else return!1;return!0}function kh(e,t,n,i){const r={};for(const s of b(e))ba(s)||x(wp(s));for(let s of Td){if(!e[s])continue;const o=e[s];if(Xn(s)){const a=Nd(s),c=r[a];if(S(c)&&(vg(c.type)&&(S(o)&&!c.timeUnit))){x(mp(a));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(x(hp),s=$e),!_h(e,s,t)){x(Ri(s,t));continue}if(s===st&&t==="line"){const a=Ie(e[s]);if(a?.aggregate){x(vp);continue}}if(s===ge&&(n?"fill"in e:"stroke"in e)){x(Ga("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===Vn||s===hn&&!E(o)&&!Re(o)||s===Dt&&E(o)){if(o){if(s===hn){const a=e[s];if(Mc(a)){r[s]=a;continue}}r[s]=V(o).reduce((a,c)=>(S(c)?a.push(Os(c,s)):x(rs(c,s)),a),[])}}else{if(s===Dt&&o===null)r[s]=null;else if(!S(o)&&!Ke(o)&&!Re(o)&&!ti(o)&&!$(o)){x(rs(o,s));continue}r[s]=qc(o,s,i)}}return r}function tr(e,t){const n={};for(const i of b(e)){const r=qc(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Ch(e){const t=[];for(const n of b(e))if(Kt(e,n)){const i=e[n],r=V(i);for(const s of r)S(s)?t.push(s):Vi(s)&&t.push(s.condition)}return t}function Ps(e,t,n){if(!e)return;for(const i of b(e)){const r=e[i];if(E(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function Fh(e,t,n,i){return e?b(e).reduce((r,s)=>{const o=e[s];return E(o)?o.reduce((a,c)=>t.call(i,a,c,s),r):t.call(i,r,o,s)},n):n}function nu(e,t){return b(t).reduce((n,i)=>{switch(i){case H:case Q:case Ci:case Ni:case Fi:case Ce:case Ue:case xt:case gn:case $e:case rt:case Fe:case it:case Ne:case Te:case Ae:case Ee:case Gn:case he:case Mt:case Dt:return n;case hn:if(e==="line"||e==="trail")return n;case Vn:case ki:{const r=t[i];if(E(r)||S(r))for(const s of V(r))s.aggregate||n.push(w(s,{}));return n}case st:if(e==="trail")return n;case ge:case Be:case We:case ot:case St:case vt:case $t:case wt:{const r=Ie(t[i]);return r&&!r.aggregate&&n.push(w(r,{})),n}}},[])}function Nh(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(E(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return E(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function zs(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const c=i?` of ${Rs(t)}`:"";return{field:o+t.field,type:t.type,title:$(a)?{signal:`${a}"${escape(c)}"`}:a+c}}),s=Ch(n).map(fh);return{tooltip:[...r,...je(s,P)]}}function Rs(e){const{title:t,field:n}=e;return X(t,n)}function Is(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:c,positionPrefix:u,endPositionPrefix:l=void 0,extraEncoding:f={}})=>{const d=Rs(n);return iu(e,a,r,{mark:c,encoding:{[t]:{field:`${u}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...N(l)?{[`${t}2`]:{field:`${l}_${n.field}`}}:{},...i,...f}})}}function iu(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...Ye(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...Un(e[t])?{}:e[t]}}]:[]}function ru(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],c=i[`${r}Error2`];return{continuousAxisChannelDef:nr(s,n),continuousAxisChannelDef2:nr(o,n),continuousAxisChannelDefError:nr(a,n),continuousAxisChannelDefError2:nr(c,n),continuousAxis:r}}function nr(e,t){if(e?.aggregate){const{aggregate:n,...i}=e;return n!==t&&x(Kp(n,t)),i}else return e}function su(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(Ye(n)&&n.orient)return n.orient;if(Tt(r)){if(Tt(s)){const o=S(r)&&r.aggregate,a=S(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return _n(s)&&!_n(r)?"horizontal":"vertical"}return"horizontal"}else{if(Tt(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const ir="boxplot",Th=["box","median","outliers","rule","ticks"],Ah=new er(ir,au);function ou(e){return j(e)?"tukey":e}function au(e,{config:t}){e={...e,encoding:tr(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=Ye(n)?n:{type:n};r&&x(Ua("boxplot"));const c=a.extent??t.boxplot.extent,u=R("size",a,t),l=a.invalid,f=ou(c),{bins:d,timeUnits:p,transform:h,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:v,encodingWithoutContinuousAxis:k,ticksOrient:_,boxOrient:T,customTooltipWithoutAggregatedField:L}=Oh(e,c,t),ue=dn(g.field),{color:ne,size:mt,...de}=k,yt=jf=>Is(a,m,g,jf,t.boxplot),sn=yt(de),hi=yt(k),mi=(z(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",yi=yt({...de,...mt?{size:mt}:{},color:{condition:{test:`datum['lower_box_${g.field}'] >= datum['upper_box_${g.field}']`,...ne||{value:mi}}}}),jn=zs([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,k),Bo={type:"tick",color:"black",opacity:1,orient:_,invalid:l,aria:!1},bi=f==="min-max"?jn:zs([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,k),Wo=[...sn({partName:"rule",mark:{type:"rule",invalid:l,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:bi}),...sn({partName:"rule",mark:{type:"rule",invalid:l,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:bi}),...sn({partName:"ticks",mark:Bo,positionPrefix:"lower_whisker",extraEncoding:bi}),...sn({partName:"ticks",mark:Bo,positionPrefix:"upper_whisker",extraEncoding:bi})],Ho=[...f!=="tukey"?Wo:[],...hi({partName:"box",mark:{type:"bar",...u?{size:u}:{},orient:T,invalid:l,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:jn}),...yi({partName:"median",mark:{type:"tick",invalid:l,...z(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...u?{size:u}:{},orient:_,aria:!1},positionPrefix:"mid_box",extraEncoding:jn})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(h),layer:Ho};const qo=`datum["lower_box_${g.field}"]`,Go=`datum["upper_box_${g.field}"]`,Vo=`(${Go} - ${qo})`,Xo=`${qo} - ${c} * ${Vo}`,Yo=`${Go} + ${c} * ${Vo}`,xi=`datum["${g.field}"]`,Lf={joinaggregate:cu(g.field),groupby:y},Ko={transform:[{filter:`(${Xo} <= ${xi}) && (${xi} <= ${Yo})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${ue}`},{op:"max",field:g.field,as:`upper_whisker_${ue}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${ue}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${ue}`},...v],groupby:y}],layer:Wo},{tooltip:WS,...Mf}=de,{scale:Qo,axis:Df}=g,Zo=Rs(g),Jo=pe(Df,["title"]),ea=iu(a,"outliers",t.boxplot,{transform:[{filter:`(${xi} < ${Xo}) || (${xi} > ${Yo})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...Zo!==void 0?{title:Zo}:{},...Qo!==void 0?{scale:Qo}:{},...M(Jo)?{}:{axis:Jo}},...Mf,...ne?{color:ne}:{},...L?{tooltip:L}:{}}})[0];let Si;const ta=[...d,...p,Lf];return ea?Si={transform:ta,layer:[ea,Ko]}:(Si=Ko,Si.transform.unshift(...ta)),{...o,layer:[Si,{transform:h,layer:Ho}]}}function cu(e){const t=dn(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function Oh(e,t,n){const i=su(e,ir),{continuousAxisChannelDef:r,continuousAxis:s}=ru(e,i,ir),o=r.field,a=dn(o),c=ou(t),u=[...cu(o),{op:"median",field:o,as:`mid_box_${a}`},{op:"min",field:o,as:(c==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:o,as:(c==="min-max"?"upper_whisker_":"max_")+a}],l=c==="min-max"||c==="tukey"?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:`iqr_${a}`},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${t}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${t}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],{[s]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:p,filteredEncoding:h}=Nh(d),{bins:g,timeUnits:m,aggregate:y,groupby:v,encoding:k}=tu(h,n),_=i==="vertical"?"horizontal":"vertical",T=i,L=[...g,...m,{aggregate:[...y,...u],groupby:v},...l];return{bins:g,timeUnits:m,transform:L,groupby:v,aggregate:y,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:k,ticksOrient:_,boxOrient:T,customTooltipWithoutAggregatedField:p}}const Ls="errorbar",Ph=["ticks","rule"],zh=new er(Ls,uu);function uu(e,{config:t}){e={...e,encoding:tr(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:c,tooltipEncoding:u}=lu(e,Ls,t);delete s.size;const l=Is(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,p={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},h=[...l({partName:"ticks",mark:p,positionPrefix:"lower",extraEncoding:u}),...l({partName:"ticks",mark:p,positionPrefix:"upper",extraEncoding:u}),...l({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...c,transform:n,...h.length>1?{layer:h}:{...h[0]}}}function Rh(e,t){const{encoding:n}=e;if(Ih(n))return{orient:su(e,t),inputType:"raw"};const i=Lh(n),r=Mh(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,c=n.y2;if(F(a)&&F(c))throw new Error(`${t} cannot have both x2 and y2`);if(F(a)){if(Tt(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(F(c)){if(Tt(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,c=n.xError2,u=n.yError,l=n.yError2;if(F(c)&&!F(a))throw new Error(`${t} cannot have xError2 without xError`);if(F(l)&&!F(u))throw new Error(`${t} cannot have yError2 without yError`);if(F(a)&&F(u))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(F(a)){if(Tt(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(F(u)){if(Tt(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function Ih(e){return(F(e.x)||F(e.y))&&!F(e.x2)&&!F(e.y2)&&!F(e.xError)&&!F(e.xError2)&&!F(e.yError)&&!F(e.yError2)}function Lh(e){return F(e.x2)||F(e.y2)}function Mh(e){return F(e.xError)||F(e.xError2)||F(e.yError)||F(e.yError2)}function lu(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,c=Ye(i)?i:{type:i};s&&x(Ua(t));const{orient:u,inputType:l}=Rh(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:h,continuousAxis:g}=ru(e,u,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:k}=Dh(c,f,d,p,h,l,t,n),{[g]:_,[g==="x"?"x2":"y2"]:T,[g==="x"?"xError":"yError"]:L,[g==="x"?"xError2":"yError2"]:ue,...ne}=r,{bins:mt,timeUnits:de,aggregate:yt,groupby:sn,encoding:hi}=tu(ne,n),mi=[...yt,...m],yi=l!=="raw"?[]:sn,jn=zs(v,f,hi,k);return{transform:[...a.transform??[],...mt,...de,...mi.length===0?[]:[{aggregate:mi,groupby:yi}],...y],groupby:yi,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:hi,ticksOrient:u==="vertical"?"horizontal":"vertical",markDef:c,outerSpec:a,tooltipEncoding:jn}}function Dh(e,t,n,i,r,s,o,a){let c=[],u=[];const l=t.field;let f,d=!1;if(s==="raw"){const p=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,h=e.extent?e.extent:p==="mean"?"stderr":"iqr";if(p==="median"!==(h==="iqr")&&x(Yp(p,h,o)),h==="stderr"||h==="stdev")c=[{op:h,field:l,as:`extent_${l}`},{op:p,field:l,as:`center_${l}`}],u=[{calculate:`datum["center_${l}"] + datum["extent_${l}"]`,as:`upper_${l}`},{calculate:`datum["center_${l}"] - datum["extent_${l}"]`,as:`lower_${l}`}],f=[{fieldPrefix:"center_",titlePrefix:Hn(p)},{fieldPrefix:"upper_",titlePrefix:fu(p,h,"+")},{fieldPrefix:"lower_",titlePrefix:fu(p,h,"-")}],d=!0;else{let g,m,y;h==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),c=[{op:m,field:l,as:`lower_${l}`},{op:y,field:l,as:`upper_${l}`},{op:g,field:l,as:`center_${l}`}],f=[{fieldPrefix:"upper_",titlePrefix:$n({field:l,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:$n({field:l,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:$n({field:l,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&x(Xp(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],u=[{calculate:`datum["${n.field}"]`,as:`upper_${l}`},{calculate:`datum["${l}"]`,as:`lower_${l}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:l}],u=[{calculate:`datum["${l}"] + datum["${i.field}"]`,as:`upper_${l}`}],r?u.push({calculate:`datum["${l}"] + datum["${r.field}"]`,as:`lower_${l}`}):u.push({calculate:`datum["${l}"] - datum["${i.field}"]`,as:`lower_${l}`}));for(const p of u)f.push({fieldPrefix:p.as.substring(0,6),titlePrefix:Lt(Lt(p.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:u,errorBarSpecificAggregate:c,tooltipSummary:f,tooltipTitleWithFieldName:d}}function fu(e,t,n){return`${Hn(e)} ${n} ${t}`}const Ms="errorband",jh=["band","borders"],Uh=new er(Ms,du);function du(e,{config:t}){e={...e,encoding:tr(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:c}=lu(e,Ms,t),u=o,l=Is(u,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},p={type:f?"line":"rule"};const h={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(d={...d,...h,ariaRoleDescription:"errorband"},p={...p,...h,aria:!1}):u.interpolate?x(Ka("interpolate")):u.tension&&x(Ka("tension")),{...a,transform:n,layer:[...l({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c}),...l({partName:"borders",mark:p,positionPrefix:"lower",extraEncoding:c}),...l({partName:"borders",mark:p,positionPrefix:"upper",extraEncoding:c})]}}const pu={};function Ds(e,t,n){const i=new er(e,t);pu[e]={normalizer:i,parts:n}}function Bh(){return b(pu)}Ds(ir,au,Th),Ds(Ls,uu,Ph),Ds(Ms,du,jh);const Wh=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],gu={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},hu={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},Hh=b(gu),qh=b(hu),Gh={header:1,headerRow:1,headerColumn:1,headerFacet:1},mu=b(Gh),yu=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Vh={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Xh={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Le="_vgsid_",Yh={point:{on:"click",fields:[Le],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function js(e){return e==="legend"||!!e?.legend}function Us(e){return js(e)&&z(e)}function Bs(e){return!!e?.select}function bu(e){const t=[];for(const n of e||[]){if(Bs(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function Kh(e){return rr(e)||Hs(e)||Ws(e)}function Ws(e){return"concat"in e}function rr(e){return"vconcat"in e}function Hs(e){return"hconcat"in e}function xu({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function Qe(e){return z(e)&&e.step!==void 0}function Su(e){return e.view||e.width||e.height}const vu=20,Qh={align:1,bounds:1,center:1,columns:1,spacing:1},Zh=b(Qh);function Jh(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&((Gi(e)&&!ei(e.facet)||Ws(e))&&(r.columns=o)),rr(e)&&(r.columns=1);for(const a of Zh)if(e[a]!==void 0)if(a==="spacing"){const c=e[a];r[a]=j(c)?c:{row:c.row??s,column:c.column??s}}else r[a]=e[a];return r}function qs(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function sr(e,t){const n=or(e,t);return Qe(n)?n.step:wu}function or(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return X(n,{step:e.step})}const wu=20,em={continuousWidth:200,continuousHeight:200,step:wu},tm={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:em,mark:Gg,arc:{},area:{},bar:Yg,circle:{},geoshape:{},image:{},line:{},point:{},rect:Kg,rule:{color:"black"},square:{},text:{color:"black"},tick:Qg,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:Cg,projection:{},legend:Vh,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Yh,style:{},title:{},facet:{spacing:vu},concat:{spacing:vu},normalizedNumberFormat:".0%"},dt=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],$u={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},Eu={blue:dt[0],orange:dt[1],red:dt[2],teal:dt[3],green:dt[4],yellow:dt[5],purple:dt[6],pink:dt[7],brown:dt[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function nm(e={}){return{signals:[{name:"color",value:z(e)?{...Eu,...e}:Eu}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function im(e){return{signals:[{name:"fontSize",value:z(e)?{...$u,...e}:$u}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function rm(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function _u(e){const t=b(e||{}),n={};for(const i of t){const r=e[i];n[i]=ri(r)?Fa(r):xe(r)}return n}function sm(e){const t=b(e),n={};for(const i of t)n[i]=_u(e[i]);return n}const om=[...wc,...Qc,...mu,"background","padding","legend","lineBreak","scale","style","title","view"];function ku(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=na({},C(tm),n?rm(n):{},t?nm(t):{},i?im(i):{},s||{});r&&Gf(o,"selection",r,!0);const a=pe(o,om);for(const c of["background","lineBreak","padding"])o[c]&&(a[c]=xe(o[c]));for(const c of wc)o[c]&&(a[c]=oe(o[c]));for(const c of Qc)o[c]&&(a[c]=_u(o[c]));for(const c of mu)o[c]&&(a[c]=oe(o[c]));if(o.legend&&(a.legend=oe(o.legend)),o.scale){const{invalid:c,...u}=o.scale,l=oe(c,{level:1});a.scale={...oe(u),...b(l).length>0?{invalid:l}:{}}}return o.style&&(a.style=sm(o.style)),o.title&&(a.title=oe(o.title)),o.view&&(a.view=oe(o.view)),a}const am=new Set(["view",...jg]),cm=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],um={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...qg};function lm(e){e=C(e);for(const t of cm)delete e[t];if(e.axis)for(const t in e.axis)ri(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Wh)delete e.legend[t];if(e.mark){for(const t of vc)delete e.mark[t];e.mark.tooltip&&z(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(bu(e.params)),delete e.params);for(const t of am){for(const i of vc)delete e[t][i];const n=um[t];if(n)for(const i of n)delete e[t][i];dm(e,t)}for(const t of Bh())delete e[t];fm(e);for(const t in e)z(e[t])&&M(e[t])&&delete e[t];return M(e)?void 0:e}function fm(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=Ca(e.title);M(t)||(e.style["group-title"]={...e.style["group-title"],...t}),M(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),M(i)?delete e.title:e.title=i}function dm(e,t,n,i){const r=i?e[t][i]:e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};M(s)||(e.style[n??t]=s),i||delete e[t]}function ar(e){return"layer"in e}function pm(e){return"repeat"in e}function gm(e){return!E(e.repeat)&&e.repeat.layer}class Gs{map(t,n){return Gi(t)?this.mapFacet(t,n):pm(t)?this.mapRepeat(t,n):Hs(t)?this.mapHConcat(t,n):rr(t)?this.mapVConcat(t,n):Ws(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(ar(t))return this.mapLayer(t,n);if(ft(t))return this.mapUnit(t,n);throw new Error(ns(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const hm={zero:1,center:1,normalize:1};function mm(e){return e in hm}const ym=new Set([bc,ji,Di,Wi,Bi,vs,ws,Ui,xc,Ss]),bm=new Set([ji,Di,bc]);function kn(e){return S(e)&&vn(e)==="quantitative"&&!e.bin}function Cu(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),o=e[t],a=e[r];if(S(o)&&S(a))if(kn(o)&&kn(a)){if(o.stack)return t;if(a.stack)return r;const c=S(o)&&!!o.aggregate,u=S(a)&&!!a.aggregate;if(c!==u)return c?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(kn(o))return t;if(kn(a))return r}else{if(kn(o))return s&&n==="vertical"?void 0:t;if(kn(a))return s&&n==="horizontal"?void 0:r}return}function xm(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function Fu(e,t){const n=Ye(e)?e:{type:e},i=n.type;if(!ym.has(i))return null;const r=Cu(t,"x",n)||Cu(t,"theta",n);if(!r)return null;const s=t[r],o=S(s)?w(s,{}):void 0,a=xm(r),c=[],u=new Set;if(t[a]){const g=t[a],m=S(g)?w(g,{}):void 0;m&&m!==o&&(c.push(a),u.add(m))}const l=a==="x"?"xOffset":"yOffset",f=t[l],d=S(f)?w(f,{}):void 0;d&&d!==o&&(c.push(l),u.add(d));const p=Ad.reduce((g,m)=>{if(m!=="tooltip"&&Kt(t,m)){const y=t[m];for(const v of V(y)){const k=Ie(v);if(k.aggregate)continue;const _=w(k,{});(!_||!u.has(_))&&g.push({channel:m,fieldDef:k})}}return g},[]);let h;return s.stack!==void 0?Un(s.stack)?h=s.stack?"zero":null:h=s.stack:bm.has(i)&&(h="zero"),!h||!mm(h)||eu(t)&&p.length===0?null:(s?.scale?.type&&s?.scale?.type!==se.LINEAR&&(s?.stack&&x(qp(s.scale.type))),F(t[He(r)])?(s.stack!==void 0&&x(Hp(r)),null):(S(s)&&s.aggregate&&!Wd.has(s.aggregate)&&x(Gp(s.aggregate)),{groupbyChannels:c,groupbyFields:u,fieldChannel:r,impute:s.impute===null?!1:Ft(i),stackBy:p,offset:h}))}function Nu(e,t,n){const i=oe(e),r=R("orient",i,n);if(i.orient=$m(i.type,t,r),r!==void 0&&r!==i.orient&&x(Fp(i.orient,r)),i.type==="bar"&&i.orient){const c=R("cornerRadiusEnd",i,n);if(c!==void 0){const u=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:Xg[i.orient];for(const l of u)i[l]=c;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=R("opacity",i,n),o=R("fillOpacity",i,n);s===void 0&&o===void 0&&(i.opacity=vm(i.type,t));const a=R("cursor",i,n);return a===void 0&&(i.cursor=Sm(i,t,n)),i}function Sm(e,t,n){return t.href||e.href||R("href",e,n)?"pointer":e.cursor}function vm(e,t){return A([Bi,Ss,vs,ws],e)&&!eu(t)?.7:void 0}function wm(e,t,{graticule:n}){if(n)return!1;const i=Ge("filled",e,t),r=e.type;return X(i,r!==Bi&&r!==Ui&&r!==Wi)}function $m(e,t,n){switch(e){case Bi:case vs:case ws:case xc:case Mg:case Lg:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case ji:if(S(i)&&(re(i.bin)||S(r)&&r.aggregate&&!i.aggregate))return"vertical";if(S(r)&&(re(r.bin)||S(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(S(i)&&i.type===qt&&!U(i.bin)||Xi(i))&&(S(r)&&re(r.bin))?"horizontal":"vertical";if(!o)return(S(r)&&r.type===qt&&!U(r.bin)||Xi(r))&&(S(i)&&re(i.bin))?"vertical":"horizontal"}case Wi:if(s&&!(S(i)&&re(i.bin))&&o&&!(S(r)&&re(r.bin)))return;case Di:if(o)return S(r)&&re(r.bin)?"horizontal":"vertical";if(s)return S(i)&&re(i.bin)?"vertical":"horizontal";if(e===Wi){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case Ui:case Ss:{const a=Dc(i),c=Dc(r);if(n)return n;if(a&&!c)return e!=="tick"?"horizontal":"vertical";if(!a&&c)return e!=="tick"?"vertical":"horizontal";if(a&&c)return"vertical";{const u=fe(i)&&i.type===bn,l=fe(r)&&r.type===bn;if(u&&!l)return"vertical";if(!u&&l)return"horizontal"}return}}return"vertical"}function Em(e){const{point:t,line:n,...i}=e;return b(i).length>1?i:i.type}function _m(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:pe(e[t],["point","line"])});return e}function Vs(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?z(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?z(t.point)?t.point:{}:void 0}function Tu(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class km{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(ft(t)){const{mark:i,encoding:r}=t,s=Ye(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!Vs(s,n[s.type],r);case"area":return!!Vs(s,n[s.type],r)||!!Tu(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:c,encoding:u,...l}=t,f=tr(u,r),d=Ye(a)?a:{type:a},p=Vs(d,r[d.type],f),h=d.type==="area"&&Tu(d,r[d.type]),g=[{name:c,...s?{params:s}:{},mark:Em({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:pe(f,["shape"])}],m=Fu(Nu(d,f,r),f);let y=f;if(m){const{fieldChannel:v,offset:k}=m;y={...f,[v]:{...f[v],...k?{stack:k}:{}}}}return y=pe(y,["y2","x2"]),h&&g.push({...o?{projection:o}:{},mark:{type:"line",...ln(d,["clip","interpolate","tension","tooltip"]),...h},encoding:y}),p&&g.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...ln(d,["clip","tooltip"]),...p},encoding:y}),i({...l,layer:g},{...n,config:_m(r)})}}function Cm(e,t){return t?ei(e)?zu(e,t):Au(e,t):e}function Xs(e,t){return t?zu(e,t):e}function Ys(e,t,n){const i=t[e];if(uh(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};x(cp(i.repeat));return}return t}function Au(e,t){if(e=Ys("field",e,t),e===void 0)return;if(e===null)return null;if(Ns(e)&<(e.sort)){const n=Ys("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}function Ou(e,t){if(S(e))return Au(e,t);{const n=Ys("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function Pu(e,t){if(F(e)){const n=Ou(e,t);if(n)return n;if(ti(e))return{condition:e.condition}}else{if(ni(e)){const n=Ou(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}return}function zu(e,t){const n={};for(const i in e)if(on(e,i)){const r=e[i];if(E(r))n[i]=r.map(s=>Pu(s,t)).filter(s=>s);else{const s=Pu(r,t);s!==void 0&&(n[i]=s)}}return n}class Fm{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(ft(t)){const{encoding:n,mark:i}=t;if(i==="line"||Ye(i)&&i.type==="line")for(const r of Fd){const s=jt(r),o=n[s];if(n[r]&&(S(o)&&!re(o.bin)||Ke(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return x(Cp(!!r.x2,!!r.y2)),i({...t,mark:z(s)?{...s,type:"rule"}:"rule"},n)}}class Nm extends Gs{constructor(){super(...arguments);this.nonFacetUnitNormalizers=[Ah,zh,Uh,new km,new Fm]}map(t,n){if(ft(t)){const i=Kt(t.encoding,tt),r=Kt(t.encoding,nt),s=Kt(t.encoding,_i);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=Xs(t.encoding,n.repeater),o={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(c=>c).join("_")}:{},...s?{encoding:s}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(o,n);const a=this.mapLayerOrUnit.bind(this);for(const c of this.nonFacetUnitNormalizers)if(c.hasMatchingType(o,n.config))return c.run(o,n,a);return o}mapRepeat(t,n){return gm(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...s}=t,{row:o,column:a,layer:c}=i,{repeater:u={},repeaterPrefix:l=""}=n;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:c},spec:r}},n):{...s,layer:c.map(f=>{const d={...u,layer:f},p=`${(r.name?`${r.name}_`:"")+l}child__layer_${W(f)}`,h=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:p});return h.name=p,h})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...o}=t;!E(i)&&t.columns&&(t=pe(t,["columns"]),x(Ba("repeat")));const a=[],{repeater:c={},repeaterPrefix:u=""}=n,l=!E(i)&&i.row||[c?c.row:null],f=!E(i)&&i.column||[c?c.column:null],d=E(i)&&i||[c?c.repeat:null];for(const h of d)for(const g of l)for(const m of f){const y={repeat:h,row:g,column:m,layer:c.layer},v=(r.name?`${r.name}_`:"")+u+"child__"+(E(i)?`${W(h)}`:(i.row?`row_${W(g)}`:"")+(i.column?`column_${W(m)}`:"")),k=this.map(r,{...n,repeater:y,repeaterPrefix:v});k.name=v,a.push(pe(k,["data"]))}const p=E(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...o,columns:p,concat:a}}mapFacet(t,n){const{facet:i}=t;return ei(i)&&t.columns&&(t=pe(t,["columns"]),x(Ba("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:o,config:a}=n,c=Iu({parentProjection:o,projection:r}),u=Ru({parentEncoding:s,encoding:Xs(i,n.repeater)});return this.mapUnit({...t,...c?{projection:c}:{},...u?{encoding:u}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:s,...o}=t.encoding,{mark:a,width:c,projection:u,height:l,view:f,params:d,encoding:p,...h}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=Xs(o,n.repeater);return this.mapFacet({...h,...m,facet:g,spec:{...c?{width:c}:{},...l?{height:l}:{},...f?{view:f}:{},...u?{projection:u}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:s}=t;if(i||r){s&&x(_p([...i?[tt]:[],...r?[nt]:[]]));const o={},a={};for(const c of[tt,nt]){const u=t[c];if(u){const{align:l,center:f,spacing:d,columns:p,...h}=u;o[c]=h;for(const g of["align","center","spacing"])u[g]!==void 0&&(a[g]??(a[g]={}),a[g][c]=u[g])}}return{facetMapping:o,layout:a}}else{const{align:o,center:a,spacing:c,columns:u,...l}=s;return{facetMapping:Cm(l,n.repeater),layout:{...o?{align:o}:{},...a?{center:a}:{},...c?{spacing:c}:{},...u?{columns:u}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:s,projection:o,...a}=t,c={...r,parentEncoding:Ru({parentEncoding:n,encoding:s,layer:!0}),parentProjection:Iu({parentProjection:i,projection:o})};return super.mapLayer({...a,...t.name?{name:[c.repeaterPrefix,t.name].filter(u=>u).join("_")}:{}},c)}}function Ru({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...b(e),...b(t)]);for(const s of r){const o=t[s],a=e[s];if(F(o)){const c={...a,...o};i[s]=c}else ni(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||Re(a)||$(a)||F(a)||E(a))&&(i[s]=a)}}else i=t;return!i||M(i)?void 0:i}function Iu(e){const{parentProjection:t,projection:n}=e;return t&&n&&x(gp({parentProjection:t,projection:n})),n??t}function Ks(e){return"filter"in e}function Tm(e){return e?.stop!==void 0}function Lu(e){return"lookup"in e}function Am(e){return"data"in e}function Om(e){return"param"in e}function Pm(e){return"pivot"in e}function zm(e){return"density"in e}function Rm(e){return"quantile"in e}function Im(e){return"regression"in e}function Lm(e){return"loess"in e}function Mm(e){return"sample"in e}function Dm(e){return"window"in e}function jm(e){return"joinaggregate"in e}function Um(e){return"flatten"in e}function Bm(e){return"calculate"in e}function Mu(e){return"bin"in e}function Wm(e){return"impute"in e}function Hm(e){return"timeUnit"in e}function qm(e){return"aggregate"in e}function Gm(e){return"stack"in e}function Vm(e){return"fold"in e}function Xm(e){return"extent"in e&&!("density"in e)&&!("regression"in e)}function Ym(e){return e.map(t=>Ks(t)?{filter:un(t.filter,Sg)}:t)}class Km extends Gs{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=Du(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=Du(t,n),t.encoding){const i={};for(const[r,s]of bt(t.encoding))i[r]=ju(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:bt(i).map(([s,o])=>{const{init:a,bind:c,empty:u,...l}=o;l.type==="single"?(l.type="point",l.toggle=!1):l.type==="multi"&&(l.type="point"),n.emptySelections[s]=u!=="none";for(const f of ie(n.selectionPredicates[s]??{}))f.empty=u!=="none";return{name:s,value:a,select:l,bind:c}})}:t}}function Du(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(Ks(s))return{filter:Qs(s,t)};if(Mu(s)&&Ut(s.bin))return{...s,bin:Uu(s.bin)};if(Lu(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function ju(e,t){const n=C(e);if(S(n)&&Ut(n.bin)&&(n.bin=Uu(n.bin)),Yt(n)&&n.scale?.domain?.selection){const{selection:i,...r}=n.scale.domain;n.scale.domain={...r,...i?{param:i}:{}}}if(ti(n))if(ia(n.condition))n.condition=n.condition.map(i=>{const{selection:r,param:s,test:o,...a}=i;return s?i:{...a,test:Qs(i,t)}});else{const{selection:i,param:r,test:s,...o}=ju(n.condition,t);n.condition=r?n.condition:{...o,test:Qs(n.condition,t)}}return n}function Uu(e){const t=e.extent;if(t?.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Qs(e,t){const n=i=>un(i,r=>{var s;const o=t.emptySelections[r]??!0,a={param:r,empty:o};return(s=t.selectionPredicates)[r]??(s[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):un(e.test||e.filter,i=>i.selection?n(i.selection):i)}class Zs extends Gs{map(t,n){const i=n.selections??[];if(t.params&&!ft(t)){const r=[];for(const s of t.params)Bs(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(vi(a)&&(a===t.name||r.includes(a))||ia(a)&&a.map(c=>r.indexOf(c)).every((c,u,l)=>c!==-1&&(u===0||c>l[u-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=Zs.prototype[e];Zs.prototype[e]=function(n,i){return t.call(this,n,Qm(n,i))}}function Qm(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function Bu(e,t){t===void 0&&(t=ku(e.config));const n=ty(e,t),{width:i,height:r}=e,s=ny(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const Zm=new Nm,Jm=new Km,ey=new Zs;function ty(e,t={}){const n={config:t};return ey.map(Zm.map(Jm.map(e,n),n),n)}function Wu(e){return N(e)?{type:e}:e??{}}function ny(e,t,n){let{width:i,height:r}=t;const s=ft(e)||ar(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(x(La("width")),i=void 0),r=="container"&&(x(La("height")),r=void 0));const a={type:"pad",...o,...n?Wu(n.autosize):{},...Wu(e.autosize)};return a.type==="fit"&&!s&&(x(Qd),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&x(Ma("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&x(Ma("height")),be(a,{type:"pad"})?void 0:a}function iy(e){return e==="fit"||e==="fit-x"||e==="fit-y"}function ry(e){return e?`fit-${Ai(e)}`:"fit"}const sy=["background","padding"];function Hu(e,t){const n={};for(const i of sy)e&&e[i]!==void 0&&(n[i]=xe(e[i]));return t&&(n.params=e.params),n}class pt{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new pt(C(this.explicit),C(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return X(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of b(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function Ze(e){return{explicit:!0,value:e}}function Se(e){return{explicit:!1,value:e}}function qu(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:cr(t,n,i,r)}}function cr(e,t,n,i){return e.explicit&&t.explicit&&x(Lp(n,i,e.value,t.value)),e}function At(e,t,n,i,r=cr){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:be(e.value,t.value)?e:r(e,t,n,i)}class oy extends pt{constructor(t={},n={},i=!1){super(t,n);this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function Cn(e){return"url"in e}function si(e){return"values"in e}function Gu(e){return"name"in e&&!Cn(e)&&!si(e)&&!Ot(e)}function Ot(e){return e&&(Vu(e)||Xu(e)||Js(e))}function Vu(e){return"sequence"in e}function Xu(e){return"sphere"in e}function Js(e){return"graticule"in e}var G;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(G||(G={}));function Yu({invalid:e,isPath:t}){const n=Ec(e,{isPath:t});switch(n){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function ay(e){const{marks:t,scales:n}=Yu(e);return t===n?G.Main:n==="include-invalid-values"?G.PreFilterInvalid:G.PostFilterInvalid}function Ku(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=we(r.field),r}function Qt(e,t=!0,n=qf){if(E(e)){const i=e.map(r=>Qt(r,t,n));return t?`[${i.join(", ")}]`:i}else if(Bt(e))return n(t?Wt(e):cg(e));return t?n(D(e)):e}function cy(e,t){for(const n of ie(e.component.selection??{})){const i=n.name;let r=`${i}${zt}, ${n.resolve==="global"?"true":`{unit: ${Jt(e)}}`}`;for(const s of hr){if(!s.defined(n))continue;s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r))}t.push({name:i+My,on:[{events:{signal:n.name+zt},update:`modify(${O(n.name+Zt)}, ${r})`}]})}return eo(t)}function uy(e,t){if(e.component.selection&&b(e.component.selection).length){const n=O(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:cn("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return eo(t)}function ly(e,t){let n=!1;for(const i of ie(e.component.selection??{})){const r=i.name,s=O(r+Zt),o=t.filter(a=>a.name===r);if(o.length===0){const a=i.resolve==="global"?"union":i.resolve,c=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${_l}(${s}, ${O(a)}${c}`})}n=!0;for(const a of hr)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}if(n){const i=t.filter(r=>r.name==="unit");i.length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]})}return eo(t)}function fy(e,t){const n=[...t],i=Jt(e,{escape:!1});for(const r of ie(e.component.selection??{})){const s={name:r.name+Zt};if(r.project.hasSelectionId&&(s.transform=[{type:"collect",sort:{field:Le}}]),r.init){const a=r.project.items.map(Ku);s.values=r.project.hasSelectionId?r.init.map(c=>({unit:i,[Le]:Qt(c,!1)[0]})):r.init.map(c=>({unit:i,fields:a,values:Qt(c,!1)}))}const o=n.filter(a=>a.name===r.name+Zt);o.length||n.push(s)}return n}function Qu(e,t){for(const n of ie(e.component.selection??{}))for(const i of hr)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function dy(e,t){for(const n of e.children)q(n)&&(t=Qu(n,t));return t}function py(e,t,n,i){const r=Tl(e,t.param,t);return{signal:Pe(n.get("type"))&&E(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function eo(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class I{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){x(fp);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class ye extends I{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n);this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${ua()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function to(e){return e.as!==void 0}function Zu(e){return`${e}_end`}class Je extends I{clone(){return new Je(null,C(this.timeUnits))}constructor(t,n){super(t);this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{const{field:a,timeUnit:c}=s;if(c){let u;if(Ht(c)){if(q(n)){const{mark:l,markDef:f,config:d}=n,p=Nt({fieldDef:s,markDef:f,config:d});(Qn(l)||!!p)&&(u={timeUnit:Z(c),field:a})}}else u={as:w(s,{forAs:!0}),field:a,timeUnit:c};if(q(n)){const{mark:l,markDef:f,config:d}=n,p=Nt({fieldDef:s,markDef:f,config:d});Qn(l)&&Y(o)&&p!==.5&&(u.rectBandPosition=p)}u&&(r[P(u)]=u)}return r},{});return M(i)?null:new Je(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=Z(i),o={...r,timeUnit:s};return new Je(t,{[P(o)]:o})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of bt(this.timeUnits)){const s=to(r)?r.as:`${r.field}_end`;t.has(s)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(ie(this.timeUnits).map(t=>to(t)?t.as:Zu(t.field)))}dependentFields(){return new Set(ie(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${P(this.timeUnits)}`}assemble(){const t=[];for(const n of ie(this.timeUnits)){const{rectBandPosition:i}=n,r=Z(n.timeUnit);if(to(n)){const{field:s,as:o}=n,{unit:a,utc:c,...u}=r,l=[o,`${o}_end`];t.push({field:we(s),type:"timeunit",...a?{units:Li(a)}:{},...c?{timezone:"utc"}:{},...u,as:l}),t.push(...el(l,i,r))}else if(n){const{field:s}=n,o=s.replaceAll("\\.","."),a=Ju({timeUnit:r,field:o}),c=Zu(o);t.push({type:"formula",expr:a,as:c}),t.push(...el([o,c],i,r))}}return t}}const ur="offsetted_rect_start",lr="offsetted_rect_end";function Ju({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=ic(i),{part:o,step:a}=ac(s,e.step),c=r?"utcOffset":"timeOffset",u=`${c}('${o}', datum['${t}'], ${n?-a:a})`;return u}function el([e,t],n,i){if(n!==void 0&&n!==.5){const r=`datum['${e}']`,s=`datum['${t}']`;return[{type:"formula",expr:tl([Ju({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${ur}`},{type:"formula",expr:tl([r,s],n+.5),as:`${e}_${lr}`}]}return[]}function tl([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const oi="_tuple_fields";class gy{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const hy={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new gy),s={},o={},a=new Set,c=(h,g)=>{const m=g==="visual"?h.channel:h.field;let y=W(`${i}_${m}`);for(let v=1;a.has(y);v++)y=W(`${i}_${m}_${v}`);return a.add(y),{[g]:y}},u=t.type,l=e.config.selection[u],f=n.value!==void 0?V(n.value):null;let{fields:d,encodings:p}=z(n.select)?n.select:{};if(!d&&!p&&f)for(const h of f){if(!z(h))continue;for(const g of b(h))Cd(g)?(p||(p=[])).push(g):u==="interval"?(x(ap),p=l.encodings):(d??(d=[])).push(g)}!d&&!p&&(p=l.encodings,"fields"in l&&(d=l.fields));for(const h of p??[]){const g=e.fieldDef(h);if(g){let m=g.field;if(g.aggregate){x(Zd(h,g.aggregate));continue}else if(!m){x(ja(h));continue}if(g.timeUnit&&!Ht(g.timeUnit)){m=e.vgField(h);const y={timeUnit:g.timeUnit,as:m,field:g.field};o[P(y)]=y}if(!s[m]){const y=u==="interval"&&qe(h)&&Pe(e.getScaleComponent(h).get("type"))?"R":g.bin?"R-RE":"E",v={field:m,channel:h,type:y,index:r.items.length};v.signals={...c(v,"data"),...c(v,"visual")},r.items.push(s[m]=v),r.hasField[m]=s[m],r.hasSelectionId=r.hasSelectionId||m===Le,ma(h)?(v.geoChannel=h,v.channel=ha(h),r.hasChannel[v.channel]=s[m]):r.hasChannel[h]=s[m]}}else x(ja(h))}for(const h of d??[]){if(r.hasField[h])continue;const g={type:"E",field:h,index:r.items.length};g.signals={...c(g,"data")},r.items.push(g),r.hasField[h]=g,r.hasSelectionId=r.hasSelectionId||h===Le}f&&(t.init=f.map(h=>r.items.map(g=>z(h)?h[g.geoChannel||g.channel]!==void 0?h[g.geoChannel||g.channel]:h[g.field]:h))),M(o)||(r.timeUnit=new Je(null,o))},signals:(e,t,n)=>{const i=t.name+oi,r=n.filter(s=>s.name===i);return r.length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(Ku)})}},gt={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!qe(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(o=="sequential"&&x(np),!s||!Pe(o)){x(tp);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||io(e)||i.length===0)return n;const r=n.find(o=>o.name===t.name);let s=r.update;if(s.includes(_l))r.update=`{${i.map(o=>`${O(we(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${O(we(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!io(e))for(const i of t.scales){const r=n.find(s=>s.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function no(e,t){const n=O(e.scaleName(t));return`domain(${n})`}function io(e){return e.parent&&Mn(e.parent)&&(!e.parent.parent??io(e.parent.parent))}const Fn="_brush",nl="_scale_trigger",ai="geo_interval_init_tick",il="_init",my="_center",yy={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...Rr(n.select)?n.select:{}};r.fields=[Le],r.encodings||(r.encodings=n.value?b(n.value):[Te,Ne]),n.select={type:"interval",...r}}if(t.translate&&!gt.defined(t)){const r=`!event.item || event.item.mark.name !== ${O(t.name+Fn)}`;for(const s of t.events){if(!s.between){x(`${s} is not an ordered event stream for interval selections.`);continue}const o=V((i=s.between[0]).filter??(i.filter=[]));o.includes(r)||o.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+zt,s=ie(t.project.hasChannel).filter(a=>a.channel===H||a.channel===Q),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,c)=>a.concat(by(e,t,c,o&&o[c.index])),[])),e.hasProjection){const a=O(e.projectionName()),c=e.projectionName()+my,{x:u,y:l}=t.project.hasChannel,f=u&&u.signals.visual,d=l&&l.signals.visual,p=u?o&&o[u.index]:`${c}[0]`,h=l?o&&o[l.index]:`${c}[1]`,g=T=>e.getSizeSignalRef(T).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;if(o&&(n.unshift({name:i+il,init:`[scale(${a}, [${u?p[0]:p}, ${l?h[0]:h}]), scale(${a}, [${u?p[1]:p}, ${l?h[1]:h}])]`}),!u||!l)){const T=n.find(L=>L.name===c);T||n.unshift({name:c,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})}const y=`intersect(${m}, {markname: ${O(e.getName("marks"))}}, unit.mark)`,v=`{unit: ${Jt(e)}}`,k=`vlSelectionTuples(${y}, ${v})`,_=s.map(T=>T.signals.visual);return n.concat({name:r,on:[{events:[..._.length?[{signal:_.join(" || ")}]:[],...o?[{signal:ai}]:[]],update:k}]})}else{if(!gt.defined(t)){const u=i+nl,l=s.map(f=>{const d=f.channel,{data:p,visual:h}=f.signals,g=O(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Pe(m)?"+":"";return`(!isArray(${p}) || (${y}invert(${g}, ${h})[0] === ${y}${p}[0] && ${y}invert(${g}, ${h})[1] === ${y}${p}[1]))`});l.length&&n.push({name:u,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:l.join(" && ")+` ? ${u} : {}`}]})}const a=s.map(u=>u.signals.data),c=`unit: ${Jt(e)}, fields: ${i+oi}, values`;return n.concat({name:r,...o?{init:`{${c}: ${Qt(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${c}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>{if(q(e)&&e.hasProjection&&t.init){const i=n.filter(r=>r.name===ai);i.length||n.unshift({name:ai,value:null,on:[{events:"timer{1}",update:`${ai} === null ? {} : ${ai}`}]})}return n},marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r?.signals.visual,a=s?.signals.visual,c=`data(${O(t.name+Zt)})`;if(gt.defined(t)||!r&&!s)return n;const u={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of b(u))u[m]=[{test:`${c}.length && ${c}[0].unit === ${Jt(e)}`,...u[m]},{value:0}];const{fill:l,fillOpacity:f,cursor:d,...p}=t.mark,h=b(p).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(v=>v).join(" && "),value:p[y]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${i+Fn}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:l},fillOpacity:{value:f}},update:u}},...n,{name:i+Fn,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...u,...h}}}]}};function by(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=O(r?e.scaleName(s):e.projectionName()),c=d=>`scale(${a}, ${d})`,u=e.getSizeSignalRef(s===H?"width":"height").signal,l=`${s}(unit)`,f=t.events.reduce((d,p)=>[...d,{events:p.between[0],update:`[${l}, ${l}]`},{events:p,update:`[${o}[0], clamp(${l}, 0, ${u})]`}],[]);if(r){const d=n.signals.data,p=gt.defined(t),h=e.getScaleComponent(s),g=h?h.get("type"):void 0,m=i?{init:Qt(i,!0,c)}:{value:[]};return f.push({events:{signal:t.name+nl},update:Pe(g)?`[${c(`${d}[0]`)}, ${c(`${d}[1]`)}]`:"[0, 0]"}),p?[{name:d,on:[]}]:[{name:o,...m,on:f},{name:d,...i?{init:Qt(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===H?0:1,p=t.name+il,h=i?{init:`[${p}[0][${d}], ${p}[1][${d}]]`}:{value:[]};return[{name:o,...h,on:f}]}}const xy={defined:e=>e.type==="point",signals:(e,t,n)=>{const i=t.name,r=i+oi,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=ie(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+Fn):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),c=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let u=`unit: ${Jt(e)}, `;if(t.project.hasSelectionId)u+=`${Le}: ${o}[${O(Le)}]`;else{const f=s.items.map(d=>{const p=e.fieldDef(d.channel);return p?.bin?`[${o}[${O(e.vgField(d.channel,{}))}], ${o}[${O(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${o}[${O(d.field)}]`}).join(", ");u+=`fields: ${r}, values: [${f}]`}const l=t.events;return n.concat([{name:i+zt,on:l?[{events:l,update:`${c} ? {${u}} : null`,force:!0}]:[]}])}};function Nn({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const s=ti(t)&&t.condition;let o=[];if(s){const c=V(s);o=c.map(u=>{const l=r(u);if(ch(u)){const{param:f,empty:d}=u,p=Nl(e,{param:f,empty:d});return{test:p,...l}}else{const f=mr(e,u.test);return{test:f,...l}}})}i!==void 0&&o.push(i);const a=r(t);return a!==void 0&&o.push(a),o.length>1||o.length===1&&Boolean(o[0].test)?{[n]:o}:o.length===1?{[n]:o[0]}:{}}function ro(e,t="text"){const n=e.encoding[t];return Nn({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>fr(i,e.config),invalidValueRef:void 0})}function fr(e,t,n="datum"){if(e){if(Re(e))return B(e.value);if(F(e)){const{format:i,formatType:r}=Ki(e);return ks({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}return}function rl(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(E(o))return{tooltip:ol({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum",c=u=>{const l=fr(u,r,a);if(l)return l;if(u===null)return;let f=R("tooltip",i,r);return f===!0&&(f={content:"encoding"}),N(f)?{value:f}:z(f)?$(f)?f:f.content==="encoding"?ol(n,s,r,t):{signal:a}:void 0};return Nn({model:e,channelDef:o,vgChannel:"tooltip",mainRefFn:c,invalidValueRef:void 0})}}function sl(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s={},o=i?"datum.datum":"datum",a=[];function c(l,f){const d=jt(f),p=fe(l)?l:{...l,type:e[d].type},h=p.title||As(p,r),g=V(h).join(", ").replaceAll(/"/g,'\\"');let m;if(Y(f)){const y=f==="x"?"x2":"y2",v=Ie(e[y]);if(re(p.bin)&&v){const k=w(p,{expr:o}),_=w(v,{expr:o}),{format:T,formatType:L}=Ki(p);m=Jn(k,_,T,L,r),s[y]=!0}}if((Y(f)||f===$e||f===Fe)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:v}=Ki(p);m=ks({fieldOrDatumDef:p,format:y,formatType:v,expr:o,config:r,normalizeStack:!0}).signal}m??(m=fr(p,r,o).signal),a.push({channel:f,key:g,value:m})}Ps(e,(l,f)=>{S(l)?c(l,f):Vi(l)&&c(l.condition,f)});const u={};for(const{channel:l,key:f,value:d}of a)!s[l]&&!u[f]&&(u[f]=d);return u}function ol(e,t,n,{reactiveGeom:i}={}){const r=sl(e,t,n,{reactiveGeom:i}),s=bt(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function Sy(e){const{markDef:t,config:n}=e,i=R("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...vy(e),...wy(e)}}function vy(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=R("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:t in Yd?{}:{ariaRoleDescription:{value:t}}}function wy(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return Nn({model:e,channelDef:s,vgChannel:"description",mainRefFn:c=>fr(c,e.config),invalidValueRef:void 0});const o=R("description",n,i);if(o!=null)return{description:B(o)};if(i.aria===!1)return{};const a=sl(t,r,i);return M(a)?void 0:{description:{signal:bt(a).map(([c,u],l)=>`"${l>0?"; ":""}${c}: " + (${u})`).join(" + ")}}}function ee(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:c}=n;const u=r[e];a===void 0&&(c??(c=R(e,i,s,{vgChannel:o,ignoreVgConfig:!ti(u)})),c!==void 0&&(a=B(c)));const l={markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=kc({...l,scaleChannel:e,channelDef:u}),d=p=>_s({...l,channel:e,channelDef:p,stack:null,defaultRef:a});return Nn({model:t,channelDef:u,vgChannel:o??e,invalidValueRef:f,mainRefFn:d})}function al(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??R("filled",n,r),a=A(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,c=R(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,u=R(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],l=o?"fill":"stroke",f={...c?{fill:B(c)}:{},...u?{stroke:B(u)}:{}};return n.color&&(o?n.fill:n.stroke)&&x(Ga("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...ee("color",e,{vgChannel:l,defaultValue:o?c:u}),...ee("fill",e,{defaultValue:i.fill?c:void 0}),...ee("stroke",e,{defaultValue:i.stroke?u:void 0})}}function $y(e){const{encoding:t,mark:n}=e,i=t.order;return!Ft(n)&&Re(i)?Nn({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>B(r.value),invalidValueRef:void 0}):{}}function Tn({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a){const u=_s({channel:s,channelDef:a,markDef:t,config:i?.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:B(o),bandPosition:r});return{offsetType:"encoding",offset:u}}const c=t[s];return c?{offsetType:"visual",offset:c}:{}}function ae(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,c=r[e],u=r[He(e)],l=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:p}=Tn({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),h=so({model:t,defaultPos:n,channel:e,scaleName:l,scale:f}),g=!c&&Y(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:Ey({channel:e,channelDef:c,channel2Def:u,markDef:s,config:o,scaleName:l,scale:f,stack:a,offset:d,defaultRef:h,bandPosition:p==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function Ey(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(F(n)&&r&&t===r.fieldChannel){if(S(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return Hi({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return Vt(n,i,{suffix:"end"},{offset:s})}return Es(e)}function so({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=jt(n),c=Et(n),u=R(n,s,o,{vgChannel:c});if(u!==void 0)return Zn(n,u);switch(t){case"zeroOrMin":return cl({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:o});case"zeroOrMax":return cl({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:o});case"mid":{const l=e[me(n)];return{...l,mult:.5}}}return}}function cl({mainChannel:e,config:t,...n}){const i=_c(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:s,heightSignal:o}=r.zeroOrMax;return{signal:`min(${s},${o})/2`}}case"theta":return r==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return r==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return r==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const _y={left:"x",center:"xc",right:"x2"},ky={top:"y",middle:"yc",bottom:"y2"};function ul(e,t,n,i="middle"){if(e==="radius"||e==="theta")return Et(e);const r=e==="x"?"align":"baseline",s=R(r,t,n);let o;return $(s)?(x(kp(r)),o=void 0):o=s,e==="x"?_y[o||(i==="top"?"left":"center")]:ky[o||i]}function dr(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?ll(e,t,{defaultPos:n,defaultPos2:i}):ae(e,t,{defaultPos:n})}function ll(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=He(e),a=me(e),c=Cy(t,i,o),u=c[a]?ul(e,r,s):Et(e);return{...ae(e,t,{defaultPos:n,vgChannel:u}),...c}}function Cy(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,c=jt(n),u=me(n),l=Et(n),f=i[c],d=e.scaleName(c),p=e.getScaleComponent(c),{offset:h}=n in i||n in s?Tn({channel:n,markDef:s,encoding:i,model:e}):Tn({channel:c,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=me(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[l]:{field:e.getName(n)}}}const g=Fy({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:p,stack:o,offset:h,defaultRef:void 0});return g!==void 0?{[l]:g}:pr(n,s)||pr(n,{[n]:zi(n,s,a.style),[u]:zi(u,s,a.style)})||pr(n,a[r])||pr(n,a.mark)||{[l]:so({model:e,defaultPos:t,channel:n,scaleName:d,scale:p})()}}function Fy({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:c,defaultRef:u}){return F(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Vt(t,s,{suffix:"start"},{offset:c}):Es({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:c,defaultRef:u})}function pr(e,t){const n=me(e),i=Et(e);if(t[i]!==void 0)return{[i]:Zn(e,t[i])};if(t[e]!==void 0)return{[i]:Zn(e,t[e])};if(t[n]){const r=t[n];if(Gt(r))x(Sp(n));else return{[n]:Zn(e,r)}}return}function Pt(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=He(t),a=me(t),c=i[t],u=i[o],l=e.getScaleComponent(t),f=l?l.get("type"):void 0,d=r.orient,p=i[a]??i.size??R("size",r,n,{vgChannel:a}),h=Sa(t),g=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal");return S(c)&&(U(c.bin)||re(c.bin)||c.timeUnit&&!u)&&!(p&&!Gt(p))&&!i[h]&&!J(f)?Ay({fieldDef:c,fieldDef2:u,channel:t,model:e}):(F(c)&&J(f)||g)&&!u?Ty(c,t,e):ll(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Ny(e,t,n,i,r,s,o){if(Gt(r))if(n){const c=n.get("type");if(c==="band"){let u=`bandwidth('${t}')`;r.band!==1&&(u=`${r.band} * ${u}`);const l=Ge("minBandSize",{type:o},i);return{signal:l?`max(${Oe(l)}, ${u})`:u}}else r.band!==1&&(x(Tp(c)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if($(r))return r;if(r)return{value:r}}if(n){const c=n.get("range");if(Ct(c)&&j(c.step))return{value:c.step-2}}if(!s){const{bandPaddingInner:c,barBandPaddingInner:u,rectBandPaddingInner:l}=i.scale,f=X(c,o==="bar"?u:l);if($(f))return{signal:`(1 - (${f.signal})) * ${e}`};if(j(f))return{signal:`${1-f} * ${e}`}}const a=sr(i.view,e);return{value:a-2}}function Ty(e,t,n){const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,c=n.scaleName(t),u=n.getScaleComponent(t),l=me(t),f=He(t),d=Sa(t),p=n.scaleName(d),h=n.getScaleComponent(Ti(t)),g=a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=ee("size",n,{vgChannel:l,defaultRef:B(i.size)}):x(zp(i.type)));const y=!!m,v=Ic({channel:t,fieldDef:e,markDef:i,config:s,scaleType:(u||h)?.get("type"),useVlSizeChannel:g});m=m||{[l]:Ny(l,p||c,h||u,s,v,!!e,i.type)};const k=(u||h)?.get("type")==="band"&&Gt(v)&&!y?"top":"middle",_=ul(t,i,s,k),T=_==="xc"||_==="yc",{offset:L,offsetType:ue}=Tn({channel:t,markDef:i,encoding:r,model:n,bandPosition:T?.5:0}),ne=Es({channel:t,channelDef:e,markDef:i,config:s,scaleName:c,scale:u,stack:o,offset:L,defaultRef:so({model:n,defaultPos:"mid",channel:t,scaleName:c,scale:u}),bandPosition:T?ue==="encoding"?0:.5:$(v)?{signal:`(1-${v})/2`}:Gt(v)?(1-v.band)/2:0});if(l)return{[_]:ne,...m};{const mt=Et(f),de=m[l],yt=L?{...de,offset:L}:de;return{[_]:ne,[mt]:E(ne)?[ne[0],{...ne[1],offset:yt}]:{...ne,offset:yt}}}}function fl(e,t,n,i,r,s,o){if(ga(e))return 0;const a=e==="x"||e==="y2",c=a?-t/2:t/2;if($(n)||$(r)||$(i)||s){const u=Oe(n),l=Oe(r),f=Oe(i),d=Oe(s),p=a?"":"-",h=s?`(${o} < ${d} ? ${p}0.5 * (${d} - (${o})) : ${c})`:c,g=f?`${f} + `:"",m=u?`(${u} ? -1 : 1) * `:"",y=l?`(${l} + ${h})`:h;return{signal:g+m+y}}else return r=r||0,i+(n?-r-c:+r+c)}function Ay({fieldDef:e,fieldDef2:t,channel:n,model:i}){const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),c=i.scaleName(n),u=a?a.get("type"):void 0,l=a.get("reverse"),f=Ic({channel:n,fieldDef:e,markDef:s,config:r,scaleType:u}),d=i.component.axes[n]?.[0],p=d?.get("translate")??.5,h=Y(n)?R("binSpacing",s,r)??0:0,g=He(n),m=Et(n),y=Et(g),v=Ge("minBandSize",s,r),{offset:k}=Tn({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:_}=Tn({channel:g,markDef:s,encoding:o,model:i,bandPosition:0}),T=nh({fieldDef:e,scaleName:c}),L=fl(n,h,l,p,k,v,T),ue=fl(g,h,l,p,_??k,v,T),ne=$(f)?{signal:`(1-${f.signal})/2`}:Gt(f)?(1-f.band)/2:.5,mt=Nt({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(U(e.bin)||e.timeUnit){const de=e.timeUnit&&mt!==.5;return{[y]:dl({fieldDef:e,scaleName:c,bandPosition:ne,offset:ue,useRectOffsetField:de}),[m]:dl({fieldDef:e,scaleName:c,bandPosition:$(ne)?{signal:`1-${ne.signal}`}:1-ne,offset:L,useRectOffsetField:de})}}else if(re(e.bin)){const de=Vt(e,c,{},{offset:ue});if(S(t))return{[y]:de,[m]:Vt(t,c,{},{offset:L})};if(Ut(e.bin)&&e.bin.step)return{[y]:de,[m]:{signal:`scale("${c}", ${w(e,{expr:"datum"})} + ${e.bin.step})`,offset:L}}}x(Qa(g));return}function dl({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return Hi({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:ur,endSuffix:lr}:{}})}const Oy=new Set(["aria","width","height"]);function ke(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?al(e):{};return{...Py(e.markDef,t),...pl("fill",n),...pl("stroke",i),...ee("opacity",e),...ee("fillOpacity",e),...ee("strokeOpacity",e),...ee("strokeWidth",e),...ee("strokeDash",e),...$y(e),...rl(e),...ro(e,"href"),...Sy(e)}}function pl(e,t){return t?{[e]:t}:{}}function Py(e,t){return Xd.reduce((n,i)=>(!Oy.has(i)&&e[i]!==void 0&&t[i]!=="ignore"&&(n[i]=B(e[i])),n),{})}function oo(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,s)=>{let o;if(!qe(s)||!(o=e.getScaleType(s)))return;const a=Oi(r.aggregate),c=$s({scaleChannel:s,markDef:n,config:t,scaleType:o,isCountAggregate:a});if(Jg(c)){const u=e.vgField(s,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});u&&i.add(u)}}),i.size>0){const r=[...i].map(s=>Mi(s,!0)).join(" && ");return{defined:{signal:r}}}return}function gl(e,t){return t!==void 0?{[e]:B(t)}:void 0}const ao="voronoi",hl={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(ao)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(Ft(s))return x(Jd(s)),n;const o={name:e.getName(ao),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...rl(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,c=!1;return n.forEach((u,l)=>{const f=u.name??"";f===e.component.mark[0].name?a=l:f.includes(ao)&&(c=!0)}),c||n.splice(a+1,0,o),n}},ml={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!js(e.bind),parse:(e,t,n)=>kl(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,o=t.init&&t.init[0],a=hl.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((c,u)=>{const l=W(`${i}_${c.field}`),f=n.filter(d=>d.name===l);f.length||n.unshift({name:l,...o?{init:Qt(o[u])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${O(c.field)}] : null`}]:[],bind:s[c.field]??s[c.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(u=>u.name===i+zt),o=i+oi,a=r.items.map(u=>W(`${i}_${u.field}`)),c=a.map(u=>`${u} !== null`).join(" && ");return a.length&&(s.update=`${c} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},gr="_toggle",yl={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+gr,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+zt,i=t.name+gr;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Jt(e)}}, `)+`${i} ? ${n} : null`}},zy={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=N(t.clear)?cn(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(ml.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===W(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+zt);i(r,"null"),yl.defined(t)&&(r=n.findIndex(s=>s.name===t.name+gr),i(r,"false"))}return n}},bl={defined:e=>{const t=e.resolve==="global"&&e.bind&&js(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Le;return t&&!n&&x(ip),t&&n},parse:(e,t,n)=>{const i=C(n);if(i.select=N(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},kl(t,i),Rr(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=V(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=Us(t.bind)?t.bind.legend:"click",s=N(r)?cn(r,"view"):V(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=Us(t.bind)&&t.bind.legend,s=o=>a=>{const c=C(a);return c.markname=o,c};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${W(o.field)}_legend`,c=`${i}_${a}`,u=n.filter(l=>l.name===c);if(u.length===0){const l=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:c,...t.init?{}:{value:null},on:[{events:l,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${c}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+zt),o=i+oi,a=r.items.filter(d=>d.hasLegend).map(d=>W(`${i}_${W(d.field)}_legend`)),c=a.map(d=>`${d} !== null`).join(" && "),u=`${c} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:u}):a.length>0&&(s.update=u,delete s.value,delete s.on);const l=n.find(d=>d.name===i+gr),f=Us(t.bind)&&t.bind.legend;return l&&(t.events?l.on.push({...l.on[0],events:f}):l.on[0].events=f),n}};function Ry(e,t,n){const i=e.fieldDef(t)?.field;for(const r of ie(e.component.selection??{})){const s=r.project.hasField[i]??r.project.hasChannel[t];if(s&&bl.defined(r)){const o=n.get("selections")??[];o.push(r.name),n.set("selections",o,!1),s.hasLegend=!0}}}const xl="_translate_anchor",Sl="_translate_delta",Iy={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=gt.defined(t),s=i+xl,{x:o,y:a}=t.project.hasChannel;let c=cn(t.translate,"scope");return r||(c=c.map(u=>(u.between[0].markname=i+Fn,u))),n.push({name:s,value:{},on:[{events:c.map(u=>u.between[0]),update:"{x: x(unit), y: y(unit)"+(o!==void 0?`, extent_x: ${r?no(e,H):`slice(${o.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?no(e,Q):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+Sl,value:{},on:[{events:c,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&vl(e,t,o,"width",n),a!==void 0&&vl(e,t,a,"height",n),n}};function vl(e,t,n,i,r){const s=t.name,o=s+xl,a=s+Sl,c=n.channel,u=gt.defined(t),l=r.find(T=>T.name===n.signals[u?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(c),p=d&&d.get("type"),h=d&&d.get("reverse"),g=u?c===H?h?"":"-":h?"-":"":"",m=`${o}.extent_${c}`,y=`${g}${a}.${c} / ${u?`${f}`:`span(${m})`}`,v=!u||!d?"panLinear":p==="log"?"panLog":p==="symlog"?"panSymlog":p==="pow"?"panPow":"panLinear",k=u?p==="pow"?`, ${d.get("exponent")??1}`:p==="symlog"?`, ${d.get("constant")??1}`:"":"",_=`${v}(${m}, ${y}${k})`;l.on.push({events:{signal:a},update:u?_:`clampRange(${_}, 0, ${f})`})}const wl="_zoom_anchor",$l="_zoom_delta",Ly={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=gt.defined(t),s=i+$l,{x:o,y:a}=t.project.hasChannel,c=O(e.scaleName(H)),u=O(e.scaleName(Q));let l=cn(t.zoom,"scope");return r||(l=l.map(f=>(f.markname=i+Fn,f))),n.push({name:i+wl,on:[{events:l,update:r?"{"+[c?`x: invert(${c}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:l,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&El(e,t,o,"width",n),a!==void 0&&El(e,t,a,"height",n),n}};function El(e,t,n,i,r){const s=t.name,o=n.channel,a=gt.defined(t),c=r.find(v=>v.name===n.signals[a?"data":"visual"]),u=e.getSizeSignalRef(i).signal,l=e.getScaleComponent(o),f=l&&l.get("type"),d=a?no(e,o):c.name,p=s+$l,h=`${s}${wl}.${o}`,g=!a||!l?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${l.get("exponent")??1}`:f==="symlog"?`, ${l.get("constant")??1}`:"":"",y=`${g}(${d}, ${h}, ${p}${m})`;c.on.push({events:{signal:p},update:a?y:`clampRange(${y}, 0, ${u})`})}const Zt="_store",zt="_tuple",My="_modify",_l="vlSelectionResolve",hr=[xy,yy,hy,yl,ml,gt,bl,zy,Iy,Ly,hl];function Dy(e){let t=e.parent;for(;t&&!ve(t);)t=t.parent;return t}function Jt(e,{escape:t}={escape:!0}){let n=t?O(e.name):e.name;const i=Dy(e);if(i){const{facet:r}=i;for(const s of _e)r[s]&&(n+=` + '__facet_${s}_' + (facet[${O(i.vgField(s))}])`)}return n}function co(e){return ie(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function kl(e,t){(vi(t.select)||!t.select.on)&&delete e.events,(vi(t.select)||!t.select.clear)&&delete e.clear,(vi(t.select)||!t.select.toggle)&&delete e.toggle}function uo(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...uo(e.object)),t.push(...uo(e.property))),t)}function Cl(e){return e.object.type==="MemberExpression"?Cl(e.object):e.object.name==="datum"}function Fl(e){const t=Vf(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&Cl(i)&&n.add(uo(i).slice(1).join("."))}),n}class An extends I{clone(){return new An(null,this.model,C(this.filter))}constructor(t,n,i){super(t);this.model=n,this.filter=i,this.expr=mr(this.model,this.filter,this),this._dependentFields=Fl(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function jy(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const s=W(r.name),o=r.select,a=N(o)?o:o.type,c=z(o)?C(o):{type:a},u=i[a];for(const d in u){if(d==="fields"||d==="encodings")continue;d==="mark"&&(c[d]={...u[d],...c[d]}),(c[d]===void 0||c[d]===!0)&&(c[d]=C(u[d]??c[d]))}const l=n[s]={...c,name:s,type:a,init:r.value,bind:r.bind,events:N(c.on)?cn(c.on,"scope"):V(C(c.on))},f=C(r);for(const d of hr)d.defined(l)&&d.parse&&d.parse(e,l,f)}return n}function Nl(e,t,n,i="datum"){const r=N(t)?t:t.param,s=W(r),o=O(s+Zt);let a;try{a=e.getSelectionComponent(s,r)}catch(d){return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,p=a.project.timeUnit.clone();d.parent?p.insertAsParentOf(d):d.parent=p}const c=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",u=a.resolve==="global"?")":`, ${O(a.resolve)})`,l=`${c}${o}, ${i}${u}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${l}`:`!${f} || ${l}`}function Tl(e,t,n){const i=W(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch(a){return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&x(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${O(s)}.`);else if(r&&!s){const a=o.project.items.filter(c=>c.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,x((a.length?"Multiple ":"No ")+`matching ${O(r)} encoding found for selection ${O(n.param)}. Using "field": ${O(s)}.`)):s=a[0].field}return`${o.name}[${O(we(s))}]`}function Uy(e,t){for(const[n,i]of bt(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new ye(new An(t,e,{param:n}),r,G.Lookup,e.component.data.outputNodeRefCounts)}}function mr(e,t,n){return Wn(t,i=>N(i)?i:yg(i)?Nl(e,i,n):uc(i))}function By(e,t){return e?E(e)&&!kt(e)?e.map(n=>As(n,t)).join(", "):e:void 0}function lo(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function ci(e,t,n,i={header:!1}){const{disable:r,orient:s,scale:o,labelExpr:a,title:c,zindex:u,...l}=e.combine();if(r)return;for(const f in l){const d=wh[f],p=l[f];if(d&&d!==t&&d!=="both")delete l[f];else if(ri(p)){const{condition:h,...g}=p,m=V(h),y=Vc[f];if(y){const{vgProp:v,part:k}=y,_=[...m.map(T=>{const{test:L,...ue}=T;return{test:mr(null,L),...ue}}),g];lo(l,k,v,_),delete l[f]}else if(y===null){const v={signal:m.map(k=>{const{test:_,...T}=k;return`${mr(null,_)} ? ${Ta(T)} : `}).join("")+Ta(g)};l[f]=v}}else if($(p)){const h=Vc[f];if(h){const{vgProp:g,part:m}=h;lo(l,m,g,p),delete l[f]}}A(["labelAlign","labelBaseline"],f)&&l[f]===null&&delete l[f]}if(t==="grid"){if(!l.grid)return;if(l.encode){const{grid:f}=l.encode;l.encode={...f?{grid:f}:{}},M(l.encode)&&delete l.encode}return{scale:o,orient:s,...l,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:X(u,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let d=a;l.encode?.labels?.update&&$(l.encode.labels.update.text)&&(d=Lt(a,"datum.label",l.encode.labels.update.text.signal)),lo(l,"labels","text",{signal:d})}if(l.labelAlign===null&&delete l.labelAlign,l.encode){for(const d of Xc)e.hasAxisPart(d)||delete l.encode[d];M(l.encode)&&delete l.encode}const f=By(c,n);return{scale:o,orient:s,grid:!1,...f?{title:f}:{},...l,...n.aria===!1?{aria:!1}:{},zindex:X(u,0)}}}function Al(e){const{axes:t}=e.component,n=[];for(const i of at)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function Wy(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>ci(r,"grid",t)),...i.map(r=>ci(r,"grid",t)),...n.map(r=>ci(r,"main",t)),...i.map(r=>ci(r,"main",t))].filter(r=>r)}function Ol(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},c=new Set([...b(o),...b(a)]),u={};for(const l of c.values())u[l]={signal:`${i.signal} === "${s}" ? ${Oe(o[l])} : ${Oe(a[l])}`};return u}return t[r]})])}function Hy(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:gc(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=$(n)?"axisOrient":`axis${Hn(n)}`,a=[...r,...r.map(u=>s+u.substr(4))],c=["axis",o,s];return{vlOnlyAxisConfig:Ol(a,i,e,n),vgAxisConfig:Ol(c,i,e,n),axisConfigStyle:qy([...c,...a],i)}}function qy(e,t){const n=[{}];for(const i of e){let r=t[i]?.style;if(r){r=V(r);for(const s of r)n.push(t.style[s])}}return Object.assign.apply(null,n)}function fo(e,t,n,i={}){const r=Oa(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(i[s]?.[e]!==void 0)return{configFrom:s,configValue:i[s][e]};return{}}const Pl={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??Gy(n,e),gridScale:({model:e,channel:t})=>Vy(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||Rl(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||zl(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Yy(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??Ky(t.type,n,S(t)&&!!t.timeUnit,S(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??Zy({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:Jy,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=Il(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return za(r?[Rc(r)]:[],S(o)?[Rc(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>eb(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??tb(n,t)};function Gy(e,t){return!J(e)&&S(t)&&!U(t?.bin)&&!re(t?.bin)}function Vy(e,t){const n=t==="x"?"y":"x";return e.getScaleComponent(n)?e.scaleName(n):void 0}function Xy(e,t,n,i,r){const s=t?.labelAngle;if(s!==void 0)return $(s)?s:qn(s);{const{configValue:o}=fo("labelAngle",i,t?.style,r);return o!==void 0?qn(o):n===H&&A([ys,ms],e.type)&&!(S(e)&&e.timeUnit)?270:void 0}}function po(e){return`(((${e.signal} % 360) + 360) % 360)`}function zl(e,t,n,i){if(e!==void 0)if(n==="x"){if($(e)){const r=po(e),s=$(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45{if(!Yt(i))return;if(zc(i.sort)){const{field:s,timeUnit:o}=i,a=i.sort,c=a.map((u,l)=>`${uc({field:s,timeUnit:o,equal:u})} ? ${l} : `).join("")+a.length;t=new On(t,{calculate:c,as:Pn(i,r,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${P(this.transform)}`}}function Pn(e,t,n){return w(e,{prefix:t,suffix:"sort_index",...n})}function yr(e,t){return A(["top","bottom"],t)?"column":A(["left","right"],t)||e==="row"?"row":"column"}function zn(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return X((t||{})[e],r[e],n.header[e])}function br(e,t,n,i){const r={};for(const s of e){const o=zn(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const go=["row","column"],ho=["header","footer"];function nb(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=br(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),c=yr(t,a),u=qn(o);return{name:`${t}-title`,type:"group",role:`${c}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...Ml(u,c),...Ll(c,u,s),...Dl(i,r,t,Hh,gu)}}}function Ll(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=Rl(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function Ml(e,t){const n=zl(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function ib(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of ho)if(n[r])for(const s of n[r]){const o=sb(e,t,r,n,s);o!=null&&i.push(o)}return i}function rb(e,t){const{sort:n}=e;return lt(n)?{field:w(n,{expr:"datum"}),order:n.order??"ascending"}:E(n)?{field:Pn(e,t,{expr:"datum"}),order:"ascending"}:{field:w(e,{expr:"datum"}),order:n??"ascending"}}function mo(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:c}=br(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=ks({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,l=yr(t,a);return{text:{signal:c?Lt(Lt(c,"datum.label",u),"datum.value",w(e,{expr:"parent"})):u},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...Ml(s,l),...Ll(l,s,o),...Dl(n,e,t,qh,hu)}}function sb(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=br(["labelOrient"],o.header,a,t);(t==="row"&&!A(["top","bottom"],f)||t==="column"&&!A(["left","right"],f))&&(s=mo(o,t,a))}const c=ve(e)&&!ei(e.facet),u=r.axes,l=u?.length>0;if(s||l){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:rb(o,t)}:{},...l&&c?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...l?{axes:u}:{}}}}return null}const ob={column:{start:0,end:1},row:{start:1,end:0}};function ab(e,t){return ob[t][e]}function cb(e,t){const n={};for(const i of _e){const r=e[i];if(r?.facetFieldDef){const{titleAnchor:s,titleOrient:o}=br(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=yr(i,o),c=ab(s,a);c!==void 0&&(n[a]=c)}}return M(n)?void 0:n}function Dl(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=zn(o,t?.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function yo(e){return[...xr(e,"width"),...xr(e,"height"),...xr(e,"childWidth"),...xr(e,"childHeight")]}function xr(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(J(o)&&Ct(a)){const c=e.scaleName(n);if(ve(e.parent)){const u=e.parent.component.resolve;if(u.scale[n]==="independent")return[jl(c,a)]}return[jl(c,a),{name:r,update:Ul(c,s,`domain('${c}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=qs(e.config.view,s?"width":"height"),c=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:c,on:[{update:c,events:"window:resize"}]}]}else return[{name:r,value:i}]}function jl(e,t){const n=`${e}_step`;return $(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function Ul(e,t,n){const i=t.get("type"),r=t.get("padding"),s=X(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${Oe(o)}, ${Oe(s)}) * ${e}_step`}function Bl(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function Wl(e,t){return b(e).reduce((n,i)=>({...n,...Nn({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>B(r.value),invalidValueRef:void 0})}),{})}function Hl(e,t){if(ve(t))return e==="theta"?"independent":"shared";if(Mn(t))return"shared";if(Po(t))return Y(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function bo(e,t){const n=e.scale[t],i=Y(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&x(Dp(t)),"independent"):e[i][t]||"shared"}const ub={...Xh,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},ql=b(ub);class lb extends pt{}const Gl={symbols:fb,gradient:db,labels:pb,entries:gb};function fb(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:c,mark:u}=n,l=o.filled&&u!=="trail";let f={...Kd({},n,Wg),...al(n,{filled:l})};const d=r.get("symbolOpacity")??c.legend.symbolOpacity,p=r.get("symbolFillColor")??c.legend.symbolFillColor,h=r.get("symbolStrokeColor")??c.legend.symbolStrokeColor,g=d===void 0?Vl(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||l&&i===ge)delete f.fill;else if(f.fill.field)p?delete f.fill:(f.fill=B(c.legend.symbolBaseFillColor??"black"),f.fillOpacity=B(g??1));else if(E(f.fill)){const m=xo(a.fill??a.color)??o.fill??(l&&o.color);m&&(f.fill=B(m))}}if(f.stroke){if(i==="stroke"||!l&&i===ge)delete f.stroke;else if(f.stroke.field||h)delete f.stroke;else if(E(f.stroke)){const m=X(xo(a.stroke||a.color),o.stroke,l?o.color:void 0);m&&(f.stroke={value:m})}}if(i!==ot){const m=S(t)&&Yl(n,r,t);m?f.opacity=[{test:m,...B(g??1)},B(c.legend.unselectedOpacity)]:g&&(f.opacity=B(g))}return f={...f,...e},M(f)?void 0:f}function db(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const c=i.get("gradientOpacity")??r.legend.gradientOpacity,u=c===void 0?Vl(o.opacity)||s.opacity:void 0;return u&&(a.opacity=B(u)),a={...a,...e},M(a)?void 0:a}function pb(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=S(t)?Yl(n,r,t):void 0,c=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:u,formatType:l}=s;let f;Xt(l)?f=ze({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:l,config:o}):u===void 0&&l===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=ze({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&S(t)&&t.timeUnit===void 0&&(f=ze({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...c?{opacity:c}:{},...f?{text:f}:{},...e};return M(d)?void 0:d}function gb(e,{legendCmpt:t}){const n=t.get("selections");return n?.length?{...e,fill:{value:"transparent"}}:e}function Vl(e){return Xl(e,(t,n)=>Math.max(t,n.value))}function xo(e){return Xl(e,(t,n)=>X(t,n.value))}function Xl(e,t){return lh(e)?V(e.condition).reduce(t,e.value):Re(e)?e.value:void 0}function Yl(e,t,n){const i=t.get("selections");if(!i?.length)return;const r=O(n.field);return i.map(s=>{const o=O(W(s)+Zt);return`(!length(data(${o})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`}).join(" || ")}const Kl={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return Nc(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return Tc(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??vb(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??wb(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??mb(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>$n(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(mn(n)&&Xe(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>hb(t,e)};function hb(e,t){const n=e.values;return E(n)?Gc(t,n):$(n)?n:void 0}function mb(e,t,n,i){if(t!=="shape"){const r=xo(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function yb(e){const{legend:t}=e;return X(t.type,bb(e))}function bb({channel:e,timeUnit:t,scaleType:n}){if(mn(e)){if(A(["quarter","month","day"],t))return"symbol";if(Xe(n))return"gradient"}return"symbol"}function xb({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??Sb(n,t)}function Sb(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function vb({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:c}=e;return Xe(r)?n==="horizontal"?i==="top"||i==="bottom"?Ql(t,"width",o,s):o:Ql(t,"height",c,a):void 0}function Ql(e,t,n,i){const r=e.getSizeSignalRef(t).signal;return{signal:`clamp(${r}, ${n}, ${i})`}}function wb(e){return A(["quantile","threshold","log","symlog"],e)?"greedy":void 0}function Zl(e){const t=q(e)?$b(e):Cb(e);return e.component.legends=t,t}function $b(e){const{encoding:t}=e,n={};for(const i of[ge,...yu]){const r=K(t[i]);if(!r||!e.getScaleComponent(i))continue;if(i===he&&S(r)&&r.type===xn)continue;n[i]=kb(e,i)}return n}function Eb(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function _b(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!n?.values;case"title":if(t==="title"&&e===i?.title)return!0}return e===(n||{})[t]}function kb(e,t){let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new lb({},Eb(e,t));Ry(e,t,a);const c=n!==void 0?!n:o.disable;if(a.set("disable",c,n!==void 0),c)return a;n=n||{};const u=e.getScaleComponent(t).get("type"),l=K(r[t]),f=S(l)?Z(l.timeUnit)?.unit:void 0,d=n.orient||s.legend.orient||"right",p=yb({legend:n,channel:t,timeUnit:f,scaleType:u}),h=xb({legend:n,legendType:p,orient:d,legendConfig:o}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:l,legendConfig:o,config:s,scaleType:u,orient:d,legendType:p,direction:h};for(const _ of ql){if(p==="gradient"&&_.startsWith("symbol")||p==="symbol"&&_.startsWith("gradient"))continue;const T=_ in Kl?Kl[_](g):n[_];if(T!==void 0){const L=_b(T,_,n,e.fieldDef(t));(L||s.legend[_]===void 0)&&a.set(_,T,L)}}const m=n?.encoding??{},y=a.get("selections"),v={},k={fieldOrDatumDef:l,model:e,channel:t,legendCmpt:a,legendType:p};for(const _ of["labels","legend","title","symbols","gradient","entries"]){const T=Wl(m[_]??{},e),L=_ in Gl?Gl[_](T,k):T;L!==void 0&&!M(L)&&(v[_]={...y?.length&&S(l)?{name:`${W(l.field)}_legend_${_}`}:{},...y?.length?{interactive:!!y}:{},update:L})}return M(v)||a.set("encode",v,!!n?.encoding),a}function Cb(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){Zl(i);for(const r of b(i.component.legends))n.legend[r]=bo(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=Jl(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of b(t))for(const r of e.children){if(!r.component.legends[i])continue;n.legend[i]==="shared"&&delete r.component.legends[i]}return t}function Jl(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const s of ql){const o=At(e.getWithExplicit(s),t.getWithExplicit(s),s,"legend",(a,c)=>{switch(s){case"symbolType":return Fb(a,c);case"title":return Ia(a,c);case"type":return r=!0,Se("symbol")}return cr(a,c,s,"legend")});e.setWithExplicit(s,o)}return r&&(e.implicit?.encode?.gradient&&$i(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&$i(e.explicit,["encode","gradient"])),e}function Fb(e,t){return t.value==="circle"?t:e}function Nb(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function ef(e){const t=e.component.legends,n={};for(const r of b(t)){const s=e.getScaleComponent(r),o=D(s.get("domains"));if(n[o])for(const a of n[o]){const c=Jl(a,t[r]);c||n[o].push(t[r])}else n[o]=[t[r].clone()]}const i=ie(n).flat().map(r=>Tb(r,e.config)).filter(r=>r!==void 0);return i}function Tb(e,t){const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(n)return;if(t.aria===!1&&s.aria==null&&(s.aria=!1),s.encode?.symbols){const o=s.encode.symbols.update;o.fill&&o.fill.value!=="transparent"&&!o.stroke&&!s.stroke&&(o.stroke={value:"transparent"});for(const a of yu)s[a]&&delete o[a]}if(s.title||delete s.title,i!==void 0){let o=i;s.encode?.labels?.update&&$(s.encode.labels.update.text)&&(o=Lt(i,"datum.label",s.encode.labels.update.text.signal)),Nb(s,"labels","text",{signal:o})}return s}function Ab(e){return Mn(e)||Po(e)?Ob(e):tf(e)}function Ob(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),tf(e))}function tf(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const c=$(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return A(o,c)||o.push(c),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const Pb=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class nf extends pt{constructor(t,n,i,r){super({...n},{name:t});this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function rf(e){e.component.projection=q(e)?zb(e):Lb(e)}function zb(e){if(e.hasProjection){const t=oe(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?Rb(e):void 0,s=new nf(e.projectionName(!0),{...oe(e.config.projection),...t},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}return}function Rb(e){const t=[],{encoding:n}=e;for(const i of[[Te,Ne],[Ee,Ae]])(K(n[i[0]])||K(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(he)&&e.typedFieldDef(he).type===xn&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(G.Main)),t}function Ib(e,t){const n=jr(Pb,r=>!on(e.explicit,r)&&!on(t.explicit,r)?!0:!!(on(e.explicit,r)&&on(t.explicit,r)&&be(e.get(r),t.get(r)))),i=be(e.size,t.size);if(i){if(n)return e;if(be(e.explicit,{}))return t;if(be(t.explicit,{}))return e}return null}function Lb(e){if(e.children.length===0)return;let t;for(const i of e.children)rf(i);const n=jr(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=Ib(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new nf(i,t.specifiedProjection,t.size,C(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}return}function Mb(e,t,n,i){if(ii(t,n)){const r=q(e)?e.axis(n)??e.legend(n)??{}:{},s=w(t,{expr:"datum"}),o=w(t,{expr:"datum",binSuffix:"end"});return{formulaAs:w(t,{binSuffix:"range",forAs:!0}),formula:Jn(s,o,r.format,r.formatType,i)}}return{}}function sf(e,t){return`${_a(e)}_${t}`}function Db(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function So(e,t,n){const i=Zi(n,void 0)??{},r=sf(i,t);return e.getName(`${r}_bins`)}function jb(e){return"as"in e}function of(e,t,n){let i,r;jb(e)?i=N(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[w(e,{forAs:!0}),w(e,{binSuffix:"end",forAs:!0})];const s={...Zi(t,void 0)},o=sf(s,e.field),{signal:a,extentSignal:c}=Db(n,o);if(Pi(s.extent)){const l=s.extent;r=Tl(n,l.param,l),delete s.extent}const u={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...c?{extentSignal:c}:{},...r?{span:r}:{}};return{key:o,binComponent:u}}class et extends I{clone(){return new et(null,C(this.bins))}constructor(t,n){super(t);this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{if(fe(s)&&U(s.bin)){const{key:a,binComponent:c}=of(s,s.bin,n);r[a]={...c,...r[a],...Mb(n,s,o,n.config)}}return r},{});return M(i)?null:new et(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=of(n,n.bin,i);return new et(t,{[r]:s})}merge(t,n){for(const i of b(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=je([...this.bins[i].as,...t.bins[i].as],P)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(ie(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(ie(this.bins).map(t=>t.field))}hash(){return`Bin ${P(this.bins)}`}assemble(){return ie(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...o}=t.bin,a={type:"bin",field:we(t.field),as:i,signal:t.signal,...Pi(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!s&&t.extentSignal&&(n.push({type:"extent",field:we(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const c of r)for(let u=0;u<2;u++)n.push({type:"formula",expr:w({field:i[u]},{expr:"datum"}),as:c[u]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function Ub(e,t,n,i){const r=q(i)?i.encoding[He(t)]:void 0;if(fe(n)&&q(i)&&Lc(n,r,i.markDef,i.config)){e.add(w(n,{})),e.add(w(n,{suffix:"end"}));const{mark:s,markDef:o,config:a}=i,c=Nt({fieldDef:n,markDef:o,config:a});Qn(s)&&c!==.5&&Y(t)&&(e.add(w(n,{suffix:ur})),e.add(w(n,{suffix:lr}))),n.bin&&ii(n,t)&&e.add(w(n,{binSuffix:"range"}))}else if(ma(t)){const s=ha(t);e.add(i.getName(s))}else e.add(w(n));return Yt(n)&&Tg(n.scale?.range)&&e.add(n.scale.range.field),e}function Bb(e,t){for(const n of b(t)){const i=t[n];for(const r of b(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class Me extends I{clone(){return new Me(null,new Set(this.dimensions),C(this.measures))}constructor(t,n,i){super(t);this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(o=>{o.aggregate&&(i=!0)});const r={},s=new Set;return i?(n.forEachFieldDef((o,a)=>{const{aggregate:c,field:u}=o;if(c)if(c==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([w(o,{forAs:!0})]);else{if(ct(c)||_t(c)){const l=ct(c)?"argmin":"argmax",f=c[l];r[f]??(r[f]={}),r[f][l]=new Set([w({op:l,field:f},{forAs:!0})])}else r[u]??(r[u]={}),r[u][c]=new Set([w(o,{forAs:!0})]);qe(a)&&n.scaleDomain(a)==="unaggregated"&&(r[u]??(r[u]={}),r[u].min=new Set([w({field:u,aggregate:"min"},{forAs:!0})]),r[u].max=new Set([w({field:u,aggregate:"max"},{forAs:!0})]))}else Ub(s,a,o,n)}),s.size+b(r).length===0?null:new Me(t,s,r)):null}static makeFromTransform(t,n){var i;const r=new Set,s={};for(const o of n.aggregate){const{op:a,field:c,as:u}=o;a&&(a==="count"?(s["*"]??(s["*"]={}),s["*"].count=new Set([u||w(o,{forAs:!0})])):(s[c]??(s[c]={}),(i=s[c])[a]??(i[a]=new Set),s[c][a].add(u||w(o,{forAs:!0}))))}for(const o of n.groupby??[])r.add(o);return r.size+b(s).length===0?null:new Me(t,r,s)}merge(t){return oa(this.dimensions,t.dimensions)?(Bb(this.measures,t.measures),!0):(tg("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...b(this.measures)])}producedFields(){const t=new Set;for(const n of b(this.measures))for(const i of b(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${P({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of b(this.measures))for(const o of b(this.measures[s]))for(const a of this.measures[s][o])i.push(a),t.push(o),n.push(s==="*"?null:we(s));const r={type:"aggregate",groupby:[...this.dimensions].map(we),ops:t,fields:n,as:i};return r}}class Rn extends I{constructor(t,n,i,r){super(t);this.model=n,this.name=i,this.data=r;for(const s of _e){const o=n.facet[s];if(o){const{bin:a,sort:c}=o;this[s]={name:n.getName(`${s}_domain`),fields:[w(o),...U(a)?[w(o,{binSuffix:"end"})]:[]],...lt(c)?{sortField:c}:E(c)?{sortIndexField:Pn(o,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of _e)this[n]&&(t+=` ${n.charAt(0)}:${P(this[n])}`);return t}get fields(){const t=[];for(const n of _e)this[n]?.fields&&t.push(...this[n].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of _e)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of at){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(J(r)&&Ct(s)){const o=vr(this.childModel,n),a=Ao(o);a?t[n]=a:x(is(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],s=[],o=[],a=[];r&&i&&i[r]&&(n?(s.push(`distinct_${i[r]}`),o.push("max")):(s.push(i[r]),o.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:c,sortIndexField:u}=this[t];if(c){const{op:l=qi,field:f}=c;s.push(f),o.push(l),a.push(w(c,{forAs:!0}))}else u&&(s.push(u),o.push("max"),a.push(u));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...s.length?{fields:s,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const c of go){for(const u of ho){const l=(i[c]&&i[c][u])??[];for(const f of l)if(f.axes?.length>0){s[c]=!0;break}}if(s[c]){const u=`length(data("${this.facet.name}"))`,l=c==="row"?n?{signal:`ceil(${u} / ${n})`}:1:n?{signal:`min(${u}, ${n})`}:{signal:u};r.push({name:`${this.facet.name}_${c}`,transform:[{type:"sequence",start:0,stop:l}]})}}const{row:o,column:a}=s;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:s,facet:o}=this;if(r&&s&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),c=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:c}]})}for(const a of[nt,tt])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(o){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function af(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Wb(e,t){const n=Hr(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=af(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=af(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return x(lp(t)),null}function Hb(e){const t={};return wi(e.filter,n=>{if(cc(n)){let i=null;us(n)?i=xe(n.equal):fs(n)?i=xe(n.lte):ls(n)?i=xe(n.lt):ds(n)?i=xe(n.gt):ps(n)?i=xe(n.gte):gs(n)?i=n.range[0]:hs(n)&&(i=(n.oneOf??n.in)[0]),i&&(Bt(i)?t[n.field]="date":j(i)?t[n.field]="number":N(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function qb(e){const t={};function n(i){_n(i)?t[i.field]="date":i.type==="quantitative"&&Bd(i.aggregate)?t[i.field]="number":pn(i.field)>1?i.field in t||(t[i.field]="flatten"):Yt(i)&<(i.sort)&&pn(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((q(e)||ve(e))&&e.forEachFieldDef((i,r)=>{if(fe(i))n(i);else{const s=jt(r),o=e.fieldDef(s);n({...i,type:o.type})}}),q(e)){const{mark:i,markDef:r,encoding:s}=e;if(Ft(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];S(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function Gb(e){const t={};if(q(e)&&e.component.selection)for(const n of b(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&pn(r.field)>1&&(t[r.field]="flatten")}return t}class ce extends I{clone(){return new ce(null,C(this._parse))}constructor(t,n){super(t);this._parse=n}hash(){return`Parse ${P(this._parse)}`}static makeExplicit(t,n,i){let r={};const s=n.data;return!Ot(s)&&s?.format?.parse&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of b(i)){const c=r.getWithExplicit(a);c.value!==void 0&&(c.explicit||c.value===i[a]||c.value==="derived"||i[a]==="flatten"?delete i[a]:x(Wa(a,i[a],c.value)))}for(const a of b(n)){const c=r.get(a);c!==void 0&&(c===n[a]?delete n[a]:x(Wa(a,n[a],c)))}const s=new pt(n,i);r.copyAll(s);const o={};for(const a of b(s.combine())){const c=s.get(a);c!==null&&(o[a]=c)}return b(o).length===0||r.parseNothing?null:new ce(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of b(this._parse)){const i=this._parse[n];pn(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(b(this._parse))}dependentFields(){return new Set(b(this._parse))}assembleTransforms(t=!1){return b(this._parse).filter(n=>t?pn(n)>1:!0).map(n=>{const i=Wb(n,this._parse[n]);if(!i)return null;const r={type:"formula",expr:i,as:dn(n)};return r}).filter(n=>n!==null)}}class Rt extends I{clone(){return new Rt(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Le])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Le}}}class ui extends I{clone(){return new ui(null,this.params)}constructor(t,n){super(t);this.params=n}dependentFields(){return new Set}producedFields(){return}hash(){return`Graticule ${P(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class li extends I{clone(){return new li(null,this.params)}constructor(t,n){super(t);this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${P(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class en extends I{constructor(t){super(null);t??(t={name:"source"});let n;if(Ot(t)||(n=t.format?{...pe(t.format,["parse"])}:{}),si(t))this._data={values:t.values};else if(Cn(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];A(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else Xu(t)?this._data={values:[{type:"Sphere"}]}:(Gu(t)||Ot(t))&&(this._data={});this._generator=Ot(t),t.name&&(this._name=t.name),n&&!M(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){return}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var cf=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},Vb=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},fi;function vo(e){return e instanceof en||e instanceof ui||e instanceof li}class wo{constructor(){fi.set(this,void 0),cf(this,fi,!1,"f")}setModified(){cf(this,fi,!0,"f")}get modifiedFlag(){return Vb(this,fi,"f")}}fi=new WeakMap;class tn extends wo{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const n=this.getNodeDepths(t,0,new Map),i=[...n.entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class $o extends wo{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Xb extends $o{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Yb extends $o{constructor(t){super();this.requiresSelectionId=t&&co(t)}run(t){t instanceof Rt&&(this.requiresSelectionId&&(vo(t.parent)||t.parent instanceof Me||t.parent instanceof ce)||(this.setModified(),t.remove()))}}class Kb extends wo{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Je&&(i=t.producedFields(),Ur(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class Qb extends $o{constructor(){super()}run(t){t instanceof ye&&!t.isRequired()&&(this.setModified(),t.remove())}}class Zb extends tn{run(t){if(vo(t))return;if(t.numChildren()>1)return;for(const n of t.children)if(n instanceof ce)if(t instanceof ce)this.setModified(),t.merge(n);else{if(Wr(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}return}}class Jb extends tn{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof ce);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const c of b(a))c in r?r[c]!==a[c]&&s.add(c):r[c]=a[c]}for(const o of s)delete r[o];if(!M(r)){this.setModified();const o=new ce(t,r);for(const a of n){if(a instanceof ce)for(const c of b(r))delete a.parse[c];t.removeChild(a),a.parent=o,a instanceof ce&&b(a.parse).length===0&&a.remove()}}}}}class ex extends tn{run(t){t instanceof ye||t.numChildren()>0||t instanceof Rn||(t instanceof en||(this.setModified(),t.remove()))}}class tx extends tn{run(t){const n=t.children.filter(r=>r instanceof Je),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class nx extends tn{run(t){const n=t.children.filter(r=>r instanceof Me),i={};for(const r of n){const s=P(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of b(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class ix extends tn{constructor(t){super();this.model=t}run(t){const n=!(vo(t)||t instanceof An||t instanceof ce||t instanceof Rt),i=[],r=[];for(const s of t.children)s instanceof et&&(n&&!Wr(t.producedFields(),s.dependentFields())?i.push(s):r.push(s));if(i.length>0){const s=i.pop();for(const o of i)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof et?t.merge(s,this.model.renameSignal.bind(this.model)):s.swapWithParent()}if(r.length>1){const s=r.pop();for(const o of r)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified()}}}class rx extends tn{run(t){const n=[...t.children],i=fn(n,o=>o instanceof ye);if(!i||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof ye){let a=o;for(;a.numChildren()===1;){const[c]=a.children;if(c instanceof ye)a=c;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class nn extends I{clone(){return new nn(null,C(this.transform))}constructor(t,n){super(t);this.transform=n}addDimensions(t){this.transform.groupby=je(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??w(t)}hash(){return`JoinAggregateTransform ${P(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const s of this.transform.joinaggregate)n.push(s.op),i.push(this.getDefaultName(s)),t.push(s.field===void 0?null:s.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}class In extends I{clone(){return new In(null,{...this.filter})}constructor(t,n){super(t);this.filter=n}static make(t,n,i){const{config:r,markDef:s}=n,{marks:o,scales:a}=i;if(o==="include-invalid-values"&&a==="include-invalid-values")return null;const c=n.reduceFieldDef((u,l,f)=>{const d=qe(f)&&n.getScaleComponent(f);if(d){const p=d.get("type"),{aggregate:h}=l,g=$s({scaleChannel:f,markDef:s,config:r,scaleType:p,isCountAggregate:Oi(h)});g!=="show"&&g!=="always-valid"&&(u[l.field]=l)}return u},{});return b(c).length?new In(t,c):null}dependentFields(){return new Set(b(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${P(this.filter)}`}assemble(){const t=b(this.filter).reduce((n,i)=>{const r=this.filter[i],s=w(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (${Eo(s)}))`):r.type==="quantitative"&&n.push(Eo(s))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function Eo(e){return`isValid(${e}) && isFinite(+${e})`}function sx(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=w(i);return r&&t.push(r),t},[])}function ox(e){return E(e)&&e.every(t=>N(t))&&e.length>1}class ht extends I{clone(){return new ht(null,C(this._stack))}constructor(t,n){super(t);this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:s,offset:o="zero"}=n,a=[],c=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),c.push(X(f.order,"ascending"));const u={field:a,order:c};let l;return ox(s)?l=s:N(s)?l=[s,`${s}_end`]:l=[`${n.stack}_start`,`${n.stack}_end`],new ht(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:o,sort:u,facetby:[],as:l})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:s,fieldChannel:o,offset:a,impute:c}=i,u=s.map(p=>{const h=r[p];return Ie(h)}).filter(p=>!!p),l=sx(n),f=n.encoding.order;let d;if(E(f)||S(f))d=Pa(f);else{const p=Mc(f)?f.sort:o==="y"?"descending":"ascending";d=l.reduce((h,g)=>(h.field.includes(g)||(h.field.push(g),h.order.push(p)),h),{field:[],order:[]})}return new ht(t,{dimensionFieldDefs:u,stackField:n.vgField(o),facetby:[],stackby:l,sort:d,offset:a,impute:c,as:[n.vgField(o,{suffix:"start",forAs:!0}),n.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${P(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[w(r,{binSuffix:"mid"})]:[w(r,{}),w(r,{binSuffix:"end"})]:[w(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:s,sort:o,offset:a,impute:c,as:u}=this._stack;if(c)for(const l of i){const{bandPosition:f=.5,bin:d}=l;if(d){const p=w(l,{expr:"datum"}),h=w(l,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${Eo(p)} ? ${f}*${p}+${1-f}*${h} : ${p}`,as:w(l,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...s,...n],key:w(l,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:o,as:u,offset:a}),t}}class Ln extends I{clone(){return new Ln(null,C(this.transform))}constructor(t,n){super(t);this.transform=n}addDimensions(t){this.transform.groupby=je(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??w(t)}hash(){return`WindowTransform ${P(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const s=this.transform.frame,o=this.transform.groupby;if(s&&s[0]===null&&s[1]===null&&n.every(f=>Jr(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...o!==void 0?{groupby:o}:{}};const a=[],c=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),c.push(f.order??"ascending");const u={field:a,order:c},l=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:u,...l!==void 0?{ignorePeers:l}:{},...o!==void 0?{groupby:o}:{},...s!==void 0?{frame:s}:{}}}}function ax(e){function t(n){if(!(n instanceof Rn)){const i=n.clone();if(i instanceof ye){const r=ko+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof Me||i instanceof ht||i instanceof Ln||i instanceof nn)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function _o(e){if(e instanceof Rn)if(e.numChildren()===1&&!(e.children[0]instanceof ye)){const t=e.children[0];(t instanceof Me||t instanceof ht||t instanceof Ln||t instanceof nn)&&t.addDimensions(e.fields),t.swapWithParent(),_o(e)}else{const t=e.model.component.data.main;uf(t);const n=ax(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(_o)}function uf(e){if(e instanceof ye&&e.type===G.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Rn||(t.swapWithParent(),uf(e))}}const ko="scale_",Sr=5;function Co(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!Co(t.children))return!1}return!0}function De(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function lf(e,t,n){let i=e.sources,r=!1;return r=De(new Qb,i)||r,r=De(new Yb(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=De(new ex,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=De(new Zb,i)||r,r=De(new ix(t),i)||r,r=De(new Kb,i)||r,r=De(new Jb,i)||r,r=De(new nx,i)||r,r=De(new tx,i)||r,r=De(new Xb,i)||r,r=De(new rx,i)||r),e.sources=i,r}function cx(e,t){Co(e.sources);let n=0,i=0;for(let r=0;rt(n))}}function ff(e){q(e)?ux(e):lx(e)}function ux(e){const t=e.component.scales;for(const n of b(t)){const i=dx(e,n),r=t[n];if(r.setWithExplicit("domains",i),gx(e,n),e.component.data.isFaceted){let s=e;for(;!ve(s)&&s.parent;)s=s.parent;const o=s.component.resolve.scale[n];if(o==="shared")for(const a of i.value)ut(a)&&(a.data=ko+a.data.replace(ko,""))}}}function lx(e){for(const n of e.children)ff(n);const t=e.component.scales;for(const n of b(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=At(i,o.getWithExplicit("domains"),"domains","scale",To);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&x(op),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function fx(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=df(t,n);if(!r){x(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=df(t,n);if(r)return"unaggregated"}return e}function dx(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=fx(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&K(i.x2)?K(i.x)?At(It(n,r,e,"x"),It(n,r,e,"x2"),"domain","scale",To):It(n,r,e,"x2"):t==="y"&&K(i.y2)?K(i.y)?At(It(n,r,e,"y"),It(n,r,e,"y2"),"domain","scale",To):It(n,r,e,"y2"):It(n,r,e,t)}function px(e,t,n){return e.map(i=>{const r=Ji(i,{timeUnit:n,type:t});return{signal:`{data: ${r}}`}})}function Fo(e,t,n){const i=Z(n)?.unit;return t==="temporal"||i?px(e,t,i):[e]}function It(e,t,n,i){const{encoding:r,markDef:s,mark:o,config:a,stack:c}=n,u=K(r[i]),{type:l}=u,f=u.timeUnit,d=ay({invalid:Ge("invalid",s,a),isPath:Ft(o)});if(Ng(t)){const g=It(e,void 0,n,i),m=Fo(t.unionWith,l,f);return Ze([...m,...g.value])}else{if($(t))return Ze([t]);if(t&&t!=="unaggregated"&&!mc(t))return Ze(Fo(t,l,f))}if(c&&i===c.fieldChannel){if(c.offset==="normalize")return Se([[0,1]]);const g=n.requestDataName(d);return Se([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const p=qe(i)&&S(u)?hx(n,i,e):void 0;if(Ke(u)){const g=Fo([u.datum],l,f);return Se(g)}const h=u;if(t==="unaggregated"){const{field:g}=u;return Se([{data:n.requestDataName(d),field:w({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:w({field:g,aggregate:"max"})}])}else if(U(h.bin)){if(J(e))return e==="bin-ordinal"?Se([]):Se([{data:Bn(p)?n.requestDataName(d):n.requestDataName(G.Raw),field:n.vgField(i,ii(h,i)?{binSuffix:"range"}:{}),sort:p===!0||!z(p)?{field:n.vgField(i,{}),op:"min"}:p}]);{const{bin:g}=h;if(U(g)){const m=So(n,h.field,g);return Se([new te(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return Se([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(h.timeUnit&&A(["time","utc"],e)){const g=r[He(i)];if(Lc(h,g,s,a)){const m=n.requestDataName(d),y=Nt({fieldDef:h,fieldDef2:g,markDef:s,config:a}),v=Qn(o)&&y!==.5&&Y(i);return Se([{data:m,field:n.vgField(i,v?{suffix:ur}:{})},{data:m,field:n.vgField(i,{suffix:v?lr:"end"})}])}}return Se(p?[{data:Bn(p)?n.requestDataName(d):n.requestDataName(G.Raw),field:n.vgField(i),sort:p}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function No(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":qi),...i?{field:we(i)}:{},...r?{order:r}:{}}}function gx(e,t){const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=e.fieldDef(t)?.bin,s=mc(i)&&i,o=Ut(r)&&Pi(r.extent)&&r.extent;(s||o)&&n.set("selectionExtent",s??o,!0)}function hx(e,t,n){if(!J(n))return;const i=e.fieldDef(t),r=i.sort;if(zc(r))return{op:"min",field:Pn(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if(lt(r)){const a=s&&!o.has(r.field);return No(r,a)}else if(ah(r)){const{encoding:a,order:c}=r,u=e.fieldDef(a),{aggregate:l,field:f}=u,d=s&&!o.has(f);if(ct(l)||_t(l))return No({field:w(u),order:c},d);if(Jr(l)||!l)return No({op:l,field:f,order:c},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(A(["ascending",void 0],r))return!0}return}function df(e,t){const{aggregate:n,type:i}=e;return n?N(n)&&!Hd.has(n)?{valid:!1,reason:Op(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:Pp(e)}:{valid:!0}:{valid:!1,reason:Ap(e)}}function To(e,t,n,i){return e.explicit&&t.explicit&&x(Mp(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function mx(e){const t=je(e.map(o=>{if(ut(o)){const{sort:a,...c}=o;return c}return o}),P),n=je(e.map(o=>{if(ut(o)){const a=o.sort;return a!==void 0&&!Bn(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}return}).filter(o=>o!==void 0),P);if(t.length===0)return;if(t.length===1){const o=e[0];if(ut(o)&&n.length>0){let a=n[0];if(n.length>1){x(Ya);const c=n.filter(u=>z(u)&&"op"in u&&u.op!=="min");n.every(u=>z(u)&&"op"in u)&&c.length===1?a=c[0]:a=!0}else if(z(a)&&"field"in a){const c=a.field;o.field===c&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=je(n.map(o=>Bn(o)||!("op"in o)||N(o.op)&&o.op in jd?o:(x(jp(o)),!0)),P);let r;i.length===1?r=i[0]:i.length>1&&(x(Ya),r=!0);const s=je(e.map(o=>ut(o)?o.data:null),o=>o);if(s.length===1&&s[0]!==null){const o={data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}};return o}return{fields:t,...r?{sort:r}:{}}}function Ao(e){if(ut(e)&&N(e.field))return e.field;if(qd(e)){let t;for(const n of e.fields)if(ut(n)&&N(n.field)){if(!t)t=n.field;else if(t!==n.field)return x(Up),t}return x(Bp),t}else if(Gd(e)){x(Wp);const t=e.fields[0];return N(t)?t:void 0}return}function vr(e,t){const n=e.component.scales[t],i=n.get("domains").map(r=>(ut(r)&&(r.data=e.lookupDataSource(r.data)),r));return mx(i)}function pf(e){return Mn(e)||Po(e)?e.children.reduce((t,n)=>t.concat(pf(n)),gf(e)):gf(e)}function gf(e){return b(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:c,range:u,reverse:l,...f}=r,d=yx(r.range,s,n,e),p=vr(e,n),h=a?py(e,a,i,p):null;return t.push({name:s,type:o,...p?{domain:p}:{},...h?{domainRaw:h}:{},range:d,...l!==void 0?{reverse:l}:{},...f}),t},[])}function yx(e,t,n,i){if(Y(n)){if(Ct(e))return{step:{signal:`${t}_step`}}}else if(z(e)&&ut(e))return{...e,data:i.lookupDataSource(e.data)};return e}class hf extends pt{constructor(t,n){super({},{name:t});this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(A([se.LOG,se.TIME,se.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&A([se.LINEAR,se.SQRT,se.POW],t))return"definitely";const i=this.get("domains");if(i.length>0){let r=!1,s=!1,o=!1;for(const a of i){if(E(a)){const c=a[0],u=a[a.length-1];if(j(c)&&j(u))if(c<=0&&u>=0){r=!0;continue}else{s=!0;continue}}o=!0}if(r)return"definitely";if(s&&!o)return"definitely-not"}return"maybe"}}const bx=["range","scheme"];function xx(e){const t=e.component.scales;for(const n of Qr){const i=t[n];if(!i)continue;const r=Sx(n,e);i.setWithExplicit("range",r)}}function mf(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:i,field:r}=n,s=me(t),o=e.getName(s);if(z(i)&&i.binned&&i.step!==void 0)return new te(()=>{const a=e.scaleName(t),c=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${c})`});if(U(i)){const a=So(e,r,i);return new te(()=>{const c=e.getSignalName(a),u=`(${c}.stop - ${c}.start) / ${c}.step`;return`${e.getSignalName(o)} / (${u})`})}}return}function Sx(e,t){const n=t.specifiedScales[e],{size:i}=t,r=t.getScaleComponent(e),s=r.get("type");for(const f of bx)if(n[f]!==void 0){const d=xs(s,f),p=yc(e,f);if(!d)x(Va(s,f,e));else if(p)x(p);else switch(f){case"range":{const h=n.range;if(E(h)){if(Y(e))return Ze(h.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return te.fromName(y,m)}return g}))}else if(z(h))return Ze({data:t.requestDataName(G.Main),field:h.field,sort:{op:"min",field:t.vgField(e)}});return Ze(h)}case"scheme":return Ze(vx(n[f]))}}const o=e===H||e==="xOffset"?"width":"height",a=i[o];if(Qe(a)){if(Y(e))if(J(s)){const f=bf(a,t,e);if(f)return Ze({step:f})}else x(Xa(o));else if(Xn(e)){const f=e===xt?"x":"y",d=t.getScaleComponent(f),p=d.get("type");if(p==="band"){const h=xf(a,s);if(h)return Ze(h)}}}const{rangeMin:c,rangeMax:u}=n,l=wx(e,t);return(c!==void 0||u!==void 0)&&xs(s,"rangeMin")&&E(l)&&l.length===2?Ze([c??l[0],u??l[1]]):Se(l)}function vx(e){return Fg(e)?{scheme:e.name,...pe(e,["name"])}:{scheme:e}}function yf(e,t,n,{center:i}={}){const r=me(e),s=t.getName(r),o=t.getSignalName.bind(t);return e===Q&&Pe(n)?i?[te.fromName(a=>`${o(a)}/2`,s),te.fromName(a=>`-${o(a)}/2`,s)]:[te.fromName(o,s),0]:i?[te.fromName(a=>`-${o(a)}/2`,s),te.fromName(a=>`${o(a)}/2`,s)]:[0,te.fromName(o,s)]}function wx(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:o}=K(s[e]),a=t.getScaleComponent(e),c=a.get("type"),{domain:u,domainMid:l}=t.specifiedScales[e];switch(e){case H:case Q:{if(A(["point","band"],c)){const f=Sf(e,n,i.view);if(Qe(f)){const d=bf(f,t,e);return{step:d}}}return yf(e,t,c)}case xt:case gn:return $x(e,t,c);case st:{const f=kx(r,i),d=Cx(r,n,t,i);return Sn(c)?_x(f,d,Ex(c,i,u,e)):[f,d]}case $e:return[0,Math.PI*2];case Mt:return[0,360];case Fe:return[0,new te(()=>{const f=t.getSignalName(ve(t.parent)?"child_width":"width"),d=t.getSignalName(ve(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case wt:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case $t:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case he:return"symbol";case ge:case Be:case We:return c==="ordinal"?o==="nominal"?"category":"ordinal":l!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case ot:case St:case vt:return[i.scale.minOpacity,i.scale.maxOpacity]}}function bf(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=Ti(n),o=i[s],a=xu({step:e,offsetIsDiscrete:F(o)&&lc(o.type)});if(a==="offset"&&Zc(i,s)){const c=t.getScaleComponent(s),u=t.scaleName(s);let l=`domain('${u}').length`;if(c.get("type")==="band"){const d=c.get("paddingInner")??c.get("padding")??0,p=c.get("paddingOuter")??c.get("padding")??0;l=`bandspace(${l}, ${d}, ${p})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${l} / (1-${ts(f)})`}}else return e.step}function xf(e,t){const n=xu({step:e,offsetIsDiscrete:J(t)});return n==="offset"?{step:e.step}:void 0}function $x(e,t,n){const i=e===xt?"x":"y",r=t.getScaleComponent(i);if(!r)return yf(i,t,n,{center:!0});const s=r.get("type"),o=t.scaleName(i),{markDef:a,config:c}=t;if(s==="band"){const u=Sf(i,t.size,t.config.view);if(Qe(u)){const l=xf(u,n);if(l)return l}return[0,{signal:`bandwidth('${o}')`}]}else{const u=t.encoding[i];if(S(u)&&u.timeUnit){const l=oc(u.timeUnit,h=>`scale('${o}', ${h})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=Nt({fieldDef:u,markDef:a,config:c})-.5,p=d!==0?` + ${d}`:"";if(f){const h=$(f)?`${f.signal}/2`+p:`${f/2+d}`,g=$(f)?`(1 - ${f.signal}/2)`+p:`${1-f/2+d}`;return[{signal:`${h} * (${l})`},{signal:`${g} * (${l})`}]}return[0,{signal:l}]}return ra(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function Sf(e,t,n){const i=e===H?"width":"height",r=t[i];return r||or(n,i)}function Ex(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&E(n)?n.length+1:(x(Zp(i)),3)}}function _x(e,t,n){const i=()=>{const r=Oe(t),s=Oe(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return $(t)?new te(i):{signal:i()}}function kx(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(Ri("size",e))}const vf=.95;function Cx(e,t,n,i){const r={x:mf(n,"x"),y:mf(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=wf(t,r,i.view);return j(s)?s-1:new te(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=wf(t,r,i.view);return j(s)?Math.pow(vf*s,2):new te(()=>`pow(${vf} * ${s.signal}, 2)`)}}throw new Error(Ri("size",e))}function wf(e,t,n){const i=Qe(e.width)?e.width.step:sr(n,"width"),r=Qe(e.height)?e.height.step:sr(n,"height");return t.x||t.y?new te(()=>{const s=[t.x?t.x.signal:i,t.y?t.y.signal:r];return`min(${s.join(", ")})`}):Math.min(i,r)}function $f(e,t){q(e)?Fx(e,t):kf(e,t)}function Fx(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of b(n)){const c=o[a],u=n[a],l=e.getScaleComponent(a),f=K(r[a]),d=c[t],p=l.get("type"),h=l.get("padding"),g=l.get("paddingInner"),m=xs(p,t),y=yc(a,t);if(d!==void 0&&(m?y&&x(y):x(Va(p,t,a))),m&&y===void 0)if(d!==void 0){const v=f.timeUnit,k=f.type;switch(t){case"domainMax":case"domainMin":Bt(c[t])||k==="temporal"||v?u.set(t,{signal:Ji(c[t],{type:k,timeUnit:v})},!0):u.set(t,c[t],!0);break;default:u.copyKeyFromObject(t,c)}}else{const v=t in Ef?Ef[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:p,scalePadding:h,scalePaddingInner:g,domain:c.domain,domainMin:c.domainMin,domainMax:c.domainMax,markDef:s,config:i,hasNestedOffsetScale:Jc(r,a),hasSecondaryRangeChannel:!!r[He(a)]}):i.scale[t];v!==void 0&&u.set(t,v,!1)}}}const Ef={bins:({model:e,fieldOrDatumDef:t})=>S(t)?Nx(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>Tx(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>Ax(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>Ox(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>Px(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>zx(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=S(e)?e.sort:void 0;return Rx(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>Ix(e,t,n,i,r,s.scale,o)};function _f(e){q(e)?xx(e):kf(e,"range")}function kf(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?_f(i):$f(i,t);for(const i of b(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=At(r,a,t,"scale",qu((c,u)=>{switch(t){case"range":return c.step&&u.step?c.step-u.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function Nx(e,t){const n=t.bin;if(U(n)){const i=So(e,t.field,n);return new te(()=>e.getSignalName(i))}else if(re(n)&&Ut(n)&&n.step!==void 0)return{step:n.step};return}function Tx(e,t){return A([ge,Be,We],e)&&t!=="nominal"?"hcl":void 0}function Ax(e,t,n,i,r,s){return Ie(s)?.bin||E(n)||r!=null||i!=null||A([se.TIME,se.UTC],e)?void 0:Y(t)?!0:void 0}function Ox(e,t,n,i,r,s){if(Y(e)){if(Xe(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(S(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===se.POINT)return n.pointPadding}return}function Px(e,t,n,i,r,s=!1){if(e!==void 0)return;if(Y(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:c,tickBandPaddingInner:u,bandWithNestedOffsetPaddingInner:l}=r;return s?l:X(o,n==="bar"?a:n==="tick"?u:c)}else if(Xn(t)&&i===se.BAND)return r.offsetBandPaddingInner;return}function zx(e,t,n,i,r,s=!1){if(e!==void 0)return;if(Y(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===se.BAND)return X(o,$(i)?{signal:`${i.signal}/2`}:i/2)}else if(Xn(t)){if(n===se.POINT)return .5;if(n===se.BAND)return r.offsetBandPaddingOuter}return}function Rx(e,t,n,i){return n==="x"&&i.xReverse!==void 0?Pe(e)&&t==="descending"?$(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse:Pe(e)&&t==="descending"?!0:void 0}function Ix(e,t,n,i,r,s,o){const a=!!n&&n!=="unaggregated";if(a&&Pe(r)){if(E(n)){const c=n[0],u=n[n.length-1];if(j(c)&&c<=0&&j(u)&&u>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!Sn(r))return!0;if(!(S(t)&&t.bin)&&A([...at,...Od],e)){const{orient:c,type:u}=i;return A(["bar","area","line","trail"],u)&&(c==="horizontal"&&e==="y"||c==="vertical"&&e==="x")?!1:A(["bar","area"],u)&&!o?!0:s?.zero}return!1}function Lx(e,t,n,i,r=!1){const s=Mx(t,n,i,r),{type:o}=e;return qe(t)?o!==void 0?Rg(t,o)?S(n)&&!zg(o,n.type)?(x(Ip(o,s)),s):o:(x(Rp(t,o,s)),s):s:null}function Mx(e,t,n,i){switch(t.type){case"nominal":case"ordinal":{if(mn(e)||Zr(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&x(ss(e,"ordinal")),"ordinal";if(Y(e)||Xn(e)){if(A(["rect","bar","image","rule","tick"],n.type))return"band";if(i)return"band"}else if(n.type==="arc"&&e in Kr)return"band";const r=n[me(e)];return Gt(r)||wn(t)&&t.axis?.tickBand?"band":"point"}case"temporal":return mn(e)?"time":Zr(e)==="discrete"?(x(ss(e,"temporal")),"ordinal"):S(t)&&t.timeUnit&&Z(t.timeUnit).utc?"utc":"time";case"quantitative":return mn(e)?S(t)&&U(t.bin)?"bin-ordinal":"linear":Zr(e)==="discrete"?(x(ss(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(qa(t.type))}function Dx(e,{ignoreRange:t}={}){Cf(e),ff(e);for(const n of Pg)$f(e,n);t||_f(e)}function Cf(e){q(e)?e.component.scales=jx(e):e.component.scales=Bx(e)}function jx(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of Qr){const o=K(t[s]);if(o&&n===Sc&&s===he&&o.type===xn)continue;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??(a={});const c=Jc(t,s),u=Lx(a,s,o,i,c);r[s]=new hf(e.scaleName(`${s}`,!0),{value:u,explicit:a.type===u})}}return r}const Ux=qu((e,t)=>fc(e)-fc(t));function Bx(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const s of e.children){Cf(s);for(const o of b(s.component.scales))if((t=r.scale)[o]??(t[o]=Hl(o,e)),r.scale[o]==="shared"){const a=i[o],c=s.component.scales[o].getWithExplicit("type");a?$g(a.value,c.value)?i[o]=At(a,c,"type","scale",Ux):(r.scale[o]="independent",delete i[o]):i[o]=c}}for(const s of b(i)){const o=e.scaleName(s,!0),a=i[s];n[s]=new hf(o,a);for(const c of e.children){const u=c.component.scales[s];u&&(c.renameScale(u.get("name"),o),u.merged=!0)}}return n}class Oo{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function q(e){return e?.type==="unit"}function ve(e){return e?.type==="facet"}function Po(e){return e?.type==="concat"}function Mn(e){return e?.type==="layer"}class zo{constructor(t,n,i,r,s,o,a){this.type=n,this.parent=i,this.config=s,this.correctDataNames=c=>(c.from?.data&&(c.from.data=this.lookupDataSource(c.from.data)),c.from?.facet?.data&&(c.from.facet.data=this.lookupDataSource(c.from.facet.data)),c),this.parent=i,this.config=s,this.view=oe(a),this.name=t.name??r,this.title=kt(t.title)?{text:t.title}:t.title?oe(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new Oo,this.projectionNameMap=i?i.projectionNameMap:new Oo,this.signalNameMap=i?i.signalNameMap:new Oo,this.data=t.data,this.description=t.description,this.transforms=Ym(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:Jh(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:Gi(t)||i?.component.data.isFaceted&&t.data===void 0},layoutSize:new pt,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?C(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){Dx(this)}parseProjection(){rf(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Zl(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of b(i)){const o=i[s];o!==void 0&&(r[s]=B(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=B(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:M(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=cb(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of _e)t[i].title&&n.push(nb(this,i));for(const i of go)n=n.concat(ib(this,i));return n}assembleAxes(){return Wy(this.component.axes,this.config)}assembleLegends(){return ef(this)}assembleProjections(){return Ab(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...Ca(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};return i.text?(A(["unit","layer"],this.type)?A(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),M(i)?void 0:i):void 0}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||ve(this.parent)?pf(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return W((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(G[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(ve(this.parent)){const n=Bl(t),i=Ai(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(J(s)&&Ct(o)){const a=r.get("name"),c=vr(this,i),u=Ao(c);if(u){const l=w({aggregate:"distinct",field:u},{expr:"datum"});return{signal:Ul(a,r,l)}}else return x(is(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){return n?this.getName(t):ba(t)&&qe(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t))?this.scaleNameMap.get(this.getName(t)):void 0}projectionName(t){return t?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(ep(n));return i}hasAxisOrientSignalRef(){return this.component.axes.x?.some(t=>t.hasOrientSignalRef())||this.component.axes.y?.some(t=>t.hasOrientSignalRef())}}class Ff extends zo{vgField(t,n={}){const i=this.fieldDef(t);return i?w(i,n):void 0}reduceFieldDef(t,n){return Fh(this.getMapping(),(i,r,s)=>{const o=Ie(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){Ps(this.getMapping(),(i,r)=>{const s=Ie(i);s&&t(s,r)},n)}}class wr extends I{clone(){return new wr(null,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"];const r=this.transform.resolve??"shared";this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${P(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class $r extends I{clone(){return new $r(null,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${P(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform,i={type:"extent",field:t,signal:n};return i}}class Er extends I{clone(){return new Er(this.parent,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((s,o)=>r[o]??s)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${P(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform,i={type:"flatten",fields:t,as:n};return i}}class _r extends I{clone(){return new _r(null,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${P(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform,i={type:"fold",fields:t,as:n};return i}}class Dn extends I{clone(){return new Dn(null,C(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[Te,Ne],[Ee,Ae]]){const s=r.map(o=>{const a=K(n.encoding[o]);return S(a)?a.field:Ke(a)?{expr:`${a.datum}`}:Re(a)?{expr:`${a.value}`}:void 0});(s[0]||s[1])&&(t=new Dn(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(he)){const r=n.typedFieldDef(he);r.type===xn&&(t=new Dn(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t);this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(N);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${P(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class di extends I{clone(){return new di(null,this.projection,C(this.fields),C(this.as))}constructor(t,n,i,r){super(t);this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[Te,Ne],[Ee,Ae]]){const r=i.map(o=>{const a=K(n.encoding[o]);return S(a)?a.field:Ke(a)?{expr:`${a.datum}`}:Re(a)?{expr:`${a.value}`}:void 0}),s=i[0]===Ee?"2":"";(r[0]||r[1])&&(t=new di(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(N))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${P(this.fields)} ${P(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class rn extends I{clone(){return new rn(null,C(this.transform))}constructor(t,n){super(t);this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t,s=[n,i,...r?[r]:[]].join(",");return{signal:`sequence(${s})`}}static makeFromTransform(t,n){return new rn(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(S(r)&&S(s)){const o=r.impute?r:s.impute?s:void 0;if(o===void 0)return;const a=r.impute?s:s.impute?r:void 0,{method:c,value:u,frame:l,keyvals:f}=o.impute,d=nu(n.mark,i);return new rn(t,{impute:o.field,key:a.field,...c?{method:c}:{},...u!==void 0?{value:u}:{},...l?{frame:l}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${P(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:s,value:o,frame:a=[null,null]}=this.transform,c={type:"impute",field:t,key:n,...i?{keyvals:Tm(i)?this.processSequence(i):i}:{},method:"value",...s?{groupby:s}:{},value:!r||r==="value"?o:null};if(r&&r!=="value"){const u={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...s?{groupby:s}:{}},l={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[c,u,l]}else return[c]}}class kr extends I{clone(){return new kr(null,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${P(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform,r={type:"loess",x:n,y:t,...i};return r}}class pi extends I{clone(){return new pi(null,C(this.transform),this.secondary)}constructor(t,n,i){super(t);this.transform=n,this.secondary=i}static make(t,n,i,r){const s=n.component.data.sources,{from:o}=i;let a=null;if(Am(o)){let c=Of(o.data,s);c||(c=new en(o.data),s.push(c));const u=n.getName(`lookup_${r}`);a=new ye(c,u,G.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[u]=a}else if(Om(o)){const c=o.param;i={as:c,...i};let u;try{u=n.getSelectionComponent(W(c),c)}catch(l){throw new Error(rp(c))}if(a=u.materialized,!a)throw new Error(sp(c))}return new pi(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?V(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${P({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:V(this.transform.as)}:{}};else{let n=this.transform.as;N(n)||(x(pp),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class Cr extends I{clone(){return new Cr(null,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${P(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform,i={type:"quantile",field:t,...n};return i}}class Fr extends I{clone(){return new Fr(null,C(this.transform))}constructor(t,n){super(t);this.transform=n,this.transform=C(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${P(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform,r={type:"regression",x:n,y:t,...i};return r}}class Nr extends I{clone(){return new Nr(null,C(this.transform))}constructor(t,n){super(t);this.transform=n}addDimensions(t){this.transform.groupby=je((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){return}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${P(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:s}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...s!==void 0?{op:s}:{},...i!==void 0?{groupby:i}:{}}}}class Tr extends I{clone(){return new Tr(null,C(this.transform))}constructor(t,n){super(t);this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${P(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function Nf(e){let t=0;function n(i,r){if(i instanceof en&&(!i.isGenerator&&!Cn(i.data))){e.push(r);const s={name:null,source:r.name,transform:[]};r=s}if(i instanceof ce&&(i.parent instanceof en&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Rn){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}if((i instanceof ui||i instanceof li||i instanceof In||i instanceof An||i instanceof On||i instanceof di||i instanceof Me||i instanceof pi||i instanceof Ln||i instanceof nn||i instanceof _r||i instanceof Er||i instanceof wr||i instanceof kr||i instanceof Cr||i instanceof Fr||i instanceof Rt||i instanceof Tr||i instanceof Nr||i instanceof $r)&&r.transform.push(i.assemble()),(i instanceof et||i instanceof Je||i instanceof rn||i instanceof ht||i instanceof Dn)&&r.transform.push(...i.assemble()),i instanceof ye){if(r.source&&r.transform.length===0)i.setSource(r.source);else if(i.parent instanceof ye)i.setSource(r.name);else if(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1){e.push(r);const s={name:null,source:r.name,transform:[]};r=s}}switch(i.numChildren()){case 0:i instanceof ye&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children){const a={name:null,source:s,transform:[]};n(o,a)}break}}}return n}function Wx(e){const t=[],n=Nf(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function Hx(e,t){const n=[],i=Nf(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function qx(e){return e==="top"||e==="left"||$(e)?"header":"footer"}function Gx(e){for(const t of _e)Vx(e,t);Af(e,"x"),Af(e,"y")}function Vx(e,t){const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const o=n[t],a=zn("title",null,i,t);let c=$n(o,i,{allowDisabling:!0,includeDefault:a===void 0||!!a});r.component.layoutHeaders[t].title&&(c=E(c)?c.join(", "):c,c+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const u=zn("labelOrient",o.header,i,t),l=o.header!==null?X(o.header?.labels,i.header.labels,!0):!1,f=A(["bottom","right"],u)?"footer":"header";s.layoutHeaders[t]={title:o.header!==null?c:null,facetFieldDef:o,[f]:t==="facet"?[]:[Tf(e,t,l)]}}}function Tf(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function Af(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=bo(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const c=qx(a.get("orient"));o[c]??(o[c]=[Tf(e,s,!1)]);const u=ci(a,"main",e.config,{header:!0});u&&o[c][0].axes.push(u),a.mainExtracted=!0}}}}function Xx(e){Ro(e),Ar(e,"width"),Ar(e,"height")}function Yx(e){Ro(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";Ar(e,t),Ar(e,n)}function Ro(e){for(const t of e.children)t.parseLayoutSize()}function Ar(e,t){const n=Bl(t),i=Ai(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const c=a.component.layoutSize.getWithExplicit(n),u=r.scale[i]??Hl(i,e);if(u==="independent"&&c.value==="step"){o=void 0;break}if(o){if(u==="independent"&&o.value!==c.value){o=void 0;break}o=At(o,c,n,"")}else o=c}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function Kx(e){const{size:t,component:n}=e;for(const i of at){const r=me(i);if(t[r]){const s=t[r];n.layoutSize.set(r,Qe(s)?"step":s,!0)}else{const s=Qx(e,r);n.layoutSize.set(r,s,!1)}}}function Qx(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(J(s)){const a=or(i.view,t);return Ct(o)||Qe(a)?"step":a}else return qs(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return qs(i.view,t);{const s=or(i.view,t);return Qe(s)?s.step:s}}}function Io(e,t,n){return w(t,{suffix:`by_${w(e)}`,...n})}class gi extends Ff{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve);this.child=Uo(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!ei(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=b(t),i={};for(const r of n){if(![tt,nt].includes(r)){x(Ri(r,"facet"));break}const s=t[r];if(s.field===void 0){x(rs(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=Os(t,n);return i.header?i.header=oe(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=Or(this),this.child.parseData()}parseLayoutSize(){Ro(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Gx(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of _e)for(const i of ho){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:o}=r;if(o){const a=zn("titleOrient",o.header,this.config,n);if(["right","bottom"].includes(a)){const c=yr(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[c]="end"}}if(s?.[0]){const a=n==="row"?"height":"width",c=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[c]??(t[c]={}),t[c][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(this.parent&&this.parent instanceof gi)return;{const t=this.getName("column_domain");return{signal:`length(data('${t}'))`}}}assembleGroupStyle(){return}assembleGroup(t){return this.parent&&this.parent instanceof gi?{...this.channelHasField("column")?{encode:{update:{columns:{field:w(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof gi){if(this.child.channelHasField("column")){const r=w(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of at){const s=this.child.component.scales[r];if(s&&!s.merged){const o=s.get("type"),a=s.get("range");if(J(o)&&Ct(a)){const c=vr(this.child,r),u=Ao(c);u?(t.push(u),n.push("distinct"),i.push(`distinct_${u}`)):x(is(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:s,ops:o,as:a}=this.getCardinalityAggregateForChild(),c=[];for(const l of _e){const f=this.facet[l];if(f){c.push(w(f));const{bin:d,sort:p}=f;if(U(d)&&c.push(w(f,{binSuffix:"end"})),lt(p)){const{field:h,op:g=qi}=p,m=Io(f,p);i&&r?(s.push(m),o.push("max"),a.push(m)):(s.push(h),o.push(g),a.push(m))}else if(E(p)){const h=Pn(f,l);s.push(h),o.push("max"),a.push(h)}}}const u=!!i&&!!r;return{name:t,data:n,groupby:c,...u||s.length>0?{aggregate:{...u?{cross:u}:{},...s.length?{fields:s,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?lt(i.sort)?[Io(i,i.sort,{expr:"datum"})]:E(i.sort)?[Pn(i,t,{expr:"datum"})]:[w(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i,s=(lt(r)?r.order:!E(r)&&r)||"ascending";return[s]}return[]}assembleLabelTitle(){const{facet:t,config:n}=this;if(t.facet)return mo(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const r of go)if(t[r]){const s=zn("labelOrient",t[r]?.header,n,r);if(i[r].includes(s))return mo(t[r],r,n)}return}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=Wx(n),r=t.assembleGroupEncodeEntry(!1),s=this.assembleLabelTitle()||t.assembleTitle(),o=t.assembleGroupStyle(),a={name:this.getName("cell"),type:"group",...s?{title:s}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:_e.map(c=>this.facetSortFields(c)).flat(),order:_e.map(c=>this.facetSortOrder(c)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(uy(this,[]))};return[a]}getMapping(){return this.facet}}function Zx(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(lt(s.sort)){const{field:o,op:a=qi}=s.sort;e=r=new nn(e,{joinaggregate:[{op:a,field:o,as:Io(s,s.sort,{forAs:!0})}],groupby:[w(s)]})}return r}return null}function Of(e,t){for(const n of t){const i=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;const r=e.format?.mesh,s=i.format?.feature;if(r&&s)continue;const o=e.format?.feature;if((o||s)&&o!==s)continue;const a=i.format?.mesh;if((r||a)&&r!==a)continue;if(si(e)&&si(i)){if(be(e.values,i.values))return n}else if(Cn(e)&&Cn(i)){if(e.url===i.url)return n}else if(Gu(e)&&e.name===n.dataName)return n}return null}function Jx(e,t){if(e.data||!e.parent){if(e.data===null){const i=new en({values:[]});return t.push(i),i}const n=Of(e.data,t);if(n)return Ot(e.data)||(n.data.format=sa({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new en(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function eS(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(Bm(r))o=e=new On(e,r),s="derived";else if(Ks(r)){const a=Hb(r);o=e=ce.makeWithAncestors(e,{},a,n)??e,e=new An(e,t,r.filter)}else if(Mu(r))o=e=et.makeFromTransform(e,r,t),s="number";else if(Hm(r)){s="date";const a=n.getWithExplicit(r.field);a.value===void 0&&(e=new ce(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=Je.makeFromTransform(e,r)}else if(qm(r))o=e=Me.makeFromTransform(e,r),s="number",co(t)&&(e=new Rt(e));else if(Lu(r))o=e=pi.make(e,t,r,i++),s="derived";else if(Dm(r))o=e=new Ln(e,r),s="number";else if(jm(r))o=e=new nn(e,r),s="number";else if(Gm(r))o=e=ht.makeFromTransform(e,r),s="derived";else if(Vm(r))o=e=new _r(e,r),s="derived";else if(Xm(r))o=e=new $r(e,r),s="derived";else if(Um(r))o=e=new Er(e,r),s="derived";else if(Pm(r))o=e=new Nr(e,r),s="derived";else if(Mm(r))e=new Tr(e,r);else if(Wm(r))o=e=rn.makeFromTransform(e,r),s="derived";else if(zm(r))o=e=new wr(e,r),s="derived";else if(Rm(r))o=e=new Cr(e,r),s="derived";else if(Im(r))o=e=new Fr(e,r),s="derived";else if(Lm(r))o=e=new kr(e,r),s="derived";else{x(dp(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function Or(e){let t=Jx(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,s=r&&(Ot(r)||Cn(r)||si(r)),o=!s&&e.parent?e.parent.component.data.ancestorParse.clone():new oy;Ot(r)?(Vu(r)?t=new li(t,r.sequence):Js(r)&&(t=new ui(t,r.graticule)),o.parseNothing=!0):r?.format?.parse===null&&(o.parseNothing=!0),t=ce.makeExplicit(t,e,o)??t,t=new Rt(t);const a=e.parent&&Mn(e.parent);(q(e)||ve(e))&&(a&&(t=et.makeFromEncoding(t,e)??t)),e.transforms.length>0&&(t=eS(t,e,o));const c=Gb(e),u=qb(e);t=ce.makeWithAncestors(t,{},{...c,...u},o)??t,q(e)&&(t=Dn.parseAll(t,e),t=di.parseAll(t,e)),(q(e)||ve(e))&&(a||(t=et.makeFromEncoding(t,e)??t),t=Je.makeFromEncoding(t,e)??t,t=On.parseAllForSortIndex(t,e));const l=t=Pr(G.Raw,e,t);if(q(e)){const m=Me.makeFromEncoding(t,e);m&&(t=m,co(e)&&(t=new Rt(t))),t=rn.makeFromEncoding(t,e)??t,t=ht.makeFromEncoding(t,e)??t}let f,d;if(q(e)){const{markDef:m,mark:y,config:v}=e,k=R("invalid",m,v),{marks:_,scales:T}=d=Yu({invalid:k,isPath:Ft(y)});_!==T&&T==="include-invalid-values"&&(f=t=Pr(G.PreFilterInvalid,e,t)),_==="exclude-invalid-values"&&(t=In.make(t,e,d)??t)}const p=t=Pr(G.Main,e,t);let h;if(q(e)&&d){const{marks:m,scales:y}=d;m==="include-invalid-values"&&y==="exclude-invalid-values"&&(t=In.make(t,e,d)??t,h=t=Pr(G.PostFilterInvalid,e,t))}q(e)&&Uy(e,p);let g=null;if(ve(e)){const m=e.getName("facet");t=Zx(t,e.facet)??t,g=new Rn(t,e,m,p.getSource()),n[m]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:l,main:p,facetRoot:g,ancestorParse:o,preFilterInvalid:f,postFilterInvalid:h}}function Pr(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,s=t.getDataName(e),o=new ye(n,s,e,r);return i[s]=o,o}class tS extends zo{constructor(t,n,i,r){super(t,"concat",n,i,r,t.resolve);(t.resolve?.axis?.x==="shared"||t.resolve?.axis?.y==="shared")&&x(up),this.children=this.getChildren(t).map((s,o)=>Uo(s,this,this.getName(`concat_${o}`),void 0,r))}parseData(){this.component.data=Or(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of b(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return rr(t)?t.vconcat:Hs(t)?t.hconcat:t.concat}parseLayoutSize(){Yx(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=yo(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){return}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function nS(e){return e===!1||e===null}const iS={disable:1,gridScale:1,scale:1,...Yc,labelExpr:1,encode:1},Pf=b(iS);class Lo extends pt{constructor(t={},n={},i=!1){super();this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new Lo(C(this.explicit),C(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!nS(this.get(t))}hasOrientSignalRef(){return $(this.explicit.orient)}}function rS(e,t,n){const{encoding:i,config:r}=e,s=K(i[t])??K(i[He(t)]),o=e.axis(t)||{},{format:a,formatType:c}=o;if(Xt(c))return{text:ze({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:c,config:r}),...n};if(a===void 0&&c===void 0&&r.customFormatTypes){if(vn(s)==="quantitative"){if(wn(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:ze({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:ze({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(vn(s)==="temporal"&&r.timeFormatType&&S(s)&&!s.timeUnit)return{text:ze({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function sS(e){return at.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[dS(n,e)]),t),{})}const oS={bottom:"top",top:"bottom",left:"right",right:"left"};function aS(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of b(r.component.axes))n.axis[s]=bo(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=cS(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of at){for(const s of e.children){if(!s.component.axes[r])continue;if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:c}=o.getWithExplicit("orient");if($(a))continue;if(i[a]>0&&!c){const u=oS[a];i[a]>i[u]&&o.set("orient",u,!1)}i[a]++}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&!!o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function cS(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;in.clone());return e}function uS(e,t){for(const n of Pf){const i=At(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return Ia(r,s);case"gridScale":return{explicit:r.explicit,value:X(r.value,s.value)}}return cr(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function lS(e,t,n,i,r){if(t==="disable")return n!==void 0;n=n||{};switch(t){case"titleAngle":case"labelAngle":return e===($(n.labelAngle)?n.labelAngle:qn(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===Il(i,r))return!0}return e===n[t]}const fS=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function dS(e,t){let n=t.axis(e);const i=new Lo,r=K(t.encoding[e]),{mark:s,config:o}=t,a=n?.orient||o[e==="x"?"axisX":"axisY"]?.orient||o.axis?.orient||Qy(e),c=t.getScaleComponent(e).get("type"),u=Hy(e,c,a,t.config),l=n!==void 0?!n:fo("disable",o.style,n?.style,u).configValue;if(i.set("disable",l,n!==void 0),l)return i;n=n||{};const f=Xy(r,n,e,o.style,u),d=Tc(n.formatType,r,c),p=Nc(r,r.type,n.format,n.formatType,o,!0),h={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:c,orient:a,labelAngle:f,format:p,formatType:d,mark:s,config:o};for(const y of Pf){const v=y in Pl?Pl[y](h):Kc(y)?n[y]:void 0,k=v!==void 0,_=lS(v,y,n,t,e);if(k&&_)i.set(y,v,_);else{const{configValue:T=void 0,configFrom:L=void 0}=Kc(y)&&y!=="values"?fo(y,o.style,n.style,u):{},ue=T!==void 0;k&&!ue?i.set(y,v,_):(!(L==="vgAxisConfig")||fS.has(y)&&ue||ri(T)||$(T))&&i.set(y,T,!1)}}const g=n.encoding??{},m=Xc.reduce((y,v)=>{if(!i.hasAxisPart(v))return y;const k=Wl(g[v]??{},t),_=v==="labels"?rS(t,e,k):k;return _!==void 0&&!M(_)&&(y[v]={update:_}),y},{});return M(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function pS({encoding:e,size:t}){for(const n of at){const i=me(n);Qe(t[i])&&(Tt(e[n])&&(delete t[i],x(Xa(i))))}return t}const gS={vgMark:"arc",encodeEntry:e=>({...ke(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...ae("x",e,{defaultPos:"mid"}),...ae("y",e,{defaultPos:"mid"}),...Pt(e,"radius"),...Pt(e,"theta")})},hS={vgMark:"area",encodeEntry:e=>({...ke(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...dr("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...dr("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...oo(e)})},mS={vgMark:"rect",encodeEntry:e=>({...ke(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Pt(e,"x"),...Pt(e,"y")})},yS={vgMark:"shape",encodeEntry:e=>({...ke(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape,i={type:"geoshape",projection:e.projectionName(),...n&&S(n)&&n.type===xn?{field:w(n,{expr:"datum"})}:{}};return[i]}},bS={vgMark:"image",encodeEntry:e=>({...ke(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Pt(e,"x"),...Pt(e,"y"),...ro(e,"url")})},xS={vgMark:"line",encodeEntry:e=>({...ke(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...ae("x",e,{defaultPos:"mid"}),...ae("y",e,{defaultPos:"mid"}),...ee("size",e,{vgChannel:"strokeWidth"}),...oo(e)})},SS={vgMark:"trail",encodeEntry:e=>({...ke(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...ae("x",e,{defaultPos:"mid"}),...ae("y",e,{defaultPos:"mid"}),...ee("size",e),...oo(e)})};function Mo(e,t){const{config:n}=e;return{...ke(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...ae("x",e,{defaultPos:"mid"}),...ae("y",e,{defaultPos:"mid"}),...ee("size",e),...ee("angle",e),...vS(e,n,t)}}function vS(e,t,n){return n?{shape:{value:n}}:ee("shape",e)}const wS={vgMark:"symbol",encodeEntry:e=>Mo(e)},$S={vgMark:"symbol",encodeEntry:e=>Mo(e,"circle")},ES={vgMark:"symbol",encodeEntry:e=>Mo(e,"square")},_S={vgMark:"rect",encodeEntry:e=>({...ke(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Pt(e,"x"),...Pt(e,"y")})},kS={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...ke(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...dr("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...dr("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...ee("size",e,{vgChannel:"strokeWidth"})}}},CS={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...ke(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...ae("x",e,{defaultPos:"mid"}),...ae("y",e,{defaultPos:"mid"}),...ro(e),...ee("size",e,{vgChannel:"fontSize"}),...ee("angle",e),...gl("align",FS(e.markDef,n,t)),...gl("baseline",NS(e.markDef,n,t)),...ae("radius",e,{defaultPos:null}),...ae("theta",e,{defaultPos:null})}}};function FS(e,t,n){const i=R("align",e,n);return i===void 0?"center":void 0}function NS(e,t,n){const i=R("baseline",e,n);return i===void 0?"middle":void 0}const TS={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"width":"height",s=i==="horizontal"?"height":"width";return{...ke(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ae("x",e,{defaultPos:"mid",vgChannel:"xc"}),...ae("y",e,{defaultPos:"mid",vgChannel:"yc"}),...ee("size",e,{defaultRef:AS(e),vgChannel:r}),[s]:B(R("thickness",n,t))}}};function AS(e){const{config:t,markDef:n}=e,{orient:i}=n,r=i==="horizontal"?"width":"height",s=i==="horizontal"?"x":"y",o=Ti(s),a=e.getScaleComponent(o)||e.getScaleComponent(s),c=e.scaleName(o)||e.scaleName(s),u=R("size",n,t,{vgChannel:r})??t.tick.bandSize;if(u!==void 0)return B(u);if(a?.get("type")==="band")return{scale:c,band:1};const l=a?.get("range"),{tickBandPaddingInner:f}=t.scale,d=l&&Ct(l)?l.step:sr(t.view,r);return j(d)&&j(f)?{value:d*(1-f)}:{signal:`${ts(f)} * ${ts(d)}`}}const zr={arc:gS,area:hS,bar:mS,circle:$S,geoshape:yS,image:bS,line:xS,point:wS,rect:_S,rule:kS,square:ES,text:CS,tick:TS,trail:SS};function OS(e){if(A([Ui,Di,Dg],e.mark)){const t=nu(e.mark,e.encoding);if(t.length>0)return PS(e,t)}else if(e.mark===ji){const t=es.some(n=>R(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return zS(e)}return Do(e)}const zf="faceted_path_";function PS(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:zf+e.requestDataName(G.Main),data:e.requestDataName(G.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Do(e,{fromPrefix:zf})}]}const Rf="stack_group_";function zS(e){const[t]=Do(e,{fromPrefix:Rf}),n=e.scaleName(e.stack.fieldChannel),i=(u={})=>e.vgField(e.stack.fieldChannel,u),r=(u,l)=>{const f=[i({prefix:"min",suffix:"start",expr:l}),i({prefix:"max",suffix:"start",expr:l}),i({prefix:"min",suffix:"end",expr:l}),i({prefix:"max",suffix:"end",expr:l})];return`${u}(${f.map(d=>`scale('${n}',${d})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...ln(t.encode.update,["y","yc","y2","height",...es]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...pe(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...ln(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...pe(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const u of es){const l=Ge(u,e.markDef,e.config);t.encode.update[u]?(s[u]=t.encode.update[u],delete t.encode.update[u]):l&&(s[u]=B(l)),l&&(t.encode.update[u]={value:0})}const a=[];if(e.stack.groupbyChannels?.length>0)for(const u of e.stack.groupbyChannels){const l=e.fieldDef(u),f=w(l);f&&a.push(f),(l?.bin||l?.timeUnit)&&a.push(w(l,{binSuffix:"end"}))}const c=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"];return s=c.reduce((u,l)=>{if(t.encode.update[l])return{...u,[l]:t.encode.update[l]};{const f=Ge(l,e.markDef,e.config);return f!==void 0?{...u,[l]:B(f)}:u}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(G.Main),name:Rf+e.requestDataName(G.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function RS(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!E(o)&&Re(o)&&Dr(o.value)||!o&&Dr(R("order",r,s)))return;if((E(o)||S(o))&&!n)return Pa(o,{expr:"datum"});if(Ft(i)){const a=r.orient==="horizontal"?"y":"x",c=t[a];if(S(c))return{field:a}}return}function Do(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,o=X(i.clip,IS(e),LS(e)),a=Aa(i),c=r.key,u=RS(e),l=MS(e),f=R("aria",i,s),d=zr[n].postEncodingTransform?zr[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:zr[n].vgMark,...o?{clip:o}:{},...a?{style:a}:{},...c?{key:c.field}:{},...u?{sort:u}:{},...l||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(G.Main)},encode:{update:zr[n].encodeEntry(e)},...d?{transform:d}:{}}]}function IS(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t?.get("selectionExtent")||n?.get("selectionExtent")?!0:void 0}function LS(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function MS(e){if(!e.component.selection)return null;const t=b(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=b(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class If extends Ff{constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,Su(t)?t.view:void 0);this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=Ye(t.mark)?{...t.mark}:{type:t.mark},a=o.type;o.filled===void 0&&(o.filled=wm(o,s,{graticule:t.data&&Js(t.data)}));const c=this.encoding=kh(t.encoding||{},a,o.filled,s);this.markDef=Nu(o,c,s),this.size=pS({encoding:c,size:Su(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=Fu(this.markDef,c),this.specifiedScales=this.initScales(a,c),this.specifiedAxes=this.initAxes(c),this.specifiedLegends=this.initLegends(c),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(u=>Bs(u))}get hasProjection(){const{encoding:t}=this,n=this.mark===Sc,i=t&&$d.some(r=>F(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return Qr.reduce((i,r)=>{const s=K(n[r]);return s&&(i[r]=this.initScale(s.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=oe(t);return E(n)&&(r.domain=n.map(xe)),E(i)&&(r.range=i.map(xe)),r}initAxes(t){return at.reduce((n,i)=>{const r=t[i];if(F(r)||i===H&&F(t.x2)||i===Q&&F(t.y2)){const s=F(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=b(t),i={};for(const r of n){const s=t[r];i[r]=ri(s)?Fa(s):xe(s)}return i}initLegends(t){return Pd.reduce((n,i)=>{const r=K(t[i]);if(r&&Rd(i)){const s=r.legend;n[i]=s&&oe(s)}return n},{})}parseData(){this.component.data=Or(this)}parseLayoutSize(){Kx(this)}parseSelections(){this.component.selection=jy(this,this.selection)}parseMarkGroup(){this.component.mark=OS(this)}parseAxesAndHeaders(){this.component.axes=sS(this)}assembleSelectionTopLevelSignals(t){return ly(this,t)}assembleSignals(){return[...Al(this),...cy(this,[])]}assembleSelectionData(t){return fy(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return yo(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Mn(this.parent))&&(t=Qu(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return Kt(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Ie(n)}typedFieldDef(t){const n=this.fieldDef(t);return fe(n)?n:null}}class jo extends zo{constructor(t,n,i,r,s){super(t,"layer",n,i,s,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,c)=>{if(ar(a))return new jo(a,this,this.getName(`layer_${c}`),o,s);if(ft(a))return new If(a,this,this.getName(`layer_${c}`),o,s);throw new Error(ns(a))})}parseData(){this.component.data=Or(this);for(const t of this.children)t.parseData()}parseLayoutSize(){Xx(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of b(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){aS(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),Al(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),yo(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of V(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t;return}assembleLayout(){return null}assembleMarks(){return dy(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),ef(this))}}function Uo(e,t,n,i,r){if(Gi(e))return new gi(e,t,n,r);if(ar(e))return new jo(e,t,n,i,r);if(ft(e))return new If(e,t,n,i,r);if(Kh(e))return new tS(e,t,n,r);throw new Error(ns(e))}function DS(e,t={}){t.logger&&Jp(t.logger),t.fieldTitle&&Hc(t.fieldTitle);try{const n=ku(na(t.config,e.config)),i=Bu(e,n),r=Uo(i,null,"",void 0,n);r.parse(),cx(r.component.data,r);const s=US(r,jS(e,i.autosize,n,r),e.datasets,e.usermeta);return{spec:s,normalized:i}}finally{t.logger&&eg(),t.fieldTitle&&yh()}}function jS(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):N(t)&&(t={type:t}),r&&s&&iy(t.type)){if(r==="step"&&s==="step")x(Da()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";x(Da(Ai(o)));const a=o==="width"?"height":"width";t.type=ry(a)}}return{...b(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...Hu(n,!1),...Hu(e,!0)}}function US(e,t,n={},i){const r=e.config?lm(e.config):void 0,s=[].concat(e.assembleSelectionData([]),Hx(e.component.data,n)),o=e.assembleProjections(),a=e.assembleTitle(),c=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let l=e.assembleLayoutSignals();l=l.filter(p=>(p.name==="width"||p.name==="height")&&p.value!==void 0?(t[p.name]=+p.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...c?{style:c}:{},...u?{encode:{update:u}}:{},data:s,...o.length>0?{projections:o}:{},...e.assembleGroup([...l,...e.assembleSelectionTopLevelSignals([]),...bu(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const BS=yd.version;export{pn as accessPathDepth,Hr as accessPathWithDatum,DS as compile,A as contains,be as deepEqual,$i as deleteNestedProperty,C as duplicate,bt as entries,jr as every,Wr as fieldIntersection,aa as flatAccessWithDatum,X as getFirstDefined,Ur as hasIntersection,P as hash,la as internalField,Bn as isBoolean,M as isEmpty,xd as isEqual,fa as isInternalField,Dr as isNullOrFalse,Ei as isNumeric,b as keys,Wn as logicalExpr,sa as mergeDeep,ra as never,Bu as normalize,qn as normalizeAngle,pe as omit,ln as pick,Br as prefixGenerator,dn as removePathFromField,Lt as replaceAll,we as replacePathInField,vd as resetIdCounter,oa as setEqual,fn as some,D as stringify,Hn as titleCase,je as unique,ua as uniqueId,ie as vals,W as varName,BS as version};export default null; diff --git a/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/dist=es2020,mode=imports,min/optimized/vega-themes.js b/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/dist=es2020,mode=imports,min/optimized/vega-themes.js deleted file mode 100644 index 24c99561..00000000 --- a/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/dist=es2020,mode=imports,min/optimized/vega-themes.js +++ /dev/null @@ -1 +0,0 @@ -var H="vega-themes",Q="2.14.0",R="Themes for stylized Vega and Vega-Lite visualizations.",K=["vega","vega-lite","themes","style"],N="BSD-3-Clause",Z={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},ee=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],te="build/vega-themes.js",oe="build/vega-themes.module.js",le="build/vega-themes.min.js",ae="build/vega-themes.min.js",ie="build/vega-themes.module.d.ts",re={type:"git",url:"https://github.com/vega/vega-themes.git"},ne=["src","build"],se={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},de={"@babel/core":"^7.22.9","@babel/plugin-proposal-async-generator-functions":"^7.20.7","@babel/plugin-proposal-json-strings":"^7.18.6","@babel/plugin-proposal-object-rest-spread":"^7.20.7","@babel/plugin-proposal-optional-catch-binding":"^7.18.6","@babel/plugin-transform-runtime":"^7.22.9","@babel/preset-env":"^7.22.9","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","browser-sync":"^2.29.3",concurrently:"^8.2.0",eslint:"^8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","gh-pages":"^5.0.0",prettier:"^3.0.0","release-it":"^16.1.0",rollup:"^3.26.2","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.2.0",typescript:"^5.1.6",vega:"^5.25.0","vega-lite":"^5.9.3"},ce={vega:"*","vega-lite":"*"},fe={},ge={name:H,version:Q,description:R,keywords:K,license:N,author:Z,contributors:ee,main:te,module:oe,unpkg:le,jsdelivr:ae,types:ie,repository:re,files:ne,scripts:se,devDependencies:de,peerDependencies:ce,dependencies:fe};const f="#fff",B="#888",be={background:"#333",view:{stroke:B},title:{color:f,subtitleColor:f},style:{"guide-label":{fill:f},"guide-title":{fill:f}},axis:{domainColor:f,gridColor:B,tickColor:f}},l="#4572a7",pe={background:"#fff",arc:{fill:l},area:{fill:l},line:{stroke:l,strokeWidth:2},path:{stroke:l},rect:{fill:l},shape:{stroke:l},symbol:{fill:l,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},a="#30a2da",v="#cbcbcb",ue="#999",he="#333",E="#f0f0f0",W="#333",me={arc:{fill:a},area:{fill:a},axis:{domainColor:v,grid:!0,gridColor:v,gridWidth:1,labelColor:ue,labelFontSize:10,titleColor:he,tickColor:v,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:E,group:{fill:E},legend:{labelColor:W,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:W,titleFontSize:14,titlePadding:10},line:{stroke:a,strokeWidth:2},path:{stroke:a,strokeWidth:.5},rect:{fill:a},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:a},bar:{binSpacing:2,fill:a,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},i="#000",Ce={group:{fill:"#e5e5e5"},arc:{fill:i},area:{fill:i},line:{stroke:i},path:{stroke:i},rect:{fill:i},shape:{stroke:i},symbol:{fill:i,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},ke=22,Fe="normal",A="Benton Gothic, sans-serif",w=11.5,ye="normal",r="#82c6df",z="Benton Gothic Bold, sans-serif",T="normal",P=13,b={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},ve={background:"#ffffff",title:{anchor:"start",color:"#000000",font:z,fontSize:ke,fontWeight:Fe},arc:{fill:r},area:{fill:r},line:{stroke:r,strokeWidth:2},path:{stroke:r},rect:{fill:r},shape:{stroke:r},symbol:{fill:r,size:30},axis:{labelFont:A,labelFontSize:w,labelFontWeight:ye,titleFont:z,titleFontSize:P,titleFontWeight:T},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:A,labelFontSize:w,symbolType:"square",titleFont:z,titleFontSize:P,titleFontWeight:T},range:{category:b["category-6"],diverging:b["fireandice-6"],heatmap:b["fire-7"],ordinal:b["fire-7"],ramp:b["fire-7"]}},n="#ab5787",m="#979797",ze={background:"#f9f9f9",arc:{fill:n},area:{fill:n},line:{stroke:n},path:{stroke:n},rect:{fill:n},shape:{stroke:n},symbol:{fill:n,size:30},axis:{domainColor:m,domainWidth:.5,gridWidth:.2,labelColor:m,tickColor:m,tickWidth:.2,titleColor:m},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},s="#3e5c69",Se={background:"#fff",arc:{fill:s},area:{fill:s},line:{stroke:s},path:{stroke:s},rect:{fill:s},shape:{stroke:s},symbol:{fill:s},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},e="#1696d2",$="#000000",xe="#FFFFFF",C="Lato",S="Lato",De="Lato",Be="#DEDDDD",Ee=18,p={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},We={background:xe,title:{anchor:"start",fontSize:Ee,font:C},axisX:{domain:!0,domainColor:$,domainWidth:1,grid:!1,labelFontSize:12,labelFont:S,labelAngle:0,tickColor:$,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:C},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:Be,gridWidth:1,labelFontSize:12,labelFont:S,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:C,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:S,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:C,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:p["six-groups-cat-1"],diverging:p["diverging-colors"],heatmap:p["diverging-colors"],ordinal:p["six-groups-seq"],ramp:p["shades-blue"]},area:{fill:e},rect:{fill:e},line:{color:e,stroke:e,strokeWidth:5},trail:{color:e,stroke:e,strokeWidth:0,size:1},path:{stroke:e,strokeWidth:.5},point:{filled:!0},text:{font:De,color:e,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:e,stroke:null}},arc:{fill:e},shape:{stroke:e},symbol:{fill:e,size:30}},d="#3366CC",q="#ccc",k="Arial, sans-serif",Ae={arc:{fill:d},area:{fill:d},path:{stroke:d},rect:{fill:d},shape:{stroke:d},symbol:{stroke:d},circle:{fill:d},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:k,fontSize:12},"guide-title":{font:k,fontSize:12},"group-title":{font:k,fontSize:12}},title:{font:k,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:q,tickColor:q,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},x=c=>c*(1/3+1),j=x(9),L=x(10),X=x(12),u="Segoe UI",Y="wf_standard-font, helvetica, arial, sans-serif",M="#252423",h="#605E5C",I="transparent",we="#C8C6C4",t="#118DFF",Te="#12239E",Pe="#E66C37",$e="#6B007B",qe="#E044A7",je="#744EC2",Le="#D9B300",Xe="#D64550",G=t,J="#DEEFFF",O=[J,G],Ye=[J,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",G],Me={view:{stroke:I},background:I,font:u,header:{titleFont:Y,titleFontSize:X,titleColor:M,labelFont:u,labelFontSize:L,labelColor:h},axis:{ticks:!1,grid:!1,domain:!1,labelColor:h,labelFontSize:j,titleFont:Y,titleColor:M,titleFontSize:X,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:we,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:t},line:{stroke:t,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:u,fontSize:j,fill:h},arc:{fill:t},area:{fill:t,line:!0,opacity:.6},path:{stroke:t},rect:{fill:t},point:{fill:t,filled:!0,size:75},shape:{stroke:t},symbol:{fill:t,strokeWidth:1.5,size:50},legend:{titleFont:u,titleFontWeight:"bold",titleColor:h,labelFont:u,labelFontSize:L,labelColor:h,symbolType:"circle",symbolSize:75},range:{category:[t,Te,Pe,$e,qe,je,Le,Xe],diverging:O,heatmap:O,ordinal:Ye}},D='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',U=400,Ie=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Ge=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function F({type:c,background:V}){const y=c==="dark"?"#161616":"#ffffff",g=c==="dark"?"#f4f4f4":"#161616",_=c==="dark"?Ie:Ge,o=c==="dark"?"#d4bbff":"#6929c4";return{background:V,arc:{fill:o},area:{fill:o},path:{stroke:o},rect:{fill:o},shape:{stroke:o},symbol:{stroke:o},circle:{fill:o},view:{fill:y,stroke:y},group:{fill:y},title:{color:g,anchor:"start",dy:-15,fontSize:16,font:D,fontWeight:600},axis:{labelColor:g,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:g,labelAngle:0},style:{"guide-label":{font:D,fill:g,fontWeight:U},"guide-title":{font:D,fill:g,fontWeight:U}},range:{category:_,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const Je=F({type:"light",background:"#ffffff"}),Oe=F({type:"light",background:"#f4f4f4"}),Ue=F({type:"dark",background:"#262626"}),Ve=F({type:"dark",background:"#161616"}),_e=ge.version;export{Oe as carbong10,Ve as carbong100,Ue as carbong90,Je as carbonwhite,be as dark,pe as excel,me as fivethirtyeight,Ce as ggplot2,Ae as googlecharts,ve as latimes,Me as powerbi,ze as quartz,We as urbaninstitute,_e as version,Se as vox};export default null; diff --git a/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/dist=es2020,mode=imports,min/optimized/vega-themes.js b/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/dist=es2020,mode=imports,min/optimized/vega-themes.js new file mode 100644 index 00000000..09b2e0d4 --- /dev/null +++ b/vl-convert-rs/vendor/cdn.skypack.dev/-/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/dist=es2020,mode=imports,min/optimized/vega-themes.js @@ -0,0 +1 @@ +var K="vega-themes",Q="2.15.0",Z="Themes for stylized Vega and Vega-Lite visualizations.",ee=["vega","vega-lite","themes","style"],te="BSD-3-Clause",oe={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},le=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],ie="build/vega-themes.js",ae="build/vega-themes.module.js",re="build/vega-themes.min.js",ne="build/vega-themes.min.js",se="build/vega-themes.module.d.ts",de={type:"git",url:"https://github.com/vega/vega-themes.git"},ce=["src","build"],fe={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},ge={"@babel/core":"^7.24.6","@babel/plugin-transform-runtime":"^7.24.6","@babel/preset-env":"^7.24.6","@babel/preset-typescript":"^7.24.6","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@typescript-eslint/eslint-plugin":"^7.11.0","@typescript-eslint/parser":"^7.11.0","browser-sync":"^3.0.2",concurrently:"^8.2.2",eslint:"^8.45.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","gh-pages":"^6.1.1",prettier:"^3.2.5","release-it":"^17.3.0",rollup:"^4.18.0","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.4.5",typescript:"^5.4.5",vega:"^5.25.0","vega-lite":"^5.9.3"},be={vega:"*","vega-lite":"*"},pe={},ue={name:K,version:Q,description:Z,keywords:ee,license:te,author:oe,contributors:le,main:ie,module:ae,unpkg:re,jsdelivr:ne,types:se,repository:de,files:ce,scripts:fe,devDependencies:ge,peerDependencies:be,dependencies:pe};const f="#fff",w="#888",he={background:"#333",view:{stroke:w},title:{color:f,subtitleColor:f},style:{"guide-label":{fill:f},"guide-title":{fill:f}},axis:{domainColor:f,gridColor:w,tickColor:f}},i="#4572a7",me={background:"#fff",arc:{fill:i},area:{fill:i},line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},shape:{stroke:i},symbol:{fill:i,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},a="#30a2da",S="#cbcbcb",Ce="#999",Fe="#333",P="#f0f0f0",T="#333",ke={arc:{fill:a},area:{fill:a},axis:{domainColor:S,grid:!0,gridColor:S,gridWidth:1,labelColor:Ce,labelFontSize:10,titleColor:Fe,tickColor:S,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:P,group:{fill:P},legend:{labelColor:T,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:T,titleFontSize:14,titlePadding:10},line:{stroke:a,strokeWidth:2},path:{stroke:a,strokeWidth:.5},rect:{fill:a},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:a},bar:{binSpacing:2,fill:a,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},r="#000",ye={group:{fill:"#e5e5e5"},arc:{fill:r},area:{fill:r},line:{stroke:r},path:{stroke:r},rect:{fill:r},shape:{stroke:r},symbol:{fill:r,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},ve=22,Se="normal",$="Benton Gothic, sans-serif",q=11.5,xe="normal",n="#82c6df",x="Benton Gothic Bold, sans-serif",L="normal",X=13,g={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},ze={background:"#ffffff",title:{anchor:"start",color:"#000000",font:x,fontSize:ve,fontWeight:Se},arc:{fill:n},area:{fill:n},line:{stroke:n,strokeWidth:2},path:{stroke:n},rect:{fill:n},shape:{stroke:n},symbol:{fill:n,size:30},axis:{labelFont:$,labelFontSize:q,labelFontWeight:xe,titleFont:x,titleFontSize:X,titleFontWeight:L},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:$,labelFontSize:q,symbolType:"square",titleFont:x,titleFontSize:X,titleFontWeight:L},range:{category:g["category-6"],diverging:g["fireandice-6"],heatmap:g["fire-7"],ordinal:g["fire-7"],ramp:g["fire-7"]}},s="#ab5787",h="#979797",De={background:"#f9f9f9",arc:{fill:s},area:{fill:s},line:{stroke:s},path:{stroke:s},rect:{fill:s},shape:{stroke:s},symbol:{fill:s,size:30},axis:{domainColor:h,domainWidth:.5,gridWidth:.2,labelColor:h,tickColor:h,tickWidth:.2,titleColor:h},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},d="#3e5c69",Be={background:"#fff",arc:{fill:d},area:{fill:d},line:{stroke:d},path:{stroke:d},rect:{fill:d},shape:{stroke:d},symbol:{fill:d},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},e="#1696d2",Y="#000000",Ee="#FFFFFF",m="Lato",z="Lato",We="Lato",Ae="#DEDDDD",we=18,b={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},Pe={background:Ee,title:{anchor:"start",fontSize:we,font:m},axisX:{domain:!0,domainColor:Y,domainWidth:1,grid:!1,labelFontSize:12,labelFont:z,labelAngle:0,tickColor:Y,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:m},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:Ae,gridWidth:1,labelFontSize:12,labelFont:z,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:m,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:z,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:m,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:b["six-groups-cat-1"],diverging:b["diverging-colors"],heatmap:b["diverging-colors"],ordinal:b["six-groups-seq"],ramp:b["shades-blue"]},area:{fill:e},rect:{fill:e},line:{color:e,stroke:e,strokeWidth:5},trail:{color:e,stroke:e,strokeWidth:0,size:1},path:{stroke:e,strokeWidth:.5},point:{filled:!0},text:{font:We,color:e,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:e,stroke:null}},arc:{fill:e},shape:{stroke:e},symbol:{fill:e,size:30}},c="#3366CC",j="#ccc",C="Arial, sans-serif",Te={arc:{fill:c},area:{fill:c},path:{stroke:c},rect:{fill:c},shape:{stroke:c},symbol:{stroke:c},circle:{fill:c},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:C,fontSize:12},"guide-title":{font:C,fontSize:12},"group-title":{font:C,fontSize:12}},title:{font:C,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:j,tickColor:j,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},D=o=>o*(1/3+1),M=D(9),I=D(10),G=D(12),p="Segoe UI",O="wf_standard-font, helvetica, arial, sans-serif",J="#252423",u="#605E5C",N="transparent",$e="#C8C6C4",t="#118DFF",qe="#12239E",Le="#E66C37",Xe="#6B007B",Ye="#E044A7",je="#744EC2",Me="#D9B300",Ie="#D64550",R=t,U="#DEEFFF",V=[U,R],Ge=[U,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",R],Oe={view:{stroke:N},background:N,font:p,header:{titleFont:O,titleFontSize:G,titleColor:J,labelFont:p,labelFontSize:I,labelColor:u},axis:{ticks:!1,grid:!1,domain:!1,labelColor:u,labelFontSize:M,titleFont:O,titleColor:J,titleFontSize:G,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:$e,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:t},line:{stroke:t,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:p,fontSize:M,fill:u},arc:{fill:t},area:{fill:t,line:!0,opacity:.6},path:{stroke:t},rect:{fill:t},point:{fill:t,filled:!0,size:75},shape:{stroke:t},symbol:{fill:t,strokeWidth:1.5,size:50},legend:{titleFont:p,titleFontWeight:"bold",titleColor:u,labelFont:p,labelFontSize:I,labelColor:u,symbolType:"circle",symbolSize:75},range:{category:[t,qe,Le,Xe,Ye,je,Me,Ie],diverging:V,heatmap:V,ordinal:Ge}},B='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',Je='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',E=400,F={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},Ne=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Re=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function k({theme:o,background:_}){const W=["white","g10"].includes(o)?"light":"dark",y=F.gridBg[o],A=F.textPrimary[o],v=F.textSecondary[o],H=W==="dark"?Ne:Re,l=W==="dark"?"#d4bbff":"#6929c4";return{background:_,arc:{fill:l},area:{fill:l},path:{stroke:l},rect:{fill:l},shape:{stroke:l},symbol:{stroke:l},circle:{fill:l},view:{fill:y,stroke:y},group:{fill:y},title:{color:A,anchor:"start",dy:-15,fontSize:16,font:B,fontWeight:600},axis:{labelColor:v,labelFontSize:12,labelFont:Je,labelFontWeight:E,titleColor:A,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:F.layerAccent01[o],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:B,fill:v,fontWeight:E},"guide-title":{font:B,fill:v,fontWeight:E}},range:{category:H,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const Ue=k({theme:"white",background:"#ffffff"}),Ve=k({theme:"g10",background:"#f4f4f4"}),_e=k({theme:"g90",background:"#262626"}),He=k({theme:"g100",background:"#161616"}),Ke=ue.version;export{Ve as carbong10,He as carbong100,_e as carbong90,Ue as carbonwhite,he as dark,me as excel,ke as fivethirtyeight,ye as ggplot2,Te as googlecharts,ze as latimes,Oe as powerbi,De as quartz,Pe as urbaninstitute,Ke as version,Be as vox};export default null; diff --git a/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/mode=imports,min/optimized/vega-embed.js b/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/mode=imports,min/optimized/vega-embed.js deleted file mode 100644 index 60ebcfd9..00000000 --- a/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/mode=imports,min/optimized/vega-embed.js +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Skypack CDN - vega-embed@6.25.0 - * Remove "min" from url for additional help & instructions. - */ - -export * from '/-/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/dist=es2020,mode=imports,min/optimized/vega-embed.js'; -export {default} from '/-/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/dist=es2020,mode=imports,min/optimized/vega-embed.js'; diff --git a/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/mode=imports,min/optimized/vega-embed.js b/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/mode=imports,min/optimized/vega-embed.js new file mode 100644 index 00000000..7a7df767 --- /dev/null +++ b/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/mode=imports,min/optimized/vega-embed.js @@ -0,0 +1,7 @@ +/* + * Skypack CDN - vega-embed@6.26.0 + * Remove "min" from url for additional help & instructions. + */ + +export * from '/-/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/dist=es2020,mode=imports,min/optimized/vega-embed.js'; +export {default} from '/-/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/dist=es2020,mode=imports,min/optimized/vega-embed.js'; diff --git a/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/mode=imports,min/optimized/vega-lite.js b/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/mode=imports,min/optimized/vega-lite.js similarity index 51% rename from vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/mode=imports,min/optimized/vega-lite.js rename to vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/mode=imports,min/optimized/vega-lite.js index 917c66bf..6b6d3560 100644 --- a/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/mode=imports,min/optimized/vega-lite.js +++ b/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/mode=imports,min/optimized/vega-lite.js @@ -1,7 +1,7 @@ /* - * Skypack CDN - vega-lite@5.12.0 + * Skypack CDN - vega-lite@5.20.1 * Remove "min" from url for additional help & instructions. */ -export * from '/-/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/dist=es2020,mode=imports,min/optimized/vega-lite.js'; -export {default} from '/-/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/dist=es2020,mode=imports,min/optimized/vega-lite.js'; +export * from '/-/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/dist=es2020,mode=imports,min/optimized/vega-lite.js'; +export {default} from '/-/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/dist=es2020,mode=imports,min/optimized/vega-lite.js'; diff --git a/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/mode=imports,min/optimized/vega-themes.js b/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/mode=imports,min/optimized/vega-themes.js deleted file mode 100644 index 42976249..00000000 --- a/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/mode=imports,min/optimized/vega-themes.js +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Skypack CDN - vega-themes@2.14.0 - * Remove "min" from url for additional help & instructions. - */ - -export * from '/-/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/dist=es2020,mode=imports,min/optimized/vega-themes.js'; -export {default} from '/-/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/dist=es2020,mode=imports,min/optimized/vega-themes.js'; diff --git a/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/mode=imports,min/optimized/vega-themes.js b/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/mode=imports,min/optimized/vega-themes.js new file mode 100644 index 00000000..74a78777 --- /dev/null +++ b/vl-convert-rs/vendor/cdn.skypack.dev/pin/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/mode=imports,min/optimized/vega-themes.js @@ -0,0 +1,7 @@ +/* + * Skypack CDN - vega-themes@2.15.0 + * Remove "min" from url for additional help & instructions. + */ + +export * from '/-/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/dist=es2020,mode=imports,min/optimized/vega-themes.js'; +export {default} from '/-/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/dist=es2020,mode=imports,min/optimized/vega-themes.js'; diff --git a/vl-convert-rs/vendor/import_map.json b/vl-convert-rs/vendor/import_map.json index d4490633..aadf04bd 100644 --- a/vl-convert-rs/vendor/import_map.json +++ b/vl-convert-rs/vendor/import_map.json @@ -37,9 +37,9 @@ "/-/json-stringify-pretty-compact@v3.0.0-RM0i5NMwoiFhg7YNuXef/dist=es2020,mode=imports,min/optimized/json-stringify-pretty-compact.js": "./cdn.skypack.dev/-/json-stringify-pretty-compact@v3.0.0-RM0i5NMwoiFhg7YNuXef/dist=es2020,mode=imports,min/optimized/json-stringify-pretty-compact.js", "/-/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/dist=es2020,mode=imports,min/optimized/vega.js": "./cdn.skypack.dev/-/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/dist=es2020,mode=imports,min/optimized/vega.js", "/-/vega-interpreter@v1.0.5-xGayK8haM1EVgaoW7oOi/dist=es2020,mode=imports,min/optimized/vega-interpreter.js": "./cdn.skypack.dev/-/vega-interpreter@v1.0.5-xGayK8haM1EVgaoW7oOi/dist=es2020,mode=imports,min/optimized/vega-interpreter.js", - "/-/vega-lite@v5.18.0-FtLrd9Ks5cFttxoTAph7/dist=es2020,mode=imports,min/optimized/vega-lite.js": "./cdn.skypack.dev/-/vega-lite@v5.18.0-FtLrd9Ks5cFttxoTAph7/dist=es2020,mode=imports,min/optimized/vega-lite.js", + "/-/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/dist=es2020,mode=imports,min/optimized/vega-lite.js": "./cdn.skypack.dev/-/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/dist=es2020,mode=imports,min/optimized/vega-lite.js", "/-/vega-schema-url-parser@v2.2.0-YmXJGRcKOXOac3VG4xfw/dist=es2020,mode=imports,min/optimized/vega-schema-url-parser.js": "./cdn.skypack.dev/-/vega-schema-url-parser@v2.2.0-YmXJGRcKOXOac3VG4xfw/dist=es2020,mode=imports,min/optimized/vega-schema-url-parser.js", - "/-/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/dist=es2020,mode=imports,min/optimized/vega-themes.js": "./cdn.skypack.dev/-/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/dist=es2020,mode=imports,min/optimized/vega-themes.js", + "/-/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/dist=es2020,mode=imports,min/optimized/vega-themes.js": "./cdn.skypack.dev/-/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/dist=es2020,mode=imports,min/optimized/vega-themes.js", "/-/vega-tooltip@v0.34.0-YVV3uKnnOnCt2kW7Vclb/dist=es2020,mode=imports,min/optimized/vega-tooltip.js": "./cdn.skypack.dev/-/vega-tooltip@v0.34.0-YVV3uKnnOnCt2kW7Vclb/dist=es2020,mode=imports,min/optimized/vega-tooltip.js", "/-/vega-scale@v7.4.1-M0T9Gn9zHGGuV6XhZsTO/dist=es2020,mode=imports,min/optimized/vega-scale.js": "./cdn.skypack.dev/-/vega-scale@v7.4.1-M0T9Gn9zHGGuV6XhZsTO/dist=es2020,mode=imports,min/optimized/vega-scale.js", "/-/vega-scale@v7.4.1-M0T9Gn9zHGGuV6XhZsTO/dist=es2020,mode=imports,min/optimized/vega-scale.js": "./cdn.skypack.dev/-/vega-scale@v7.4.1-M0T9Gn9zHGGuV6XhZsTO/dist=es2020,mode=imports,min/optimized/vega-scale.js", @@ -127,15 +127,14 @@ "/-/vega-view@v5.13.0-kQxd3tMOiOBtyjX1ukMi/dist=es2020,mode=imports,min/optimized/vega-view.js": "./cdn.skypack.dev/-/vega-view@v5.13.0-kQxd3tMOiOBtyjX1ukMi/dist=es2020,mode=imports,min/optimized/vega-view.js", "/-/vega-parser@v6.4.0-nwGMLAa2L4N1N7f1iRh9/dist=es2020,mode=imports,min/optimized/vega-parser.js": "./cdn.skypack.dev/-/vega-parser@v6.4.0-nwGMLAa2L4N1N7f1iRh9/dist=es2020,mode=imports,min/optimized/vega-parser.js", "/-/lodash.debounce@v4.0.8-aOLIwnE2RethWPrEzTeR/dist=es2020,mode=imports,min/optimized/lodash.debounce.js": "./cdn.skypack.dev/-/lodash.debounce@v4.0.8-aOLIwnE2RethWPrEzTeR/dist=es2020,mode=imports,min/optimized/lodash.debounce.js", - "/-/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/dist=es2020,mode=imports,min/optimized/vega-embed.js": "./cdn.skypack.dev/-/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/dist=es2020,mode=imports,min/optimized/vega-embed.js", - "/-/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/dist=es2020,mode=imports,min/optimized/vega-lite.js": "./cdn.skypack.dev/-/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/dist=es2020,mode=imports,min/optimized/vega-lite.js", + "/-/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/dist=es2020,mode=imports,min/optimized/vega-embed.js": "./cdn.skypack.dev/-/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/dist=es2020,mode=imports,min/optimized/vega-embed.js", "/-/vega-lite@v5.13.0-GkFo6HVxfKtvVL5RV8aE/dist=es2020,mode=imports,min/optimized/vega-lite.js": "./cdn.skypack.dev/-/vega-lite@v5.13.0-GkFo6HVxfKtvVL5RV8aE/dist=es2020,mode=imports,min/optimized/vega-lite.js", "/-/vega-lite@v5.14.1-0IRM1VigcIVzRzBRoLFR/dist=es2020,mode=imports,min/optimized/vega-lite.js": "./cdn.skypack.dev/-/vega-lite@v5.14.1-0IRM1VigcIVzRzBRoLFR/dist=es2020,mode=imports,min/optimized/vega-lite.js", "/-/vega-lite@v5.15.1-lQeQs8sDPgFa9d7Jm3sd/dist=es2020,mode=imports,min/optimized/vega-lite.js": "./cdn.skypack.dev/-/vega-lite@v5.15.1-lQeQs8sDPgFa9d7Jm3sd/dist=es2020,mode=imports,min/optimized/vega-lite.js", "/-/vega-lite@v5.16.3-Hw7pZxUuaiVgThsNMjY9/dist=es2020,mode=imports,min/optimized/vega-lite.js": "./cdn.skypack.dev/-/vega-lite@v5.16.3-Hw7pZxUuaiVgThsNMjY9/dist=es2020,mode=imports,min/optimized/vega-lite.js", "/-/vega-lite@v5.17.0-jkfrfJOQ30TsVIlEEbKQ/dist=es2020,mode=imports,min/optimized/vega-lite.js": "./cdn.skypack.dev/-/vega-lite@v5.17.0-jkfrfJOQ30TsVIlEEbKQ/dist=es2020,mode=imports,min/optimized/vega-lite.js", "/-/vega-lite@v5.18.1-CIbWw1F4YnIlhO9UCtHA/dist=es2020,mode=imports,min/optimized/vega-lite.js": "./cdn.skypack.dev/-/vega-lite@v5.18.1-CIbWw1F4YnIlhO9UCtHA/dist=es2020,mode=imports,min/optimized/vega-lite.js", - "/-/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/dist=es2020,mode=imports,min/optimized/vega-lite.js": "./cdn.skypack.dev/-/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/dist=es2020,mode=imports,min/optimized/vega-lite.js", + "/-/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/dist=es2020,mode=imports,min/optimized/vega-lite.js": "./cdn.skypack.dev/-/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/dist=es2020,mode=imports,min/optimized/vega-lite.js", "/-/vega-lite@v5.8.0-4snbURNltT4se5LjMOKF/dist=es2020,mode=imports,min/optimized/vega-lite.js": "./cdn.skypack.dev/-/vega-lite@v5.8.0-4snbURNltT4se5LjMOKF/dist=es2020,mode=imports,min/optimized/vega-lite.js" } } diff --git a/vl-convert-rs/vendor_imports.js b/vl-convert-rs/vendor_imports.js index eb494e03..0735393f 100644 --- a/vl-convert-rs/vendor_imports.js +++ b/vl-convert-rs/vendor_imports.js @@ -1,5 +1,4 @@ import * as v_5_8 from "https://cdn.skypack.dev/pin/vega-lite@v5.8.0-4snbURNltT4se5LjMOKF/mode=imports,min/optimized/vega-lite.js"; -import * as v_5_12 from "https://cdn.skypack.dev/pin/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/mode=imports,min/optimized/vega-lite.js"; import * as v_5_13 from "https://cdn.skypack.dev/pin/vega-lite@v5.13.0-GkFo6HVxfKtvVL5RV8aE/mode=imports,min/optimized/vega-lite.js"; import * as v_5_14 from "https://cdn.skypack.dev/pin/vega-lite@v5.14.1-0IRM1VigcIVzRzBRoLFR/mode=imports,min/optimized/vega-lite.js"; import * as v_5_15 from "https://cdn.skypack.dev/pin/vega-lite@v5.15.1-lQeQs8sDPgFa9d7Jm3sd/mode=imports,min/optimized/vega-lite.js"; @@ -7,7 +6,8 @@ import * as v_5_16 from "https://cdn.skypack.dev/pin/vega-lite@v5.16.3-Hw7pZxUua import * as v_5_17 from "https://cdn.skypack.dev/pin/vega-lite@v5.17.0-jkfrfJOQ30TsVIlEEbKQ/mode=imports,min/optimized/vega-lite.js"; import * as v_5_18 from "https://cdn.skypack.dev/pin/vega-lite@v5.18.1-CIbWw1F4YnIlhO9UCtHA/mode=imports,min/optimized/vega-lite.js"; import * as v_5_19 from "https://cdn.skypack.dev/pin/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/mode=imports,min/optimized/vega-lite.js"; +import * as v_5_20 from "https://cdn.skypack.dev/pin/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/mode=imports,min/optimized/vega-lite.js"; import * as vega from "https://cdn.skypack.dev/pin/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/mode=imports,min/optimized/vega.js"; -import * as vegaThemes from "https://cdn.skypack.dev/pin/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/mode=imports,min/optimized/vega-themes.js"; -import * as vegaEmbed from "https://cdn.skypack.dev/pin/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/mode=imports,min/optimized/vega-embed.js"; +import * as vegaThemes from "https://cdn.skypack.dev/pin/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/mode=imports,min/optimized/vega-themes.js"; +import * as vegaEmbed from "https://cdn.skypack.dev/pin/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/mode=imports,min/optimized/vega-embed.js"; import lodashDebounce from "https://cdn.skypack.dev/pin/lodash.debounce@v4.0.8-aOLIwnE2RethWPrEzTeR/mode=imports,min/optimized/lodash.debounce.js"; diff --git a/vl-convert-vendor/src/main.rs b/vl-convert-vendor/src/main.rs index 69855129..3826cf7c 100644 --- a/vl-convert-vendor/src/main.rs +++ b/vl-convert-vendor/src/main.rs @@ -17,10 +17,6 @@ const VL_PATHS: &[(&str, &str)] = &[ "5.8", "/pin/vega-lite@v5.8.0-4snbURNltT4se5LjMOKF/mode=imports,min/optimized/vega-lite.js", ), - ( - "5.12", - "/pin/vega-lite@v5.12.0-ujK64YZaLHcwzRN5lx1E/mode=imports,min/optimized/vega-lite.js", - ), ( "5.13", "/pin/vega-lite@v5.13.0-GkFo6HVxfKtvVL5RV8aE/mode=imports,min/optimized/vega-lite.js", @@ -53,13 +49,17 @@ const VL_PATHS: &[(&str, &str)] = &[ "5.19", "/pin/vega-lite@v5.19.0-4m5nwXbwdKW9Bc7adV02/mode=imports,min/optimized/vega-lite.js", ), + ( + "5.20", + "/pin/vega-lite@v5.20.1-5FloWSAHKfabpxOoogY3/mode=imports,min/optimized/vega-lite.js", + ), ]; const SKYPACK_URL: &str = "https://cdn.skypack.dev"; const VEGA_PATH: &str = "/pin/vega@v5.30.0-fYDVG3pUN16BiGmbVNdw/mode=imports,min/optimized/vega.js"; const VEGA_THEMES_PATH: &str = - "/pin/vega-themes@v2.14.0-RvUmNETlVH2y3yQM1y36/mode=imports,min/optimized/vega-themes.js"; + "/pin/vega-themes@v2.15.0-wV2Z38N5Dk8FL05cPDbE/mode=imports,min/optimized/vega-themes.js"; const VEGA_EMBED_PATH: &str = - "/pin/vega-embed@v6.25.0-3T3K5LYNFrLq0n1oBsLI/mode=imports,min/optimized/vega-embed.js"; + "/pin/vega-embed@v6.26.0-0yAdpZbj3i4rRevkUMhK/mode=imports,min/optimized/vega-embed.js"; const DEBOUNCE_PATH: &str = "/pin/lodash.debounce@v4.0.8-aOLIwnE2RethWPrEzTeR/mode=imports,min/optimized/lodash.debounce.js"; diff --git a/vl-convert/README.md b/vl-convert/README.md index b866d938..7c1d549f 100644 --- a/vl-convert/README.md +++ b/vl-convert/README.md @@ -56,7 +56,7 @@ Usage: vl-convert vl2vg [OPTIONS] --input --output Options: -i, --input Path to input Vega-Lite file -o, --output Path to output Vega file to be created - -v, --vl-version Vega-Lite Version. One of 4.17, 5.8, 5.9, 5.10, 5.11, 5.12, 5.13, 5.14, 5.15, 5.16 [default: 5.16] + -v, --vl-version Vega-Lite Version. One of 4.17, 5.8, 5.9, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19, 5.20 [default: 5.20] -t, --theme Named theme provided by the vegaThemes package (e.g. "dark") -c, --config Path to Vega-Lite config file. Defaults to ~/.config/vl-convert/config.json -p, --pretty Pretty-print JSON in output file @@ -86,7 +86,7 @@ Options: -o, --output Path to output SVG file to be created -v, --vl-version - Vega-Lite Version. One of 4.17, 5.8, 5.9, 5.10, 5.11, 5.12, 5.13, 5.14, 5.15, 5.16 [default: 5.16] + Vega-Lite Version. One of 4.17, 5.8, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19, 5.20 [default: 5.20] --theme Named theme provided by the vegaThemes package (e.g. "dark") -c, --config @@ -127,7 +127,7 @@ Options: -o, --output Path to output PNG file to be created -v, --vl-version - Vega-Lite Version. One of 4.17, 5.8, 5.9, 5.10, 5.11, 5.12, 5.13, 5.14, 5.15, 5.16 [default: 5.16] + Vega-Lite Version. One of 4.17, 5.8, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19, 5.20 [default: 5.20] --theme Named theme provided by the vegaThemes package (e.g. "dark") -c, --config @@ -171,7 +171,7 @@ Options: -o, --output Path to output PDF file to be created -v, --vl-version - Vega-Lite Version. One of 4.17, 5.8, 5.9, 5.10, 5.11, 5.12, 5.13, 5.14, 5.15, 5.16 [default: 5.16] + Vega-Lite Version. One of 4.17, 5.8, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19, 5.20 [default: 5.20] --theme Named theme provided by the vegaThemes package (e.g. "dark") -c, --config @@ -230,7 +230,7 @@ Options: -o, --output Path to output HTML file to be created -v, --vl-version - Vega-Lite Version. One of 4.17, 5.8, 5.9, 5.10, 5.11, 5.12, 5.13, 5.14, 5.15, 5.16 [default: 5.16] + Vega-Lite Version. One of 4.17, 5.8, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19, 5.20 [default: 5.20] --theme Named theme provided by the vegaThemes package (e.g. "dark") -c, --config diff --git a/vl-convert/src/main.rs b/vl-convert/src/main.rs index 6047f30f..2bcc3b15 100644 --- a/vl-convert/src/main.rs +++ b/vl-convert/src/main.rs @@ -12,7 +12,7 @@ use vl_convert_rs::module_loader::import_map::VlVersion; use vl_convert_rs::text::register_font_directory; use vl_convert_rs::{anyhow, anyhow::bail}; -const DEFAULT_VL_VERSION: &str = "5.19"; +const DEFAULT_VL_VERSION: &str = "5.20"; const DEFAULT_CONFIG_PATH: &str = "~/.config/vl-convert/config.json"; #[derive(Debug, Parser)] // requires `derive` feature @@ -36,7 +36,7 @@ enum Commands { #[arg(short, long)] output: String, - /// Vega-Lite Version. One of 5.8, 5.12, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19 + /// Vega-Lite Version. One of 5.8, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19, 5.20 #[arg(short, long, default_value = DEFAULT_VL_VERSION)] vl_version: String, @@ -68,7 +68,7 @@ enum Commands { #[arg(short, long)] output: String, - /// Vega-Lite Version. One of 5.8, 5.12, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19 + /// Vega-Lite Version. One of 5.8, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19, 5.20 #[arg(short, long, default_value = DEFAULT_VL_VERSION)] vl_version: String, @@ -112,7 +112,7 @@ enum Commands { #[arg(short, long)] output: String, - /// Vega-Lite Version. One of 5.8, 5.12, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19 + /// Vega-Lite Version. One of 5.8, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19, 5.20 #[arg(short, long, default_value = DEFAULT_VL_VERSION)] vl_version: String, @@ -164,7 +164,7 @@ enum Commands { #[arg(short, long)] output: String, - /// Vega-Lite Version. One of 5.8, 5.12, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19 + /// Vega-Lite Version. One of 5.8, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19, 5.20 #[arg(short, long, default_value = DEFAULT_VL_VERSION)] vl_version: String, @@ -216,7 +216,7 @@ enum Commands { #[arg(short, long)] output: String, - /// Vega-Lite Version. One of 5.8, 5.12, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19 + /// Vega-Lite Version. One of 5.8, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19, 5.20 #[arg(short, long, default_value = DEFAULT_VL_VERSION)] vl_version: String, @@ -272,7 +272,7 @@ enum Commands { #[arg(short, long)] output: String, - /// Vega-Lite Version. One of 5.8, 5.12, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19 + /// Vega-Lite Version. One of 5.8, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19, 5.20 #[arg(short, long, default_value = DEFAULT_VL_VERSION)] vl_version: String, diff --git a/vl-convert/tests/test_cli.rs b/vl-convert/tests/test_cli.rs index aa6b0fae..d2501704 100644 --- a/vl-convert/tests/test_cli.rs +++ b/vl-convert/tests/test_cli.rs @@ -159,7 +159,6 @@ mod test_vl2vg { fn test( #[values( "v5_8", - "v5_12", "v5_13", "v5_14", "v5_15", @@ -167,6 +166,7 @@ mod test_vl2vg { "v5_17", "v5_18", "v5_19", + "v5_20", )] vl_version: &str, @@ -226,7 +226,6 @@ mod test_vl2html_no_bundle { fn test( #[values( "5.8", - "5.12", "5.13", "5.14", "5.15", @@ -234,6 +233,7 @@ mod test_vl2html_no_bundle { "5.17", "5.18", "5.19", + "5.20", )] vl_version: &str, @@ -277,7 +277,6 @@ mod test_vl2html_bundle { fn test( #[values( "5.8", - "5.12", "5.13", "5.14", "5.15", @@ -285,6 +284,7 @@ mod test_vl2html_bundle { "5.17", "5.18", "5.19", + "5.20", )] vl_version: &str,